Search completed in 0.96 seconds.
669 results for "double":
Your results are loading. Please wait...
JS_DefineConstDoubles
create multiple constant double or integer valued properties on an object. syntax bool js_defineconstdoubles(jscontext *cx, js::handleobject obj, const jsconstdoublespec *cds); bool js_defineconstintegers(jscontext *cx, js::handleobject obj, const jsconstintegerspec *cis); // added in spidermonkey 38 name type description cx jscontext * the context in which to define the new properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to create new properties. cds jsconstdoublespec * pointer to an array of jsconstdoublespec records containing property names and values to create. the last array element...
...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. ...
...es 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. ...
...And 5 more matches
JS_DoubleToInt32
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per ecma spec. ...
...since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per ecma spec. ...
...this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per ecma spec. syntax int32_t js_doubletoint32(double d); uint32_t js_doubletouint32(double d); name type description d double the numeric value to convert. description js_doubletoint32 converts a c floating-point number of type double to int32, a signed 32-bit integer. ...
...And 3 more matches
DOUBLE_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval. ...
... still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval. description double_to_jsval is the inverse of js::tonumber. ...
...removed at any time. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval. description double_to_jsval is the inverse of js::tonumber. to convert a c float, double to type js::value, use js_numbervalue instead. ...
...And 2 more matches
JS::DoubleNaNValue
this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value. ...
... this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value. ...
... this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value. ...
JSConstDoubleSpec
this article covers features introduced in spidermonkey 17 describes a double and integer value and assigns it a name. syntax template<typename t> struct jsconstscalarspec { const char *name; t val; /* uint8_t flags; // obsolete from jsapi 35 uint8_t spare[3]; // obsolete from jsapi 35 */ }; typedef jsconstscalarspec<double> jsconstdoublespec; typedef jsconstscalarspec<int32_t> jsconstintegerspec; // added in spidermonkey 38 name type description val double or int32_t value for the double or integer. name const char * name to assign the double. flags uint8_t property attributes for the double. obsolete since jsapi 35 currently these can be 0 or more of the following values or'd: js...
...e jsapi 35 currently these can be 0 or more of the following values or'd: jsprop_enumerate: property is visible in for loops. jsprop_readonly: property is read-only. jsprop_permanent: property cannot be deleted. jsprop_exported: property can be exported outside its object. jsprop_index: property is actually an array element. ...
...p_permanent: property cannot be deleted. jsprop_exported: property can be exported outside its object. jsprop_index: property is actually an array element. if this field is 0, js_defineconstdoubles uses the default attributes jsprop_readonly | jsprop_permanent instead. spare uint8_t [3] reserved for future use. obsolete since jsapi 35 description jsconstdoublespecs is used to define a set of double values that are assigned as properties to an object using js_defineconstdoubles. jsconstintegerspecs is used to define a set of double values that are assigned as properties to an object using js_defineconstintegers. see also mxr id search for jsconstdoublespec mxr id search for jsconstintegerspec js_defineconstdoubles. js_defineconstintegers bug 1066020...
JS_DoubleIsInt32
this article covers features introduced in spidermonkey 17 compare double value and int32_t value. syntax bool js_doubleisint32(double d, int32_t *ip); name type description d double a double value to compare ip int32_t * a pointer to int32_t value to compare description js_doubleisint32 returns true if d i sequal to *ip. (comment from mozilla::numberequalsint32) casting a floating-point value that doesn't truncate to int32_t, to int32_t, induces undefined behavior.
...qual to *ip. ...
... (comment from mozilla::numberequalsint32) casting a floating-point value that doesn't truncate to int32_t, to int32_t, induces undefined behavior. we should definitely fix this (bug 744965), but as apparently it "works" in practice, it's not a pressing concern now. see also mxr id search for js_doubleisint32 js_doubletoint32 js_doubletouint32 bug 631132 bug 744965 ...
JS_NewDouble
obsolete since jsapi 17this 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. use js_newnumbervalue instead. allocates a copy of jsdouble on the gc heap. syntax jsdouble * js_newdouble(jscontext *cx, jsdouble d); name type description cx jscontext * the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the number to copy. description js_newdouble allocates a copy of the number d on the javascript garbage collection heap. this function is not very useful. to convert a jsdouble to a jsval, use js_newnumbervalue instead. warning: the argum...
...caller must be in a request on this jscontext. d jsdouble the number to copy. description js_newdouble allocates a copy of the number d on the javascript garbage collection heap. this function is not very useful. to convert a jsdouble to a jsval, use js_newnumbervalue instead. warning: the argument d must not be a value that could fit in an integer jsval. if it is, js_newdouble creates a bad jsdouble that might behave as desired in some cases but not others. the new jsdouble is subject to garbage collection until you protect it using a local root, an object property, or the js_addroot function. on success, js_newdouble returns a pointer to the new number. otherwise it returns null. ...
...js_newdouble creates a bad jsdouble that might behave as desired in some cases but not others. the new jsdouble is subject to garbage collection until you protect it using a local root, an object property, or the js_addroot function. on success, js_newdouble returns a pointer to the new number. otherwise it returns null. the application must treat the returned pointer as read-only. modifying a jsdouble allocated with this function can cause undefined behavior. see also js_numbervalue bug 549143 ...
JS_NewDoubleValue
obsolete since jsapi 17this 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. use js_numbervalue instead. create a floating-point jsval syntax jsbool js_newdoublevalue(jscontext *cx, jsdouble d, jsval *rval); name type description cx jscontext * the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the numeric value to convert. this must not be a value that could fit in an integer jsval (see int_fits_in_jsval). rval jsval * out parameter. on success, *rval receives a javascript number with the value d. description j...
...which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the numeric value to convert. this must not be a value that could fit in an integer jsval (see int_fits_in_jsval). rval jsval * out parameter. on success, *rval receives a javascript number with the value d. description js_newdoublevalue creates a floating-point jsval. warning: the argument d must not be a value that could fit in an integer jsval. if it is, js_newdoublevalue creates a bad jsval that might behave 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...
...ent d must not be a value that could fit in an integer jsval. if it is, js_newdoublevalue creates a bad jsval that might behave 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 unspecified. see also js_numbervalue bug 549143 ...
ConstrainDouble - Web APIs
the constraindouble type is used to specify a constraint for a property whose value is a double-precision floating-point number. it extends the doublerange dictionary (which provides the ability to specify a permitted range of property values) to also support an exact value and/or an ideal value the property should take on. additionally, you can specify the property's value as a simple floating-point value, in which case the user agent does its best to match the value once all other more stringent constraints are met. properties if the value of a constraindouble is an object rather than a number, it may have the properties below in addition the properties it inherits from doublerange. ...
...y should take on. additionally, you can specify the property's value as a simple floating-point value, in which case the user agent does its best to match the value once all other more stringent constraints are met. properties if the value of a constraindouble is an object rather than a number, it may have the properties below in addition the properties it inherits from doublerange. exact a double-precision floating-point number specifying a specific, required, value the property must have to be considered acceptable. ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definiti...
...ing-point number specifying a specific, required, value the property must have to be considered acceptable. ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definition of 'constraindouble' in that specification. candidate recommendation initial definition technically, constraindouble is actually based on an intermediary dictionary named constraindoublerange, which adds exact and ideal to doublerange, with constraindouble being a type that can be either a long integer or a doublerange. however, for the sake of documentation clarity, the intermediate type (present only...
JS::DoubleValue
this article covers features introduced in spidermonkey 24 convert a c floating-point number of type double to a js::value. syntax js::value js::doublevalue(double dbl) name type description dbl double c double to convert. description js::doublevalue converts a c floating-point number of type double to js::value, the type of javascript values. the result is an floating-point js::value. ...
... c floating-point number of type double to a js::value. syntax js::value js::doublevalue(double dbl) name type description dbl double c double to convert. description js::doublevalue converts a c floating-point number of type double to js::value, the type of javascript values. the result is an floating-point js::value. ...
jsdouble
implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various platforms. controlling the behavior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right. ...
... implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various platforms. controlling the behavior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right. ...
nsISupportsDouble
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. ...
... methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. ...
JSVAL_IS_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. determines if a given jsval is a number represented as a jsdouble. syntax jsval_is_double(v) description jsval_is_double(v) is true if v is a number represented in memory as a jsdouble. to check whether v is a number, regardless of implementation details, use jsval_is_number instead. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js double data type. if (jsval_is_double(myitem)) { . . . } see also bug 952650 ...
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 ...
DoubleRange - Web APIs
the doublerange dictionary is used to define a range of permitted double-precision floating-point values for a property, with either or both a maximum and minimum value specified. the constraindouble dictionary is based on this, augmenting it to support exact and ideal values as well. properties max a floating-point value specifying the largest permissible value of the property it describes. min a floating-point value 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 'doublerange' in that specification. candidate recomme...
Index - Web APIs
Web › API › Index
sensor apis, sensors the accelerometer constructor creates a new accelerometer object which returns the acceleration of the device along all three axes at the time it is read. 26 accelerometer.x api, accelerometer, accelerometer api, generic sensor api, property, reference, sensor, sensor apis, sensors, x the x read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the device along the its x axis. 27 accelerometer.y api, accelerometer, accelerometer api, generic sensor api, property, reference, sensor, sensor apis, sensors, y the y read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the device along the its y axis. 2...
...or apis, sensors, y the y read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the device along the its y axis. 28 accelerometer.z api, accelerometer, accelerometer api, generic sensor api, property, reference, sensor, sensor apis, sensors, z the z read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the device along the its z axis. 29 addresserrors api, address, addresserrors, dictionary, errors, interface, payment address, payment request, payment request api, reference, payment, paymentaddress the addresserrors dictionary is used by the payment request api to to report validation errors in a physical address (typically ...
...lysernode, method, reference, référence(2), web audio api the getfloattimedomaindata() method of the analysernode interface copies the current waveform, or time-domain, data into a float32array array passed into it. 59 analysernode.maxdecibels api, analysernode, property, reference, web audio api, maxdecibels the maxdecibels property of the analysernode interface is a double value representing the maximum power value in the scaling range for the fft analysis data, for conversion to unsigned byte/float values — basically, this specifies the maximum value for the range of results when using getfloatfrequencydata() or getbytefrequencydata(). 60 analysernode.mindecibels api, analysernode, property, reference, référence(2), web audio api, mindecibels ...
...And 48 more matches
LIR - Archive of obsolete content
void links code chunks. 3 parami integer 32 bit load an int parameter (register or stack location). 4 paramq quad 64 bit load a quad parameter (register or stack location). ...
... (register or stack location). ...
...17 ldc2i integer load char and sign-extend to an int 18 lds2i integer load short and sign-extend to an int 19 lduc2ui integer load unsigned char and zero-extend to an unsigned int 20 ldus2ui integer load unsigned short and zero-extend to an unsigned int 21 ldi integer load int 22 ldq quad 64 bit load quad 23 ldd double load double 24 ldf2d double load float and extend to a double store 25 sti2c void store int truncated to char 26 sti2s void store int truncated to short 27 sti void store int 28 stq void 64 bit store quad 29 std void store double 30 std2f void store double as a float (losing precision) 31 ...
...And 19 more matches
Index
ser guide jsapi, spidermonkey this document explains how to embed spidermonkey, the mozilla javascript engine, in your c++ program. 17 jsapi reference needscontent, spidermonkey js::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_...
...flatestringtoutf8buffer jsapi reference, refere, spidermonkey js::deflatestringtoutf8buffer encodes src as utf8. the caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. ...
...ingtoutf8buffer encodes src as utf8. the caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. 39 js::doublenanvalue jsapi reference, reference, référence(2), spidermonkey js::doublenanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan). 40 js::doublevalue jsapi reference, reference, référence(2), spidermonkey js::doublevalue converts a c floating-point number of type double to js::value, the type of javascript values. 41 js::evaluate jsapi reference, reference, référence(2), spidermon...
...And 14 more matches
nsIAnnotationService
ing aname, in long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint64(in nsiuri auri, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint64(in long long aitemid, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationdouble(in nsiuri auri, in autf8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setitemannotationdouble(in long long aitemid, in autf8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setpageannotationbinary(in nsiuri auri, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adata...
...temannotationstring(in long long aitemid, in autf8string aname); long getpageannotationint32(in nsiuri auri, in autf8string aname); long getitemannotationint32(in long long aitemid, in autf8string aname); long long getpageannotationint64(in nsiuri auri, in autf8string aname); long long getitemannotationint64(in long long aitemid, in autf8string aname); double getpageannotationdouble(in nsiuri auri, in autf8string aname); double getitemannotationdouble(in long long aitemid, in autf8string aname); void getpageannotationbinary(in nsiuri auri, in autf8string aname,[array, size_is(adatalen)] out octet adata, out unsigned long adatalen, out autf8string amimetype); void getitemannotationbinary(in long long aitemid, in autf8string a...
...ire as long as the uri is in the database. expire_with_history 5 for annotations that only live as long as the uri is in history (for example, has > 0 visits). this is only valid for page annotations. expire_days 6 for short-lived temporary data that you still want to outlast a session. removed at 7 days. type_int32 1 int32 type constant. type_double 2 double type constant. type_string 3 string type constant. type_binary 4 binary type constant. type_int64 5 int64 type constant. note: use of value "1" is omitted due to it's temporary use as expire_never in bug 319455. methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with th...
...And 9 more matches
LiveConnect Overview - Archive of obsolete content
the jdk to access the liveconnect classes, place the .jar or .zip file in the classpath of the jdk compiler in either of the following ways: create a classpath environment variable to specify the path and name of .jar or .zip file. specify the location of .jar or .zip file when you compile by using the -classpath command line parameter. you can specify an environment variable in windows nt by double-clicking the system icon in the control panel and creating a user environment variable called classpath with a value similar to the following: c:\program files\java\jre1.4.1\lib\plugin.jar see the sun jdk documentation for more information about classpath. note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into t...
... sections. for example, if jsobject.eval returns a javascript number, you can find the rules for converting this number to an instance of java.lang.object in number values. number values when you pass javascript number types as parameters to java methods, java converts the values according to the rules described in the following table: java parameter type conversion rules double the exact value is transferred to java without rounding and without a loss of magnitude or sign. nan is converted to nan. java.lang.double java.lang.object a new instance of java.lang.double is created, and the exact value is transferred to java without rounding and without a loss of magnitude or sign. float values are rounded to ...
... converted directly to the java equivalents. java.lang.boolean java.lang.object a new instance of java.lang.boolean is created. each parameter creates a new instance, not one instance with the same primitive value. java.lang.string values are converted to strings. for example: true becomes "true" false becomes "false" byte char double float int long short true becomes 1 false becomes 0 when a javascript boolean is passed as a parameter to a java method which expects an instance of java.lang.string, the boolean is converted to a string. use the == operator to compare the result of this conversion with other string values. string values when you pass javascript string types as...
...And 8 more matches
TextMetrics - Web APIs
the textmetrics interface represents the dimensions of a piece of text in the canvas; a textmetrics() instance can be retrieved using the canvasrenderingcontext2d.measuretext() method. properties textmetrics.width read only is a double giving the calculated width of a segment of inline text in css pixels. it takes into account the current font of the context. ...
...rface represents the dimensions of a piece of text in the canvas; a textmetrics() instance can be retrieved using the canvasrenderingcontext2d.measuretext() method. properties textmetrics.width read only is a double giving the calculated width of a segment of inline text in css pixels. it takes into account the current font of the context. textmetrics.actualboundingboxleft read only is a double giving the distance from the alignment point given by the canvasrenderingcontext2d.textalign property to the left side of the bounding rectangle of the given text, in css pixels. ...
...s. it takes into account the current font of the context. textmetrics.actualboundingboxleft read only is a double giving the distance from the alignment point given by the canvasrenderingcontext2d.textalign property to the left side of the bounding rectangle of the given text, in css pixels. the distance is measured parallel to the baseline. textmetrics.actualboundingboxright read only is a double giving the distance from the alignment point given by the canvasrenderingcontext2d.textalign property to the right side of the bounding rectangle of the given text, in css pixels. the distance is measured parallel to the baseline. ...
...And 7 more matches
nsIVariant
ut nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines astring getasastring(); native code only! autf8string getasautf8string(); native code only! prbool getasbool(); native code only! char getaschar(); native code only! domstring getasdomstring(); native code only! double getasdouble(); native code only! float getasfloat(); native code only! nsresult getasid(out nsid retval); violates the xpcom interface guidelines print16 getasint16(); native code only! print32 getasint32(); native code only! print64 getasint64(); native code only! pruint8 getasint8(); native code only...
...ing. native code only!getasautf8string autf8string getasautf8string(); parameters none. return value the internal value is converted to a utf8 string. an iso-8859-1 string is widened to a utf16 string first. arrays and interface pointers cannot be converted to a string. native code only!getasbool prbool getasbool(); parameters none. return value if possible, the internal value is converted to a double, which is then compared to zero. native code only!getaschar char getaschar(); parameters none. return value if the internal value is a string, it is first converted to a double, if possible. if it is of a numeric type, it is cast directly to char. native code only!getasdomstring domstring getasdomstring(); parameters none. return value this returns the same as the getasastring method. native co...
...en compared to zero. native code only!getaschar char getaschar(); parameters none. return value if the internal value is a string, it is first converted to a double, if possible. if it is of a numeric type, it is cast directly to char. native code only!getasdomstring domstring getasdomstring(); parameters none. return value this returns the same as the getasastring method. native code only!getasdouble double getasdouble(); parameters none. return value if the internal value is a string, it is converted to a double, if possible. if it is of a numeric type it is cast directly to double. native code only!getasfloat float getasfloat(); parameters none. return value if the internal value is a string, it is first converted to a double, if possible. if it is of a numeric type, it is cast directly t...
...And 6 more matches
Mobile accessibility - Learn web development
on. follow any additional on-screen prompts that you are presented with. when talkback is turned on, your android device's basic controls will be a bit different. for example: single-tapping an app will select it, and the device will read out what the app is. swiping left and right will move between apps, or buttons/controls if you are in a control bar. the device will read out each option. double-tapping anywhere will open the app/select the option. you can also "explore by touch" — hold your finger down on the screen and drag it around, and your device will read out the different apps/items you move across. if you want to turn talkback off: navigate back to the talkback menu screen (using the different gestures that are currently enabled.) navigate to the slider switch and activ...
...gestures. unlocking the phone when talkback is turned on, unlocking the phone is a bit different. you can do a two-finger swipe up from the bottom of the lock screen. if you've set a passcode or pattern for unlocking your device, you will then be taken to the relevant entry screen to enter it. you can also explore by touch to find the unlock button at the bottom middle of the screen, and then double-tap. global and local menus talkback allows you to access global and local context menus, wherever you have navigated to on the device. the former provides global options relating to the device as a whole, and the latter provides options relating just to the current app/screen you are in. to get to these menus: access the global menu by quickly swiping down, and then right. access the loca...
...rovides global options relating to the device as a whole, and the latter provides options relating just to the current app/screen you are in. to get to these menus: access the global menu by quickly swiping down, and then right. access the local menu by quickly swiping up, and then right. swipe left and right to cycle between the different options. once you've selected the option you want, double-click to choose that option. for details on all the options available under the global and local context menus, see use global and local context menus. browsing web pages you can use the local context menu while in a web browser to find options to navigate web pages using just the headings, form controls, or links, or navigate line by line, etc. for example, with talkback turned on: open ...
...And 5 more matches
SpiderMonkey 1.8.5
jspropertyop to jsstrictpropertyop (to accomodate es5 strict mode). to migrate, simply add a jsbool strict parameter to each setter function. it is safe for the setter to ignore the value of the argument. the rooting apis (js_addroot, js_removeroot, etc.) have been replaced with a family of type-safe functions (js_addstringroot, js_removestringroot, etc.) that are easier to use correctly. js_newdouble, js_newdoublevalue, and js_newnumbervalue are gone. instead use double_to_jsval, int_to_jsval, and uint_to_jsval, which are faster and can't fail. js_getstringbytes and js_getstringchars are gone. there is no longer an infallible way to examine string characters. applications must use js_getstringcharsandlength or js_encodestring/js_free and check for errors. these and other changes are explain...
... bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which accepts pointers to specific types. js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global object, a context, and a set of related objects with no outside references (crosscompartment wrappers excepted). the new garbage collector can perform per-container garbage collection, which can be a sig...
...ments in c with jsval cases are no longer legal. additionally, because not all fields are used by all jsvals, it is no longer safe to compare jsvals as though they were c values. instead, jsvals should be converted to their c equivalents with the appropriate jsval_to_* macro and then compared. jsapi no longer represents floating-point numbers (and integers more than 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 ...
...And 5 more matches
JS_NumberValue
the result is an integer js::value if d can be stored that way. otherwise, a new floating-point js::value is created. ...
... the result is an integer js::value if d can be stored that way. otherwise, a new floating-point js::value is created. ...
... the result is an integer js::value if d can be stored that way. otherwise, a new floating-point js::value is created. ...
...And 4 more matches
JSAPI reference
r obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonkey 24 js::stringvalue added in spidermonkey 24 js::objectvalue added in spidermonkey 24 js::objectornullvalue added in spidermonkey 24 js::symbolvalue added in spidermonkey 38 js::value constants: js::nullhandlevalue added in spidermonkey 24 js::undefinedhandlevalue added in spidermonkey 24 js::truehandlevalue added in ...
...te since jsapi 42 function and macros for checking the type of a jsval: enum jstype js_typeofvalue all of the following are deprecated. see js::value for their modern replacements. jsval_is_null obsolete since jsapi 32 jsval_is_void obsolete since jsapi 32 jsval_is_boolean obsolete since jsapi 32 jsval_is_number obsolete since jsapi 32 jsval_is_int obsolete since jsapi 32 jsval_is_double obsolete since jsapi 32 jsval_is_string obsolete since jsapi 32 jsval_is_object obsolete since jsapi 15 jsval_is_primitive obsolete since jsapi 32 jsval_is_gcthing obsolete since jsapi 32 high-level type-conversion routines for packing and unpacking function arguments. js_convertarguments obsolete since jsapi 38 js_convertargumentsva obsolete since jsapi 38 js_pusharguments obsolete ...
...obsolete since jsapi 28 js_valuetouint16 obsolete since jsapi 28 fast, unchecked type-casting macros. these macros must not be applied to values that are not known to be the right type. like c casts, they may cause crashes if applied to incorrect values. they never create new objects or call into javascript code. ...
...And 4 more matches
WebIDL bindings
the relevant global and can get a jscontext* by calling context() on it. the name of the c++ method is simply the name of the webidl operation with the first letter converted to uppercase. webidl overloads are turned into c++ overloads: they simply call c++ methods with the same name and different signatures. ...
...terface? ...
... int8_t int8_t bytestring const nsacstring& nscstring& (outparam) nsacstring& (outparam) nscstring date mozilla::dom::date domstring const nsastring& mozilla::dom::domstring& (outparam) nsastring& (outparam) nsstring& (outparam) nsstring utf8string const nsacstring& nsacstring& (outparam) nscstring double double double double float float float float interface: non-nullable foo& already_addrefed<foo> foo* owningnonnull<foo> interface: nullable foo* already_addrefed<foo> foo* refptr<foo> long int32_t int32_t int32_t long long int64_t int64_t int64_t object js::handle<jsobj...
...And 4 more matches
HTMLMediaElement - Web APIs
ver the user agent shows its own set of controls. the domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback. htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element. htmlmediaelement.currentsrc read only returns a domstring with the absolute url of the chosen media resource. htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been 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 wh...
...d 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, indicating whether the media element is allowed to have a remote playback ui. htmlmediaelement.duration read only a read-only double-precision floating-point value indicating the total duration of the media in seconds. if no media data is availa...
...to. a group of media elements shares a common mediacontroller. htmlmediaelement.mediakeys read only returns a mediakeys object or null. mediakeys is a set of keys that an associated htmlmediaelement can use for decryption of media data during playback. htmlmediaelement.mozaudiocaptured read only returns a boolean. related to audio stream capture. htmlmediaelement.mozfragmentend is a double that provides access to the fragment end time if the media element has a fragment uri for currentsrc, otherwise it is equal to the media duration. htmlmediaelement.mozframebufferlength is a unsigned long that indicates the number of samples that will be returned in the framebuffer of each mozaudioavailable event. this number is a total for all channels, and by default is set to be the num...
...And 4 more matches
MediaTrackConstraints - Web APIs
udio tracks autogaincontrol a constrainboolean object which specifies whether automatic gain control is preferred and/or required. channelcount a constrainlong specifying the channel count or range of channel counts which are acceptable and/or required. echocancellation a constrainboolean object specifying whether or not echo cancellation is preferred and/or required. latency a constraindouble specifying the latency or range of latencies which are acceptable and/or required. noisesuppression a constrainboolean which specifies whether noise suppression is preferred and/or required. samplerate a constrainlong specifying the sample rate or range of sample rates which are acceptable and/or required. samplesize a constrainlong specifying the sample size or range of sample sizes which ...
...are acceptable and/or required. noisesuppression a constrainboolean which specifies whether noise suppression is preferred and/or required. samplerate a constrainlong specifying the sample rate or range of sample rates which are acceptable and/or required. samplesize a constrainlong specifying the sample size or range of sample sizes which are acceptable and/or required. volume a constraindouble specifying the volume or range of volumes which are acceptable and/or required. properties of image tracks whitebalancemode a string specifying one of "none", "manual", "single-shot", or "continuous". exposuremode a string specifying one of "none", "manual", "single-shot", or "continuous". focusmode a string specifying one of "none", "manual", "single-shot", or "continuous". pointsofin...
...shot", or "continuous". exposuremode a string specifying one of "none", "manual", "single-shot", or "continuous". focusmode a string specifying one of "none", "manual", "single-shot", or "continuous". pointsofinterest the pixel coordinates on the sensor of one or more points of interest. ...
...And 4 more matches
Generator comprehensions - Archive of obsolete content
are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as short hand syntax for creating generators. suppose we have an iterator it which iterates over a large sequence of integers. ...
...s instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as short hand syntax for creating generators. suppose we have an iterator it which iterates over a large sequence of integers. we want to create a new iterator that will iterate over their doubles. ...
......
...And 3 more matches
Eclipse CDT
dcards. to quickly switch between a source file and its header file, use ctrl-tab. to quickly switch to a recently viewed document use cmd-f6/ctrl-f6. if you want to change this awkward key binding, the command you need to rebind is "next editor". to show a filterable list of open documents (similar to the way emacs gives you a list of open buffers), use cmd-e/ctrl-e. if you click the yellow, double arrow button at the top of the project explorer tab on the left, it will keep the selected file in the project explorer tab in sync with the file that you're currently editing. organizing views use ctrl-m to toggle maximization of the current editor view (the editor must be focused first). to tab to another view, use cmd-f7/ctrl-f7. this is useful if you have maximized the editor using ctrl-m ...
...r, "quick type hierarchy" from the context menu. the results for "open type hierarchy" will show all classes in the class inheritance tree, and the classes that have methods that override the method will have a triangular red marker beside them. if you select one of these classes, then in the method pane to the right the method you searched for will be highlighted (you may need to scroll to it) - double click to see its definition. the results for "quick type hierarchy" will only show those classes in the inheritance tree that override the method. double click on a class to go straight to its override's definition. building from eclipse in short, don't do this. eclipse doesn't have good facilities for building incrementally in individual directories in the way that mozilla developers generally...
...set any other environment variables you want to set for the build, then close the project properties window. now when you hit the build button (the little hammer icon), you should see the source build in the console tab at the bottom of the window. the benefit of building from inside eclipse is that build errors will appear in the problems tab at the bottom of the window, and from there you can double click on the build error and it will take you straight to the source file and line where the problem occurred. for this to work reliably though, you still need to build using slow -j1 -w builds, so that make outputs non-interleaved "entering"/"leaving" lines. it also used to be necessary to add the following two lines to your mozconfig to make the compiler output errors all on a single line, but ...
...And 3 more matches
JSAPI User Guide
value, the javascript garbage collector recycles objects, strings, and numbers that don't appear to be in use, and a js::value by itself does not protect its referent from the garbage collector. see garbage collection below for crucial information on how to use js::values safely. js::value includes member functions to test the javascript data type. these are isobject(), isnumber(), isint32(), isdouble(), isstring(), isboolean(), isnull(), and isundefined(). if a js::value contains a jsobject, double, or jsstring, you can cast it to its underlying data type using the toobject(), todouble(), and tostring() member functions, respectively. this is useful in some cases where your application or a jsapi function requires a variable or argument of a specific data type, rather than a js::value. simil...
... garbage collection as it runs, javascript code implicitly allocates memory for objects, strings, variables, and so on. ...
... garbage collection as it runs, javascript code implicitly allocates memory for objects, strings, variables, and so on. ...
...And 3 more matches
SpiderMonkey 1.8.7
bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which accepts pointers to specific types. js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global object, a context, and a set of related objects with no outside references (crosscompartment wrappers excepted). the new garbage collector can perform per-container garbage collection, which can be a sig...
...ments in c with jsval cases are no longer legal. additionally, because not all fields are used by all jsvals, it is no longer safe to compare jsvals as though they were c values. instead, jsvals should be converted to their c equivalents with the appropriate jsval_to_* macro and then compared. jsapi no longer represents floating-point numbers (and integers more than 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 ...
...jsextendedclass jsextendedclass has been removed from the api entirely. jsid previous spidermonkey versions could freely interchange jsid and jsval. ...
...And 3 more matches
nsIDOMWindowUtils
49.0 / seamonkey 2.46) implemented by: window. ...
...ttowindow(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); void sendmousescrollevent(in astring atype, in float ax, in float ay, in long abutton, in long ascrollflags, in long adelta, in long amodifiers); obsolete since gecko 17.0 void sendwheelevent(in float ax, in float ay, in double adeltax, in double adeltay, in double adeltaz, in unsigned long adeltamode, in long amodifiers, in long alineorpagedeltax, in long alineorpagedeltay, in unsigned long aoptions); void sendnativekeyevent(in long anativekeyboardlayout, in long anativekeycode, in long amodifierflags, in astring acharacters, in astring aunmodifiedcharacters); void sendnativemouseevent(in long ascre...
...lags); boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, in boolean areverse); obsolete since gecko 31.0 boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, [optional] in unsigned long aadditionalflags); void sendsimplegestureevent(in astring atype, in float ax, in float ay, in unsigned long adirection, in double adelta, in long amodifiers); void sendtextevent(in astring acompositionstring, in long afirstclauselength, in unsigned long afirstclauseattr, in long asecondclauselength, in unsigned long asecondclauseattr, in long athirdclauselength, in unsigned long athirdclauseattr, in long acaretstart, in long acaretlength); obsolete since gecko 26 boolean sendtouchevent(in astring atype, [...
...And 3 more matches
Value definition syntax - CSS: Cascading Style Sheets
e mandatory and should appear in the exact order. bold <length> , thin this example matches the following values: bold 1em, thin bold 0, thin bold 2.5cm, thin bold 3vh, thin but not: thin 1em, bold, as the entities must be in the expressed order bold 1em thin, as the entities are mandatory; the comma, a literal, must be present bold 0.5ms, thin, as the ms values are not <length> double ampersand separating two or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold && <length> this example matches the following values: bold 1em bold 0 2.5cm bold 3vh bold but not: bold, as both components must appear in the value. bold 1em bold, as both components must appear only one time. note: juxtapositio...
... or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold && <length> this example matches the following values: bold 1em bold 0 2.5cm bold 3vh bold but not: bold, as both components must appear in the value. bold 1em bold, as both components must appear only one time. note: juxtaposition has precedence over the double ampersand, meaning that bold thin && <length> is equivalent to [ bold thin ] && <length>. it describes bold thin <length> or <length> bold thin but not bold <length> thin. double bar separating two or more components by a double bar, ||, means that all entities are options: at least one of them must be present, and they may appear in any order. typically this is used to define the different va...
... any order. typically this is used to define the different values of a shorthand property. <'border-width'> || <'border-style'> || <'border-color'> this example matches the following values: 1em solid blue blue 1em solid 1px yellow but not: blue yellow, as a component must appear at most one single time. bold, as it isn't a keyword allowed as value of any of the entity. note: the double ampersand has precedence over the double bar, meaning that bold || thin && <length> is equivalent to bold || [ thin && <length> ]. it describes bold, thin <length>, bold thin <length>, or thin <length> bold but not <length> bold thin as bold, if not omitted, must be placed before or after the whole thin && <length> component. single bar separating two or more entities by a single bar, |, means...
...And 3 more matches
border-style - CSS: Cascading Style Sheets
e clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... 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 ...
...specific. the radius of the dots is half the computed value of the same side's border-width. dashed displays a series of short square-ended dashes or line segments. the exact size and length of the segments are not defined by the specification and are implementation-specific. solid displays a single, straight, solid line. double displays two straight lines that add up to the pixel size defined by border-width. groove displays a border with a carved appearance. it is the opposite of ridge. ridge displays a border with an extruded appearance. it is the opposite of groove. inset displays a border that makes th...
...And 3 more matches
Array.prototype.reduce() - JavaScript
accumulator }, []) console.log(myorderedarray) replace .filter().map() with .reduce() using array.filter() then array.map() traverses the array twice, but you can achieve the same effect while traversing only once with array.reduce(), thereby being more efficient. (if you like for loops, you can filter and map while traversing once with array.foreach()). ...
... then array.map() traverses the array twice, but you can achieve the same effect while traversing only once with array.reduce(), thereby being more efficient. (if you like for loops, you can filter and map while traversing once with array.foreach()). ...
...you can achieve the same effect while traversing only once with array.reduce(), thereby being more efficient. (if you like for loops, you can filter and map while traversing once with array.foreach()). ...
...And 3 more matches
NPVariant - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npvariant is a struct that holds a value and the type of that value. the value is held in a union, and the type is one of types defined in the npvarianttype enumeration. syntax typedef struct _npvariant { npvarianttype type; union { bool boolvalue; int32_t intvalue; double_t doublevalue; npstring stringvalue; npobject *objectvalue; } value; } npvariant; fields the data structure has the following fields: type a member of the npvarianttype enumeration specifying the data type contained in the npvariant. value the value contained in the npvariant structure. it may be a boolean, integer, double, string, or object, depending on the variant type. javascript type to npvarianttype enumerat...
...ing npvariants to access javascript objects in the browser, or vise versa, the mapping of javascript values to npvariants is as follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvarianttype_double string npvarianttype_string all other types npvarianttype_object functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access...
... npn_releasevariantvalue(), and the following macros are provided: npvariant_is_void() evaluates to true if v is of type npvarianttype_void. npvariant_is_null() evaluates to true if v is of type npvarianttype_null. npvariant_is_boolean() evaluates to true if v is of type npvarianttype_bool. npvariant_is_int32() evaluates to true if v is of type npvarianttype_int32. ...
...And 2 more matches
JS_DefineProperty
32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handl...
...tive getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); // ---- added in spidermonkey 45 ---- bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::handle<jspropertydescriptor> desc, js::objectopresult &result); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js:...
...requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object on which to create th...
...And 2 more matches
mozIStorageBindingParams
.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). ...
...only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). ...
...ringbyindex(in unsigned long aindex, in astring avalue); native code only! void bindutf8stringbyindex(in unsigned long aindex, in autf8string avalue); native code only! void bindbyname(in autf8string aname, in nsivariant avalue); void bindblobbyname(in autf8string aname, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyname(in autf8string aname, in double avalue); native code only! void bindint32byname(in autf8string aname, in long avalue); native code only! void bindint64byname(in autf8string aname, in long long avalue); native code only! void bindnullbyname(in autf8string aname); native code only! void bindstringbyname(in autf8string aname, in astring avalue); native code ...
...And 2 more matches
nsIAccelerometerUpdate
...
... ...
... ...
...And 2 more matches
nsIXmlRpcClient
from this server. null if the server was unreachable or not yet contacted. responsestring readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. constants constant type description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url. call this before using this object void getdata ( in string serverurl ) ; parameters serverurl url of server side object on which methods should be called setauthentication() se...
..." void setauthentication ( in string encoding ) ; parameters encoding encoding charset to be used asynccall() call remote method methodname asynchronously with given arguments. ...
... setauthentication ( in string encoding ) ; parameters encoding encoding charset to be used asynccall() call remote method methodname asynchronously with given arguments. ...
...And 2 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
can be used directly to alter the cue. ...
...tly to alter the cue. ...
... the new keyword can be used for defining a new vttre...
...And 2 more matches
<string> - CSS: Cascading Style Sheets
Web › CSS › string
the <string> css data type represents a sequence of characters. strings are used in numerous css properties, such as content, font-family, and quotes. syntax the <string> data type is composed of any number of unicode characters surrounded by either double (") or single (') quotes. most characters can be represented literally. all characters can also be represented with their respective unicode code points in hexadecimal, in which case they are preceded by a backslash (\). ...
...ch as content, font-family, and quotes. syntax the <string> data type is composed of any number of unicode characters surrounded by either double (") or single (') quotes. most characters can be represented literally. all characters can also be represented with their respective unicode code points in hexadecimal, in which case they are preceded by a backslash (\). for example, \22 represents a double quote, \27 a single quote ('), and \a9 the copyright symbol (©). importantly, certain characters which would otherwise be invalid can be escaped with a backslash. these include double quotes when used inside a double-quoted string, single quotes when used inside a single-quoted string, and the backslash itself. for example, \\ will create a single backslash. to output new lines, you must escap...
... \a or \00000a. in your code, however, strings can span multiple lines, in which case each new line must be escaped with a \ as the last character of the line. however, to get new lines, you must also set the white-space property to appropriate value. note: html entities (such as &nbsp; or &#8212;) cannot be used in a css <string>. ...
...And 2 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
osed in h3 elements, so the field was pretty wide open in terms of what we could do. since the image was floated, any background or border we set on the h3 would "slide under" the image; this is an expected effect with floated elements. rather than try to fight it or push the image below the h3's element box, i let the image mostly overlap the h3, but with a slight offset. ...
...image mostly overlap the h3, but with a slight offset. i then set up a thicker double border on the left, a one-pixel border the rest of the way around, and set the background to match the rest of the design. thus: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} finishing the style adding the background to the heading containing the name of the fish created three problems: the double border was completely covered up by the image. the text of the h3 was basically touching the right side of the floated image... ...or it would have been, except in some browsers...
...to offset the top let corners of the fish image and fish name. with just a few simple margin and padding changes, this was possible. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} note how the image is pushed downward four pixels, while the h3 is pushed rightward four pixels. at the same time, the heading's padding was set to that it had 150 pixels of left padding. thus, the text starts 159 pixels from the leftmost edge of the card (4px left margin plus 5px left border plus 150px le...
...sirable for the cases where only one word would wrap under an image. it's better to keep the text as if it's in a column of its own. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} div.card p {margin: 0.5em 0.5em 0.5em 160px;} and voila! the cards are done. conclusion redesigning a classic is something like being asked to revisemoby dick for modern audiences: you're thrilled at the opportunity, but afraid of doing injustice to the original. i'd like to think that the final result w...
Building up a basic demo with PlayCanvas editor - Game development
three shapes on your scene, something like the below screenshot. animating our scene animating 3d models might be considered an advanced thing to do, but all we want to do is to control a few properties of a given object — we can use a script component to do that. click on the plus button in the assets panel, select the script option, and name your new script file boxanimation.js. if you double click on it, you'll be moved to a code editor. as you can see, the file contains some boilerplate code already: pc.script.create('boxanimation', function (app) { // creates a new boxanimation instance var boxanimation = function (entity) { this.entity = entity; }; boxanimation.prototype = { // called once after all resources are loaded and before the first update...
... the box selected on the scene. click on add component, then script in the entity inspector. at the bottom of the screen you can see the list of scripts available — for now there's only boxanimation.js — clicking it will add the animation script to the box object. the cylinder now we'll do the same steps for cylinder. first: create a new script asset. name it cylinderanimation.js. double click the script icon to launch the code editor. this time instead of rotating the object we will try to scale it. for that we'll need a timer to store the total amount of time passed since the start of the animation. add this code to the initialize() function: this.timer = 0; and those two lines to the update() function: this.timer += dt; this.entity.setlocalscale(1, math.abs(math.sin(this.
...ath.sin() of the timer, with math.abs() applied to the result of that to have the values always above zero (0-1; sin values are normally between -1 and 1.) this gives us a nice scaling effect as a result. remember to add the cylinderanimation.js file to the cylinder object to apply the given animations. the cone time to play with the last object — the cone. create a coneanimation.js file and double click it to open it in the editor. next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below to the update() function: this.timer += dt; this.entity.setposition(2, math.sin(this.timer*2), 0); the position of the cone will be animated on each frame by being passed the math.sin() value of ...
... add the coneanimation.js script to the cone object, as before. test the demo out launch the demo to see the effects — all the shapes should animate. congratulations, you've completed the tutorial! summary now you can check the playcanvas engine article if you haven't seen it yet, go back to the building up a basic demo with playcanvas page, o...
Hacking Tips
break on the write of a differing pixel: find the x/y of a pixel that differs use 'run z' where z is the mark in the log for test-start. for example in '[rr 28496 607198]reftest test-start | file:///home/bgirard/mozilla-central/tree/image/test/reftest/bmp/bmpsuite/b/wrapper.html?badpalettesize.bmp' z would be 607198. ...
...n the write of a differing pixel: find the x/y of a pixel that differs use 'run z' where z is the mark in the log for test-start. for example in '[rr 28496 607198]reftest test-start | file:///home/bgirard/mozilla-central/tree/image/test/reftest/bmp/bmpsuite/b/wrapper.html?badpalettesize.bmp' z would be 607198. ...
...ite of a differing pixel: find the x/y of a pixel that differs use 'run z' where z is the mark in the log for test-start. for example in '[rr 28496 607198]reftest test-start | file:///home/bgirard/mozilla-central/tree/image/test/reftest/bmp/bmpsuite/b/wrapper.html?badpalettesize.bmp' z would be 607198. ...
... differing pixel: find the x/y of a pixel that differs use 'run z' where z is the mark in the log for test-start. for example in '[rr 28496 607198]reftest test-start | file:///home/bgirard/mozilla-central/tree/image/test/reftest/bmp/bmpsuite/b/wrapper.html?badpalettesize.bmp' z would be 607198. ...
SpiderMonkey Internals
are gc-reachable. javascript values the type js::value represents a javascript value. the representation is 64 bits and uses nan-boxing on all platforms, although the exact nan-boxing format depends on the platform. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented as one canonical nan format). other values are encoded as a value and a type tag: on x86, arm, and similar 32-bit platforms, we use what we call "nunboxing", in which non-double values are a 32-bit type tag and a 32-bit payload, which is normally either a pointer or a signed 32-bit integer. there are a few special values: nullvalue(), undefinedva...
...e a few special values: nullvalue(), undefinedvalue(), truevalue() and falsevalue(). on x64 and similar 64-bit platforms, pointers are longer than 32 bits, so we can't use the nunboxing format. instead, we use "punboxing", which has 17 bits of tag and 47 bits of payload. only jit code really depends on the layout--everything else in the engine interacts with values through functions like val.isdouble(). most parts of the jit also avoid depending directly on the layout: the files punboxassembler.h and nunboxassembler.h are used to generate native code that depends on the value layout. objects consist of a possibly shared structural description, called the map or scope; and unshared property values in a vector, called the slots. each property has an id, either a nonnegative integer or an atom ...
...truct and macros. jscpucfg.cpp this standalone program generates jscpucfg.h, a header file containing bytes per word and other constants that depend on cpu architecture and c compiler type model. it tries to discover most of these constants by running its own experiments on the build host, so if you are cross-compiling, beware. jsdtoa.cpp, jsdtoa.h, dtoa.c dtoa.c contains david gay's portable double-precision floating point to string conversion code, with permission to use notice included. jsdtoa.cpp #includes this file. jshash.cpp, jshash.h, jsdhash.cpp, jsdhash.h portable, extensible hash tables. these use multiplicative hash for strength reduction over division hash, yet with very good key distribution over power of two table sizes. jshash resolves collisions via chaining, so each entry...
...insic c types, like long long, on platforms where they exist (most everywhere, these days). jsprf.* portable, buffer-overrun-resistant sprintf and friends. for no good reason save lack of time, the %e, %f, and %g formats cause your system's native sprintf, rather than js_dtoa(), to be used. this bug doesn't affect spidermonkey, because it uses its own js_dtoa() call in jsnum.cpp to convert from double to string, but it's a bug that we'll fix later, and one you should be aware of if you intend to use a js_*printf() function with your own floating type arguments - various vendor sprintf's mishandle nan, +/-inf, and some even print normal floating values inaccurately. prmjtime.c, prmjtime.h time functions. these interfaces are named in a way that makes local vs. universal time confusion likely.
JS::Value
accessors mutators null val.isnull() js::nullvalue() n/a val.setnull() undefined val.isundefined() js::undefinedvalue() n/a val.setundefined() boolean val.isboolean(), val.istrue(), val.isfalse() js::booleanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::doublevalue(double), js::float32value(float) val.toint32(), val.todouble(), val.tonumber() val.setint32(int32_t), val.setnumber(uint32_t), val.setnumber(double) string val.isstring() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() ...
...ing() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() js::objectvalue(jsobject&amp;), js::objectornullvalue(jsobject*) val.toobject() val.setobject(jsobject &) symbol val.issymbol() js::symbolvalue(js::symbol*) val.tosymbol() val.setsymbol(js::symbol &) numbers are stored in a js::value either as a double or as an int32_t. the different representations are visible using the separate int32/double methods but do not affect observable semantics (ignoring performance). the number mutators attempt to use int32_t representation for compatible input values, returning true when int32 could be used and false when double representation was required. any double value may be stored in a js::value, in one of t...
... val.to*() methods. ...
...ests jsval constants and constructors jsval accessors null jsval_is_null(v) jsval_null undefined jsval_is_void(v) jsval_void boolean jsval_is_boolean(v) jsval_true, jsval_false, boolean_to_jsval(b) jsval_to_boolean(v) number jsval_is_number(v), jsval_is_int(v), jsval_is_double(v) jsval_zero, jsval_one, int_to_jsval(i), double_to_jsval(d) jsval_to_int(v), jsval_to_double(v) string jsval_is_string(v) string_to_jsval(str) jsval_to_string(v), js_getstringchars(str), js_getstringlength(str) object !jsval_is_primitive(v) object_to_jsval(obj) jsval_to_object(v) there was also a further method, jsval_is_object(v), which did not what you would expect -- return true if the value w...
JS_DefineElement
unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj, uint32_t index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs); name type description cx jscontext * the context in which to creat...
...xt in which to create the new property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject or jsobject * the object on which to create the new property. index uint32_t the index of the property to define. value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double or jsval initial value to assign to the property. getter jsnative or jspropertyop getproperty method for retrieving the current property value. setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value. flags unsigned property attributes. obsolete since jsapi 32 description js_defineelement defines a numer...
...ue. 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 to this element. obsolete since jsapi 32 flags contains the property attributes to set for the new property. on success, js_defineelement ...
... obsolete since jsapi 32 flags contains the property attributes to set for the new property. on success, js_defineelement returns true. otherwise it returns false. obsolete since jsapi 32. ...
Secure Development Guidelines
n check the bounds of your arrays use a safe and well-designed api when using integers as array indexes, use caution format string bugs example: int main(int argc, char *argv[]) { if (argc > 1) printf(argv[1]); } format string bugs: prevention easy to fix: always use a format string specifier: int main(int argc, char *argv[]) { if (argc > 1) printf("%s", argv[1]); } double free example: void* ptr = malloc(1024); if (error) { free(ptr); } free(ptr); double free: prevention set a pointer to null when it’s freed valgrind or malloc debugging can help detect those bugs use after free accessing data after a free() or delete can lead to undefined behavior some debug tools might be able catch some cases un-initialized data example: int main...
...if (ptr) free(ptr); _exit(0); } int main() { signal(sigint, sighandler); ptr = malloc(1000); if (!ptr) exit(0); ... do stuff ... ...
...er overflows and 0-termination issues every string derived from the abstract base class nsastring common read-only methods length() isempty() equals() common methods for modifying the string assign() append() insert() truncate() checking return values often causes problems return value not handled certain cases not handled or interpreted incorrectly double meaning malloc() can return a pointer or null, but null by itself is a valid address checking return values int main() { int fds[2]; pipe(fds); write(fds[0], "data", 4); } the pipe() return value is not checked if pipe() fails, fds is not initialized write to un-initialized file descriptor checking return values check all return values—no matter how unlik...
...ialized file descriptor checking return values check all return values—no matter how unlikely the api failure for example: close() can fail and leak file descriptor setuid() can fail and privileges don’t get dropped snprintf() can fail and result in return value -1 tmp = realloc(tmp, size) — realloc could fail and leak tmp writing secure code: exception handling double freeing pointers double frees can occur in exception handling they free data in try block and then free it again in the catch block this is a common issue double freeing pointers char *ptr1 = null, *ptr2 = null; try { ptr1 = new char[1024]; do_something(); delete ptr1; do_something_else(); ptr2 = new char[-1] // oom } catch (...) { delete ptr1; delete ...
Using the Places annotation service
oth pages and on items in the places database (see nsiannotationservice.idl for the exact declarations). ...
...auri, aname, avalue, aflags, aexpiration); setpageannotationbinary(auri, aname, adata, adatalen, aflags, aexpiration); and likewise for items in the places database: setitemannotationstring(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint32(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint64(aitemid, aname, avalue, aflags, aexpiration); setitemannotationdouble(aitemid, aname, avalue, aflags, aexpiration); setitemannotationbinary(aitemid, aname, avalue, adatalen, aflags, aexpiration); from javascript there are two simple function to perform all of these operations: setpageannotation(auri, aname, avalue, aflags, aexpiration); setitemannotation(aitemid, aname, avalue, aflags, aexpiration); these annotations all take similar parameters: uri or ...
... annotationservice.setpageannotation(uri, "my_extension/some_annotation", "this is the annotation value", 0, 0); retrieving annotations there are corresponding getters for the setters above (see nsiannotationservice.idl for the exact declarations): from c++: getpageannotationstring(auri, aname); getpageannotationint32(auri, aname); getpageannotationint64(auri, aname); getpageannotationdouble(auri, aname); getpageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amimetype); from javascript: getpageannotation(auri, aname); getitemannotation(aitemi...
...c++ call...
Components.utils.evalInSandbox
utils.sandbox. in the constructor you define the security principal for code running in the sandbox, and can make various properties available to code running in the sandbox. the sandbox will become the global scope object when you pass it to evalinsandbox(text, sandbox). you can import functions or objects into the sandbox simply by assigning them to the sandbox object. ...
...ject when you pass it to evalinsandbox(text, sandbox). you can import functions or objects into the sandbox simply by assigning them to the sandbox object. for example: function double(n) { return n * 2; } // create new sandbox instance var mysandbox = new components.utils.sandbox("http://www.example.com/"); mysandbox.y = 5; // insert property 'y' with value 5 into global scope. ...
... you pass it to evalinsandbox(text, sandbox). you can import functions or objects into the sandbox simply by assigning them to the sandbox object. for example: function double(n) { return n * 2; } // create new sandbox instance var mysandbox = new components.utils.sandbox("http://www.example.com/"); mysandbox.y = 5; // insert property 'y' with value 5 into global scope. ...
...nctions or objects into the sandbox simply by assigning them to the sandbox object. for example: function double(n) { return n * 2; } // create new sandbox instance var mysandbox = new components.utils.sandbox("http://www.example.com/"); mysandbox.y = 5; // insert property 'y' with value 5 into global scope. ...
nsIBinaryOutputStream
void setoutputstream( in nsioutputstream aoutputstream ); parameters aoutputstream instance of the nsioutputstream object to which output should...
...void setoutputstream( in nsioutputstream aoutputstream ); parameters aoutputstream instance of the nsioutputstream object to which output should be direct...
...void setoutputstream( in nsioutputstream aoutputstream ); parameters aoutputstream instance of the nsioutputstream object to which output should be directed. wri...
...nt8 abytes, in pruint32 alength ); parameters abytes the bytes to write to the stream. alength the number of bytes to write to the stream. writebytes() writes an opaque byte array to the stream. void writebytes( [size_is(alength)] in string astring, in pruint32 alength ); parameters astring the byte array to write to the stream. alength the number of bytes to write to the stream. writedouble() writes a double precision floating point number to the stream. void writedouble( in double adouble ); parameters adouble the double to write to the stream. writefloat() writes a floating point number to the stream. void writefloat( in float afloat ); parameters afloat the floating point value to write to the stream. writestringz() writes an 8-bit pascal style string to the stream. the...
nsIDOMGeoPositionCoords
the nsidomgeopositioncoords interface describes a geographical location. dom/interfaces/geolocation/nsidomgeopositioncoords.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description latitude double the user's current latitude, in degrees. read only. ...
...s a geographical location. dom/interfaces/geolocation/nsidomgeopositioncoords.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description latitude double the user's current latitude, in degrees. read only. longitude double the user's current longitude, in degrees. read only. altitude double the user's current altitude, in meters. zero if the device doesn't support altitude detection. read only. accuracy double the accuracy of position information, in meters. read only. altitudeaccuracy double the accuracy of altitude information, in meters. zero if the device doesn't ...
...read only. ...
...ort altitude detection. read only. accuracy double the accuracy of position information, in meters. read only. altitudeaccuracy double the accuracy of altitude information, in meters. zero if the device doesn't support altitude detection. read only. heading double the current heading at which the user is moving, in degrees. read only. speed double the speed at which the user is moving, in meters per second (confirm this). read only. ...
Standard OS Libraries
amework/corefoundation"); let cgeventref = ctypes.voidptr_t; let cgeventsourceref = ctypes.voidptr_t; let cgeventcreate = coregraphics.declare("cgeventcreate", ctypes.default_abi, cgeventref, cgeventsourceref); let cgfloat = ctypes.voidptr_t.size == 4 ? ...
..."); let cgeventref = ctypes.voidptr_t; let cgeventsourceref = ctypes.voidptr_t; let cgeventcreate = coregraphics.declare("cgeventcreate", ctypes.default_abi, cgeventref, cgeventsourceref); let cgfloat = ctypes.voidptr_t.size == 4 ? ...
...let objc_msgsend_nspoint = objc.declare("...
...let objc_msgsend_nspoint = objc.declare("objc_msgsend", ...
GeolocationCoordinates - Web APIs
the geolocationcoordinates interface represents the position and altitude of the device on earth, as well as the accuracy with which these properties are calculated. properties the geolocationcoordinates interface doesn't inherit any properties. geolocationcoordinates.latitude read only secure context returns a double representing the position's latitude in decimal degrees. geolocationcoordinates.longitude read only secure context returns a double representing the position's longitude in decimal degrees. geolocationcoordinates.altitude read only secure context returns a double representing the position's altitude in meters, relative to sea level. this value can be null if the implementation cannot provide the data. geolocationcoordinates.accuracy read only secure contex...
...longitude read only secure context returns a double representing the position's longitude in decimal degrees. geolocationcoordinates.altitude read only secure context returns a double representing the position's altitude in meters, relative to sea level. this value can be null if the implementation cannot provide the data. geolocationcoordinates.accuracy read only secure context returns a double representing 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. ...
...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. ...
...lue, 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 representing the velocity of the device in meters per second. this value can be null. methods the geolocationcoordinates interface neither implements, nor inherits any method. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates' in that specification. recommendation initial specification. ...
PannerNode - Web APIs
ode. the orientation and position value are set and retrieved using different syntaxes, since they're stored as audioparam values. retrieval is done by accessing, for example, pannernode.positionx. while setting the same property is done with pannernode.positionx.value. this is why these values are not marked read only, which is how they appear in the webidl. ...
...eval is done by accessing, for example, pannernode.positionx. while setting the same property is done with pannernode.positionx.value. this is why these values are not marked read only, which is how they appear in the webidl. pannernode.coneinnerangle is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction. pannernode.coneouterangle a double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the coneoutergain attribute. pannernode.coneoutergain a double value describing the amount of volume reduction outside the cone defined by the coneouterangle attribute. its default value is 0, meaning that no sound can be heard. pannernode.distancemodel an enumerated v...
...tion outside the cone defined by the coneouterangle attribute. its default value is 0, meaning that no sound can be heard. pannernode.distancemodel an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener. possible values are "linear", "inverse" and "exponential". the default value is "inverse". pannernode.maxdistance a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further. pannernode.orientationx represents the horizontal position of the audio source's vector in a right-hand cartesian coordinate system. while this audioparam cannot be directly changed, its value can be altered using its value property. the default is value is 1. p...
...ctly changed, its value can be altered using its value property. the default is value is 0. pannernode.positionz represents the longitudinal (back and forth) position of the audio in a right-hand cartesian coordinate system. the default is 0. while this audioparam cannot be directly changed, its value can be altered using its value property. the default is value is 0. pannernode.refdistance a double value representing the reference distance for reducing volume as the audio source moves further from the listener. for distances greater than this the volume will be reduced based on rollofffactor and distancemodel. pannernode.rollofffactor a double value describing how quickly the volume is reduced as the source moves away from the listener. this value is used by all distance models. methods...
border-bottom-style - CSS: Cascading Style Sheets
ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-bottom-style: none; border-bottom-style: hidden; border-bottom-style: dotted; border-bottom-style: dashed; border-bottom-style: solid; border-bottom-style: double; border-bottom-style: groove; border-bottom-style: ridge; border-bottom-style: inset; border-bottom-style: outset; /* global values */ border-bottom-style: inherit; border-bottom-style: initial; border-bottom-style: unset; the border-bottom-style property is specified as a single keyword chosen from those available for the border-style property. formal definition initial valuenoneapplies toa...
...order-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. ...
...ion typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples demonstrating all border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 3px; background-color: #52e385; } tr, td { padding: 3px; } /* border-bottom-style example classes */ .b1 {border-bottom-style: none;} .b2 {border-bottom-style: hidden;} .b3 ...
... candidate recommendation no significant change. css le...
border-left-style - CSS: Cascading Style Sheets
to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-left-style: none; border-left-style: hidden; border-left-style: dotted; border-left-style: dashed; border-left-style: solid; border-left-style: double; border-left-style: groove; border-left-style: ridge; border-left-style: inset; border-left-style: outset; /* global values */ border-left-style: inherit; border-left-style: initial; border-left-style: unset; the border-left-style property is specified as a single keyword chosen from those available for the border-style property. formal definition initial valuenoneapplies toall elements. it ...
...l; 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. ...
...ocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-left-style example classes */ .b1 {border-left-style: none;} .b2 {border-left-style: hidden;} .b3 {borde...
... candidate recommendation no significant change. css level 2 (rev...
border-right-style - CSS: Cascading Style Sheets
e interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-right-style: none; border-right-style: hidden; border-right-style: dotted; border-right-style: dashed; border-right-style: solid; border-right-style: double; border-right-style: groove; border-right-style: ridge; border-right-style: inset; border-right-style: outset; /* global values */ border-right-style: inherit; border-right-style: initial; border-right-style: unset; the border-right-style property is specified as a single keyword chosen from those available for the border-style property. formal definition initial valuenoneapplies toall eleme...
... 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. ...
...as specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-right-style example classes */ .b1 {border-right-style: none;} .b2 {border-right-style: hidden;} .b3 {bo...
... candidate recommendation no significant change. css level 2...
border-top-style - CSS: Cascading Style Sheets
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-top-style: none; border-top-style: hidden; border-top-style: dotted; border-top-style: dashed; border-top-style: solid; border-top-style: double; border-top-style: groove; border-top-style: ridge; border-top-style: inset; border-top-style: outset; /* global values */ border-top-style: inherit; border-top-style: initial; border-top-style: unset; the border-top-style property is specified as a single keyword chosen from those available for the border-style property. formal definition initial valuenoneapplies toall elements. it also app...
...ial; 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. ...
...ocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-top-style example classes */ .b1 {border-top-style: none;} .b2 {border-top-style: hidden;} .b3 {border-t...
... candidate recommendation no significant change. css level 2 (revision...
JavaScript data types and data structures - JavaScript
alues: true and false. see boolean and boolean for more details. null type the null type has exactly one value: null. see null and null for more details. undefined type a variable that has not been assigned a value has the value undefined. see undefined and undefined for more details. number type ecmascript has two built-in numeric types: number and bigint (see below). the number type is a double-precision 64-bit binary format ieee 754 value (numbers between -(253 − 1) and 253 − 1). in addition to representing floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan ("not a number"). to check for the largest available value or smallest available value within ±infinity, you can use the constants number.max_value or number.min_value. starting ...
......
...tures. properties are identified using key values. a key value is either a string or a symbol value. there are two types of object properties which have certain attributes: the data property and the accessor property. note: each property has corresponding attributes. attributes are used internally by the javascript engine, so you cannot directly access them. that's why attributes are listed in double square brackets, rather than single. see object.defineproperty() to learn more. data property associates a key with a value, and has the following attributes: attributes of a data property attribute type description default value [[value]] any javascript type the value retrieved by a get access of the property. undefined [[writable]] boole...
...t32array 0 to 4294967295 4 32-bit unsigned integer unsigned long uint32_t float32array 1.2×10-38 to 3.4×1038 4 32-bit ieee floating point number (7 significant digits e.g., 1.1234567) unrestricted float float float64array 5.0×10-324 to 1.8×10308 8 64-bit ieee floating point number (16 significant digits e.g., 1.123...15) unrestricted double double bigint64array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) biguint64array 0 to 264-1 8 64-bit unsigned integer bigint uint64_t (unsigned long long) keyed collections: maps, sets, weakmaps, weaksets these data structures, introduced in ecmascript edition 6, take object references as keys. ...
Equality comparisons and sameness - JavaScript
%typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015). which operation you choose depends on what sort of comparison you are looking to perform. briefly: double equals (==) will perform a type conversion when comparing two things, and will handle nan, -0, and +0 specially to conform to ieee 754 (so nan != nan, and -0 == +0); triple equals (===) will do the same comparison as double equals ...
... (go look at these. they're brief and readable. hint: read the strict equality algorithm first.) es5 also describes, in section 9.12, the samevalue algorithm for use internally by the js engine. it's largely the same as the strict equality algorithm, except that 11.9.6.4 and 9.12.4 differ in handling numbers. es2015 simply proposes to expose this algorithm through object.is. we can see that with double and triple equals, with the exception of doing a type check upfront in 11.9.6.1, the strict equality algorithm is a subset of the abstract equality algorithm, because 11.9.6.2–7 correspond to 11.9.3.1.a–f. a model for understanding equality comparisons? prior to es2015, you might have said of double equals and triple equals that one is an "enhanced" version of the other. for example, someon...
...s, with the exception of doing a type check upfront in 11.9.6.1, the strict equality algorithm is a subset of the abstract equality algorithm, because 11.9.6.2–7 correspond to 11.9.3.1.a–f. a model for understanding equality comparisons? prior to es2015, you might have said of double equals and triple equals that one is an "enhanced" version of the other. for example, someone might say that double equals is an extended version of triple equals, because the former does everything that the latter does, but with type conversion on its operands. e.g., 6 == "6". (alternatively, someone might say that double equals is the baseline, and triple equals is an enhanced version, because it requires the two operands to be the same type, so it adds an extra constraint. which one is the better model for ...
...hanced version, because it requires the two operands to be the same type, so it adds an extra constraint. which one is the better model for understanding depends on how you choose to view things.) however, this way of thinking about the built-in sameness operators is not a model that can be stretched to allow a place for es2015's object.is on this "spectrum". object.is isn't simply "looser" than double equals or "stricter" than triple equals, nor does it fit somewhere in between (i.e., being both stricter than double equals, but looser than triple equals). we can see from the sameness comparisons table below that this is due to the way that object.is handles nan. notice that if object.is(nan, nan) evaluated to false, we could say that it fits on the loose/strict spectrum as an even stricter for...
Grammar and types - JavaScript
ing() { // super calls return 'd ' + super.tostring(); }, // computed (dynamic) property names [ 'prop_' + (() => 42)() ]: 42 }; regexp literals a regex literal (which is defined in detail later) is a pattern enclosed between slashes. the following is an example of a regex literal. var re = /ab+c/; string literals a string literal is zero or more characters enclosed in double (") or single (') quotation marks. a string must be delimited by quotation marks of the same type (that is, either both single quotation marks, or both double quotation marks). the following are examples of string literals: 'foo' "bar" '1234' 'one line \n another line' "john's cat" you can call any of the string object's methods on a string literal value. javascript automatically converts the...
...ect, calls the method, then discards the temporary string object. you can also use the string.length property with a string literal: // will print the number of symbols in the string including whitespace. console.log("john's cat".length) // in this case, 10. in es2015, template literals are also available. template literals are enclosed by the back-tick (`) (grave accent) character instead of double or single quotes. template strings provide syntactic sugar for constructing strings. (this is similar to string interpolation features in perl, python, and more.) optionally, a tag can be added to allow the string construction to be customized, avoiding injection attacks, or constructing higher-level data structures from string contents. // basic literal string creation `in javascript '\n' is ...
... to string interpolation features in perl, python, and more.) optionally, a tag can be added to allow the string construction to be customized, avoiding injection attacks, or constructing higher-level data structures from string contents. ...
...' the following table lists the special characters that you can use in javascript strings. table: javascript 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 hexadecima...
Monitoring downloads - Archive of obsolete content
gging multiple downloads of // the same file. ...
...l'); var datestr = thedate.tolocalestring(); cell.setattribute("label", datestr); row.appendchild(cell); thedate = new date(statement.getint64(3)); // end time cell = document.createelement('listcell'); datestr = thedate.tolocalestring(); cell.setattribute("label", datestr); row.appendchild(cell); var speed = statement.getdouble(4) / 1024.0; cell = document.createelement('listcell'); cell.setattribute("label", speed.tofixed(1) + "kb/sec"); cell.setattribute("style", "text-align:right"); row.appendchild(cell); var status = statement.getint32(5); var style = "color:black"; cell = document.createelement('listcell'); var statusstr; switch(status) { ca...
...ement object's executestep() method. each time that method is called, one row of the results is fetched. after that, the list row object is created, and each entry in the search result is fetched and inserted into the appropriate list cell. the interesting bits to take away from this: mozistoragestatement has several data getter routines for fetching search results, including getstring(), getdouble(), and getint64(). these methods take as a parameter the zero-based index number of the column whose value you wish to retrieve. note that the start time is being divided by 1000 before we create a javascript date object from it. that's to adjust the value from the granularity stored in the database to that expected by javascript. to right-justify the numeric columns, we set the appropriate cel...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
ent/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- calendar --> <rdf:li> <rdf:seq about="chrome://calendar/content/calendar.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> </rdf:seq> </rdf:rdf> optionally customize the file by changing the displayname, description and author attributes. change the text between double-quote characters on those three lines. optionally remove the sections for toolbars where you do not want your button. save the file. explanation: this file contains details of your extension, and specifies how it modifies seamonkey. 6. create a plain text file named button.xul. copy the following content, making sure that you scroll to get all of it. paste it into the new file: ...
...ar"> <toolbarbutton id="custom-button-1" position="10"/> </toolbar> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" oncommand="custombutton[1]()" class="toolbarbutton-1 custombutton" /> </overlay> optionally customize the file by changing the label, accesskey and tooltiptext attributes. change the text between double-quote characters on those lines. optionally remove the sections for toolbars that you do not need. save the file. explanation: this xul file adds the button to the toolbars. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making su...
...the name must match the change that you made in step 1. 4. in your working directory, create a new directory named content. move all the files from your original custombutton directory into your new content directory. 5. remove your extension from seamonkey. (for instructions, see the section uninstalling the button, above.) 6. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
cur in the same paragraph, the text in each language must appear in its proper directionality. 30 bigint bigint, glossary, javascript, reference, arbitrary precision format in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. 31 blink glossary, infrastructure, layout, rendering engine blink is an open-source browser layout engine developed by google as part of chromium (and therefore part of chrome as well). specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine. 3...
...dress. the meaning of a null reference varies among language implementations. 293 nullish value glossary, javascript, null, primitive, undefined in javascript, a nullish value is the value which is either null or undefined. nullish values are always falsy. 294 number codingscripting, glossary, javascript in javascript, number is a numeric data type in the double-precision 64-bit floating point format (ieee 754). in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums. 295 oop beginner, codingscripting, glossary oop (object-oriented programming) is an approach in programming in which data is encapsulated within objects and the object itself is operated on, rather than its compon...
... browser support, codingscripting, glossary, javascript, polyfill a polyfill is a piece of code (usually javascript on the web) used to provide modern functionality on older browsers that do not natively support it. 325 polymorphism codingscripting, glossary polymorphism is the presentation of one interface for multiple data types. for example, integers, floats, and doubles are implicitly polymorphic: regardless of their different types, they can all be added, subtracted, multiplied, and so on. 326 port glossary, intro, security, computer network, port for a computer connected to a network with an ip address, a port is a communication endpoint. ports are designated by numbers, and below 1024 each port is associated by default with a specific pr...
Debugging HTML - Learn web development
some kind, everything is usually fine, until that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to. for example, the following shows an error reported when trying to compile a simple program written in the rust language. here, the error message is relatively easy to understand — "unterminated double quote string". if you look at the listing, you can probably see how println!(hello, world!"); might logically be missing a double quote. however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust. debugging doesn't have to be scary though — the ...
...s is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text has been strongly emphasised. this section is badly nested: <strong>strong <em>strong emphasised?</strong> what is this?</em>. it is not easy to tell how this has been interpreted because of the previous problem. the href attribute value is missing a closing double quote. this seems to have caused the biggest problem — the link has not rendered at all. now let's look at the markup the browser has rendered, as opposed to the markup in the source code. to do this, we can use the browser developer tools. if you are not familiar with how to use your browser's developer tools, take a few minutes to review discover browser developer tools. in the dom ins...
...en given closing tags. it isn't clear where the first <strong> element should be closed, so the browser has wrapped each separate block of text with its own strong tag, right down to the bottom of the document! the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the missing double quote has been deleted altogether. the last list item looks like this: <li> <strong>unclosed attributes: another common source of html problems. let's look at an example: </strong> </li> html validation so you can see from the above example that you really want to make sure your html is well-formed! but how? in a small example like the one seen above, it is easy to search thro...
Getting started with HTML - Learn web development
ribute for three attributes: a title attribute with the value the, and two boolean attributes, mozilla and homepage. obviously, this is not intended! it will cause errors or unexpected behavior, as you can see in the live example below. try hovering over the link to view the title text! always include the attribute quotes. it avoids such problems, and results in more readable code. single or double quotes? in this article you will also notice that the attributes are wrapped in double quotes. however, you might see single quotes in some html code. this is a matter of style. you can feel free to choose which one you prefer. both of these lines are equivalent: <a href="http://www.example.com">a link to my example.</a> <a href='http://www.example.com'>a link to my example.</a> make sure you...
... will also notice that the attributes are wrapped in double quotes. however, you might see single quotes in some html code. this is a matter of style. you can feel free to choose which one you prefer. both of these lines are equivalent: <a href="http://www.example.com">a link to my example.</a> <a href='http://www.example.com'>a link to my example.</a> make sure you don't mix single quotes and double quotes. this example (below) shows a kind of mixing quotes that will go wrong: <a href="http://www.example.com'>a link to my example.</a> however, if you use one type of quote, you can include the other type of quote inside your attribute values: <a href="http://www.example.com" title="isn't this fun?">a link to my example.</a> to use quote marks inside other quote marks of the same type (sin...
...for example, this will break: <a href='http://www.example.com' title='isn't this fun?'>a link to my example.</a> instead, you need to do this: <a href='http://www.example.com' title='isn&apos;t this fun?'>a link to my example.</a> anatomy of an html document individual html elements aren't very useful on their own. next, let's examine how individual elements combin...
IPDL Tutorial
ic, protected, and private labels in c++. parameters message declarations allow any number of parameters. parameters specify data that are sent with the message. their values are serialized by the sender and deserialized by the receiver. ipdl supports built-in and custom primitive types, as well as unions and arrays. the built-in simple types include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring). ipdl imports these automatically because they are common, and because the base ipc library knows how to serialize and deserialize these types. see ipc/ipdl/ipdl/builtin.py for the most up-to-date list of automatically imported types. actors may be passed as parameters. the c++ signature will accept a pprotocolparent* on one side and convert it to a ...
...ation in an ipdl specification. a custom serializer and deserializer must be provided by your c++ code. using mozilla::plugins::npremoteevent; sync protocol pplugininstance { child: async handleevent(npremoteevent); }; unions ipdl has built-in support for declaring discriminated unions. ...
...child: async handleevent(npremoteevent); }; unions ipdl has built-in support for declaring discriminated unions. using struct mozilla::void_t from "ipc/ipcmessageutils.h"; union variant { void_t; bool; int; double; nscstring; ppluginscriptableobject; }; this union generates a c++ interface which includes the following: struct variant { enum type { tvoid_t, tbool, tint, tdouble, tnscstring, tpplugionscriptableobject }; type type(); void_t& get_void_t(); bool& get_bool(); int& get_int(); double& get_double(); nscstring& get_nscstring(); ppluginscriptableobject* get_ppluginscriptableobject(); }; aunion.type() can be used to determine the type of a union received in an ipdl message handler, with the remaining functions granting access to its contents. to...
JSAPI Cookbook
// javascript va...
... // javascript var global = this; there is a funct...
...eturn 23; /* jsapi * * warning: this only works for integers that fit in 32 bits. * otherwise, convert the number to floating point (see the next example). */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setint32(23); return true; returning a floating-point number // javascript return 3.14159; /* jsapi */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setdouble(3.14159); exception handling throw the most common idiom is to create a new error object and throw that. js_reporterror does this. note that javascript exceptions are not the same thing as c++ exceptions. the jsapi code also has to return false to signal failure to the caller. // javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror...
nsAString
index_type [pruint32] type used to represent an offset into the string. ...
... index_type [pruint32] type used to represent an offset into the string. methods beginreading the beginreading function returns a const pointer to the first element of the string's internal buffer. ...
...is a shortcut for the append family of functions. remarks the nsastring class is never instantiated directly. it should be instantiated using a subclass, such as nsembedstring . nsastring corresponds to the astring and domstring xpidl data types. nsastring by itself does not imply a particular character encoding. that is, it may be used to store utf-16 characters, ucs-2 characters, or any random double-byte data. the character encoding in use for a particular nsastring instance depends on the context in which it is used. if used with xpidl, then the character encodings of the corresponding xpidl data types applies. nsastring may even hold data with embedded null values. thus, the length of the data contained in the nsastring should be determined by calling the nsastring::length method. the meth...
mozIStorageAggregateFunction
nscomptr<mozistoragefunction> func = new standarddeviationfunc(); ns_ensure_true(func, ns_error_out_of_memory); nsresult rv = dbconn->createfunction( ns_literal...
...nscomptr<mozistoragefunction> func = new standarddeviationfunc(); ns_ensure_true(func, ns_error_out_of_memory); nsresult rv = dbconn->createfunction( ns_literal_cstring("st...
...nscomptr<mozistoragefunction> func = new standarddeviationfunc(); ns_ensure_true(func, ns_error_out_of_memory); nsresult rv = dbconn->createfunction( ns_literal_cstring("stddev"), 1, f...
mozIStorageValueArray
iew document. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
...nt. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
...; 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 has isvoid set to di...
nsIBinaryInputStream
pruint8 read8(); parameters none. return value an 8-bit integer read from the stream. read16() reads from the stream. pruint16 read16(); parameters none. return value a 16-bit integer read from the stre...
... pruint8 read8(); parameters none. return value an 8-bit integer read from the stream. read16() reads from the stream. pruint16 read16(); parameters none. return value a 16-bit integer read from the stream. read32...
...ers alength the number of bytes to read. astring a string containing the bytes read from the stream. exceptions thrown ns_error_failure if it can't read alength bytes. readcstring() reads an 8-bit pascal style string from the stream. 32-bit length field, followed by length 8-bit chars. acstring readcstring(); parameters none. return value the string read from the stream. readdouble() reads from the stream. double readdouble(); parameters none. return value a double read from the stream. readfloat() reads from the stream. float readfloat(); parameters none. return value a float read from the stream. readstring() reads an 16-bit pascal style string from the stream. 32-bit length field, followed by length prunichars. astring readstring(); parameters none. ...
nsIDOMOrientationEvent
determine the orientation of the device. dom/interfaces/events/nsidomorientationevent.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for ...
...must be "mozorientation". canbubblearg specifies whether or not the created event will bubble. cancelablearg specifies whether or not the created event can be canceled. x the amount of tilt along the x axis. y the amount of tilt along the y axis. ...
...e amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. methods initorientationevent() initializes the orientation event object. void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event. must be "mozorientation". canbubblearg specifies whether or not the created event will bubble. cancelablearg specifies whether or not the created event can be canceled. x the amount of tilt along the x axis. y the amount of tilt along the y axis. z the amount of tilt along the z axis. ...
nsIDOMSimpleGestureEvent
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 specifie...
... viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in 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 ...
... deltaarg the value to assign to the delta attribute. see also mouse gestur...
nsIPropertyBag2
getting properties in specific formats. ...
...n specific formats. ...
... value the property value as an autf8string. note: accessing a property of a different type may attempt conversion to this type. getpropertyasbool() boolean getpropertyasbool( in astring prop ); parameters prop property to return the value of. return value the property value as a boolean. note: accessing a property of a different type may attempt conversion to this type. getpropertyasdouble() double getpropertyasdouble( in astring prop ); parameters prop property to return the value of. return value the property value as a double. note: accessing a property of a different type may attempt conversion to this type. getpropertyasint32() print32 getpropertyasint32( in astring prop ); parameters prop property to return the value of. return value the property val...
nsISupportsPrimitive
sisupportspruint32. type_pruint64 8 corresponding to nsisupportspruint64. type_prtime 9 corresponding to nsisupportsprtime. type_char 10 corresponding to nsisupportschar. type_print16 11 corresponding to nsisupportsprint16. type_print32 12 corresponding to nsisupportsprint32. type_print64 13 corresponding to nsisupportsprint64. type_float 14 corresponding to nsisupportsfloat. ...
...corresponding to nsisupportspruint64. type_prtime 9 corresponding to nsisupportsprtime. type_char 10 corresponding to nsisupportschar. type_print16 11 corresponding to nsisupportsprint16. type_print32 12 corresponding to nsisupportsprint32. type_print64 13 corresponding to nsisupportsprint64. type_float 14 corresponding to nsisupportsfloat. type_double 15 corresponding to nsisupportsdouble. ...
...t 14 corresponding to nsisupportsfloat. type_double 15 corresponding to nsisupportsdouble. type_void 16 corresponding to nsisupportsvoid. type_interface_pointer 17 corresponding to nsisupportsinterfacepointer. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
XPIDL
uilt-in native types. the built-in native types are those listed under the type_spec production above. ...
...tive types. the built-in native types are those listed under the type_spec production above. ...
.... the built-in native types are those listed under the type_spec production above. ...
AnalyserNode - Web APIs
t, audionode. analysernode.fftsize is an unsigned long value representing the size of the fft (fast fourier transform) to be used to determine the frequency domain. analysernode.frequencybincount read only is an unsigned long value half that of the fft size. this generally equates to the number of data values you will have to play with for the visualization. ...
...lly equates to the number of data values you will have to play with for the visualization. analysernode.mindecibels is a double value representing the minimum power value in the scaling range for the fft analysis data, for conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when using getbytefrequencydata(). analysernode.maxdecibels is a double value representing the maximum power value in the scaling range for the fft analysis data, for conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when using getbytefrequencydata(). ...
... methods inherits methods from its parent, audionode. ...
DOMMatrixReadOnly - Web APIs
...
... in column-major (colexographical access, or "colex") order. (in other words, down the first column from top to bottom, then the second column, and so forth.) dommatrixreadonly.tofloat64array() returns a new float64array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix. the elements are stored into the array as double-precision floating-point numbers in column-major (colexographical access access or "colex") order. (in other words, down the first column from top to bottom, then the second column, and so forth.) dommatrixreadonly.tojson() returns a json representation of the dommatrixreadonly object. dommatrixreadonly.tostring() creates and returns a domstring object which contains a string representation...
...erits methods from dommatrixreadonly. fromfloat32array() creates a new mutable dommatrix object given an array of single-precision (32-bit) floating-point values. if the array has six values, the result is a 2d matrix; if the array has 16 values, the result is a 3d matrix. otherwise, a typeerror exception is thrown. fromfloat64array() creates a new mutable dommatrix object given an array of double-precision (64-bit) floating-point values. if the array has six values, the result is a 2d matrix; if the array has 16 values, the result is a 3d matrix. otherwise, a typeerror exception is thrown. frommatrix() creates a new mutable dommatrix object given an existing matrix or a dommatrixinit dictionary which provides the values for its properties. if no matrix is specified, the matrix is initia...
GlobalEventHandlers.ondblclick - Web APIs
the ondblclick property of the globaleventhandlers mixin is an eventhandler that processes dblclick events on the given element. the dblclick event is raised when the user double clicks an element. it fires after two click events. syntax target.ondblclick = functionref; value functionref is a function name or a function expression. the function receives a mouseevent object as its sole argument. within the function, this will be the element upon which the event was triggered. only one ondblclick handler can be assigned to an object at a time. ...
...a function name or a function expression. the function receives a mouseevent object as its sole argument. within the function, this will be the element upon which the event was triggered. only one ondblclick handler can be assigned to an object at a time. you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible. ...
...tion expression. the function receives a mouseevent object as its sole argument. within the function, this will be the element upon which the event was triggered. only one ondblclick handler can be assigned to an object at a time. you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible. example this example logs the position of double clicks. html <p>double click anywhere in this example.</p> <p id="log"></p> javascript let log = document.getelementbyid('log'); document.ondblclick = logdoubleclick; function logdoubleclick(e) { log.textcontent = `position: (${e.clientx}, ${e.clienty})`; } result specifications specification status comment html living standardthe definition of 'ondblclick' in that specification. l...
HTMLTextAreaElement - Web APIs
00px; height: 100px; } html <form> <fieldset> <legend>your comments</legend> <p><textarea class="noscrollbars" onkeyup="autogrow(this);"></textarea></p> <p><input type="submit" value="send" /></p> </fieldset> </form> insert html tags example insert some html tags or smiles or any custom text in a textarea. ...
...> </form> insert html tags example insert some html tags or smiles or any custom text in a textarea. ...
...starttag, sendtag) { var bdouble = arguments.length > 1, omsginput = document.myform.mytxtarea, nselstart = omsginput.selectionstart, nselend = omsginput.selectionend, soldtext = omsginput.value; omsginput.value = soldtext.substring(0, nselstart) + (bdouble ? sstarttag + soldtext.substring(nselstart, nselend) + sendtag : sstarttag) + soldtext.substring(nselend); omsginput.setselectionrange(bdouble || nselstart === nselend ? nselstart + sstarttag.length : nselstart, (bdouble ? nselend : nselstart) + sstarttag.length); omsginput.focus(); } css css to decorate the internal span to behave like a link: .intlink { cursor: pointer; text-decoration: underline; color: #0000ff; } html: <form name="myform"> <p>[&nbsp;<span class="intlink" onclick="insertmetachars('&lt;strong&gt;','&lt;\/...
MediaTrackConstraints.latency - Web APIs
the mediatrackconstraints dictionary's latency property is a constraindouble describing the requested or mandatory constraints placed upon the value of the latency constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency 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 rtcpeerconnection will never include this property. ...
...adevices.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 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 perfor...
...d 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 variation should be expected. example see example: ...
MediaTrackSettings - Web APIs
the current value of the channelcount property, specifying the number of audio channels present on the track (therefore indicating how many audio samples exist in each audio frame). this is 1 for mono, 2 for stereo, and so forth. echocancellation a boolean indicating the current value of the echocancellation property, specifying true if echo cancellation is enabled, otherwise false. latency a double-precision floating point value indicating the current value of the latency property, specifying the audio latency, in seconds. latency is the amount of time which elapses between the start of processing the audio and the data being available to the next stop in the audio utilization process. this value is a target value; actual latency may vary to some extent for various reasons. noisesuppressio...
... specifying the sample rate in samples per second of the audio data. standard cd-quality audio, for example, has a sample rate of 41,000 samples per second. samplesize a long integer value indicating the current value of the samplesize property, specifying the linear size, in bits, of each audio sample. cd-quality audio, for example, is 16-bit, so 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 w...
...ie cam"), used for self-portraiture and video calling. "environment" a camera facing away from the user (when the user is looking at the screen). this is typically the highest quality camera on the device, used for general photography. "left" a camera facing toward the environment to the user's left. "right" a camera facing toward the environment to the user's right. framerate a double-precision floating point value indicating the current value of the framerate property, specifying how many frames of video per second the track includes. if the value can't be determined for any reason, the value will match the vertical sync rate of the device the user agent is running on. height a long integer value indicating the current value of the height property, specifying the height of ...
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
is property takes into account any horizontal scrolling of the page. for example, if the page is scrolled such that 200 pixels of the left side of 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. 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 pro...
...nates 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 browsers have been updated to use the revised data type. example more examples you can also see an example ...
... touch eventsthe definition of 'pagex' in that specification. unknown initial definition. prior to being added to the cssom view specification, pagex and pagey were available on the uievent interface in a limited subset of browsers for a short time. ...
Touch() - Web APIs
Web › API › Touch › Touch
syntax touch = new touch(touchinit); arguments touchinit is a touchinit dictionary, having the following fields: "identifier", required, of type long, that is the identification number for the touch point. "target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface. ...
... is the identification number for the touch point. "target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface. "clientx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset. "clienty", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, excluding any scroll offset. "screenx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the user's screen. "screeny", optional and defaulting to 0, of type double, that is the vertical position of the touch on the user's screen. "pagex", optional and defaultin...
...rtical position of the touch on the client window of the user's screen, excluding any scroll offset. "screenx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the user's screen. "screeny", optional and defaulting to 0, of type double, that is the vertical position of the touch on the user's screen. "pagex", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, including any scroll offset. "pagey", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, including any scroll offset. "radiusx", optional and defaulting to 0, of type float, that is the radius of the ellipse which most closely ci...
outline-style - CSS: Cascading Style Sheets
contribute to the interactive examples project, please clone https://github.com/mdn/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-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. ...
...e: 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 the two lines and the space between them. groove the outline looks as though it were carved into the page. ridge the opposite of groove: the outline looks as though it were extruded from the page. inset the outline makes the box look as though it were embedded in the page. outset the opposite of inset: the...
...ing: 15px; } result setting outline style to dashed and dotted html <div> <div class="dotted"> <p class="dashed">outline demo</p> </div> </div> css .dotted { outline-style: dotted; /* same result as "outline: dotted" */ } .dashed { outline-style: dashed; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to solid and double html <div> <div class="solid"> <p class="double">outline demo</p> </div> </div> css .solid { outline-style: solid; } .double { outline-style: double; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to groove and ridge html <div> <div class="groove"> <p class="ridge">outline demo</p> </div> </div> css .groov...
text-emphasis-style - CSS: Cascading Style Sheets
sis marks */ /* <string> values */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25b2'; text-emphasis-style: '*'; text-emphasis-style: 'foo'; /* should not be used. it may be computed to or rendered as 'f' only */ /* keyword values */ text-emphasis-style: filled; text-emphasis-style: open; text-emphasis-style: dot; text-emphasis-style: circle; text-emphasis-style: double-circle; text-emphasis-style: triangle; text-emphasis-style: filled sesame; text-emphasis-style: open sesame; /* global values */ text-emphasis-style: inherit; text-emphasis-style: initial; text-emphasis-style: unset; syntax values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. ...
...ax values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), and the open circle is '○' (u+25cb). double-circle display double circles as marks. the filled double-circle is '◉' (u+25c9), and the open double-circle is '◎' (u+25ce). triangle display triangles as marks. the filled triangle is '▲' (u+25b2), and the open triangle is '△' (u+25b3). sesame display sesames as marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). <string> display the given string as...
...same 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 ...
SyntaxError: JSON.parse: bad parsing - JavaScript
ntaxerror: json.parse: unexpected character syntaxerror: json.parse: end of data while reading object contents syntaxerror: json.parse: expected property name or '}' syntaxerror: json.parse: end of data when ',' or ']' was expected syntaxerror: json.parse: expected ',' or ']' after array element syntaxerror: json.parse: end of data when property name was expected syntaxerror: json.parse: expected double-quoted property name syntaxerror: json.parse: end of data after property name when ':' was expected syntaxerror: json.parse: expected ':' after property name in object syntaxerror: json.parse: end of data after property value in object syntaxerror: json.parse: expected ',' or '}' after property value in object syntaxerror: json.parse: expected ',' or '}' after property-value pair in object litera...
...this string has to be valid json and will throw this...
...ct syntax was encountered. examples json.parse() does not allow trailing commas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4]'); json.parse('{"foo": 1}'); property names must be double-quoted strings you cannot use single-quotes around properties, like 'foo'. json.parse("{'foo': 1}"); // syntaxerror: json.parse: expected property name or '}' // at line 1 column 2 of the json data instead write "foo": json.parse('{"foo": 1}'); leading zeros and decimal points you cannot use leading zeros, like 01, and decimal points must be followed by at least one digit. json.parse('{"fo...
String - JavaScript
s, 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 treat the string as an ...
...al(str1, str2) { return str1.touppercase() === str2.touppercase() } // isequal upper case is used instead of lower case in this function, due to problems with certain utf-8 character conversions. string primitives and string objects note that javascript distinguishes between string objects and primitive string values. (the same is true of boolean and numbers.) string literals (denoted by double or single quotes) and strings returned from string calls in a non-constructor context (that is, called without using the new keyword) are primitive strings. javascript automatically converts primitives to string objects, so that it's possible to use string object methods for primitive strings. in contexts where a method is to be invoked on a primitive string or a property lookup occurs, javascrip...
...its primitive counterpart with the valueof() method. console.log(eval(s2.valueof())) // returns the number 4 escape notation special characters can be encoded using escape notation: code output \xxx (where xxx is 1–3 octal digits; range of 0–377) iso-8859-1 character / unicode code point between u+0000 and u+00ff \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uxxxx (where xxxx is 4 hex digits; range of 0x0000–0xffff) utf-16 code unit / unicode code point between u+0000 and u+ffff \u{x} ... \u{xxxxxx} (where x…xxxxxx is 1–6 hex digits; range...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
rage mechanism in quicknote1 for our debugger. install quicknote from the following url and relaunch firefox. https://addons.mozilla.org/firefox/46/. after relaunching firefox, activate quicknote. then select tools:quicknote:float to display it in its own window. using venkman read in source code activate venkman, and then select open windows:quicknote.xul:files on the top-left of the screen. double-click on quicknote.js to open it in source-code view (figure 2). fixme: figure 2: selecting source code inserting breakpoints now you’ll want to set some breakpoints. try inserting one within the quicknote_savenote function, around line 345 (figure 3). fixme: figure 3: inserting a breakpoint start debugger type in some text into the quicknote screen, and then select save current tab from ...
...that's the c++ name of the function implementing initwithpath. use that as your search string. that should produce nslocalfilewin.cpp and other os-specific files. let’s look inside nslocalfilewin.cpp—we’ll see, for example, that it’s checking for the presence of a “:” in the driv...
Index - Archive of obsolete content
, etc.). 616 hostwindow prism prism hosts web applications in a simple, minimal window. the window does have some ui components (as shown in the screenshot below). prism can be configured to show or hide several of the ui components. 617 installer prism the installer should configure the os to associate *.webapp files with prism. this means that when you double-click or launch a *.webapp file, prism is launched and automatically opens the web application. 618 scripting prism prism allows for some client-side web application customization. the web application bundle is allowed to hold a javascript file named webapp.js (called the webapp script). this file will be loaded into the prism chrome window very much like a firefox extension...
...own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers. 2075 string.prototype.quote() javascript, method, obsolete, prototype, reference, string the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes ("). 2076 arguments.caller functions, javascript, obsolete, property, arguments the obsolete arguments.caller property used to provide the function that invoked the currently executing function. this property has been removed and no longer works. 2077 for each...in deprecated, e4x, javascript, language feature, obsolete, statement the for each...in...
Editor Embedding Guide - Archive of obsolete content
docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. nsicommandparams creating how do you create an nsicommandparams? -saari writing once you have created an nsicommandparams you call the "set" methods. setbooleanvalue setlongvalue setdoublevalue setstringvalue setcstringvalue setisupportsvalue removevalue each will take a name value pair. in the case of setbooleanvalue for example you use a boolean as the second parameter. commandparam->setcstringvalue("state_attribute","left"); reading for reading you may go after individual name/value pairs you know are there or you may iterate through all the name/value pairs and progra...
...iterate through all the name/value pairs and programatically pull off data. first getnext (returns the next name in the name/value pair list) hasmoreelements getvaluetype (numeric enum type see nsicommandparams for values) if the name/value pair is known or it was obtained using the methods described above, it is possible to call the following methods: getbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an nsastring. commandparam->getbooleanvalue("state_enabled",&boolval); original document information authors: michael judge (mjudge@netscape.com) contributor: kathleen brade (brade@netscape.com) last updated date: march 27, 2003 original ...
Venkman Introduction - Archive of obsolete content
roperties" menu item in the view's context menu. if a property shows up in a bold red font, an exception occurred when venkman tried to read the value. the exception object will appear as the value of the property. icon data type icon data type void (undefined) value null value boolean value string value integer value double value object value function value figure 9. type icons the column picker for this view (the box on the top right) can be used to display type and flags columns. the type column contains a textual description of the type of the object. flags lists one or more applicable flags for this object. flags are shown enumerated in figure 8. if an item visible in the local var...
... view the call stack view is on the left portion of the window by default, at the bottom. when the debugger is stopped, the call stack view displays the list of active functions. the function at the top of the call stack view is the one in which the debugger stopped, the function below it is the caller, below that is the caller's caller, and so on. these items are referred to as stack frames. double-clicking on a stack frame will change the "current" frame. this will cause the source of function to be displayed in the source code view, the local variables view will change to display variables local to the selected stack frame, and script evaluated in the interactive session view will be relative to the selected frame. if you would like to copy the current call stack to the clipboard, select...
diskSpaceAvailable - Archive of obsolete content
description use this function to make sure there is adequate space on the local disk for extracting and installing your files (see example below). ...
...description use this function to make sure there is adequate space on the local disk for extracting and installing your files (see example below). ...
XUL Events - Archive of obsolete content
d. the event is not sent until the focus is moved to another element. attribute: onchange click this event is sent when a mouse button is pressed and released. you can determine which mouse button was clicked by retrieving the button property of the event object. this event is also sent when the user double-clicks with the mouse. the detail property specifies how many clicks occurred. you can also check for triple-clicks in a similar manner. you should not use this event in xul to respond to user actions; the command event should be used instead. attribute: onclick dblclick this event is like the click ...
... specifies how many clicks occurred. you can also check for triple-clicks in a similar manner. you should not use this event in xul to respond to user actions; the command event should be used instead. attribute: onclick dblclick this event is like the click event except it is only sent when the user double clicks with the mouse. this is an alternative to checking the detail property in the click event. attribute: ondblclick dommousescroll this event is sent when the mouse wheel is moved, whether it results in content being scrolled or not. the target of this event is the element that was un...
Custom toolbar button - Archive of obsolete content
8e30fb-e89b-41dd-9da7-e25a45638b28}" em:minversion="0.2.9" em:maxversion="99" /> </em:targetapplication> <em:file> <description about="urn:mozilla:extension:custombutton" em:package="content/custombutton/" /> </em:file> </description> </rdf> optionally customize the file by changing the name, description and creator. change the text between double-quote characters on these three lines. optionally remove the sections for target applications that you do not want. save the file. explanation: this file contains information used by the application's extension manager. sections for target applications specify the versions where the extension works. the last section in the file specifies that this extension adds content to the application. 4...
...on id="custom-button-1"/> </toolbarpalette> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" oncommand="custombutton[1]()" class="toolbarbutton-1 chromeclass-toolbar-additional custombutton" /> </overlay> optionally customize the file by changing the label and tooltiptext in the last section. change the text between double-quote characters on these two lines. optionally remove the sections for toolbars that you do not need. save the file. explanation: this xul file adds the button to the application's toolbar customization palette. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the f...
More Event Handlers - Archive of obsolete content
ed again for that event. the following sections list some of the events that may be used. a full list is provided in the xulplanet event reference. mouse events there are several events which can be used to handle mouse specific actions, which are described briefly below: click called when the mouse is pressed and released on an element. dblclick called when the a mouse button is double clicked. mousedown called when a mouse button is pressed down on an element. the event handler will be called as soon as a mouse button is pressed, even if it hasn't been released yet. mouseup called when a mouse button is released on an element. mouseover called when the mouse pointer is moved onto an element. you could use this to highlight the element, however css provi...
...se pointer. the event's button property can be used to determine which button was pressed, where possible values are 0 for the left button, 1 for the middle button and 2 for the right button. if you've configured your mouse differently, these values may be different. the detail property holds the number of times the button has been clicked quickly in sequence. this allows you to check for single, double or triple clicks. of course, if you just want to check for double clicks, you can also use the dblclick event instead. the click event will be fired once for the first click, again for the second click, and again for the third click, but the dblclick event will only be fired once for a double click. the button and detail properties only apply to the mouse button related events, not mouse movement...
param - Archive of obsolete content
Archive › Mozilla › XUL › param
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. ...
...s 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. ...
Array comprehensions - Archive of obsolete content
or if statements are allowed. array comprehension was previously proposed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another. comprehensions can often be used in place of calls to map() and filter(), or as a way of combining the two. the following comprehension takes an array of numbers and creates a new array of the double of each of those numbers. var numbers = [1, 2, 3, 4]; var doubled = [for (i of numbers) i * 2]; console.log(doubled); // logs 2,4,6,8 this is equivalent to the following map() operation: var doubled = numbers.map(i => i * 2); comprehensions can also be used to select items that match a particular expression. here is a comprehension which selects only even numbers: var numbers = [1, 2, 3, 2...
...ers: var numbers = [1, 2, 3, 21, 22, 30]; var evens = [for (i of numbers) if (i % 2 === 0) i]; console.log(evens); // logs 2,22,30 filter() can be used for the same purpose: var evens = numbers.filter(i => i % 2 === 0); map() and filter() style operations can be combined into a single array comprehension. here is one that filters just the even numbers, then creates an array containing their doubles: var numbers = [1, 2, 3, 21, 22, 30]; var doubledevens = [for (i of numbers) if (i % 2 === 0) i * 2]; console.log(doubledevens); // logs 4,44,60 the square brackets of an array comprehension introduce an implicit block for scoping purposes. new variables (such as i in the example) are treated as if they had been declared using let. this means that they will not be available outside of the com...
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
l+xml, then it should be treated as an xml document which must conform to the strict rules for authoring and displaying xml. proper xhtml is an application of xml and as such requires that authors follow strict rules when authoring xhtml. in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ... ]]>). comments (<!—— ... ——>) must not contain double dashes (——). content contained within comments (<!—— ... ——>) can be ignored. problems with inline style and script inline style and script tags can cause several different problems in xhtml when it is treated as xml rather than html. javascript contains characters which can not exist in xhtml javascript typically contains characters which can not exist in xhtml outside of cdata...
...ontent in text/xml or application/xhtml+xml can be problematic. mozilla 1.1+/opera 7 do not apply css or execute the javascript. netscape 7.0x/mozilla 1.0.x do not apply css but does execute the javascript. internet explorer 5.5+ can not display the document. (see talk:properly_using_css_and_javascript_in_xhtml_documents of this ascertation. - xmlguru) inline style and script containing double dashes another problem with using comments to surround javascript in xhtml is related to the problems which can occur if comments contain double dashes (——). <script type="text/javascript"> <!-- var i; var sum = 0; for (i = 10; i > 0; --i) { sum += i; } // --> </script> using cdata instead of comments properly enclosing script contents inside of cdata sections can cause pr...
Handling text — strings in JavaScript - Learn web development
quote, it complains with an error (with "unterminated string literal"). if your program is raising such errors, then go back and check all your strings to make sure you have no missing quote marks. the following will work if you previously defined the variable string — try it now: let badstring = string; badstring; badstring is now set to have the same value as string. single quotes vs. double quotes in javascript, you can choose single quotes or double quotes to wrap your strings in. both of the following will work okay: let sgl = 'single quotes.'; let dbl = "double quotes"; sgl; dbl; there is very little difference between the two, and which you use is down to personal preference. you should choose one and stick to it, however; differently quoted code can be confusing, especi...
...e last instance, we joined only two strings, but you can join as many as you like, as long as you include a + between each pair. try this: let multiple = one + one + one + one + two; multiple; you can also use a mix of variables and actual strings. try this: let response = one + 'i am fine — ' + two; response; note: when you enter an actual string in your code, enclosed in single or double quotes, it is called a string literal. concatenation in context let's have a look at concatenation being used in action — here's an example from earlier in the course: <button>press me</button> const button = document.queryselector('button'); button.onclick = function() { let name = prompt('what is your name?'); alert('hello ' + name + ', nice to see you!'); } here we're using a wi...
Server-side web frameworks - Learn web development
a team name that starts with "fr" or ends with "al"). the second code snippet shows a view function (resource handler) for displaying all of our u09 teams. in this case we specify that we want to filter for all records where the team_level field has exactly the text 'u09' (note below how this criteria is passed to the filter() function as an argument with field name and match type separated by double underscores: team_level__exact). #best/views.py from django.shortcuts import render from .models import team def youngest(request): list_teams = team.objects.filter(team_level__exact="u09") context = {'youngest_teams': list_teams} return render(request, 'best/index.html', context) rendering data web frameworks often provide templating systems. these allow you to specify the s...
...structure of an output document, using placeholders for data that will be added when a page is generated. templates are often used to create html, but can also create other types of document. web frameworks often provide a mechanism to make it easy to generate other formats from stored data, including json and xml. for example, the django template system allows you to specify variables using a "double-handlebars" syntax (e.g. {{ variable_name }}), which will be replaced by values passed in from the view function when a page is rendered. the template system also provides support for expressions (with syntax: {% expression %}), which allow templates to perform simple operations like iterating list values passed into the template. note: many other templating systems use a similar syntax, e.g.:...
Handling common accessibility problems - Learn web development
like a link or button with css, and to behave like a link or button with javascript, but they won't actually be links or buttons, and you'll lose a lot of the accessibility these elements give you for free. so don't do it if you can avoid it. another tip — as shown in our example, you can control how your focusable elements look when focused, using the :focus pseudo-class. ...
... places. have a play with vo now; you can then go on to play with some of our examples in the screenreader testing section. nvda nvda is windows-only, and you'll need to install it. download it from nvaccess.org. you can choose whether to make a donation or download it for free; you'll also need to give them your e-mail address before you can download it. once downloaded, install it — you double click the installer, accept the license and follow the prompts. to start nvda, double click on the program file/shortcut, or use the keyboard shortcut ctrl + alt + n. you'll see the nvda welcome dialog when you start it. here you can choose from a couple of options, then press the ok button to get going. nvda will now be active on your computer. to use nvda, you will make a lot of use of the ...
Embedding API for Accessibility
ptions. this document lays out what we already have, and what we'll need later, in the embedding api to support accessibility. text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::settextzoom(float zoomfactor) methods can be used to set a wide range of text zoom factors on a content window. a zoom factor of 1.0 represents 100%, or normal zoom. for double-sized text, use nsidomwindow::settextzoom(2.0); using accessibility preferences there are a number of prefs related to accessibility. for the most part, an automatic reframe is performed when one of these prefs is changed. a reframe fixes the appearance of the page to match the new prefs, without reloading the document over the network. be aware that in debug builds, this can cause a great nu...
... setboolpref("browser.accept.audio", acceptaudio); no timed events setboolpref("browser.accept.timed_events", accepttimedevents); no timer speed setintpref("timer.relative_speed", percent); /* 100 corresponds to normal speed, 200 to double speed */ no allow cycling in lists and links setboolpref("keyboardnav.allow_cycling", allowcycling); no mouse pointer moves with keyboard focus setboolpref("keyboardnav.mouse_follows_keyboard_focus", mousefollows); /* if this pref is set, the mouse pointer...
Debugging on Mac OS X
tab then under the "other" template group select the "empty" project type. the click next. name the project and click next. create/select a temporary directory to contain the project and then click create. before going any further, close the project (file > close project) and open finder. find the *.xcodejproj directory in the temporary directory, move it into your mozilla source tree, and then double-click on it to reopen it. in the left-hand pane in xcode you should see a tree item where the root item has the project name. if the temporary directory that you originally created the xcode project in is under that, right click it and delete it. now, right click on the root item, select 'add files to "<project-name>"', select all the files and directories in your source directory, untick "copy ...
...debugging mozilla with lldb for more information. having a profile for debugging purposes it is recommended to create a separate profile to debug with, whatever your task, so that you don't lose precious data like bookmarks, saved passwords, etc. so that you're not bothered with the profile manager every time you start to debug, expand the "executables" branch of the "groups & files" list and double click on the executable you added for mozilla. click the plus icon under the "arguments" list and type "-p <profile name>" (e.g. "-p mozilladebug"). close the window when you're done. running a debug session make sure breakpoints are active (which implies running under the debugger) by opening the product menu and selecting "debug / activate breakpoints" (also shown by the "breakpoints" button ...
Displaying Places information using views
tains a specific nsinavhistoryresultnode: var treeview = document.getelementbyid("myplacestreeview"); treeview.selectnode(somehistoryresultnode); placestreeview 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. ...
...efined 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 . ...
Experimental features in Firefox
re details. release channel version added enabled by default? nightly 75 no developer edition 75 no beta 75 no release 75 no preference name devtools.webconsole.input.context mobile gesture support in responsive design mode mouse gestures are used to simulate mobile gestures like swiping/scrolling, double-tap and pinch-zooming and long-press to select/open the context menu. see bug 1621781, bug 1245183, and bug 1401304 for more details. release channel version added enabled by default? nightly 76[1] yes developer edition 76[1] yes beta 76[1] yes release 76[1] no preference name n/a [1] support for zo...
...ooming and long-press to select/open the context menu. see bug 1621781, bug 1245183, and bug 1401304 for more details. release channel version added enabled by default? nightly 76[1] yes developer edition 76[1] yes beta 76[1] yes release 76[1] no preference name n/a [1] support for zooming using the double-tap gesture was added in firefox 76. the other gestures were added for firefox 79. compatibility panel a side panel for the page inspector that shows you information detailing your app's cross-browser compatibility status. see bug 1584464 for more details. release channel version added enabled by default? nightly 71 yes developer edition 71 yes ...
IME handling guide
.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.imeunderlinerelativesize" pref. this affects all types of clauses. the value should be 100 or 200. 100 means normal wi...
...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.imeunderlinerelativesize" pref. this affects all types of clauses. the value should be 100 or 200. 100 means normal width, 200 means double width. on some platforms, ime may support its own style for each clause. currently, this feature is supported in tsf mode of windows and on linux. the style information is stored in textrangestyle which is defined in textrange.h. it's a member of textrange. textrange is stored in mranges of widgetcompositionevent only when its message is ecompositionchange. lifetime of composition string when ...
Localization content best practices
ireframes. use unicode characters over their ascii counterparts when possible strings should use directional quotation marks when possible. u+2018 and u+2019 (\u2018 and \u2019 in javascript) are the left and right single quotation marks, respectively. the right single quotation mark should be used as an apostrophe. ...
...html does not prefer one over the other, and our codebase uses them interchangeably as of march 2016. ...
Localizing with Koala
nd the english string is automatically highlighted, so that you can translate it right away. this entity is used in the tooltip that appears when you hover over the magnifying glass icon in the search bar. once you translated the searchendcap.label entity, add the other one from this file, i.e. cmd_enginemanager.label. you can right-click it and choose "add entity" as you did previously, or just double-click the entity name to add it to the file. note how koala is smart enough to insert this entity before searchendcap.label. this is helpful for keeping the localization files clean and tidy at all times. the string to translated is selected so that you can translate it without any further clicking. when you are done with translating the cmd_enginemanager.label entity, save the file. now let's ...
...to add it to the file. note how koala is smart enough to insert this entity before searchendcap.label. this is helpful for keeping the localization files clean and tidy at all times. the string to translated is selected so that you can translate it without any further clicking. when you are done with translating the cmd_enginemanager.label entity, save the file. now let's create the other file. double-click on search.properties and click "ok" when koala asks if you want to create this file. from the sidebar, add the cmd_addfoundengine string to the newly-created search.properties file in your locale file structure. translate the cmd_addfoundengine string. notice that the .properties files have a different syntax than the dtd files. they're just a simple key=value mapping. save the file to sa...
Leak-hunting strategies and tips
84136 for examples. (is this advice still accurate now that we have a cycle collector? --jesse) dropping a reference on the floor by: forgetting to release (because you weren't using nscomptr when you should have been): see bug 99180 or bug 93087 for an example or bug 28555 for a slightly more interesting one. this is also a frequent problem around early returns when not using nscomptr. ...
...een): see bug 99180 or bug 93087 for an example or bug 28555 for a slightly more interesting one. this is also a frequent problem around early returns when not using nscomptr. double-addref: this happens most often when assigning the result of a function that returns an addrefed pointer (bad!) into an nscomptr without using dont_addref(). see bug 76091 or bug 49648 for an example. [obscure] double-assignment into the same variable: if you release a member variable and then assign into it by calling another function that does the same thing, you can leak the object assigned into the variable by the inner function. (this can happen equally with or without nscomptr.) see bug 38586 and bug 287847 for examples. dropping a non-refcounted object on the floor (especially one that owns refere...
Memory reporting
object of in a foo::sizeofexcludingthis method. this is ok, but it's worth adding a comment explaining this to the method. occasionally you do want to compute sizes analytically instead of using moz_malloc_size_of. in that case, use computedsizeof as the prefix for the function name. it's important that no memory is measured twice; this can lead to strange results in about:memory. avoiding double measurement is easy in tree-like structures. in graph-like structures (where an object might be pointed to by more than one other object) it gets more difficult, and might even require some way to mark objects that have been counted (and then a way to unmark them once the measurement is complete). it's easy to get confused as to whether you should use sizeofincludingthis or sizeofexcludingthis...
...document. thanks! dmd dmd is a tool that detects two deficiencies with memory reporters. it identifies places in the code that allocate memory but do not have memory reporters for that memory. this helps drive about:memory's heap-unclassified number down. it detects certain defects in existing heap memory reporters: if non-heap memory is reported, or if a heap block is partially reported or double-reported. dmd is absolutely crucial; these things cannot be done without it. that's why the integration of dmd and memory reporters is so important and thus mentioned multiple times above. see the instructions on how to run dmd. ...
PR_strtod
ties are broken by the ieee round-even rule. ...
...ng to be scanned. se a pointer that, if not null, will be assigned the address of the last character scanned in the input string. returns the result of the conversion is a prfloat64 value equivalent to the input string. if the parameter se is not null the location it references is also set. description pr_strtod converts the prefix of the input decimal string pointed to by s00 to a nearest double-precision floating point number. ties are broken by the ieee round-even rule. the string is scanned up to the first unrecognized character. if the value of se is not (char **) null, pr_strtod stores a pointer to the character terminating the scan in *se. if the answer would overflow, a properly signed huge_val (infinity) is returned. if the answer would underflow, a properly signed 0 is returned.
NSS API Guidelines
$revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$" you can put the string in a comment or in a static char array. use #ifdef debug to include the array in debug builds only. the advantage of using an array is that you can use strings(1) to pull the id tags out of a (debug) compiled library. you can even put them in header files; the header files are protected from double inclusion. the only catch is that you have to determine the name of the array. here is an example from lib/base/baset.h: #ifdef debug static const char baset_cvs_id[] = "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$"; #endif /* debug */ the difference, between this and id, is that id has some use...
...otypes public nss____t.h nss____.h friend (only if required) nss____tf.h nss____f.h nss-private ____t.h ____.h module-private ____tm.h ____m.h the files on the right include the files to their left; the files in a row include the files directly above them. header files always include what they need; the files are protected against double inclusion (and even double opening by the compiler). note: it's not necessary all eight files exist. further, this is a simple ideal, and often reality is more complex. we would like to keep names to 8.3, even if we no longer support win16. this usually gives us four characters to identify a module of nss. in short: header files for consumption outside nss start with "nss." header files ...
JS::NumberValue
this article covers features introduced in spidermonkey 24 convert a c integer or floating-point value to a js::value. syntax js::value js::numbervalue(float f) js::value js::numbervalue(double dbl) js::value js::numbervalue(int8_t i) js::value js::numbervalue(uint8_t i) js::value js::numbervalue(int16_t i) js::value js::numbervalue(uint16_t i) js::value js::numbervalue(int32_t i) js::value js::numbervalue(uint32_t i) name type description f or dbl or i any c integer or floating-point value to convert. ...
...bervalue(int32_t i) js::value js::numbervalue(uint32_t i) name type description f or dbl or i any c integer or floating-point value to convert. description js::numbervalue converts a c integer or floating-point value to js::value, the type of javascript values. see also mxr id search for js::numbervalue js::value js::int32value js::float32value js::doublevalue js_numbervalue ...
JS::ToNumber
on success, *out receives the converted floating-point value. description js::tonumber converts a javascript value to a number. it implements the tonumber operator described in ecma 262-3 §9.3. ...
...on success, *out receives the converted floating-point value. description js::tonumber converts a javascript value to a number. it implements the tonumber operator described in ecma 262-3 §9.3. on success, js::tonumber stores the converted value in *out and returns true. ...
JS_ConvertArguments
n one or more instances of the following characters, as appropriate: character c type description b bool boolean c uint16_t ecma uint16_t, unicode character i int32_t ecma int32_t j int32_t ecma int32_t (used to be different, behaves like i now) obsolete since jsapi 28 u uint32_t ecma uint32_t d double ieee double i double integral ieee double s char * (c string) bug 607292 s jsstring * unicode string, accessed by a jsstring pointer w char16_t * unicode character vector, 0-terminated (w for wide) o jsobject * object reference f jsfunction * the argument is converted to a function as though by a c...
...h are optional. if an optional argument is missing from argv, js_convertarguments neither assigns anything to any variable nor reports an error. this function also takes in consideration any additional custom types defined on cx using js_addargumentformatter. for example, if format is "biob", then js_convertarguments converts the first js value in argv into a bool, the second value into a double, the third value into a jsobject *, and the last value into a bool. to skip a given argument, pass an asterisk in the corresponding position in format. if argc is less than the number of arguments required by format, js_convertargument reports an error and returns false. if argc is greater than the number of arguments described in format, the extraneous arguments are ignored. on success, js_co...
JS_EnterLocalRootScope
aller must be in a request on this jscontext. description scoped local root management allows native functions, getter/setters, etc. to avoid calling js_addroot and js_removeroot to manage global roots temporarily. js_addroot roots a variable, ensuring that whatever the variable points to at any given moment is protected from gc. by contrast, local root scopes protect newly-created objects, doubles, and strings. there is no need to tell the js engine about each variable that may point to such a value. calling js_enterlocalrootscope and js_leavelocalrootscope around the body of the native hook protects each object, double, and string created using the same jscontext from gc. for example: jsbool my_getproperty(jscontext *cx, jsobject *obj, jsval id, jsval *vp) { jsbool ok; if (!js_e...
... even if js_gc is // called, these new values will not be collected. ok = my_getpropertybody(cx, obj, id, vp); // when we leave the local root scope, this protection ends. new // items created in this local root scope become subject to gc. ...
JS_ForgetLocalRoot
yntax void js_forgetlocalroot(jscontext *cx, void *thing); name type description cx jscontext * pointer to the context in which the caller is running. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. thing void * pointer to the value to be unrooted. this must point to a jsobject, jsstring, jsfunction, or jsdouble. it must not be null. description this function is used to interact with scoped local root management. see js_enterlocalrootscope for more on this topic. in case a native hook allocates many objects or other gc-things, but the native protects some of those gc-things by storing them as property values in an object that is itself protected, the hook can call js_forgetlocalroot to free the loc...
...allocates many objects or other gc-things, but the native protects some of those gc-things by storing them as property values in an object that is itself protected, the hook can call js_forgetlocalroot to free the local root automatically pushed for the now-protected gc-thing. (here the term gc-thing refers to any value that is subject to garbage collection: a jsobject, jsstring, jsfunction, or jsdouble.) js_forgetlocalroot works on any gc-thing allocated in the current local root scope, but it's more time-efficient when called on references to more recently created gc-things. calling it successively on other than the most recently allocated gc-thing will tend to average the time inefficiency, and may risk o(n2) growth rate, but in any event, you shouldn't allocate too many local roots if you ca...
JS_PushArguments
he next c/c++ argument. format can contain one or more instances of the following characters, as appropriate: character argument type b jsbool c uint16 (16-bit, unsigned integer) i int32 (32-bit, ecma-compliant signed integer) u uint32 (32-bit, ecma-compliant, unsigned integer) j int32 (32-bit, signed integer) d jsdouble i jsdouble (converted to an integer value) s char * (c string) s jsstring * (unicode string) w jschar * (unicode null-terminated string) o jsobject * f jsfunction * * none. any asterisks (*) in format are ignored. this function also takes in consideration any additional custom types defined in cx using js_ad...
... w jschar * (unicode null-terminated string) o jsobject * f jsfunction * * none. any asterisks (*) in format are ignored. this function also takes in consideration any additional custom types defined in cx using js_addargumentformatter. for example, if format is "biob", then there must be four arguments after format. their types must be jsbool, jsdouble, jsobject *, and jsbool. if successful, js_pusharguments would return a pointer to the first element of an array of four jsvals: a boolean, a number, an object (or null), and a boolean. on success, js_pusharguments fills in the supplied markp pointer and returns a pointer to the first element of an array of jsval which are automatically rooted as necessary (protected from the gc temporarily). the...
JS_PutEscapedString
ion cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. buffer char * a pointer to char buffer to write into. size size_t the size of buffer in bytes. str jsstring * or jsflatstring * a string to write into the file. quote char one of 0, single quote, and double quote. description js_putescapedstring and js_putescapedstring write str into buffer escaping any non-printable or non-ascii character using \escapes for js string literals. guarantees that a nul is at the end of the buffer unless size is 0. returns the length of the written output, not including the nul. thus, a return value of size or more means that the output was truncated. if buffer ...
...fer escaping any non-printable or non-ascii character using \escapes for js string literals. guarantees that a nul is at the end of the buffer unless size is 0. returns the length of the written output, not including the nul. thus, a return value of size or more means that the output was truncated. if buffer is null, just returns the length of the output. if quote is not 0, it must be a single or double quote character that will quote the output. see also mxr id search for js_putescapedstring mxr id search for js_putescapedflatstring bug 609440 ...
JS_SetElement
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the o...
... jscontext * the context in which to set the element. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to modify, commonly an array object. index uint32_t index number of the element to set. v js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double the value to assign to the element. added in spidermonkey 31 vp js::mutablehandlevalue in/out parameter. *vp is the value to assign to the element. js_setelement ordinarily leaves *vp unchanged, but a jsclass.addproperty hook or non-default setter may modify it. obsolete since jsapi 29 description js_setelement assigns a value to a numeric property of an object. it behave...
SpiderMonkey 38
1107639) js::removescriptroot (bug 1107639) js::removescriptrootrt (bug 1107639) js::removestringroot (bug 1107639) js::removestringrootrt (bug 1107639) js::removevalueroot (bug 1107639) js::removevaluerootrt (bug 1107639) jsclass_new_enumerate (bug 1097267) jsclass_new_resolve (bug 993026) jsid_is_object (bug 915482) jsnewresolveop (bug 993026) jsval_is_boolean (bug 952650) jsval_is_double (bug 952650) jsval_is_gcthing (bug 952650) jsval_is_int (bug 952650) jsval_is_null (bug 952650) jsval_is_number (bug 952650) jsval_is_primitive (bug 952650) jsval_is_string (bug 952650) jsval_is_void (bug 952650) jsval_to_boolean (bug 952650) jsval_to_double (bug 952650) jsval_to_gcthing (bug 952650) jsval_to_int (bug 952650) jsval_to_object (bug 952650) jsval_to_private (bug 952650)...
...(bug 952650) jsval_to_private (bug 952650) jsval_to_string (bug 952650) js_clearnonglobalobject (bug 1043281) js_clonefunctionobject (bug 1089026) js_compilefunction (bug 1089026) js_compileucfunction (bug 1089026) js_convertarguments (bug 1125784) js_convertargumentsva (bug 1125784) js_convertstub (bug 1103152) js_defineownproperty (bug 1017323) js_deletepropertystub (bug 1103152) js_doubletoint32 (bug 1112774) js_doubletouint32 (bug 1112774) js_enumeratestub (bug 1103152) js_evaluatescript (bug 1100579) js_evaluateucscript (bug 1100579) js_executescriptversion (bug 1095660) js_getflatstringchars (bug 1037869) js_getfunctioncallback (bug 1103269) js_getinternedstringchars (bug 1037869) js_getinternedstringcharsandlength (bug 1037869) js_getstringcharsandlength (bug 1037869...
Using XPCOM Utilities to Make Things Easier
ut engine and other subsystems that manage large chunks of data. additionally, in some versions of mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may or may not be null terminated)[nulls-in-strings]. all string classes in xpcom derive from one of two abstract classes[other-string-classes]: nsastring and nsacstring. the former handles double byte characters, and the latter tends to be used in more general circumstances, but both of these classes define the functionality of a string. you can see these classes being passed as arguments in many of the xpcom interfaces we'll look at in the following chapters. using strings explaining how all the string classes work is outside the scope of this book, but we can show you how to use strin...
...to extract the data from the url class: const char* astringurl = url.get(); note that the memory pointed to by astringurl after the call to url.get() is owned by the url string object. if you need to keep this string data around past the lifetime of the string object, you must make a copy. string size the examples above illustrate the use of the single byte string class, nsembedcstring. the double byte version, nsembedstring, has the same functionality but the constructor takes nsastring and the .get() method returns the type prunichar*. note that prunichar is a two byte value. in the coming chapters, you'll see examples that use this version in the weblock component. smart pointers all of the interfaces that you've seen so far are reference counted. leaking a reference by not releasing...
Index
Mozilla › Tech › XPCOM › Index
936 data no summary! 937 tostring no summary! 938 nsisupportschar interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference this methods returns a string valued representation of the object. 939 data no summary! 940 tostring no summary! 941 nsisupportsdouble interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference this methods returns a string valued representation of the object. 942 data no summary! 943 tostring no summary! 944 nsisupportsfloat interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference this methods...
...m api reference this operator is a shortcut for the assign family of functions. 1164 nsacstring (external) needscontent, reference, référence(2), strings class declaration 1165 nsacstring_internal class declaration 1166 nsastring xpcom, xpcom api reference the nsastring abstract class represents a character string composed of double-byte storage units. this class is typically used to represent unicode character arrays. 1167 append xpcom, xpcom api reference the append family of functions appends a value to the end of a string's internal buffer. 1168 assign xpcom, xpcom api reference the assign family of functions sets the value of a string's internal buffer. 1169 beginread...
mozIStorageStatement
g escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparamindex, in autf8string avalue); void bindstringparameter(in unsigned long aparamindex, in astring avalue); void binddoubleparameter(in unsigned long aparamindex, in double avalue); void bindint32parameter(in unsigned long aparamindex, in long avalue); void bindint64parameter(in unsigned long aparamindex, in long long avalue); void bindnullparameter(in unsigned long aparamindex); void bindblobparameter(in unsigned long aparamindex, [array,const,size_is(avaluesize)] in octet avalue, ...
...dstringparameter() binds a string parameter to the specified index. void bindstringparameter( in unsigned long aparamindex, in astring avalue ); 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). avalue to be bound to the specified index. binddoubleparameter() binds a double parameter to the specified index. void binddoubleparameter( in unsigned long aparamindex, in double avalue ); 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). avalue to be bound to the specified index. bindint32par...
nsICRLManager
security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
...void deletecrl( in unsigned long crlindex ); parameters crlindex getcrls() get a list of crl entries in the db. nsiarray getcrls(); parameters none. return value importcrl() import a crl into the certificate database. void importcrl( [array, size_is(length)] in octet data, in unsigned l...
nsIWritablePropertyBag2
ged in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setpropertyasacstring(in astring prop, in acstring value); void setpropertyasastring(in astring prop, in astring value); void setpropertyasautf8string(in astring prop, in autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value); void setpropertyasinterface(in astring prop, in nsisupports value); void setpropertyasuint32(in astring prop, in pruint32 value); void setpropertyasuint64(in astring prop, in pruint64 value); m...
...propertyasautf8string() void setpropertyasautf8string( in astring prop, in autf8string value ); parameters prop property to set the value of. value value to set the property to. setpropertyasbool() void setpropertyasbool( in astring prop, in boolean value ); parameters prop property to set the value of. value value to set the property to. setpropertyasdouble() void setpropertyasdouble( in astring prop, in double value ); parameters prop property to set the value of. value value to set the property to. setpropertyasint32() void setpropertyasint32( in astring prop, in print32 value ); parameters prop property to set the value of. value value to set the property to. setpropertyasint64() void setpropertyasint...
XPIDL Syntax
Mozilla › Tech › XPIDL › Syntax
eral = octal_literal / decimal_literal / hex_literal / floating_literal literal /= string_literal / char_literal literal /= "true" / "false" ; in regex: /"[^"\n]*["\n]/. yes, newline terminates. ...
... pyxpidl syntax idlfile = *(cdata / include / interface / typedef / native) typedef = "typedef" identifer identifier ";" native = [attributes] "native" identifier "(" nativeid ")" interface = [attributes] "interface" identifier" [ifacebase] [ifacebody] ";" ifacebase = ":" identifier ifacebody = "{" *(member) "}" member = cdata / "const" identifier identifier "=" number ";" memb...
AnalyserNode.maxDecibels - Web APIs
the default value is -30 db. ...
...the default value is -30 db. when getting data from getfloatfrequencydata() or getbytefrequencydata(), any frequencies with an amplitude of maxdecibels or higher will be returned as +1.0 or 255, respectively. ...
AnalyserNode.minDecibels - Web APIs
the default value is -100 db. ...
...the default value is -100 db. when getting data from getfloatfrequencydata() or getbytefrequencydata(), any frequencies with an amplitude of mindecibels or lower will be returned as 0.0 or 0, respectively. ...
AnalyserNode.smoothingTimeConstant - Web APIs
the default value is 0.8. ...
...the default value is 0.8. if 0 is set, there is no averaging done, whereas a value of 1 means "overlap the previous and current buffer quite a lot while computing the value", which essentially smoothes the changes across analysernode.getfloatfrequencydata/analysernode.getbytefrequencydata calls. ...
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 possibl...
...he 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 and reliable latency it can). the value can also be specified as a double-precision floating-point value, specifying the preferred maximum latency in seconds. this provides more precise control over the balance between audio latency and device energy usage. to determine the actual latency of the context after creating it, check the value of the context's baselatency property. specifications specification status comment web audio apithe defini...
AudioListener.dopplerFactor - Web APIs
the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
AudioListener.speedOfSound - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...ty's default value is 343.3 m/s and is used to calculate the doppler shift appropriate for the speed the panner is travelling at (as defined by pannernode.setvelocity.) note: bear in mind that no propagation delay is automatically applied to a sound far from the listener. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.speedofsound = 343.3; value a double. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character a...
BiquadFilterNode - Web APIs
sed in the default count mode) channel interpretation "speakers" constructor biquadfilternode() creates a new instance of a biquadfilternode object. properties inherits properties from its parent, audionode. note: though the audioparam objects returned are read-only, the values they represent are not. ...
...ram objects returned are read-only, the values they represent are not. biquadfilternode.frequency read only is an a-rate audioparam, a double representing a frequency in the current filtering algorithm measured in hertz (hz). biquadfilternode.detune read only is an a-rate audioparam representing detuning of the frequency in cents. biquadfilternode.q read only is an a-rate audioparam, a double representing a q factor, or quality factor. biquadfilternode.gain read only is an a-rate audioparam, a double representing the gain used in the current filtering algorithm. biquadfilternode.type is a string value defining the kind of filtering algorithm the node is implementing. the meaning of the different parameters depending of the type of the filter (detune has the same meaning re...
CSSUnitValue.value - Web APIs
examples the following creates a csspositionvalue from individual cssunitvalue constructors, then queries the cssunitvalue.value. ...
... examples the following creates a csspositionvalue from individual cssunitvalue constructors, then queries the cssunitvalue.value. ...
DOMHighResTimeStamp - Web APIs
this type can be used to describe a discrete point in time or a time interval (the difference in time between two discrete points in time). the time, given in milliseconds, should be accurate to 5 µs (microseconds), with the fractional part of the number indicating fractions of a millisecond. however, if the browser is unable to provide a time value accurate to 5 µs (due, for example, to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond. also note the section below on reduced time precision controlled by browser preferences to avoid timing attacks and fingerprinting. ...
...70 // ... // reduced time precision with `privacy.resistfingerprinting` enabled event.timestamp; // 1519129853500 // 1519129858900 // 1519129864400 // ... in firefox, you can also enable privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. properties this type has no properties. it is a double-precision floating-point value. value the value of a domhighrestimestamp is a double-precision floating-point number which describes the number of milliseconds (accurate to within 5 microseconds if the device supports it) elapsed between two points in time. the starting time can be either a specific time determined by the script for a site or app, or the time origin. the time origin the time ...
DOMMatrix - Web APIs
Web › API › DOMMatrix
...
...erits methods from dommatrixreadonly. fromfloat32array() creates a new mutable dommatrix object given an array of single-precision (32-bit) floating-point values. if the array has six values, the result is a 2d matrix; if the array has 16 values, the result is a 3d matrix. otherwise, a typeerror exception is thrown. fromfloat64array() creates a new mutable dommatrix object given an array of double-precision (64-bit) floating-point values. if the array has six values, the result is a 2d matrix; if the array has 16 values, the result is a 3d matrix. otherwise, a typeerror exception is thrown. frommatrix() creates a new mutable dommatrix object given an existing matrix or a dommatrixinit dictionary which provides the values for its properties. usage notes the matrix defined by the dommat...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
returns a node object. ...
... returns a node object. ...
Element: dblclick event - Web APIs
the dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time. dblclick fires after two click events (and by extension, after two pairs of mousedown and mouseup events). bubbles yes cancelable yes interface mouseevent event handler property ondblclick examples this example toggles the size of a card when you double click on it. ...
... bubbles yes cancelable yes interface mouseevent event handler property ondblclick examples this example toggles the size of a card when you double click on it. javascript const card = document.queryselector('aside'); card.addeventlistener('dblclick', function (e) { card.classlist.toggle('large'); }); html <aside> <h3>my card</h3> <p>double click to resize this object.</p> </aside> css aside { background: #fe9; border-radius: 1em; display: inline-block; padding: 1em; transform: scale(.9); transform-origin: 0 0; transition: transform .6s; } .large { transform: scale(1.3); } result specifications specification status ui eventsthe definition of 'dblclick' in that specification. working dr...
Gamepad.axes - Web APIs
Web › API › Gamepad › axes
the gamepad.axes property of the gamepad interface returns an array representing the controls with axes present on the device (e.g. analog thumb sticks).- each entry in the array is a floating point value in the range -1.0 – 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). ...
... specifications specification status comment gamepadthe definition of 'gamepad.axes' in that specification. working draft initial definition ...
GamepadButton - Web APIs
individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. a gamepadbutton object is returned by querying any value of the array returned by the buttons property of the gamepad interface. note: this is the case in firefox gecko 28 and later; chrome and earlier firefox versions still return an array of double values when this property is accessed. properties gamepadbutton.value read only a double value used to represent the current state of analog buttons, such as the triggers on many modern gamepads. the values are normalized to the range 0.0 —1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. gamepadbutton.pressed read only a boo...
...essed. gamepadbutton.pressed read only a boolean value indicating whether the button is currently pressed (true) or unpressed (false). example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stored as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are. in this simple example i've just allowed either. function gameloop() { if(navigator.webkitgetgamepads) { var gp...
HTMLElement - Web APIs
t's attributes, text, and element contents. htmlelement.nomodule is a boolean indicating whether an import script can be executed in user agents that support module scripts. htmlorforeignelement.nonce returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed. ...
... can be executed in user agents that support module scripts. htmlorforeignelement.nonce returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed. htmlelement.offsetheight read only returns a double containing the height of an element, relative to the layout. htmlelement.offsetleft read only returns a double, the distance from this element's left border to its offsetparent's left border. htmlelement.offsetparent read only returns a element that is the element from which all offset calculations are currently computed. htmlelement.offsettop read only returns a double, the distance from this element's top border to its offsetparent's top border. htmlelement.offsetwidth read only returns a do...
HTMLImageElement.srcset - Web APIs
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. this is written by stating the pixel density as a positive, non-zero floating-point value followed by the lower-case letter "x". as an example, to state that the corresponding image should be used when the pixel density is double the standard density, you can give the pixel density descriptor 2x or 2.0x. you may mix and match the two types of descriptor. you must not, however, provide multiple image candidate strings that specify the same descriptor. all of the following are valid image candidate strings: "images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w" this string provides ver...
.... you may mix and match the two types of descriptor. you must not, however, provide multiple image candidate strings that specify the same descriptor. all of the following are valid image candidate strings: "images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w" this string provides versions of an image to be used at the standard pixel density (1x) as well as double that pixel density (2x). also available is a version of the image for use at a width of 2048 pixels (2048w). "header640.png 640w, header960.png 960w, header1024.png 1024w, header.png" this string provides versions of a header image to use when the user agent's renderer needs an image of width 640px, 960px, or 1024px. an additional, fallback image candidate is provided without any condition at a...
HTMLMeterElement - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmeterelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from its parent, htmlelement. htmlmeterelement.high a double representing the value of the high boundary, reflecting the high attribute. htmlmeterelement.low a double representing the value of the low boundary, reflecting the lowattribute. htmlmeterelement.max a double representing the maximum value, reflecting the max attribute. htmlmeterelement.min a double representing the minimum value, reflecting the min attribute. htmlmeterelement.optimum a d...
... htmlmeterelement.labelsread only a nodelist of <label> elements that are associated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. ...
HTMLProgressElement - Web APIs
4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlprogresselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...nt-baseline="middle">htmlprogresselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlprogresselement.max is a double value reflecting the content attribute of the same name, limited to numbers greater than zero. its default value is 1.0. htmlprogresselement.positionread only returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it returns -1. htmlprogresselement.value is a double value that reflects the current value; if the progress bar is an indeterminate progress bar, it returns 0. htmlprogresselement.labelsread only returns nodelist containing the list of <label> ele...
Key Values - Web APIs
...
...ad_hook (0x01001261) ̡ gdk_key_dead_horn (0xfe62) qt::key_dead_horn (0x01001262) ̛ gdk_key_dead_stroke (0xfe63) ̶̶ gdk_key_dead_abovecomma (0xfe64) ̓̓ gdk_key_dead_psili (0xfe64) ᾿ gdk_key_dead_abovereversedcomma (0xfe65) ʽ gdk_key_dead_dasia (0xfe65) ῾ gdk_key_dead_doublegrave (0xfe66) ̏ gdk_key_dead_belowring (0xfe67) ˳ gdk_key_dead_belowmacron (0xfe68) ̱ gdk_key_dead_belowcircumflex (0xfe69) ꞈ gdk_key_dead_belowtilde (0xfe6a) ̰ gdk_key_dead_belowbreve (0xfe6b) ̮ gdk_key_dead_belowdiaeresis (0xfe6c) ̤ gdk_key_dead_invertedbreve (0xfe6d) ̯...
MediaTrackConstraints.aspectRatio - Web APIs
the mediatrackconstraints dictionary's aspectratio property is a constraindouble describing the requested or mandatory constraints placed upon the value of the aspectratio constrainable property. 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 constraintsobject = { aspectratio: constraint }; constraintsobject.aspectratio = constraint; value a constraindouble describing the acceptable or required value(s) for a video track's aspect ratio. the value is the width divided by the height and is rounded to ten decima...
...t 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 status comment media capture an...
MediaTrackConstraints.frameRate - Web APIs
the mediatrackconstraints dictionary's framerate property is a constraindouble describing the requested or mandatory constraints placed upon the value of the framerate constrainable property. 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 constraintsobject = { 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 obta...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackControls.volume - Web APIs
the mediatrackconstraints dictionary's volume property is a constraindouble describing the requested or mandatory constraints placed upon the value of the volume constrainable property. 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're unfamiliar with. syntax var constraintsobject = { volume: constraint }; constraintsobject.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 ...
...le 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: constraint exerciser in capabilities, constraints, an...
MediaTrackSettings.aspectRatio - Web APIs
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(). ...
...aints(). 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 = mediatracksettings.aspectratio; value a double-precision floating-point number indicating the current configuration of the track's aspect ratio. the aspect ratio is computed by taking the track's width, dividing by its height, and rounding the result to ten decimal places. for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. example see example: constraint exerciser in capabilities, cons...
MediaTrackSettings.frameRate - Web APIs
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(). ...
...constraints(). 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 = mediatracksettings.framerate; value a double-precision floating-point number indicating the current configuration of the track's frame rate, in frames per second. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'framerate' in that specification. candidate recommendatio...
MediaTrackSettings.latency - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.latency property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). this is, of course, an approximation, since latency can vary for many reasons including cpu, transmission, and storage overhead. ...
...upportedconstraints.latency 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 rtcpeerconnection will never include this property. syntax var latency = mediatracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'latency' in that specification. candidate recommendat...
MediaTrackSettings.volume - Web APIs
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(). ...
...ack.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're unfamiliar with. syntax var volume = mediatracksettings.volume; value a double-precision floating-point number indicating the volume, from 0.0 to 1.0, of the audio track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MouseEvent.clientX - Web APIs
nterface provides the horizontal coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page). for example, clicking on the left edge of the client area will always result in a mouse event with a clientx value of 0, regardless of whether the page is scrolled horizontally. syntax var x = instanceofmouseevent.clientx return value a double floating point value, as redefined by the cssom view module. originally, this property was defined as a long integer. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. html <p>move your mouse to see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#...
...t.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'clientx' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent.clientx' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe definition of 'mouseevent.clientx' in that specification. obsolete initial definition. ...
MouseEvent.clientY - Web APIs
ent interface provides the vertical coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page). for example, clicking on the top edge of the client area will always result in a mouse event with a clienty value of 0, regardless of whether the page is scrolled vertically. syntax var y = instanceofmouseevent.clienty return value a double floating point value, as redefined by the cssom view module. originally, this property was defined as a long integer. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. html <p>move your mouse to see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#...
...t.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'clienty' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent.clienty' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe definition of 'mouseevent.clienty' in that specification. obsolete initial definition. ...
MouseEvent.screenX - Web APIs
early versions of the spec defined this as an integer referring to the number of pixels. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
...xample demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) view modulethe definition of 'screenx' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent.screenx' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe definition of 'mouseevent.sceenx' in that specification. obsolete initial definition ...
MouseEvent.screenY - Web APIs
early versions of the spec defined this as an integer referring to the number of pixels. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
...t.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe definition of 'screeny' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent.screeny' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe definition of 'mouseevent.sceeny' in that specification. obsolete initial definition ...
MouseEvent - Web APIs
; } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft redefines mouseevent from long to double. this means that a pointerevent whose pointertype is mouse will be a double. pointer lockthe definition of 'mouseevent' in that specification. candidate recommendation from document object model (dom) level 3 events specification, added movementx and movementy properties. css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working d...
...del (dom) level 3 events specification, added movementx and movementy properties. css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft from document object model (dom) level 3 events specification, added offsetx and offsety, pagex and pagey, x, and y properties. redefined screen, page, client, and coordinate (x and y) properties as double from long. ui eventsthe definition of 'mouseevent' in that specification. working draft document object model (dom) level 3 events specificationthe definition of 'mouseevent' in that specification. obsolete from document object model (dom) level 2 events specification, added the mouseevent() constructor, the getmodifierstate() method and the buttons property. ...
PannerNode.coneInnerAngle - Web APIs
example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. ...
... example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. ...
PannerNode.coneOuterAngle - Web APIs
example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. ...
... example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. ...
PannerNode.coneOuterGain - Web APIs
the default is 0, and its value can be in the range 0–1. exceptions invalidstateerror the property has been given a value outside the accepted range (0–1). example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. ...
...the default is 0, and its value can be in the range 0–1. exceptions invalidstateerror the property has been given a value outside the accepted range (0–1). example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. ...
PannerNode.maxDistance - Web APIs
the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. ...
...the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
RTCRtpEncodingParameters - Web APIs
the microphone muted automatically in the absence of voice activity). the value is taken from the enumerated string type rtcdtxstatus. maxbitrate an unsigned long integer indicating the maximum number of bits per second to allow for this encoding. other parameters may further constrain the bit rate, such as the value of maxframerate or transport or physical network limitations. maxframerate a double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding. ptime an unsigned long integer value indicating the preferred duration of a media packet in milliseconds. this is typically only relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies a...
...the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. the default value, 1.0, means that the sent video's size will be the same as the original. a value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. the value must not be less than 1.0 (you can't use this to scale the video u...
RTCRtpSendParameters.encodings - Web APIs
the microphone muted automatically in the absence of voice activity). the value is taken from the enumerated string type rtcdtxstatus. maxbitrate an unsigned long integer indicating the maximum number of bits per second to allow for this encoding. other parameters may further constrain the bit rate, such as the value of maxframerate or transport or physical network limitations. maxframerate a double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding. ptime an unsigned long integer value indicating the preferred duration of a media packet in milliseconds. this is typically only relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies a...
...the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. the default value, 1.0, means that the sent video's size will be the same as the original. a value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. the value must not be less than 1.0 (you can't use this to scale the video u...
VTTRegion - Web APIs
Web › API › VTTRegion
the vttregion interface—part of the api for handling webvtt (text tracks on media presentations)—describes a portion of the video to render a vttcue onto. constructor vttregion() returns a newly created vttregion object. properties vttregion.id a domstring that identifies the region. vttregion.width a double representing the width of the region, as a percentage of the video. vttregion.lines a double representing the height of the region, in number of lines. vttregion.regionanchorx a double representing the region anchor x offset, as a percentage of the region. vttregion.regionanchory a double representing the region anchor y offset, as a percentage of the region. vttregion.viewportanchorx a double representing the viewport anchor x offset, as a percentage of the video. ...
... vttregion.scroll an enum representing how adding new cues will move existing cues. examples var region = new vttregion(); region.width = 50; // use 50% of the video width region.lines = 4; // use 4 lines of height. ...
Window.devicePixelRatio - Web APIs
andard display versus a hidpi or retina display, which use more screen pixels to draw the same objects, resulting in a sharper image. you can use window.matchmedia() to check if the value of devicepixelratio changes (which can happen, for example, if the user drags the window to a display with a different pixel density). see the example below. syntax value = window.devicepixelratio; value a double-precision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in css pixels. a value of 1 indicates a classic 96 dpi (76 dpi on some platforms) display, while a value of 2 is expected for hidpi/retina displays. other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixe...
...point value indicating the ratio of the display's resolution in physical pixels to the resolution in css pixels. a value of 1 indicates a classic 96 dpi (76 dpi on some platforms) display, while a value of 2 is expected for hidpi/retina displays. other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixel depth than simply double the standard resolution of 96 or 76 dpi. examples correcting resolution in a <canvas> a <canvas> can appear too blurry on retina screens. use window.devicepixelratio to determine how much extra pixel density should be added to allow for a sharper image. html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // set...
Web APIs
Web › API
st cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit ...
...eritem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle ele...
Perceivable - Accessibility
should be at a minimum level to ensure legibility: text and its background should have a contrast ratio of at least 4.5:1. heading (or just larger) text should have a ratio of at least 3:1. larger text is defined as at least 18pt, or 14pt bold. see color and color contrast. 1.4.4 resize text (aa) the page should be readable and usable when the text size is doubled. this means that designs should be responsive, so that when the text size is increased, the content is still accessible. 1.4.5 images of text (aa) images should not be used to present content where text would do the job. for example, if an image is mostly textual, it could be represented using text as well as images. 1.4.6 enhanced contrast (aaa) this follows...
... be user-selectable. text blocks should be no wider than 80 characters (or glyphs), for maximum readability. text should not be fully justified (e.g., text-align: justify;). line height should be at least 1.5 times the text size within paragraphs (e.g., line-height: 1.5;), and at least 2.25 times the text size between paragraphs (e.g., padding: 2.25rem;). when the text size is doubled, the content should not need to be scrolled. 1.4.9 images of text (no exception) (aaa) text should not be presented as part of an image unless it is purely decoration (i.e., it does not convey any content) or cannot be presented in any other way. 1.4.10 reflow (aa) added in 2.1 no horizontal scrolling for left-to-right languages (like english) ...
@charset - CSS: Cascading Style Sheets
Web › CSS › @charset
ng defined by the referring document: the charset attribute of the <link> element. this method is obsoleted in html5 and must not be used. assume that the document is utf-8 syntax @charset "utf-8"; @charset "iso-8859-15"; where: charset is a <string> denoting the character encoding to be used. it must be the name of a web-safe character encoding defined in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. formal syntax @charset "<charset>"; examples valid and invalid charset declarations @charset "utf-8"; /* set the encoding of the style sheet to unicode utf-8 */ @charset 'iso-8859-15'; /...
... iossamsung internet@charsetchrome full support 2edge full support 12firefox full support 1.5notes full support 1.5notes notes firefox 1 supported an invalid syntax where the character encoding is not between single or double quotes.ie full support 5.5notes full support 5.5notes notes from internet explorer 5.5 to ie 7 (inclusive), internet explorer supported an invalid syntax where the character encoding is not between single or double quotes.opera full support 9safari ...
text-decoration-style - CSS: Cascading Style Sheets
encouraged to denote this meaning using an html tag, like <del> or <s>. as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. syntax /* keyword values */ text-decoration-style: solid; text-decoration-style: double; text-decoration-style: dotted; text-decoration-style: dashed; text-decoration-style: wavy; /* global values */ text-decoration-style: inherit; text-decoration-style: initial; text-decoration-style: unset; values solid draws a single line. double draws a double line. dotted draws a dotted line. dashed draws a dashed line. wavy draws a wavy line. -moz-none draws no line. use text...
...ws 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. ...
translate() - CSS: Cascading Style Sheets
the translate() css function repositions an element in the horizontal and/or vertical directions. its result is a <transform-function> data type. this transformation is characterized by a two-dimensional vector. its coordinates define how much the element moves in each direction. syntax /* single <length-percentage> values */ transform: translate(200px); transform: translate(50%); /* double <length-percentage> values */ transform: translate(100px, 200px); transform: translate(100px, 50%); transform: translate(30%, 200px); transform: translate(30%, 50%); values single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. the ordinate (vertical, y-coordinate) of the translating vector will be...
... single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. the ordinate (vertical, y-coordinate) of the translating vector will be set to 0. for example, translate(2) is equivalent to translate(2, 0). a percentage value refers to the width of the reference box defined by the transform-box property. double <length-percentage> values this value describes two <length> or <percentage> values representing both the abscissa (x-coordinate) and the ordinate (y-coordinate) of the translating vector. a percentage as first value refers to the width, as second part to the height of the reference box defined by the transform-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
the image will be tainted and its usage restricted. when not present, the resource is fetched 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, in seconds, of the audio. if the audio's metadata isn't available yet—thereby preventing you from knowing the media's start time or duration—currenttime instead indicates, and can be used to change, the time at which playback will begin. otherwise, setting currenttime sets the current playback position to the given time ...
...a timeline's reference frame. disableremoteplayback a boolean attribute used to disable the capability of remote playback in devices that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). see this proposed specification for more information. in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which 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 attribut...
<input type="datetime-local"> - HTML: Hypertext Markup Language
ute; right: -18px; } the best way to deal with dates in forms in a cross-browser way at the moment is to get the user to enter the day, month, year, and time in separate controls (<select> elements being popular — see below for an implementation), or use javascript libraries such as jquery date picker, and the jquery timepicker plugin. the y2k38 problem (often server-side) javascript uses double precision floating points to store dates, as with all numbers, meaning that javascript code will not suffer from the y2k38 problem unless integer coercion/bit-hacks are used because all javascript bit operators use 32-bit signed 2s-complement integers. the problem is with the server side of things: storage of dates greater than 231-1. to fix this problem, you must store all dates using either un...
...all numbers, meaning that javascript code will not suffer from the y2k38 problem unless integer coercion/bit-hacks are used because all javascript bit operators use 32-bit signed 2s-complement integers. the problem is with the server side of things: storage of dates greater than 231-1. to fix this problem, you must store all dates using either unsigned 32-bit integers, signed 64-bit integers, or double-precision floating points on the server. if your server is written in php, the fix may be as simple as upgrading to php 8 or 7, and upgrading your hardware to x86_64 or ia64. if you are stuck with other hardware, you can try to emulate 64-bit hardware inside a 32-bit virtual machine, but most vms don't support this kind of virtualization, stability may suffer, and performance will definately suff...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
the image will be tainted and its usage restricted. when not present, the resource is fetched 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 t...
...in-picture context menu or to request picture-in-picture automatically in some cases. disableremoteplayback a boolean attribute used to disable the capability of remote playback in devices that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the media in 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. height the height of th...
A re-introduction to JavaScript (JS tutorial) - JavaScript
st a special type of object. so the type diagram looks more like this: number string boolean symbol (new in es2015) object function array date regexp null undefined and there are some built-in error types as well. things are a lot easier if we stick with the first diagram, however, so we'll discuss the types listed there for now. numbers numbers in javascript are "double-precision 64-bit format ieee 754 values", according to the spec — there's no such thing as an integer in javascript (except bigint), so you have to be a little careful. see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent integer is in fact implicitly a float. also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; ...
...u add a string to a number (or other value) everything is converted into a string first. this might trip you up: '3' + 4 + 5; // "345" 3 + 4 + '5'; // "75" adding an empty string to something is a useful way of converting it to a string itself. comparisons in javascript can be made using <, >, <= and >=. these work for both strings and numbers. equality is a little less straightforward. the double-equals operator performs type coercion if you give it different types, with sometimes interesting results: 123 == '123'; // true 1 == true; // true to avoid type coercion, use the triple-equals operator: 123 === '123'; // false 1 === true; // false there are also != and !== operators. javascript also has bitwise operations. if you want to use them, they're there. control structures ja...
Indexed collections - JavaScript
« previousnext ...
... « previousnext » ...
Text formatting - JavaScript
at index 0, the next at index 1, and so on. the length of a string is the number of elements in it. you can create strings using string literals or string objects. caution: if you edit this page, do not include any characters above u+ffff, until mdn bug 857438 is fixed ( https://bugzilla.mozilla.org/show_bug.cgi?id=857438 ). string literals you can create simple strings using either single or double quotes: 'foo' "bar" more advanced strings can be created using escape sequences: hexadecimal escape sequences the number after \x is interpreted as a hexadecimal number. '\xa9' // "©" unicode escape sequences the unicode escape sequences require at least four hexadecimal digits following \u. '\u00a9' // "©" unicode code point escapes new in ecmascript 2015. with unicode code point es...
...e elements of the object repeated the given times. trim trims whitespace from the beginning and end of the string. multi-line template literals template literals are string literals allowing embedded expressions. you can use multi-line strings and string interpolation features with them. template literals are enclosed by the back-tick (` `) (grave accent) character instead of double or single quotes. template literals can contain place holders. these are indicated by the dollar sign and curly braces (${expression}). multi-lines any new line characters inserted in the source are part of the template literal. using normal strings, you would have to use the following syntax in order to get multi-line strings: console.log('string text line 1\n\ string text line 2'); // "strin...
SyntaxError: unterminated string literal - JavaScript
the javascript error "unterminated string literal" occurs when there is an unterminated string somewhere. string literals must be enclosed by single (') or double (") quotes. message syntaxerror: unterminated string constant (edge) syntaxerror: unterminated string literal (firefox) error type syntaxerror what went wrong? ...
...nterminated string literal" occurs when there is an unterminated string somewhere. string literals must be enclosed by single (') or double (") quotes. message syntaxerror: unterminated string constant (edge) syntaxerror: unterminated string literal (firefox) error type syntaxerror what went wrong? there is an unterminated string somewhere. string literals must be enclosed by single (') or double (") quotes. javascript makes no distinction between single-quoted strings and double-quoted strings. escape sequences work in strings created with either single or double quotes. to fix this error, check if: you have opening and closing quotes (single or double) for your string literal, you have escaped your string literal correctly, your string literal isn't split across multiple lines. e...
Array.prototype.map() - JavaScript
ray is still: // [{key: 1, value: 10}, // {key: 2, value: 20}, // {key: 3, value: 30}] mapping an array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it. the argument will automatically be assigned from each element of the array as map loops through the original array. ...
..., // {key: 3, value: 30}] mapping an array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it. the argument will automatically be assigned from each element of the array as map loops through the original array. ...
DataView - JavaScript
t 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. 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 (...
...t the specified byte offset from the start of the view. dataview.prototype.setuint32() stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the view. dataview.prototype.setfloat32() stores a signed 32-bit float (float) value at the specified byte offset from the start of the view. dataview.prototype.setfloat64() stores a signed 64-bit float (double) value at the specified byte offset from the start of the view. dataview.prototype.setbigint64() stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the view. dataview.prototype.setbiguint64() stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the view. examples using dataview var buffer =...
JSON - JavaScript
son. it can't be called or constructed, and aside from its two method properties, it has no interesting functionality of its own. description javascript and json differences json is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing commas are forbidden. numbers leading zeros are prohibited. a decimal point must be followed by at least one digit. nan and infinity are unsupported. any json text is a valid javascript expression... ...but only in javascript engines that have implemented the proposal to make all json text valid ecma-262. in engines that haven't implemented the proposal, u+2028 line s...
... keys in json; but their use in these features in javascript string literals is a syntaxerror. consider this example where json.parse() parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntaxerror in old engines other differences include allowing only double-quoted strings and having no provisions for undefined or comments. for those who wish to use a more human-friendly configuration format based on json, there is json5, used by the babel compiler, and the more commonly used yaml. full json syntax the full json syntax is as follows: json = null or true or false or jsonnumber or jsonstring or jsonobject or jsonarray jsonnumber...
Number - JavaScript
this means it can represent fractional values, but there are some limits to what it can store. ...
...this means it can represent fractional values, but there are some limits to what it can store. ...
TypedArray - JavaScript
instead, you create an instance of an array of a particular type, such as a int8arra...
...instead, you create an instance of an array of a particular type, such as a int8array or a big...
Lexical grammar - JavaScript
g are only reserved when they are found in strict mode code: implements interface let package private protected public static the following are only reserved when they are found in module code: await future reserved keywords in older standards the following are reserved as future keywords by older ecmascript specifications (ecmascript 1 till 3). abstract boolean byte char double final float goto int long native short synchronized throws transient volatile additionally, the literals null, true, and false cannot be used as identifiers in ecmascript. reserved word usage reserved words actually only apply to identifiers (vs. identifiernames) . as described in es5.github.com/#a.1, these are all identifiernames which do not exclude reservedwords. a.import a['im...
...ject and object initializer for more information. var o = { a: 'foo', b: 'bar', c: 42 }; // shorthand notation. new in es2015 var a = 'foo', b = 'bar', c = 42; var o = {a, b, c}; // instead of var o = { a: a, b: b, c: c }; array literals see also array for more information. [1954, 1974, 1990, 2014] string literals a string literal is zero or more unicode code points enclosed in single or double quotes. unicode code points may also be represented by an escape sequence. all code points may appear literally in a string literal except for these closing quote code points: u+005c \ (backslash), u+000d <cr>, and u+000a <lf>. prior to the proposal to make all json text valid ecma-262, u+2028 <ls> and u+2029 <ps>, were also disallowed from appearing unescaped in string literals. any code...
Logical NOT (!) - JavaScript
converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the ! operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive. ...
...the conversion is based on the "truthyness" or "falsyness" of the value (see truthy and falsy). the same conversion can be done through the boolean function. ...
JavaScript typed arrays - JavaScript
this is usef...
...this is useful when de...
<ms> - MathML
Web › MathML › Element › ms
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. ...
...which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. ...
<feComposite> - SVG: Scalable Vector Graphics
aring of the background.</desc> <defs> <desc>define two sets of six filters for each of the six compositing operators. the first set wipes out the background image by flooding with opaque white. ...
...thmeticflood)" /> <text x="-25" y="275">arithmetic</text> </g> </g> <g transform="translate(0,325)" enable-background="new"> <desc>render the examples using the filters that do not obliterate the background, thus sometimes causing the background to continue to appear in some cases, and in other cases the background image blends into itself ("double-counting").</desc> <text x="15" y="75">opacity 1.0</text> <text x="15" y="115" font-size="27">(without feflood)</text> <text x="15" y="200">opacity 0.5</text> <text x="15" y="240" font-size="27">(without feflood)</text> <use xlink:href="#bluetriangles"/> <g transform="translate(275,25)"> <use xlink:href="#red100" filter="url(#overnoflood)" /> <u...
Window: deviceproximity event - Archive of obsolete content
abled preference (bug 1462308). bubbles no cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant device (distance in centimetres). min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise). max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). related events userproximity ...
ui/button/action - Archive of obsolete content
64.png" } }); if you use the final form, firefox will automatically choose the best-fit icon for your button, depending on the device screen resolution and where the button is in the ui. on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. so you can supply three icon files: icon: { "16": "./addon16.png", "32": "./addon32.png", "64": "./addon64.png" } this will look fine in both toolbar and menu panel, and for both screen resolutions. however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: ...
ui/button/toggle - Archive of obsolete content
64.png" } }); if you use the final form, firefox will automatically choose the best-fit icon for your button, depending on the device screen resolution and where the button is in the ui. on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. so you can supply three icon files: icon: { "16": "./addon16.png", "32": "./addon32.png", "64": "./addon64.png" } this will look fine in both toolbar and menu panel, and for both screen resolutions. however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: ...
Storing annotations - Archive of obsolete content
on, and install it in firefox. activate the add-on, add an annotation, and then right-click the widget. you should see something like this: restart firefox, right-click the widget again, and check that the annotation is still there. until now we've always run cfx run rather than building an xpi and installing the add-on in firefox. if the annotation does not reappear when you restart firefox, double check you installed the add-on and didn't just use cfx run again. responding to overquota events add-ons have a limited quota of storage space. if the add-on exits while it is over quota, any data stored since the last time it was in quota will not be persisted. so we want to listen to the overquota event emitted by simple-storage and respond to it. add the following to your add-on's main func...
Running applications - Archive of obsolete content
ces. there are two ways to run programs. using nsiprocess the recommended way is to use the nsiprocess interface because it is crossplatform. using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux! see nsilocalfile.launch() for details and make sure that all your target platforms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more information on nsifile/nsilocalfile, see file i/o. var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); file.initwithpath("c:\\myapp.exe"); file.launch(); references nsiprocess nsilocalfile if you need to la...
Chapter 1: Introduction to Extensions - Archive of obsolete content
xplosively—there are now more than 7000 extensions and themes published at the firefox add-ons site (https://addons.mozilla.org). what you can do with extensions let's look at what features extensions can add, and some actual examples of extensions. single feature extensions fixme: update this. these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked url follows that url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a url’s domain and path in the location bar for easier reading. feature enhancing extensions fixme: update this. these extensions enhance features that already exist in firefox. tab mix plus offer...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ript errors to the error console. true javascript.options.strict (present in firefox 3.5+) enforces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly. some of these preferences do not exist—to create them, right-click, select “new>boolean”, and type in the name and set the value accordingly. install the dom inspector the dom inspector is an extension that lets you examine html and xul dom tree structures, javascript objects and css properties, etc. this is not required for developing extensions, bu...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
arystream.setoutputstream(filestream); binarystream.writebytearray(array , array.length); binarystream.close(); filestream.close(); text file i/o text files are read the same way streams are. if the text includes multi-byte characters, as is used in japanese, you'll need to convert the character codes. text file input listing 15 shows an example of opening a text file encoded as shift-jis (a double-byte character encoding for japanese). copy some japanese text into a text file, save it as shift-jis, and put in the path to that file. the text will be displayed as-is. the text that you've read in is actually being represented internally as unicode (utf-16). listing 15: reading a shift-jis text file file.initwithpath('c:\\temp\\temp.txt'); var charset = 'shift_jis'; var filestream = componen...
Setting Up a Development Environment - Archive of obsolete content
nd we'll see next. in the "start in" textbox you should choose %p (directory path of active project). if you don't see this textbox, click on the "more" button. you also have the option to save the command, by clicking on the "add to toolbox" checkbox. to see the toolbox, click on view > tabs > toolbox, from the main menu. with that, you should now have a very easy way to build your xpi, by just double clicking on the created commands. we can make it even better. once you're testing and debugging your code, you'll find that constantly building and installing an xpi can be very tedious. this is the reason why we introduced "make install". this only works if your extension is already installed in a firefox profile. just like in the provided project, you need the add-on id and profile location se...
Setting up an extension development environment - Archive of obsolete content
ack them in your user home directory, and name folders for easy navigation to firenightly and firedevedition or similar. you do not have to install these unstable versions, if you do not wish. make a symbolic link (also referred to as a shortcut) to the firefox binary (firefox.exe on windows), then move the link to your desktop, or your preferred location. to run this version of firefox, simply double click on this file. explore this profile a little: change some settings, install any additional extensions, and finally close this instance of firefox. now run your firefox profile manager. (linux, mac os x, windows instructions.) you'll see the list of available user profiles one which is default (stable) and other (unstable) profile(s) created automatically when you run other versions of fire...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
ach table ensured the flexibility we needed if certain modules and pieces of content appeared or disappeared. when you get to that point, the amount of markup you have to sift through to find anything becomes ridiculous. until this redesign, wired news wasn't even using css to style the content inside tables. the sheer amount [sic] of redundant <font> tags inside every cell was probably enough to double file size. my initial attempts at the markup and css for the wired news design eliminated the majority of our tables, but left one master table to control the primary columns of each page. that approach meant that the content of every column would have to be loaded and calculated before it would be rendered in the browser window. that wasn't good enough. around that time, i started discovering g...
Creating reusable content with CSS and XBL - Archive of obsolete content
does not link any javascript code. the document does not contain any buttons. it only contains the text of the button's label. the button is added by the binding. the document stylesheet links the binding. the binding links its own stylesheet, and it supplies its own content and javascript code. so the binding is self-contained. challenges change the xbl file so that the square doubles in width when it changes color, instead of jumping to the right. use the dom inspector tool to inspect the document, revealing the added content. what next? if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page. in this demonstration, the square and the button make a self-contained widget that functions withi...
chargingtimechange - Archive of obsolete content
as changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type description batterymanager.chargingtime double (float) the remaining time in seconds until the system's battery is fully charged. returns 0 if the battery is fully charged. returns positive infinity, if the battery is discharging or if the implementation is unable to report the remaining charging time. read only. example navigator.getbattery().then(function(battery) { console.log("battery charging time: " + battery.chargingtime ...
dischargingtimechange - Archive of obsolete content
changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type description batterymanager.dischargingtime double (float) the remaining time in seconds until the system's battery is completely discharged and the system is about to be suspended. returns positive infinity if the battery is charging, if the implementation is unable to report the remaining discharging time, or if there is no battery attached to the system. read only. example navigator.getbattery().then(function(battery) { console.l...
levelchange - Archive of obsolete content
y api has changed. general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type description batterymanager.level double (float) the system's battery charging level scaled from 0 to 1.0. returns 0 if the battery is empty and the system is about to suspend. returns 1.0 if the battery is full, if the implementation is unable to report the battery's level, or if there is no battery attached to the system. read only. example navigator.getbattery().then(function(battery) { console.log("battery level: " + b...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the comma - matches are whole-word only) and value 0x5, the assert would automatically be ignored. if you also had a dword named "3173", it would have no effect here because the handler stops comparing values at the first match. note that double quotes which delimit an item (") are ignored in value names and the assertion string, so "silly" and silly will both be matched by a value named silly. "silly", will only be matched by a value named "silly", since the quotes are internal to the string. ...
Getting Started - Archive of obsolete content
es). delete the bolded text: original skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/ modified skin,install,url,resource:/chrome/classic/skin/classic/global/ once you have made these modifications, save them and run mozilla. if mozilla runs fine, that means that it worked. if it doesn't appear as you expected, then go back into the installed-chrome.txt file and double check that you modified the lines correctly. changing borders and colours this is the part where knowing css comes in handy. to find all of the css files that we're going to be modifying, we must first understand the directory structure. directories in \mozilla\chrome\classic\skin\classic there are a number of different directories which contain the skin information for the default packages that ...
In-Depth - Archive of obsolete content
as url("chrome://navigator/skin/icons/dino.png");. when it's all done you should have something that looks like this: #navigation-toolbar > .toolbar-holder > .toolbar-primary-icon { background-image: url("chrome://navigator/skin/icons/dino.png"); } put the image in that directory, fire up mozilla, and take a look at your creation. if the navigation toolbar dissapears or something, go back and double check everything. especially the -moz-binding commands. ...
Developing New Mozilla Features - Archive of obsolete content
rience with the project. eventually you’ll be plugged in enough you won’t need us, you’ll be able to find your own back-ups. we’ll still want to know if a developer is consistently not responding to contributors, but you’ll be able to deal with the occasional problems just by asking someone else. design in the open post your plans to the appropriate newsgroup. if there is no response, double-check to see if you have been successful with suggestion five. try hard to design your feature so that it can be implemented and reviewed in manageable size patches if you can implement and submit core elements first and build on them in subsequent patches, so much the better. if you think your feature can only be implemented and reviewed in one enormous chunk, ask for design help in the approp...
Bundles - Archive of obsolete content
tify the user. the user can then decide to install the webapp. how-to here is a simple way to build a basic web application bundle: create file called webapp.ini that contains something like: [parameters] id=unique-app-id@unique-author-id.whatever name=webapp name uri=http://[the-url-what-you-want-to-connect-to]/ status=yes location=no sidebar=no navigation=no zip the file to [whatever].webapp double-click the webapp bundle or use prism -webapp [path-to-webapp] structure a bundle can contain the following files. any other files in the .webapp file will be ignored. after the .webapp file is executed the first time, these files will be unzipped and "cached" to a local directory structure. / webapp.ini webapp.js webapp.css winnt/ webapp.css darwin/ webapp.css linux/ webap...
Installer - Archive of obsolete content
current windows and mac installs automatically associate *.webapp with prism. ...
Frequently Asked Questions - Archive of obsolete content
no way for svg content authors to make mozilla use a plugin when people view the svg files on their website. the native svg support must be turned off before mozilla will look to see if there's an svg plugin installed. this is done by toggling a hidden user configuration preference (pref). to access the pref type about:config into the url bar, then type svg.enabled into the filter field. when you double click on the pref you will see its value change to and from true/false, turning the native support on/off. how does mozilla's svg implementation compare to adobe's? mozilla's native implementation is less complete than adobe svg viewer's in general. there are major features such as filters and smil based animation that have still to be implemented in mozilla. however, mozilla's implementation a...
SpiderMonkey coding conventions - Archive of obsolete content
d mixed case, e.g. js_searchscope. most static function names have unprefixed, mixed-case names: getchar. but static native methods of js objects have lowercase, underscore-separated or intercaps names, e.g., str_indexof. and library-private and static data use underscores, not intercaps (but library-private data do use a js_ prefix). scalar type names are lowercase and js-prefixed: jsdouble. aggregate type names are js-prefixed and mixed-case: jsobject. macros are generally all_caps and underscored, to call out potential side effects, multiple uses of a formal argument, etc. linkage dll entry points have their return type expanded within a js_public_api() macro call, to get the right windows secret type qualifiers in the right places for all build variants. dll entry point...
Treehydra Manual - Archive of obsolete content
abstract interpretation library treehydra includes a library for creating abstract interpretation analyses based on esp. users only need to define their esp property variables, abstract values, and the flow semantics of gimple statements, and the library will do all of the substate tracking and fixed-point solving. the library is at unstable/esp.js. there is a sample application that checks for double-locking in a simple mutex api in test/esp_lock.js. abstract interpretation is a big topic, which is not yet fully documented here. for now, here is an explanation of some of the terminology that is often confusing: concrete value. a value in the programming language being analyzed. e.g., (int) 3. abstract value. a value used in the analysis script that represents a set of concrete values. e.g., n...
Event Handlers - Archive of obsolete content
eparated 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 authors to easily define handlers for right-click, or for left double-click, without having to write script on the same handler to differentiate those cases. key events support the charcode and keycode attributes. when set, the corresponding fields in the event object must match for the event to fire. [editor's note: should we have section on error-handling? probably.] ...
Windows Install - Archive of obsolete content
// subkeys have to exist before values can be put in. var subkey; // the name of the subkey you are poking around in var valname; // the name of the value you want to look at var value; // the data in the value you want to look at. var winreg = getwinregistry() ; if(winreg != null) { // here, we get the current versio...
modDate - Archive of obsolete content
summary returns the last modified date of a specified file or directory. 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. example f = getfolder("program"); filesource = getfolder(f, "myfile.txt"); err = file.moddate(filesource); see moddatechanged for an example of comparing the dates of two files. ...
modDateChanged - Archive of obsolete content
summary returns whether file has been modified since a certain date. method of file object syntax boolean moddatechanged (filespecobject asourcefolder, number anolddate); parameters the moddatechanged method has the following parameters: asourcefolder a filespecobject representing the file to be queried. anolddate a double representing the date. returns a boolean value indicating whether the file has been modified since the input date or has not. description most often, the date passed in as the second parameter in moddatechanged is the returned value from a moddate on a separate file, as in the following example, in which the dates of two files are compared. example filesource1 = getfolder("program", "file1.txt"); filesource2 = getfolder("pro...
execute - Archive of obsolete content
llowing line, for example, passes the "-c" command-line parameter to the executable: err = file.execute(myfile, "-c", true); when you want to pass more than one parameter to the executable itself, however, you must format the args string in a particular way so that the parameters can be broken up and passed separately as required. in general, you should use single quotes for the args string and double quotes to delimit the command-line arguments within args. the following parsing rules apply: double quotes are treated as quotes; single quotes are ignored by the executable but legal in the execute() method. the outer quotes that frame the args string itself are stripped off when the string is passed to the executable. quotes that are escaped, or "backslashed," are passed through the exe...
query.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value ...
treecell.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of individual cells in the column to be changed, especially useful when <treecol type="checkbox">. also useful for disabling editing of individual treecells. when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. the tree and treecol must also be marked as editable in order for this to work. the tree must be a content tree for this to work on treecells. ...
treecol.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of cells in the column to be changed, especially useful when type="checkbox". when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. 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. ...
Reading from Files - Archive of obsolete content
value. read8 will read a single byte and return it. the 8 in the method name indicates that 8 bits of data are being read. read16 will read two bytes from the stream and interpret them as an integer. this method will return the value as a number. read32 will read four bytes and return this as a single 32-bit integer. readfloat will read four bytes and interpret them as a floating point value. readdouble will read eight bytes and interpret them as a double floating point value. in this next example, the read32 method is used to read a 32-bit length from the file. then, this length is used to determine how many additional bytes of data to read. var length = stream.read32(); var data = stream.readstring(length); all values are read in big endian form, which means that integers are stored in the f...
Writing to Files - Archive of obsolete content
es will be converted into booleans automatically. write8 will write a single byte. the 8 in the method name indicates that 8 bits of data are being written. if the supplied value is larger than 8 bits, only the lowest significant 8 bits are written. write16 will write two bytes to the stream. write32 will write four bytes. writefloat will write a floating point value in four bytes. writedouble will write a floating point value in eight bytes. in this example, the write16 method is used to write the value 1000 in two bytes. the write32 method performs a similar operation except that the value 1000 is written using four bytes, padding the unused bits with zeroes. stream.write16(1000); stream.write32(1000); all values are read in big endian form, which means that integers are stored in ...
Building Hierarchical Trees - Archive of obsolete content
ildren. for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy similar to that in the xml document. or, with more complex xpath expressions, a template could display a tree where the hierarchy wasn't directly like the xml document. if a node is a container, the tree item becomes a container, and the user may open the row by double-clicking it. note that this test is done on the member value not the reference value. for instance, in the photo example, we have a container 'http://www.xulplanet.com/rdf/myphotos' with three photos. three results will be generated from a simple rule with no extra conditions. it is the result, or the photo, that will be checked, not the container of photos. since a photo isn't a container, the t...
SQLite Templates - Archive of obsolete content
ge" name="minage" type="integer">30</param> <param id="maxage" 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...
Code Samples - Archive of obsolete content
rk in firefox, thunderbird, sunbird and seamonkey, except where the text says otherwise. launch a file on your computer to launch a file on your computer, use code like this. change the first line to specify the file that you want to launch. you can launch an executable file or some other file that your operating system knows how to open. note: on operating systems that use backslash characters, double each backslash character. on operating systems that use forward-slash characters, specify the file in the normal way. const path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwithpath(path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to ope...
Accesskey display rules - Archive of obsolete content
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 localize to "キャンセル(&c)". this label will be displayed as "キャンセル(c)(c)" on the localized build. so, "(c)" will be doubled. for this issue, we recommend the following format if you use .properties: <command-name>.label=cancel <command-name>.accesskey=c note that apis of nsipromptservice are using the bad way. because the apis are already frozen. therefore, xul toolkit removes accesskey text before setting the label to the buttons. however, xul application developers should not make same mistake. ...
Creating a Window - Archive of obsolete content
se in the next set of sections. </window> and finally, we need to close the window tag at the end of the file. opening a window in order to open a xul window, there are several methods that can be used. if you are only in the development stage, you can just type the url (whether a chrome:, file: or other url type) into the location bar in a mozilla browser window. you should also be able to double-click the file in your file manager, assuming that xul files are associated with mozilla. the xul window will appear in the browser window as opposed to a new window, but this is often sufficient during the early stages of development. note: the local xul document can be opened in the browser as mentioned above only if |dom.allow_xul_xbl_for_file| preference in "about:config" has been set to |tr...
Property Files - Archive of obsolete content
ping the percentage character will generate an incorrect string that strips the space character between the percentage character and the next word of the string ("50%off"). non-ascii characters, utf-8 and escaping gecko 1.8.x (or later) supports property files encoded in utf-8. you can and should write non-ascii characters directly without escape sequences, and save the file as utf-8 without bom. double-check the save options of your text editor, because many don't do this by default. see localizing extension descriptions for more details. in some cases, it may be useful or needed to use escape sequences to express some characters. property files support escape sequences of the form: \uxxxx , where xxxx is a unicode character code. for example, to put a space at the beginning or end of a string ...
Tree Box Objects - Archive of obsolete content
he value 'cell' indicates the area around the text, for example, the margin on the left side where the open and close twisties are normally drawn. if there was a twisty, however, the value would be 'twisty' instead. this is convenient since you could determine whether the user clicked on a twisty instead of another part of the row. in fact, this is what the underlying tree code does when the user double clicks the twisty. the final value that may be returned is 'image' if there is an image in the tree cell and the coordinate corresponds to a location where the image is. of course, in many cases you may not care what part of the cell the coordinate is on and just want the row and column. to go in reverse and get the coordinates of a specific cell, use the getcoordsforcellitem() function. it take...
XUL Structure - Archive of obsolete content
ication/vnd.mozilla.xul+xml (eg with php header('content-type: application/vnd.mozilla.xul+xml');). this content type is how mozilla knows the difference between html and xul. mozilla does not use the file extension, unless reading files from the file system, but you should use the .xul extension for all xul files. you can load xul files from your own machine by opening them in the browser, or by double-clicking the file in your file manager. remember that remote xul will have significant restrictions on what it can do, and does not work with current firefox versions! document types: html xml xul css mozilla uses a distinctly different kind of document object (dom) for html and xul, although they share much of the same functionality. there are three main types of document in mozilla: html, xm...
Using the Editor from XUL - Archive of obsolete content
lmouselistener this is an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor. note: this is ugly, and should probably be redesigned to work on callbacks out of the editor, or moved entirely to javascript. the nseditorshellmouselistener essentially calls nseditorshell::handlemouseclickonelement to show property dialogs for items that you double-click on. the path of a key press so what happens to a key press once it's got to the nstexteditorkeylistener? how does that end up in the document? let's trace through. nstexteditorkeylistener::keypress() gets the key press event. for normal character keys, that falls into nshtmleditor::editorkeypress(). nshtmleditor::editorkeypress() gets the character code from the key event, put...
XUL accessibility guidelines - Archive of obsolete content
ered into the textbox. the correct label for textbox is actually the same, but we don't want assistive technologies to read or show it twice. we need a way of specifying in the source that the checkbox, editbox, and nearby text labels are all part of a single entity, and that they essentially label each other. to solve this problem, we use the aria-labelledby attribute on both controls (note the double l—aria uses uk-style spelling) to specify that the checkbox and the textbox are both labeled by the the entire group of components. put into xul, this looking something like the following. <checkbox id="rememberhistorydays" aria-labelledby="historydaysprelabel historybox historydayspostlabel"> <label id="historydaysprelabel">remember visited pages for the last</label> <textbox id="histor...
XML - Archive of obsolete content
ur syntax, and in particular about these four cardinal rules of xul: all events and attributes must be written in lowercase. unlike html, xul is very sensitive to case. all of the events and attributes -- even the javascript event listeners normally formatted in the javascript world with uppercase verbs (e.g., onclick, onload) -- must be lowercase or they are invalid. all strings must be double quoted. all of the values for all of the attributes declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags to be well-formed. html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a closing element. in xul, elements ...
treecell - Archive of obsolete content
text for the cell using the label attribute. more information is available in the xul tutorial. attributes editable, label, mode, properties, ref, src, value attributes editable type: boolean allows the contents of individual cells in the column to be changed, especially useful when <treecol type="checkbox">. also useful for disabling editing of individual treecells. when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. the tree and treecol must also be marked as editable in order for this to work. the tree must be a content tree for this to work on treecells. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value o...
treecol - Archive of obsolete content
mark in the cell. if the cycler attribute is not set, the cell is a regular text cell. dragging type: boolean this attribute will be set to true if the column is being dragged. this attribute is set automatically; you shouldn't adjust it yourself. editable type: boolean allows the contents of cells in the column to be changed, especially useful when type="checkbox". when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. 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 eithe...
XUL Explorer - Archive of obsolete content
sole are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. roadmap features: the preview pane can be toggled with the editor. previewing in a popup window is still available. option to automatically update the preview as the editor changes. indicator in the statusbar shows errors. double-click to display error console. option to specify the snippet used to load the editor on startup. option to include a user snippet file. the snippets are merged with the built-in snippets at startup. double-click or drag-and-drop to insert a snippet file > new allows user to pick any “template” snippet, as well as blank. simple xul checker can be used to ‘validate’ the xul snippet. i...
nsIContentPolicy - Archive of obsolete content
de (e.g., lengths of node lists). [javascript implementations only] access properties of any sort on any object without using xpcnativewrapper (either explicitly or implicitly). due to various dom0 things, this leads to item 4. if you do any of these things in your shouldload() implementation, expect unpredictable behavior, possibly including crashes, content not showing up, content showing up doubled, etc. if you need to do any of the things above, do them off timeout or event. note: when multiple content policies are used (for example through several extensions), if one of them rejects a request, the rest of the policies are not called. reference: //github.com/realityripple/uxp/blob/master/dom/base/nscontentpolicy.cpp#l129. note: the order of content policies in the above case depends ...
Monitoring plugins - Archive of obsolete content
var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(this, "experimental-notify-plugin-call", false); this.registered = true; } }, //unregisters from the observer services u...
NPVariantType - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npvarianttype is an enumeration that is used to identify the data type of an npvariant structure. syntax typedef enum { npvarianttype_void, npvarianttype_null, npvarianttype_bool, npvarianttype_int32, npvarianttype_double, npvarianttype_string, npvarianttype_object } npvarianttype; description each type is self-explanatory. see also npvariant ...
Sunbird Theme Tutorial - Archive of obsolete content
change the next six lines to describe your theme. ensure that the internal name is a single word. note: if your theme is for a version of sunbird later than 0.4, then also change the maxversion. save the file. registering your theme to register your theme, create a plain text file named <tt>chrome.manifest</tt>. copy and paste the ...
Common Firefox theme issues and solutions - Archive of obsolete content
ivate the "click me" link. the url bar of the resulting popup window is disabled. address bar "door hangers" door hanger sync panel not styled the sync panel at the bottom of the "door hanger" for the save password panel displayed when a user logs into a website needs to be styled to match rest of panel including border. this issue also applies to the edit bookmark panel, which is activated by double clicking on the bookmark star in the url bar. for details, please see bug 708797. "about" pages about:addons disabled add-on icons are not grey scale in tools > add-ons, the icons of disabled icons need to be converted to grey scale. to accomplish this copy the file chrome://mozapps/skin/extensions/extensions.svg from the default theme into the mozapps/extensions/ folder of your theme and add...
-ms-content-zooming - Archive of obsolete content
e element is not zoomable. zoom the initial value of the top-level element. the element is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. by default, zoom-enabled elements can be zoomed by the user via pinch-zoom. the top-level element can also be zoomed via double-tap when it is zoom-enabled. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-filter - Archive of obsolete content
mage and related properties gradient background-image: linear-gradient() dropshadow text-shadow or box-shadow matrix transform, transform-origin in windows internet 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 ...
String.prototype.quote() - Archive of obsolete content
obsolete since gecko 37 (firefox 37 / thunderbird 37 / seamonkey 2.34)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes ("). syntax str.quote() return value a new string representing the original string wrapped in double-quotes, with any special characters escaped. examples using quote in the table below the quote() method replaces any special characters and wraps the strings in double-quotes. also note the third column where a wrapped eval() evaluates the escape sequences again. str str...
Archived JavaScript Reference - Archive of obsolete content
...
Examples - Archive of obsolete content
</p> </body> </html> back to the article examples for "using css rules in inline style within comments" example 1 <!-- this file should have a .html extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head>...
XForms Range Element - Archive of obsolete content
enting values. this determines how much the value of the range will be changed upon user interaction. if this attribute is omitted, then it is assumed to be the value of end - start / 20. type restrictions the range element can be bound to a node of type xsd:duration, xsd:date, xsd:time, xsd:datetime, xsd:gyearmonth, xsd:gyear, xsd:gmonthday, xsd:gday, xsd:gmonth, xsd:float, xsd:decimal or xsd:double or any type derived from one of these. representations the xforms range element is represented by a slider widget (xhtml only). characteristics analogous widget is <xul:scale/>, which is available in fx 3.0 only if the incremental attribute has the value true, the value of the bound node will be updated upon each movement of the slider's thumb. ...
Window: devicelight event - Archive of obsolete content
ta is available from a light sensor. note: this event has been disabled by default in firefox 62, behind the device.sensors.ambientlight.enabled preference (bug 1462308). bubbles no cancelable no interface sensorcallback target defaultview (window) other properties property type description value read only double (float) the sensor data for ambient light in lux. min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise). max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). examples window.addeventlistener('devicelight', function(event) { console.log(event.valu...
Animations and tweens - Game development
ween. we will also add the optional oncomplete event handler, which defines a function to be executed when the tween finishes. the last thing do to is to start the tween right away using start(). that's the expanded version of the tween definition, but we can also use the shorthand syntax: game.add.tween(brick.scale).to({x:2,y:2}, 500, phaser.easing.elastic.out, true, 100); this tween will double the brick's scale in half a second using elastic easing, will start automatically, and have a delay of 100 miliseconds. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps animations and tweens look very nice, but we can add even more to our game — in the next section we'll look at handlin...
BigInt - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: bigint the javascript global object bigint ...
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
ned anonymous function. to do so, we have two ways: 1- using a variable const sayhello = function() { return function() { console.log("hello!"); } } const myfunc = sayhello(); myfunc(); this way, it returns the hello! message. you have to use another variable. if you invoked sayhello directly, it would return the function itself without invoking its returned function. 2- using double parentheses function sayhello() { return function() { console.log("hello!"); } } sayhello()(); we are using double parentheses ()() to invoke the returned function as well. ...
Number - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, number is a numeric data type in the double-precision 64-bit floating point format (ieee 754). in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: number the javascript global object number ...
Polymorphism - MDN Web Docs Glossary: Definitions of Web-related terms
polymorphism is the presentation of one interface for multiple data types. for example, integers, floats, and doubles are implicitly polymorphic: regardless of their different types, they can all be added, subtracted, multiplied, and so on. in the case of oop, by making the class responsible for its code as well as its own data, polymorphism can be achieved in that each class has its own function that (once called) behaves properly for any object. learn more general knowledge polymorphism on wikipedia ...
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
, so authentication bypasses successfully. just due to a simple string (magical string) the entire database is compromised. how to prevent before executing the queries for the user credentials, make some changes like the following: $id = $_get['id'] (1) $id = stripslashes($id) (2) $id = mysql_real_escape_string($id) so due to (1) each single quote (') in the input string is replaced with double quotes ("), and due to (2) before every (') it adds (/). the revised magical string fails to bypass the authentication, and your database stays secure. learn more general knowledge sql injection on wikipedia explanation of sql injection on owasp (open web application security project) ...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
ree levels of conformance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content. conformance to this level is described as a. priority 2: web developers should satisfy these requirements, otherwise some groups will find it difficult to access the web content. conformance to this level is described as aa or double-a. priority 3: web developers may satisfy these requirements, in order to make it easier for some groups to access the web content. conformance to this level is described as aaa or triple-a. learn more general knowledge wcag on wikipedia technical knowledge accessibility information on mdn the wcag 2.0 recommendation at the w3c ...
CSS and JavaScript accessibility best practices - Learn web development
ing event handlers, which allow us to run functions in response to certain events happening. some events can have accessibility issues. the main example you'll come across is mouse-specific events like mouseover, mouseout, dblclick, etc. functionality that runs in response to these events will not be accessible using other mechanisms, like keyboard controls. to mitigate such problems, you should double up these events with similar events that can be activated by other means (so-called device-independent event handlers) — focus and blur would provide accessibility for keyboard users. let's look at an example that highlights when this could be useful. maybe we want to provide a thumbnail image that shows a larger version of the image when it is moused over or focused (like you'd see on an e-co...
WAI-ARIA basics - Learn web development
ike you to take a copy of aria-no-live.html and quotes.json, and update your <section> tag as follows: <section aria-live="assertive"> this will cause a screenreader to read out the content as it is updated. note: most browsers will throw a security exception if you try to do an xmlhttprequest call from a file:// url, e.g. if you just load the file by loading it directly into the browser (via double clicking, etc.). to get it to run, you will need to upload it to a web server, for example using github, or a local web server like python's simplehttpserver. there is an additional consideration here — only the bit of text that updates is read out. it might be nice if we always read out the heading too, so the user can remember what is being read out. to do this, we can add the aria-atomic p...
Cascade and inheritance - Learn web development
ut 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 user agent style sheets (e.g. the browser's default styles, used when no other styling is set). normal declarations in user style sheets (custom styles set by a user). normal declarations in author style sheets (...
Fundamental CSS comprehension - Learn web development
ve a separate css panel, feel free to put it in a <style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html and an image, and need to write the necessary css to style this into a nifty little online business card, which can perhaps double as a gamer card or social media profile. the following sections describe what you need to do. basic setup: first of all, create a new file in the same directory as your html and image files. call it something really imaginative like style.css. link your css to your html file via a <link> element. the first two rulesets in the css resource file are yours, for free! after you've finished rejo...
Pseudo-classes and pseudo-elements - Learn web development
; this only applies if the user moves their pointer over an element, typically a link. :focus — only applies if the user focuses the element using keyboard controls. what is a pseudo-element? pseudo-elements behave in a similar way, however they act as if you had added a whole new html element into the markup, rather than applying a class to existing elements. pseudo-elements start with a double colon ::. ::pseudo-element-name note: some early pseudo-elements used the single colon syntax, so you may sometimes see this in code or examples. modern browsers support the early pseudo-elements with single- or double-colon syntax for backwards compatibility. for example, if you wanted to select the first line of a paragraph you could wrap it in a <span> element and use an element selector;...
Grids - Learn web development
</div> <div>three</div> <div>four</div> <div>five</div> <div>six</div> <div>seven</div> </div> note: the *gap properties used to be prefixed by grid-, but this has been changed in the spec, as the intention is to make them usable in multiple layout methods. the prefixed versions will be maintained as an alias so will be safe to use for some time. to be on the safe side, you could double up and add both properties to make your code more bulletproof. .container { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-gap: 20px; gap: 20px; } repeating track listings you can repeat all, or a section of, your track listing using repeat notation. change your track listing to the following: .container { display: grid; grid-template-columns: repeat(3, 1fr); gri...
Fundamental text and font styling - Learn web development
e-height property sets the height of each line of text — this can take most length and size units, but can also take a unitless value, which acts as a multiplier and is generally considered the best option — the font-size is multiplied to get the line-height. ...
Styling links - Learn web development
the mouse pointer style — you shouldn't turn this off unless you've got a very good reason. outline for the text outline (an outline is similar to a border, the only difference being that border takes up space in the box and an outline doesn't; it just sits over the top of the background). the outline is a useful accessibility aid, so think carefully before turning it off; you should at least double up the styles given to the link hover state on the focus state too. note: you are not just limited to the above properties to style your links — you are free to use any properties you like. just try not to go too crazy! styling some links now we've looked at the default states in some detail, let's look at a typical set of link styles. to start off with, we'll write out our empty ruleset...
What text editors are available? - Learn web development
t case scenario, compile your editor from source. take the time to carefully check the installation instructions on the text editor's website. when you install a new text editor, your os will probably continue to open text files with its default editor until you change the file association. these instructions will help you specify that your os should open files in your preferred editor when you double-click them: windows windows 8 windows 7 older systems mac os x linux ubuntu unity gnome kde next steps now that you have a good text editor, you could take some time to finalize your basic working environment, or, if you want to play with it right away, write your very first web page. ...
How do you upload your files to a web server? - Learn web development
directory in your right pane. this directory is effectively the root of your website — where your index.html file and other assets will go. once you've found the correct remote directory to put your files in, to upload your files to the server you need to drag-and-drop them from the left pane to the right pane. are they really online? so far, so good, but are the files really online? you can double-check by going back to your website (e.g. http://demozilla.examplehostingprovider.net/) in your browser: and voilà! our website is live! rsync rsync is a local-to-remote file synchronizing tool, which is generally available on most unix-based systems (like macos and linux), but windows versions exist too. it is seen as a more advanced tool than sftp, beause by default it is used on the com...
What are browser developer tools? - Learn web development
for debugging and testing. :hover/:active/:focus. forces element states to be toggled on, so you can see what their styling would look like. copy/copy as html. copy the currently selected html. some browsers also have copy css path and copy xpath available, to allow you to copy the css selector or xpath expression that would select the current html element. try editing some of your dom now. double-click an element, or right-click it and choose edit as html from the context menu. you can make any changes you'd like, but you cannot save your changes. exploring the css editor by default, the css editor displays the css rules applied to the currently selected element: these features are especially handy: the rules applied to the current element are shown in order of most-to-least-speci...
How do you set up a local testing server? - Learn web development
ting server on your machine, and the basics of how to use it. prerequisites: you need to first know how the internet works, and what a web server is. objective: you will learn how to set up a local testing server. local files vs. remote files throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open... and navigating to the html file. there are many ways to achieve this. if the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. in contrast, if you view one of our examples hosted on github (or an example on some other remot...
How to build custom form controls - Learn web development
the list of options; adding this to .select:focus-within will be a better option when fully supported */ position: relative; /* this will make our control become part of the text flow and sizable at the same time */ display : inline-block; } we need an extra class active to define the look and feel of our control when it is in its active state. because our control is focusable, we double this custom style with the :focus pseudo-class in order to be sure they will behave the same. .select .active, .select:focus { outline: none; /* this box-shadow property is not exactly required, however it's imperative to ensure active state is visible, especially to keyboard users, that we use it as a default value. */ box-shadow: 0 0 3px 1px #227755; } now, let's handle the list o...
Dealing with files - Learn web development
we need to tell the html where the image is. the image is inside the images directory, which is in the same directory as index.html. to walk down the file structure from index.html to our image, the file path we'd need is images/your-image-filename. for example, our image is called firefox-icon.png, so the file path is images/firefox-icon.png. insert the file path into your html code between the double quote marks of the src="" code. save your html file, then load it in your web browser (double-click the file). you should see your new webpage displaying your image! some general rules for file paths: to link to a target file in the same directory as the invoking html file, just use the filename, e.g. my-image.jpg. to reference a file in a subdirectory, write the directory name in front...
The web and web standards - Learn web development
o through the learning material presented here, you'll start to learn how this is made possible with some very clever design and implementation work. being a web developer is good the web industry is a very attractive market to enter if you are looking for a job. recent published figures say that there are currently around 19 million web developers in the world, and that figure is set more than double in the next decade. and at the same time, there is a skill shortage in the industry — so what better time to learn web development? it isn't all fun and games however — building web sites is a more complicated proposition than it used to be, and you'll have to put some time in to studying all the different technologies you need to use, all the techniques and best practices you need to know, ...
From object to iframe — other embedding technologies - Learn web development
do this, all the additional bandwidth would start to cost mozilla a lot of money. only embed when necessary sometimes it makes sense to embed third-party content — like youtube videos and maps — but you can save yourself a lot of headaches if you only embed third-party content when completely necessary. a good rule of thumb for web security is "you can never be too cautious. if you made it, double-check it anyway. if someone else made it, assume it's dangerous until proven otherwise." besides security, you should also be aware of intellectual property issues. most content is copyrighted, offline and online, even content you might not expect (for example, most images on wikimedia commons). never display content on your webpage unless you own it or the owners have given you written, unequi...
Index - Learn web development
and navigating to the html file. there are many ways to achieve this. 21 how do you upload your files to a web server? beginner, ftp, github, uploading, webmechanics, hosting, rsync, sftp if you have built a simple web page (see html basics for an example), you will probably w...
Introduction to events - Learn web development
the color changes when the button is focused and unfocused; try pressing the tab to focus on the button and press the tab again to focus away from the button. these are often used to display information about filling in form fields when they are focused, or displaying an error message if a form field is filled with an incorrect value. btn.ondblclick — the color changes only when the button is double-clicked. window.onkeypress, window.onkeydown, window.onkeyup — the color changes when a key is pressed on the keyboard. the keypress event refers to a general press (button down and then up), while keydown and keyup refer to just the key down and key up parts of the keystroke, respectively. note: it doesn't work if you try to register this event handler on the button itself — we've had to re...
Basic math in JavaScript — numbers and operators - Learn web development
ed to know now. types of numbers in programming, even the humble decimal number system that we all know so well is more complicated than you might think. we use different terms to describe different types of decimal numbers, for example: integers are whole numbers, e.g. 10, 400, or -5. floating point numbers (floats) have decimal points and decimal places, for example 12.5, and 56.7786543. doubles are a specific type of floating point number that have greater precision than standard floating point numbers (meaning that they are accurate to a greater number of decimal places). we even have different types of number systems! decimal is base 10 (meaning it uses 0–9 in each column), but we also have things like: binary — the lowest level language of computers; 0s and 1s. octal — b...
Storing the information you need — Variables - Learn web development
ke 30 (also called integers) or decimal numbers like 2.456 (also called floats or floating point numbers). you don't need to declare variable types in javascript, unlike some other programming languages. when you give a variable a number value, you don't include quotes: let myage = 17; strings strings are pieces of text. when you give a variable a string value, you need to wrap it in single or double quote marks; otherwise, javascript tries to interpret it as another variable name. let dolphingoodbye = 'so long and thanks for all the fish'; booleans booleans are true/false values — they can have two values, true or false. these are generally used to test a condition, after which code is run as appropriate. so for example, a simple case would be: let iamalive = true; whereas in reality ...
What is JavaScript? - Learn web development
o your javascript code that will be ignored by the browser, and exist simply to provide instructions to your fellow developers on how the code works (and you, if you come back to your code after six months and can't remember what you did). comments are very useful, and you should use them often, particularly for larger applications. there are two types: a single line comment is written after a double forward slash (//), e.g. // i am a comment a multi-line comment is written between the strings /* and */, e.g. /* i am also a comment */ so for example, we could annotate our last demo's javascript with comments like so: // function: creates a new paragraph and appends it to the bottom of the html body. function createparagraph() { let para = document.createelement('p'); para...
Solve common problems in your JavaScript code - Learn web development
in web development? how do you do basic math in javascript? what is operator precedence, and how is it handled in javascript? how do you increment and decrement values in javascript? how do you compare values in javascript? (e.g. to see which one is bigger, or to see if one value is equal to another). ...
Working with JSON - Learn web development
tity": "jane wilson", "powers": [ "million tonne punch", "damage resistance", "superhuman reflexes" ] } ] the above is perfectly valid json. you'd just have to access array items (in its parsed version) by starting with an array index, for example [0]["powers"][0]. other notes json is purely a data format — it contains only properties, no methods. json requires double quotes to be used around strings and property names. single quotes are not valid. even a single misplaced comma or colon can cause a json file to go wrong, and not work. you should be careful to validate any data you are attempting to use (although computer-generated json is less likely to include errors, as long as the generator program is working correctly). you can validate json using an appl...
Client-Server Overview - Learn web development
els, which are python classes that define the fields to be stored in the underlying database. if we have a model named team with a field of "team_type" then we can use a simple query syntax to get back all teams that have a particular type. the example below gets a list of all teams that have the exact (case sensitive) team_type of "junior" — note the format: field name (team_type) followed by double underscore, and then the type of match to use (in this case exact). there are many other types of matches and we can daisy chain them. we can also control the order and the number of results returned. #best/views.py from django.shortcuts import render from .models import team def junior(request): list_teams = team.objects.filter(team_type__exact="junior") context = {'list': list_tea...
Ember interactivity: Events, classes and state - Learn web development
pture the keydown event via the on modifier, which is just ember syntactic sugar around addeventlistener and removeeventlistener (see this explanation if needed). add the new line shown below to your header.hbs file: <input class='new-todo' aria-label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double curly braces, which tells you it is part of ember's dynamic templating syntax. the first argument passed to on is the type of event to respond to (keydown), and the last argument is the event handler — the code that will run in response to the keydown event firing. as you may expect from dealing with vanilla javascript objects, the this keyword refers to the "context" or "scope" of the componen...
Framework main features - Learn web development
/header> handlebars the handlebars templating language is not specific to ember applications, but it is heavily utilized in ember apps. handlebars code resembles html, but it has the option of pulling data in from elsewhere. this data can be used influence the html that an application ultimately builds. like jsx, handlebars uses curly braces to inject the value of a variable. handlebars uses a double-pair of curly braces, instead of a single pair. given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the oth...
Working with Svelte stores - Learn web development
it's just a literal javascript object being passed as a parameter to the fly transition. try your app out again — you'll see that the notifications now look a bit more appealing. note: being a compiler allows svelte to optimize the size of our bundle by excluding features that are not used. in this case, if we compile our app for product...
Implementing feature detection - Learn web development
lement() and then check if a method exists on it. if it does, check what value it returns. see dive into html5 video formats detection test. property on element retains value create an element in memory using document.createelement(), set a property to a certain value, then check to see if the value is retained. see dive into html5 <input> types detection test. note: the double not in the above example (!!) is a way to force a return value to become a "proper" boolean value, rather than a truthy/falsy value that may skew the results. the dive into html5 detecting html5 features page has a lot more useful feature detection tests besides the ones listed above, and you can generally find a feature detection test for most things by searching for "detect support for your-f...
Strategies for carrying out testing - Learn web development
ual hard disk now, vdi (virtual disk image), and dynamically allocated). choose the file location and size for the virtual hard disk (choose a sensible name and location to keep it, and for the size specify around 50gb, or as much as you are comfortable with specifying). now the new virtual box should appear in the left hand menu of the main virtual box ui window. at this point, you can double-click to open it — it will start to boot up the virtual machine, but it won't yet have the operating system (os) installed. at this point you need to point the dialog box at the installer image/disk, and it will run through the steps to install the os just like on a physical machine. important: you need to make sure you have the operating system image you want to install on the virtual mach...
Accessibility/LiveRegionDevGuide
event.detail1 is the start index while event.detail2 is the text string length. in iaccessible2, iaccessibletext::get_oldtext and iaccessibletext::get_newtext are used to acquire the text and offsets. filtering events text changed events certain web page mutation events, such as adding to a list, trigger both an object changed and a text changed event. both events should not be acted upon or double announcements would result. instead, all text changed events should be examined for the presence of an embed character. if one is present, the text changed event should be discarded because an object changed event will follow. filtering user actions this paragraph describes object properties and event naming schemes that are used to help an at determine if an event is an actual live region ev...
Accessible Toolkit Checklist
item, shift+space to select to current point or control+space to toggle selection of current item typing letter or several letters to navigate (similar to list support for this) shift+f10 or context menu key to bring up context menu for current item (on os x ctrl+space is used to bring up context menu). space bar toggles checkboxes the enter key should activate an item if double clicking would do so msaa support, including accessible selection, exposing current level and position in list, alternative text for informative or interactive images, selectable, multiselectable and extselectable states, statechange events for expanding/collapsing and toggling of checkbox children. note, you can use the accessible description to expose the current tree view level and posit...
Commenting IDL for better documentation
xxxxxxxxxx)] interface nsicookiemonster : nsicookiefan { // cookie flavor constants /** * simple sugar cookie. */ const integer cookie_flavor_sugar = 1; /** * chocolate chip cookie. */ const integer cookie_flavor_chocolate_chip = 2; /** * peanut butter cookie. */ const integer cookie_flavor_peanut_butter = 3; /** * chocolate cookie with chocolate chips. */ const integer cookie_flavor_double_chocolate = 4; /** * an unknown type of cookie. */ const integer cookie_flavor_other = 0; // yumminess constants /** * the cookie is disgusting. */ const integer cookie_not_yummy = 1; /** * the cookie is good but not awesome. */ const integer cookie_sort_of_yummy = 2; /** * the cookie is really, really yummy. */ const integer cookie_extremely_yummy = 3; /** * omg this is the best c...
SVG Guidelines
ay to combat this is to first run svg files through a linter such as svgo (see the tools section below). however, when authoring svgs by hand here are some best practices to help keep them lightweight. these rules are based on some real examples seen in mozilla's code. ...
Multiple Firefox profiles
to pop up each time you start firefox, so you can choose a profile, you will need to edit the "target" of the launch icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a "target" text field that you can edit, and it should show the current file path. after the closing quote, add -profilemanager. click ok. now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use. if you want individual icons to launch specific profiles, you will need to edit the "target" of each icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a "target" text field that you can edit, and it should show the cu...
Performance best practices for Firefox front-end engineers
tion of one or more nodes in the document will need to be updated, and then javascript asks for the size or position of anything. since everything is pending a reflow, the answer isn't available, so everything stalls until the reflow is complete and the script can be given an answer. flushing layout also means that styles must be flushed to calculate the most up-to-date state of things, so it's a double-whammy. here’s a simple example, cribbed from this blog post by paul rouget: div1.style.margin = "200px"; // line 1 var height1 = div1.clientheight; // line 2 div2.classlist.add("foobar"); // line 3 var height2 = div2.clientheight; // line 4 dosomething(height1, height2); // line 5 at line 1, we’re setting some style information on a dom node that’s going to resul...
CustomizableUI.jsm
ible with versions of firefox below 29, i.e. before customizableui was introduced, then you have to make sure that in case of running on newer browsers, xul overlay does not contain description of the button that you are creating with createwidget() method. otherwise, conflicting static xul overlay button and dynamic customizableui buttons might cause the created button to be unstable or create a double button. to avoid that, update your chrome manifest file with links to two different versions of xul overlay, using manifest flags. note: unlike button described with xul overlay, widget-button created via createwidget() method cannot have references to other overlay elements transferred directly as parameters. for example, if there is a need to create a button with dynamically assignable tooltip...
Following the Android Toasts Tutorial from a JNI Perspective
ded. in jni, there is the all-important property called sig. when something is declared, we are stating the sig and the name. the sig's will be represented as javascript strings in jni.jsm, and the sig's of the types are as follows: java type signature boolean z byte b char c class/object lclass name in slash notation here; double d float f int i long j short s void v array of type [sig here method format (sig of type of each argument here)sig of the return type here declaring a class/object is done in a special way. for example, if the class is blah.foo.bar then the signature of this will be this in slash notation with an l and ;...
SVN for Localizers
the appropriate mozilla svn repository by entering the following command: svn commit -m "minor modifications for firefox [version #] beta page for [your locale]" the svn commit command will commit your changes directly to the mozilla svn repositories. since you are writing to the repository here, you will be asked for your ldap login credentials. the -m parameter followed by some text within double quotes (") will be pushed along with your changes. within the double quotes you should briefly describe your changes so that everyone can see what you contributed. you can also double check your changes using the viewvc interface. after you commit your changes, wait 15 minutes and check the staging website for your locale. your recent changes should now be visible online. you will have the ch...
Mozilla Framework Based on Templates (MFBT)
useful "hook" for embeddings that must customize the types underlying the fixed-size integer types.) types.h includes standardinteger.h and further provides size_t. checkedint.h implements checked integers. they behave like integers, but safely check for integer overflow and divide-by-zero. useful for input validation. floatingpoint.h provides various operations for examining and working upon double-precision floating point values, and for producing various special floating point values. core types.h further provides macros to define imported and exported c symbols. attributes.h implements various function and class attribute macros. the function macros control inlining, note whether a function returns, and enforce various c++-related restrictions on inheritance and use. the class macros ...
Fonts for Mozilla's MathML engine
re relatively good mathml rendering. an enhancement request has been submitted to microsoft to install latin modern math and stix by default. os x install the latin modern math and stix fonts as follows: download latinmodern-math-1959.zip. extract the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. you will find a latinmodern-math font file. double-click the latinmodern-math font file click the "install the font" button from the window that opens. download stixv2.0.2.zip. open the zip archive, move inside the /stixv2.0.0/fonts/otf/ directory. you will find the stixmath-regular, stix-regular, stix-bold, stix-italic, stix-bolditalic font files. open the stixmath-regular font file and click the "install the font" button from the window that...
Fonts for Mozilla 2.0's MathML engine
stretchy operators. starting in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), mathjax fonts are used as the default fonts for mathematical text and symbol stretching. these fonts are freely available under the apache license. they are close to latex rendering and should look more familiar to scientists. mathjax fonts also improves support for mathvariant attribute (e.g. to write double-struck, script or fraktur text). all the fonts mentioned above may already be installed by default on your system or can easily be installed via your software manager. for convenience we provide a zip archive of mathml fonts. the fonts may be installed by extracting the font files (which have the .otf extension) from the zip archive, then following instructions for microsoft windows, or copying t...
MathML Accessibility in Mozilla
__________ the integral from 1 to x of times fraction d t over t end fraction __________ integral, subscript 1, superscript x, fraction stary, d t over t, end of fraction integral. subscript 1. superscript x. fraction start. d t over t. fraction end. torture test 17: ∬ d dx dy __________ double integral over cap d of d x d y __________ ∬, subscript d, dxdy webkit's bug 146505 double integral. subscript d. d x d y torture test 18: f ( x ) = { 1 / 3 if 0 ≤ x ≤ 1 ; 2 / 3 if 3 ≤ x ≤ 4 ; 0 elsewhere. __________ f of x is equal to left brace...
MathML Demo: <mfrac> - fractions
line ↑ sin ⁡ θ m ↑ the end. inline down arrows, text style, no line ↓ sin ⁡ θ m ↓ the end. inline floor, auto, normal line ⌊ sin ⁡ θ m ⌋ the end. inline ceiling, display style, normal line ⌈ sin ⁡ θ m ⌉ the end. inline updown arrows, text style, normal line ↕ sin ⁡ θ m ↕ the end. inline double up arrows, auto, thick line ⇑ sin ⁡ θ m ⇑ the end. inline double down arrows, display style, thick line ⇓ sin ⁡ θ m ⇓ the end. inline double up down arrows, text style, thick line ⇕ sin ⁡ θ m ⇕ the end. inline, styles auto, display and text 1 2 - 1 2 + 1.23456 7890 , the rendering should be script-size, normal-siz...
Mozilla Style System Documentation
the order determines which declarations override other declarations. (in css,declarations are the property-value pairs within style rules. in mozilla, nscssdeclaration objects correspond to css declaration-blocks.) due to the high similarity of these lists between elements in the content tree, mozilla stores the output of the selector matching process in a lexicographic tree, the rule tree. this double tree (style context tree and rule tree) allows for sharing of style data, which allows the data to take up less memory and allows the data computation to take less time. for example, suppose we had the css stylesheet: /* rule 1 */ doc { display: block; text-indent: 1em; } /* rule 2 */ title { display: block; font-size: 3em; } /* rule 3 */ para { display: block; } /* rule 4 */ [class="emph"] { ...
Gecko Profiler FAQ
es)? [mstange] hard to say. prefer to do comparisons by measuring your timings with code instead of by inspecting profiles. always keep in mind that profiler overhead has the potential to skew the results. is it better to profile across multiple platforms, or to focus time on windows (since that's the bulk of our users)? [mstange] in my opinion, as long as you double-check that the problems you find are actually present on windows, it doesn’t matter much what platform you find them on. [ehsan] that being said, we do see a lot of windows-specific issues that you will not find on other platforms, for example sometimes code calls into a windows api that requires loading a dll the first time you call it that takes 10s of milliseconds to finish, etc.
TimerFirings logging
.mozilla.org/repair/:7:13669 118 801266240[7f7c1f248000]: [7163] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 103 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] http://static.dynamicyield.com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_uuid=353d5460-19f6-4400-9bbd-d0fcc3bcf595&mt_3pck=http%3a//beacon-apac-hkg1.rubiconproject.com/beacon/t/d1f9921d-4e47-448f-b6ba-36cae1c31b65/&redirect=;ord=2744535504761193354?:83:0 94...
Floating Point Number to String Conversion
the header file prdtoa.h declares these functions. the functions are: pr_strtod pr_dtoa pr_cnvtf references gay's implementation is inspired by these two papers. [1] william d. clinger, "how to read floating point numbers accurately," proc. acm sigplan '90, pp. 92-101. [2] guy l. steele, jr. and jon l. white, "how to print floating-point numbers accurately," proc. ...
PL_HashTableAdd
h 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 does not free the value of the entry. pl_hashtableadd returns null if there is not enough memory to create a new entry. it doubles the number of buckets if the table is overloaded. ...
PRFloat64
the nspr floating-point type is always 64 bits. syntax #include <prtypes.h> typedef double prfloat64; ...
PR_cnvtf
ber to a string. syntax #include <prdtoa.h> void pr_cnvtf ( char *buf, printn bufsz, printn prcsn, prfloat64 fval); parameters the function has these parameters: buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. prcsn the number of digits of precision to which to generate the floating point value. fval the double-precision floating point number to be converted. description pr_cnvtf is a simpler interface to convert a floating point number to a string. it conforms to the ecma standard of javascript (ecmascript). on return, the result is written to the buffer pointed to by buf of size bufsz. ...
Index
-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 for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ... where: -g test-type sets status checking test type. pos...
NSS_3.12_release_notes.html
_objects_from_handles bug 415007: pk11_findcertfromdersubjectandnickname is dead code bug 416267: compiler warnings on solaris due to extra semicolon in sec_asn1_mksub bug 419763: logger thread should be joined on exit bug 424471: counter overflow in bltest bug 229335: remove certificates that expired in august 2004 from tree bug 346551: init secitem dertemp in crmf_encode_popoprivkey bug 395080: double backslash in sysdir filenames causes problems on os/2 bug 341371: certutil lacks a way to request a certificate with an existing key bug 382292: add support for camellia to cmd/symkeyutil bug 385642: add additional cert usage(s) for certutil's -v -u option bug 175741: strict aliasing bugs in mozilla/dbm bug 210584: cert_asciitoname doesn't accept all valid values bug 298540: vfychain usage option...
NSS 3.14.2 release notes
/bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been tested. bug 373108 - fixed a bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 - fixed a crash in dtls_freehandshakemessages. bug 823336 - reject invalid ldap aia uris sooner...
NSS 3.15.1 release notes
tlgenrandom function. bug 875601 - secmod_closeuserdb/secmod_openuserdb fails to reset the token delay, leading to spurious failures. bug 884072 - fix a typo in the header include guard macro of secmod.h. bug 876352 - certutil now warns if importing a pem file that contains a private key. bug 565296 - fix the bug that shlibsign exited with status 0 even though it failed. the nss_survive_double_bypass_failure build option is removed. bugs fixed in nss 3.15.1 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;classification=components;query_format=advanced;target_milestone=3.15.1;product=nss compatibility nss 3.15.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work w...
PKCS11 Implement
if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported. c_getinfo the nss calls c_getinfo on startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed when the user views the information. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslotlist the nss calls c_getslotlist on startup or when it loads a new module, requests all the module's slots, and keeps track of the list from that point on. the slots are expected to remain static: that is, the module never has more slots or fewer slots than ...
NSS tools : vfychain
rtificate 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 for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ... where: -g test-type sets status checking test type. possible values are "leaf" or "chain" -g test type sets status checking test type. possible values are "l...
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 responder, 11=any ca -v verbose mode. prints root cert subject(double the argument for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ... where: -g test-type sets status checking test type. pos...
The JavaScript Runtime
these types are implemented with the following java types and values: javascript fundamental type java type undefined a singleton object defined by context.getundefinedtype() null null boolean java.lang.boolean number java.lang.number, that is, any of java.lang.byte, java.lang.short, java.lang.integer, java.lang.float, or java.lang.double. not java.lang.long, since a double representation of a long may lose precision. string java.lang.charsequence (java.lang.string or org.mozilla.javascript.consstring) object org.mozilla.javascript.scriptable in addition, ecma refers to objects that implement [[call]] as functions. these object types are represented by implementing the function interface. since java...
64-bit Compatibility
:insimm() is always 32-bit. quad versus float internally, "quads" are 64-bit opaque values in nanojit. they can be either floating point values or integral values. to help form well-typed lir, there is a special opcode called lir_float which specifies that the associated constant value is definitely floating-point. tracemonkey uses this to decide whether arbitrary constants in lir are pointers or doubles. you should never use lirwriter::insimmq() to inject a floating point value. use lirwriter::insimmf() instead. mucking with native integers in lir the following opcodes can be used to safely load, modify, and compare native integers. for such opcodes there are two forms, an "undecorated" form which is 32-bit, and a form decorated with a "q" or "qi" that is 64-bit. to make it easier to generate p...
Bytecode Descriptions
jsop::int32. zero stack: ⇒ 0 push the number 0. one stack: ⇒ 1 push the number 1. int8 operands: (int8_t val) stack: ⇒ val push the int8_t immediate operand as an int32value. uint16 operands: (uint16_t val) stack: ⇒ val push the uint16_t immediate operand as an int32value. uint24 operands: (uint24_t val) stack: ⇒ val push the uint24_t immediate operand as an int32value. double operands: (double val) stack: ⇒ val push the 64-bit floating-point immediate operand as a doublevalue. if the operand is a nan, it must be the canonical nan (see js::detail::canonicalizenan). bigint operands: (uint32_t bigintindex) stack: ⇒ bigint push the bigint constant script->getbigint(bigintindex). string operands: (uint32_t atomindex) stack: ⇒ string push the string constant sc...
Introduction to the JavaScript shell
n'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 things or one of 'object', 'double', 'string', 'function', '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 i...
JIT Optimization Outcomes
ct being accessed has indexed properties that are exotic (for example, defined as a property on a prototype object and left as a hole in the underlying object). arraybadflags the array being accessed may have flags that the optimization strategy cannot handle. for example, if the array has sparse indexes, or has indexes that overflow the array's length, the optimization strategy may fail. arraydoubleconversion the type-system indicates that some arrays at this site should be converted to packed arrays of doubles while others should not. the optimization strategy fails for this condition. arrayrange could not accurately calculate the range attributes of an inline array creation. arrayseennegativeindex arrays at this element access location have seen negative indexes. typedobjectneutered ...
JS::Float32Value
to a js::value. ...
JS::Int32Value
to a js::value. ...
JSVAL_IS_GCTHING
s discouraged since it could be removed at any time. try to avoid using it. indicates whether a js value has a type that is subject to garbage collection. syntax jsval_is_gcthing(v) description jsval_is_gcthing(v) is true if the jsval v is either jsval_null or a reference to a value that is subject to garbage collection. javascript performs automatic garbage collection of objects, strings, and doubles. this macro exposes javascript engine implementation details and usually isn't what the application really means. see jsval for alternatives. see also bug 952650 ...
JSVAL_IS_NUMBER
avoid using it. determine if a given jsval is a javascript number. syntax jsval_is_number(v) description jsval_is_number(v) is true if v is a javascript number. to convert a numeric jsval to a c floating-point number, use js_valuetonumber. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer or double value. if (jsval_is_number(myitem)) { ... } see also bug 952650 ...
JSVAL_LOCK
ny time. try to avoid using it. locks a js value to prevent garbage collection on it. syntax jsval_lock(cx,v) description jsval_lock is a deprecated feature that is supported only for backward compatibility with existing applications. to lock a value, use local roots with js_addroot. jsval_lock locks a js value, v, to prevent the value from being garbage collected. v is a js object, string, or double value. jsval_lock determines if v is an object, string, or double value, and if it is, it locks the value. if locking is successful, or v already cannot be garbage collected because it is not an object, string, or double value, jsval_lock evaluates to true. otherwise, it evaluates to false. see also jsval_is_gcthing jsval_to_gcthing jsval_unlock js_addroot js_lockgcthing bug 787580 ...
JSVAL_UNLOCK
to avoid using it. unlocks a js value, enabling garbage collection on it. syntax jsval_unlock(cx,v) description jsval_unlock is a deprecated feature that is supported only for backward compatibility with existing applications. to unlock a value, use local roots with js_removeroot. jsval_unlock unlocks a previously locked js value, v, so it can be garbage collected. v is a js object, string, or double value. jsval_unlock determines if v is an object, string, or double value, and if it is, it unlocks the value. if unlocking is successful, or v not affected by garbage collection because it is not an object, string, or double value, jsval_unlock evaluates to true. otherwise, it evaluates to false. see also jsval_is_gcthing jsval_to_gcthing jsval_lock js_addroot js_lockgcthing bug 787580 ...
JS_ClearNewbornRoots
its use is discouraged since it could be removed at any time. try to avoid using it. clear a context's newborn roots, which temporarily protect newly allocated values from garbage collection. syntax void js_clearnewbornroots(jscontext *cx); name type description cx jscontext * the context to clear. description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context. these newborn roots help native code protect newly-created gc-things from gc invocations activated before those things can be rooted using local or global roots. however, the newborn roots can also entrain great gobs of garbage, so the js_gc entry ...
JS_DefineProperties
r each element in the array before the element with a null name field. each property is defined as though by calling js_defineproperties. ...
JS_DumpNamedRoots
_dumpnamedroots calls it, it passes three arguments: argument type description name const char * the name of the named root. rp void * a pointer to the rooted variable, array element, or field. this is the pointer that the application passed to js_addnamedroot. it points to a variable, array element, or field of type jsval, jsobject *, jsstring *, or jsdouble *. data void * the data argument that the application passed to js_dumpnamedroots. example static void dumproot(const char *name, void *addr, void *data) { /* the application may use `data` for anything. in this example, we use it to pass the desired output file. */ file *f = (file *) data; fprintf(f, "there is a root named '%s' at %p\n", name, addr); } ...
JS_FileEscapedString
this article covers features introduced in spidermonkey 1.8.5 write string into file with escaping. syntax bool js_fileescapedstring(file *fp, jsstring *str, char quote); name type description fp file * a file pointer to write into. str jsstring * a string to write into the file. quote char one of 0, single quote, and double quote. description js_fileescapedstring writes str into file fp escaping any non-printable or non-ascii character. if quote is not 0, it must be a single or double quote character that will quote the output. if successful, js_fileescapedstring returns true, otherwise false. see also mxr id search for js_fileescapedstring bug 609440 ...
JS_LockGCThing
text. 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 applications. use js_addroot and js_removeroot instead. see also bug 734250 - removed *rt functions bug 706885 ...
JS_LooselyEqual
_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_strictlyequal js_samevalue ...
JS_MapGCRoots
p_gcroot_stop. to continue mapping, return js_map_gcroot_next. these constants are flags; you can or them together. this function acquires and releases rt's gc lock around the mapping of the roots table, so the map function should run to completion in as few cycles as possible. the map function cannot call js_gc, js_maybegc, js_beginrequest, or any js api entry point that acquires locks, without double-tripping or deadlocking on the gc lock. js_mapgcroots returns the count of roots that were successfully mapped. see also bug 803907 ...
JS_NewDateObjectMsec
this article covers features introduced in spidermonkey 1.8.5 creates a new date object instance, configured to represent the date and time indicated by the specified time in milliseconds since the unix epoch. 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. description the returned jsobject is a standard javascript date. see also mxr id search for js_newdateobjectmsec js_newdateobject js_objectisdate bug 625870 ...
JS_NewNumberValue
use js_numbervalue instead convert a c floating-point number of type jsdouble to a jsval. syntax jsbool js_newnumbervalue(jscontext *cx, jsdouble d, jsval *rval); name type description cx jscontext * the context in which to create the new number. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. d jsdouble the numeric value to convert. rval jsval * out parameter. on success, *rval receives a javascript number with the value d. description js_newnumbervalue converts a c floating-point number of type jsdouble to jsval, the type of javascript values. the result is an integer jsval if d can be stored that way. otherwise, a new floating-point jsval is created. some space for ...
JS_RemoveRootRT
the runtime with which the root was registered. rp void * address of the pointer to no longer protect. this must have been passed to one of js_addroot, js_addnamedroot, or js_addnamedrootrt earlier. description js_removerootrt removes the gc thing that rp points to from the list of gc things that are protected from garbage collection. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or 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_addna...
JS_StrictlyEqual
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_looselyequal js_samevalue bug 1132045 -- use handle ...
JS_TracerInit
below, which the tracing apis will call each time a pointer is found from one gc thing to another. callback syntax typedef void (*jstracecallback)(jstracer *trc, void *thing, uint32 kind); name type description trc jstracer * the tracer visiting obj. thing void * a gc thing. kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind. in the latter case, the only operations the callback may perform on thing are to call js_tracechildren or the debug-only js_printtracethinginfo function. description js_tracechildren and other tracing apis call the tracer callback for each traceable thing directly referenced by a particular object or runt...
JS_ValueToNumber
obsolete since jsapi 24this 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. replaced by js::tonumber. convert any javascript value to a floating-point number of type jsdouble. syntax jsbool js_valuetonumber(jscontext *cx, jsval v, jsdouble *dp); 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. dp jsdouble * out parameter. on success, *dp receives the converted floating-point value. description js_valuetonumber converts a javascript value to a number. it imp...
SpiderMonkey 1.8.8
aders also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint8, int8, uint16, int16, uint32, int32, uint64, int64 uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t mozilla/stdint.h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types. the file must conform to the ...
SpiderMonkey 1.8
1.13.1. in certain cases, the javascript engine no longer calls jsclass.resolve callbacks repeatedly, as it did in previous versions. specifically, if a property lookup first calls a resolve hook which does not define the property, then finds the property on a prototype, that result can be cached. future lookups for the same property on the same sort of object may bypass the resolve hook. js_newdouble is now deprecated. use js_newdoublevalue. the security apis js_setcheckobjectaccesscallback, js_setprincipalstranscoder, and js_setobjectprincipalsfinder are still present but are deprecated in this release. in spidermonkey 1.8.1 they will be removed and replaced with a new set of apis (js_getsecuritycallbacks and friends, bug 451729). js.mak, an old windows-specific nmake file, has been delete...
SpiderMonkey 17
aders also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint8, int8, uint16, int16, uint32, int32, uint64, int64 uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t mozilla/stdint.h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types. the file must conform to the ...
WebReplayRoadmap
the types in an app that is being converted to use flow or typescript. type profiling (not yet implemented) the types that appear in practice have a large effect on how well the associated code can be optimized by jits. while different jits optimize code in different ways, for peak performance they all require code to operate on values of consistent types: primitive types, including int32 vs. doubles, or objects that have the same set of properties. if js performance is a bottleneck, recordings can be analyzed for code regions that are both very hot and have inconsistent types. these are good candidates for optimization, and as with static type integration above, points where unexpected types appear can be seeked to in the debugger for investigation. memory analysis (not yet implemented) ...
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
re are %d elements.\n", count); } // using nsimutablearray, so callee may modify void tweakarray(nsimutablearray* elements) { elements->removeelementat(0); elements->appendelement(newelement, pr_false); } while it is usually possible to call queryinterface on an nsiarray to get access to the nsimutablearray interface, this is against convention and it should be avoided. // no need for the double-pointer, and this violates xpcom rules // which expect acess to a new object void tweakarray(nsimutablearray** elements) { // ugh, extra indirection! *elements->removeelementat(0); *elements->appendelement(newelement, pr_false); } in-place enumeration when accessing all members of an nsiarray, in-place enumeration is preferred over indexed access. however, i seem to have forgotten to imp...
Avoiding leaks in JavaScript XPCOM components
tion() { return (private_data += 1); } result[1] = function() { return (private_data *= 2); } return result; } // this function returns the string "results: 1, 2, 4, 0, 5, 1, 10." function test() { var fns1 = function_array(); var fns2 = function_array(); return "results: " + fns1[0]() + ", " + // increments first private_data to 1 fns1[1]() + ", " + // doubles first private_data to 2 fns1[1]() + ", " + // doubles first private_data to 4 fns2[1]() + ", " + // doubles second private_data to 0 fns1[0]() + ", " + // increments first private_data to 5 fns2[0]() + ", " + // increments second private_data to 1 fns1[1]() + "."; // doubles first private_data to 10 } this shows that clos...
Detailed XPCOM hashtable guide
ldhash.h if you intend to use pldhash. the c++ wrappers for pldhash (see below) are often much easier and safer to use in c++ code, as many potential casting errors are easily avoided. you must declare an entry struct type, deriving from pldhashentryhdr. this entry struct should contain whatever data you wish to store in the hashtable (any pointer or fixed-length data type). note: because of the double-hashing implementation, entries may move in memory when the hashtable is altered. if you need entry pointers to remain constant, you may want to consider using plhashtable instead. you must also initialize a pldhashtableops structure. this serves similarly to a vtable in c++, with pointers to appropriate user-defined functions that initialize, compare, and match entries. because pldhash does not...
XPConnect wrappers
if you've implemented some component with an interface nsifoo and you pass your javascript object into a c++ function taking an nsifoo, an xpcwrappedjs is created around your object. c++ calls are routed through xpcwrappedjs code into your javascript implementation. these wrappers are created by xpconnect, so you should not have to worry about how to construct them or whether to construct them. double wrapping. there is one case where an xpcwrappednative wraps another wrapper object. this case is where a js object was passed in via some idl-declared interface, creating an xpcwrappedjs, and is now being returned to javascript via some other interface. in order to preserve api compatibility, an xpcwrappednative is created around the xpcwrappedjs. security wrappers exposed to chrome to learn ab...
XPCshell Test Manifest Expressions
ons to tests in order to control when tests get run. the conditions accept a simple boolean expression syntax, described here. operators in order of decreasing precedence: () == != && || literal values booleans: the literal strings true and false. integers: a series of contiguous digits. only decimal integers are supported. strings: any series of characters enclosed in double quotes " or single quotes '. no escape sequences are supported. variables variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by writemozinfo.py which writes mozinfo.json into the root of the build di...
NS_ConvertASCIItoUTF16
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
NS_ConvertUTF16toUTF8
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
NS_ConvertUTF8toUTF16
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
NS_LossyConvertUTF16toASCII
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsAdoptingCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsAdoptingString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsAutoString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsCAutoString
void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* ...
nsCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsDependentCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsDependentString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsFixedCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsFixedString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsPromiseFlatCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsPromiseFlatString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
nsXPIDLCString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source ...
nsXPIDLString
int32 ainteger print32 aradix void appendint(pruint32, print32) - source append the given unsigned integer to this string parameters pruint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunicha...
XPCOM glue classes
stringthe nsacstring abstract class represents a character string composed of single-byte storage units. this class is typically used to represent ascii or utf-8 character arrays.nsacstring (external)class declarationnsacstring_internalclass declarationnsadoptingcstringclass declarationnsadoptingstringclass declarationnsastringthe nsastring abstract class represents a character string composed of double-byte storage units. this class is typically used to represent unicode character arrays.nsastring (external)class declarationnsastring_internalclass declarationnsautorefnsautoref<t> is a template class implementing an object that holds a handle to a resource that must be released, typically on destruction of the object.</t>nsautoreftraitsnsautoreftraits<t> is a template class describing traits of ...
IAccessibleValue
od overview [propget] hresult currentvalue([out] variant currentvalue ); [propget] hresult maximumvalue([out] variant maximumvalue ); [propget] hresult minimumvalue([out] variant minimumvalue ); hresult setcurrentvalue([in] variant value ); methods currentvalue() returns the value of this object as a number. the exact return type is implementation dependent. typical types are long and double. [propget] hresult currentvalue( [out] variant currentvalue ); parameters currentvalue returns the current value represented by this object. see the section about. return value s_false if there is nothing to return, [out] value is null. s_ok. maximumvalue() returns the maximal value that can be represented by this object. the type of the returned value is implementation dependent. it does no...
nsIAccessibleValue
accessible/public/nsiaccessiblevalue.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean setcurrentvalue(in double value); obsolete since gecko 1.9 attributes attribute type description currentvalue double maximumvalue double read only. minimumincrement double read only. minimumvalue double read only. methods setcurrentvalue() obsolete since gecko 1.9 (firefox 3) return a success condition of the value getting set. that is if the value is within the range of minimumvalue - maximumvalue. boolean setcurrentvalue( in double value ); parameters value new value for current value. return value true if the value is within the range of minimumvalue...
nsIDOMXPathResult
(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value. read only. invaliditeratorstate boolean true if the iterator state has become invalid. for example, modifying a node invalidates the iterator. read only. numbervalue double if resulttype is number_type, the numeric value of the xpath value. read only. resulttype unsigned short the type of result; can be any of the type constants except any_type. read only. singlenodevalue nsidomnode if resulttype is any_unordered_node_type or first_ordered_node_type, a single dom node. read only. snapshotlength unsigned long if resultt...
nsIDeviceMotionData
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). attributes attribute type description type unsigned long the type of motion data reported by this object; see motion type constants for possible values. read only. x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. constants motion type constants constant value description type_acceleration...
nsIDownload
boolean indicates if the download can be resumed after being paused or not. this is only the case if the download is over http/1.1 or ftp and if the server supports it. read only. size long long the total size of the file in bytes, or ll_maxuint if the file's size is unknown. read only. source nsiuri the source uri of the download. read only. speed double the downloads transfer speed in bytes per second. read only. starttime long long the time at which the transfer was started. read only. state short the downloads current state. see nsidownloadmanager.constants. read only. target nsiuri the target of the transfer. read only. targetfile nsilocalfile indicates the location at which t...
data
...
toString
...
nsITelemetry
ring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyed...
XPCOM Interface Reference
msservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisupportspruint32nsisupportspruint64nsisupportsprimitivensisupportsprioritynsisupportsstringnsisupportsvoidnsisupportsweakreferencensisyncjpakensisyncmessagesendernsitxttohtmlconvnsitaggingservicensitaskbarpreviewnsit...
XPCOM primitive
pports-print64;1 [scriptable, uuid(e3cb0ff0-4a1c-11d3-9890-006008962422)] interface nsisupportsprint64 : nsisupportsprimitive { attribute print64 data; string tostring(); }; float nsisupportsfloat @mozilla.org/supports-float;1 [scriptable, uuid(abeaa390-4ac0-11d3-baea-00805f8a5dd7)] interface nsisupportsfloat : nsisupportsprimitive { attribute float data; string tostring(); }; double nsisupportsdouble @mozilla.org/supports-double;1 [scriptable, uuid(b32523a0-4ac0-11d3-baea-00805f8a5dd7)] interface nsisupportsdouble : nsisupportsprimitive { attribute double data; string tostring(); }; voidptr nsisupportsvoid @mozilla.org/supports-void;1 [scriptable, uuid(464484f0-568d-11d3-baf8-00805f8a5dd7)] interface nsisupportsvoid : nsisupportsprimitive { [noscript] attribute...
XPCOM Interface Reference by grouping
nsifeedresult nsifeedresultlistener nsifeedtextconstruct script mozijssubscriptloader storage mozistoragevacuumparticipant util nsieffectivetldservice worker nsiabstractworker data nsiarray nsicategorymanager nsicollection nsidictionary nsimutablearray nsisimpleenumerator nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprimitive nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference ...
Troubleshooting XPCOM components registration
, etc.). if you are compiling your own firefox (or xulrunner, etc.), use the artifacts from that compilation to build your component. if you are testing a build from your linux distribution (or other vendor-supplied build), look for -dev packages from them. remember to check that the directory the component is in is named correctly i.e. $profile/extensions/$plugindirectory/components! double check your guids in your install.rdf with your sourcecode, and then check them again. windows-specific hints use dependency walker to check that your dependent libraries are loaded correctly. in dependency walker, open the options menu and select configure module search order.... in the bottom right corner of the new dialog, click browse... and select the directory firefox.exe...
Mail and RDF
datasource as a content observer. notification: folder data changes. folder notifies mail session that it's data changed. mail session notifies folder listeners that the folder has changed. folder datasource notifies rdf content observers of the changes. content observers update ui. an aside: rational behind the design after reviewing this design, it might seem unnecessary to have the double-levels of notification/registration. why can't folders directly notify the rdf content observers when things change? here is the rational behind this design: it keeps all rdf datasource-related code in one place and out of the messages and folders themselves. this allows the mail code to be mostly free of rdf. the actual dependancies on rdf are small, so it makes sense to keep rdf out of fold...
The libmime module
--- mimemultipart (abstract) | | | | | |--- mimemultipartmixed | | | | | |--- mimemultipartdigest | | | | | |--- mimemultipartparallel | | | | | |--- mimemultipartalternative | | | | | |--- mimemultipartrelated | | | | | |--- mimemultipartappledouble | | | | | |--- mimesunattachment | | | | | |--- mimemultipartsigned (abstract) | | | |--- mimemessage | | | |--- mimeuntypedtext | |--- mimeleaf (abstract) | | | |--- mimeinlinetext (abstract) | | | | | |--- mimeinlinetextplain | | | | ...
Thunderbird Configuration Files
ricks mentioned on this site can be applied by using the built-in config editor. to access the config editor, go to tools > options or do thunderbird > preferences. if you are on mac os x, and on linux do edit > preferences on, select the advanced options panel, click on the general tab, and click on config editor. this will display a list of used preferences, as well as a search bar at the top. double-click on a preference to change its value. to do add a new preference, open the context menu (right-click) on any existing preference, go to the new menu, and select the type of preference. some preferences may require that you restart thunderbird in order to take effect. configuration files some tips and tricks require that you edit configuration files manually. there are three files you shou...
Adding items to the Folder Pane
first, our "numbers" container looks like this: let containerrow = { _numbers: 3, id: "numbers-main-container", text: "numbers", level: 0, open: false, _children: null, get children() { if (!this._children) { this._children = []; ...
Use SQLite
if you'd like to use an sqlite database in your extension you'll need to look over the storage docs for an api reference, however this code should get you started. be careful of multi-thread access to your database. this will create an sqlite db named tbird.sqlite inside your profile directory with a table called attachments. you can see the schema for the attachments table in the code. to double check the information you've inserted you can query the tbird.sqlite file using regular sqlite programs. const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \...
Theme Packaging
icon.png chrome/ browser/files communicator/files global/files mozapps/files ... you must have a top-level chrome.manifest file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the appearance section of the add-ons manager. preview.png is a preview image which will show when double-clicked on a theme in the appearance section of the add-ons manager. it can be any size. icon.png is a 32x32 (max. 48x48) png (may contain alpha transparency) which will show up in the appearance section of the add-ons manager. install.rdf your install.rdf manifest will look something like this: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="ht...
Declaring and Calling Functions
ich converts a time structure into a string. const asctime = lib.declare("asctime", ctypes.default_abi, ctypes.char.ptr, struct_tm.ptr); for a more complete version of this example (including the implementation of the struct_tm type), see the structures example. returned values if the return type can fit into a javascript number without loss (that is, it's a number 32 bits or smaller, or is a double or float), then the function just return a javascript number. for everything else it returns a ctypes object representing the return value (including 64-bit integers). ...
Using js-ctypes
be used. the below will do the same as standardalert from above, it will use the core foundation function of cfusernotificationdisplaynotice. ...
ctypes
rts to a uint64 javascript object on all platforms, since it's unknown whether this is a 32-bit or 64-bit value. this is done for compatibility's sake. long_long a integer type at least 64 bits wide. unsigned_long_long an unsigned integer type at least 64 bits wide. float a floating point value that behaves like the float type on the platform. double a double-precision floating point value that behaves like the double type on the platform. character types character types are 8-bit values that behave like their c counterparts. they're similar to the int8_t and uint8_t types, except conversion is handled differently. for example, ctypes.char.array(30)(str) converts the string str to utf-8 and returns a new cdata object of array type...
Pretty-print a minified file - Firefox Developer Tools
tom of the source pane. the debugger formats the source and displays it as a new file with a name like: "{ } [original-name]". after you click the icon, the source code looks like this: the pretty print source icon is available only if the source file is minified (i.e., not an original file), and is not already "prettified". note: if you want to prettify some inline javascript code, just double click the code in the inspector pane. ...
Migrating from Firebug - Firefox Developer Tools
the context menu. additionally, the devtools allow to display the creation date of a cookie as well as when it was last accessed and whether it is host-only. edit cookies to edit a cookie in firebug you have to right-click the cookie and choose edit from the context menu. then a dialog pops up allowing you to edit the data of the cookie and save it. inside the storage inspector you just have to double-click the data you want to edit. then an inline editor allows you to edit the value. delete cookies firebug's cookies panel allows you to delete all cookies of a website via the menu option cookies > remove cookies or by pressing ctrl+shift+o. it also allows you to only remove session cookies via cookies > remove session cookies and to remove single cookies by right-clicking them and choosing d...
Network request list - Firefox Developer Tools
ext menu. a reset columns command is available on the context menu to reset the columns to their initial configuration. you can also change the width of the columns to help make the information you are looking for easier to view. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets the width of the columns to the default values. clicking the column header label sorts the request list by that column. you can reset the sort to the default by selecting "reset sorting" from the context menu. here is a list of all available columns: ...
Edit Shape Paths in CSS - Firefox Developer Tools
op, right, bottom, and left offset values. polygon() if the value of shape-outside is polygon() then you are using the polygon basic shape. this is the most complex of the basic shape values, therefore the tool gives you more options when editing these: clicking on the shapes icon will activate the shapes path editor and give you the option to move any of the points of your polygon shape. double-click anywhere on a line of the shape and you will get a new point to adjust. double click on an existing point and it will be removed. remember that a polygon needs at least three points. moving and scaling shapes there is extra functionality available on the shape highlight — if you ctrl/cmd + click on the shapes icon for your shape the highlight will change, instead providing the abili...
Examine and edit HTML - Firefox Developer Tools
udo-class) active set the :active css pseudo-class. (change pseudo-class) focus set the :focus css pseudo-class. (change pseudo-class) focus-within set the :focus-within css pseudo-class. (change pseudo-class) visited set the :visited css pseudo-class. editing html you can edit the html — tags, attributes, and content — directly in the html pane: double-click the text you want to edit, change it, and press enter to see the changes reflected immediately. to edit an element's outerhtml, activate the element's popup menu and select "edit as html". you'll see a text box in the html pane: you can add any html in here: changing the element's tag, changing existing elements, or adding new ones. once you click outside the box, the changes are applied ...
Cookies - Firefox Developer Tools
d. created — date and time when the cookie was created. hostonly — is this cookie a domain cookie? that is, the domain value matches exactly the domain of the current website. note: some of the columns are not shown by default — to change the column display, right-click on the existing table headings and use the resulting context menu to show/hide the columns. you can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want. context menu the context menu for each cookie includes the following commands: add item - add a new cookie. delete <cookie name>.<domain> - deletes the selected cookie delete all from <domain> - de...
Local Storage / Session Storage - Firefox Developer Tools
when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table. you can edit local and session storage items by double-clicking inside cells in the table widget and editing the values they contain: you can delete local storage and session storage entries using the context menu: you can also delete local and session storage entries by selecting an item and pressing the delete or backspace key. finally, you can add new storage items by clicking the "plus" (+) button and then editing the resulting new row to the value you want. ...
Web Console UI Tour - Firefox Developer Tools
messages appear, both those generated by the code in the page, and those generated by the commands entered on the command line. see console messages for a lot more detail on what the messages can contain. note: you can clear the contents of the console by entering the keyboard command ctrl + shift + l (windows, macos, and linux) or cmd + k on macos. command line the command line starts with double angle brackets (>>). use it to enter javascript expressions. in firefox 71 onwards, there is a new "split pane" icon on the right hand side of the command line — clicking this will open the new console multi-line mode. ...
Accelerometer.x - Web APIs
Web › API › Accelerometer › x
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var xacceleration = accelerometer.x value a number. example acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Accelerometer.y - Web APIs
Web › API › Accelerometer › y
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var yacceleration = accelerometer.y value a number. example acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Accelerometer.z - Web APIs
Web › API › Accelerometer › z
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var zacceleration = accelerometer.z value a number. example acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Accelerometer - Web APIs
ugh the permissions api. if a feature policy blocks the use of a feature, it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. constructor accelerometer.accelerometer() creates a new accelerometer object. properties accelerometer.x read only returns a double containing the acceleration of the device along the device's x axis. accelerometer.y read only returns a double containing the acceleration of the device along the device's y axis. accelerometer.z read only returns a double containing the acceleration of the device along the device's z axis. example acceleration is typically read in the sensor.onreading event callback. in the example bel...
Animation.playbackRate - Web APIs
factor from the rate of change of the animation's timeline time values to the animation’s current time. the playback rate is initially 1. syntax var currentplaybackrate = animation.playbackrate; animation.playbackrate = newrate; value takes a number that can be 0, negative, or positive. negative values reverse the animation. the value is a scaling factor, so for example a value of 2 would double the playback rate. setting an animation’s playbackrate to 0 effectively pauses the animation (however, its playstate does not necessarily become paused). examples in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alic...
Animation.startTime - Web APIs
an animation’s start time is the time value of its documenttimeline when its target keyframeeffect is scheduled to begin playback. an animation’s start time is initially unresolved (meaning that it's null because it has no value). syntax var animationstartedwhen = animation.starttime; animation.starttime = newstarttime; value a floating-point number representing the current time in milliseconds, or null if no time is set. ...
AudioBuffer.duration - Web APIs
the duration property of the audiobuffer interface returns a double representing the duration, in seconds, of the pcm data stored in the buffer. syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.duration; value a double. example // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getc...
AudioBuffer - Web APIs
obuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per second, of the pcm data stored in the buffer. audiobuffer.length read only returns an integer representing the length, in sample-frames, of the pcm data stored in the buffer. audiobuffer.duration read only returns a double representing the duration, in seconds, of the pcm data stored in the buffer. audiobuffer.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 re...
AudioBufferSourceNode.playbackRate - Web APIs
ue indicating the playback rate of the audio as a decimal proportion of the original sampling rate. consider a sound buffer containing audio sampled at 44.1 khz (44,100 samples per second). let's see what a few values of playbackrate do: a playbackrate of 1.0 plays the audio at full speed, or 44,100 hz. a playbackrate of 0.5 plays the audio at half speed, or 22,050 hz. a playbackrate of 2.0 doubles the audio's playback rate to 88,200 hz. 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 the playbackrate property value on the fly. you can run the example live (or view the source.) play the song an...
AudioContext() - Web APIs
w audiocontext(); var audioctx = new audiocontext(options); parameters options optional an object based on the audiocontextoptions dictionary that contains zero or more optional properties to configure the new context. available properties are as follows: latencyhint optional the type of playback that the context will be used 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 ...
AudioContext.baseLatency - Web APIs
the baselatency read-only property of the audiocontext interface returns a double that represents the number of seconds of processing latency incurred by the audiocontext passing an audio buffer from the audiodestinationnode — i.e. the end of the audio graph — into the host system's audio subsystem ready for playing. note: you can request a certain latency during construction time with the latencyhint option, but the browser may ignore the option. syntax var baselatency = audioctx.baselatency; value a double representing the base latency in seconds. example // default latency ("interactive") const audioctx1 = new audiocontext(); console.log(audioctx1.baselatency); // 0.00 // higher latency ("playback") const audioctx2 = new audiocontext({ latencyhint: 'playback' }); console.log(au...
AudioContext.outputLatency - Web APIs
rent audio context. this is the time, in seconds, between the browser passing an audio buffer out of an audio graph over to the host system's audio subsystem to play, and the time at which the first sample in the buffer is actually processed by the audio output device. it varies depending on the platform and the available hardware. syntax var outputlatency = audioctx.outputlatency; value a double representing the output latency in seconds. example const audioctx = new audiocontext(); console.log(audioctx.outputlatency); specifications specification status comment web audio apithe definition of 'outputlatency' in that specification. working draft ...
AudioContextOptions - Web APIs
the audiocontextoptions dictionary is used to specify configuration options when constructing a new audiocontext object to represent a graph of web audio nodes. it is only used when calling the audiocontext() constructor. properties latencyhint optional the type of playback that the context will be used 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 spe...
AudioListener - Web APIs
of each other. the default is 0. methods audiolistener.setorientation() sets the orientation of the listener. audiolistener.setposition() sets the position of the listener. note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari. deprecated features audiolistener.dopplerfactor a double value representing the amount of pitch shift to use when rendering a doppler effect. audiolistener.speedofsound is a double value representing the speed of sound, in meters per second. in a previous version of the specification, the dopplerfactor and speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected d...
AudioParam.cancelAndHoldAtTime() - Web APIs
the cancelandholdattime() property of the audioparam interface cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods. syntax var audioparam = audioparam.cancelandholdattime(canceltime) parameters canceltime a double representing the time (in seconds) after the audiocontext was first created after which all scheduled changes will be cancelled. return value a reference to the audioparam it was called on. specifications specification status comment web audio apithe definition of 'cancelandholdattime()' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd l...
AudioParam.cancelScheduledValues() - Web APIs
returns a reference to this audioparam object. in some older implementations this method returns void. ...
AudioParam.exponentialRampToValueAtTime() - Web APIs
given in the endtime parameter. note: exponential ramps are considered more useful when changing frequencies or playback rates than linear ramps because of the way the human ear works. syntax var audioparam = audioparam.exponentialramptovalueattime(value, endtime) parameters value a floating point number representing the value the audioparam will ramp to by the given time. endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop. returns a reference to this audioparam object. in some browsers older implementations of this interface return void. examples in this example, we have a media source with two control buttons (see the audio-param repo for the source code, or view the example live.) when these buttons ar...
AudioParam.linearRampToValueAtTime() - Web APIs
e 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. 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. endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop. returns a reference to this audioparam object. in some browsers older implementations of this interface return void. example in this example, we have a media source with two control buttons (see the audio-param repo for the source code, or view the example live.) when these buttons ...
AudioParam.setValueAtTime() - Web APIs
ethod of the audioparam interface schedules an instant change to the audioparam value at a precise time, as measured against audiocontext.currenttime. the new value is given in the value parameter. syntax var audioparam = audioparam.setvalueattime(value, starttime) parameters value a floating point number representing the value the audioparam will change to at the given time. starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen. a typeerror is thrown if this value is negative. returns a reference to this audioparam object. in some browsers older implementations of this interface return void. examples this simple example features a media element source with two control buttons (see our webaudio-examples r...
AudioParam.setValueCurveAtTime() - Web APIs
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 time (in seconds) over which the parameter's value will change following the specified curve. the specified values are spaced equally along this duration. r...
AudioParam.value - Web APIs
Web › API › AudioParam › value
= 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 = new audiobuffersourcenode(...); const 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 converte...
AudioProcessingEvent - Web APIs
t. property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? playbacktime read only double the time when the audio will be played, as defined by the time of audiocontext.currenttime inputbuffer read only audiobuffer the buffer containing the input audio data to be processed. the number of channels is defined as a parameter, numberofinputchannels, of the factory method audiocontext.createscriptprocessor(). note the the returned audiobuffer is only valid in the scope o...
AudioWorkletGlobalScope - Web APIs
riables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes. properties currentframe read only returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. it is incremented by 128 (the size of a render quantum) after the processing of each audio block. currenttime read only returns a double that represents the ever-increasing context time of the audio block being processed. it is equal to the currenttime property of the baseaudiocontext the worklet belongs to. samplerate read only returns a float that represents the sample rate of the associated baseaudiocontext. methods registerprocessor() registers a class derived from the audioworkletprocessor interface. the class can th...
BaseAudioContext.currentTime - Web APIs
it starts at 0. syntax var curtime = baseaudiocontext.currenttime; example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // older webkit/blink browsers require a prefix ... console.log(audioctx.currenttime); reduced time precision to offer protection against timing attacks and fingerprinting, the precision of audioctx.currenttime might get rounded depending on browser settings. ...
BaseAudioContext - Web APIs
</div> a:hover text { fill: #0095dd; pointer-events: all;} properties baseaudiocontext.audioworklet read only secure context returns the audioworklet object, which can be used to create and manage audionodes in which javascript code implementing the audioworkletprocessor interface are run in the background to process audio data. baseaudiocontext.currenttime read only returns a double representing an ever-increasing hardware time in seconds used for scheduling. it starts at 0. baseaudiocontext.destination read only returns an audiodestinationnode representing the final destination of all audio in the context. it can be thought of as the audio-rendering device. baseaudiocontext.listener read only returns the audiolistener object, used for 3d spatialization. baseaudiocont...
BiquadFilterNode.Q - Web APIs
it is a dimensionless value with a default value of 1 and a nominal range of 0.0001 to 1000. syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.q.value = 100; note: though the audioparam returned is read-only, the value it represents is not. value an audioparam. 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). ...
BiquadFilterNode.frequency - Web APIs
frequency's default value is 350 with a nominal range of 10 to the nyquist frequency — that is, half of the sample rate. syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.frequency.value = 3000; note: though the audioparam returned is read-only, the value it represents is not. value an audioparam. example the following example shows basic usage of an audiocontext to create a biquad filter node. ...
BiquadFilterNode.gain - Web APIs
when it takes a positive value it is a real gain, when negative it is an attenuation. it is expressed in db, has a default value of 0 and can take a value in a nominal range of -40 to 40. syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.gain.value = 25; note: though the audioparam returned is read-only, the value it represents is not. value an audioparam. example the following example shows basic usage of an audiocontext to create a biquad filter node. ...
BudgetService.getCost() - Web APIs
}); parameters operation must be "silent-push". returns a promise that resolves to a number. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
BudgetService - Web APIs
the budgetservice interface of the web budget api provides a programmatic interface to the user agent’s budget service. it is available in both document and worker environments. properties none. methods budgetservice.getcost() returns a promise that resolves to a double, indicating the worst-case background operation cost of the provided background operation. budgetservice.getbudget() returns a promise that resolves to an array of budgetstate objects, indicating the expected state of the budget at times in the future. budgetservice.reserve() returns a promise that resolves to a boolean, indicating whether the requested budget operation can be reserved. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
BudgetState.budgetAt - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
CSSMathProduct.CSSMathProduct() - Web APIs
specifications specification status comment css typed om level 1the definition of 'cssmathproduct()' in that specification. working draft initial definition. ...
CSSMathSum.CSSMathSum() - Web APIs
the cssmathsum() constructor creates a new cssmathsum object which creates a new csskeywordvalue object which represents the result obtained by calling add(), sub(), or tosum() on cssnumericvalue. syntax var cssmathsum = new cssmathsum() parameters values one or more double integers or cssnumericvalue objects. specifications specification status comment css typed om level 1the definition of 'cssmathsum()' in that specification. working draft initial definition. ...
CSSNumericValue.add() - Web APIs
return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSUnitValue.CSSUnitValue() - Web APIs
unit returns a usvstring indicating the type of unit. ...
CSSUnitValue - Web APIs
cssunitvalue.unit returns a usvstring indicating the type of unit. event handlers none. methods none. ...
DOMPoint.w - Web APIs
Web › API › DOMPoint › w
this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). the default is 1.0. ...
DOMPoint.x - Web APIs
Web › API › DOMPoint › x
the dompoint interface's x property holds the horizontal coordinate, x, for a point in space. in general, positive values x mean to the right, and negative values of x means to the left, barring any transforms that may have altered the orientation of the axes. syntax var xpos = dompoint.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recommendation initial definition ...
DOMPoint.y - Web APIs
Web › API › DOMPoint › y
the dompoint interface's y property holds the vertical coordinate, y, for a point in space. unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward. syntax var ypos = dompoint.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate recommendation initial definition ...
DOMPoint.z - Web APIs
Web › API › DOMPoint › z
the dompoint interface's z property specifies the depth coordinate of a point in space. unless transforms have changed the orientation, a z of 0 is the plane of the screen, with positive values extending outward toward the user from the screen, and negative values receding into the distance behind the screen. syntax var zpos = dompoint.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification. candidate recommendation initial definition ...
DOMPointInit.w - Web APIs
Web › API › DOMPointInit › w
the dompointinit dictionary's w property is used to specify the w perspective value of a point in space when either creating or serializing to json a dompoint or dompointreadonly object. syntax var dompointinit = { w: wperspective }; dompointinit.w = wperspective; var wperspective = dompointinit.w; value a double-precision floating-point value indicating the point's w perspective value. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inh...
DOMPointInit.x - Web APIs
Web › API › DOMPointInit › x
used to specify the x component of a point in 2d or 3d space when either creating or serializing a dompoint or dompointreadonly. in general, positive values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes. syntax var dompointinit = { x: xpos }; dompointinit.x = xpos; var xpos = dompointinit.x; value a double-precision floating-point value indicating the point's x coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default. dompointinit is used as an input when calling either dompointreadonly.fromp...
DOMPointInit.y - Web APIs
Web › API › DOMPointInit › y
when either creating or serializing to json a dompoint or dompointreadonly object. in general, the value of y increases to the right and decreases to the left, becoming negative to the left of the origin. this may change if transforms have been applied causing the axes' orientation to change. syntax var dompointinit = { y: ypos }; dompointinit.y = ypos; var ypos = dompointinit.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default. there are two methods which use dompointinit: the static function dompoi...
DOMPointInit.z - Web APIs
Web › API › DOMPointInit › z
value increases, the point moves outward from the screen toward the user. as the value decreases, the point moves farther from the user, with negative values being behind the screen, receding into the distance. of course, if transforms have been applied, the axes may have changed orientation. syntax var dompointinit = { z: zpos }; dompointinit.z = zpos; var zpos = dompointinit.z; value a double-precision floating-point value indicating the point's z-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates ...
DOMPointReadOnly.w - Web APIs
the dompointreadonly interface's w property holds the point's perspective value, w, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. syntax const perspective = somedompointreadonly.w value a double-precision floating-point value indicating the w perspective value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). the default is 1.0. specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification. candidate recommendation initial definition ...
DOMPointReadOnly.x - Web APIs
donly interface's x property holds the horizontal coordinate, x, for a read-only point in space. this property cannot be changed by javascript code in this read-only version of the dompoint object. in general, positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal. syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recommendation initi...
DOMPointReadOnly.y - Web APIs
y interface's y property holds the vertical coordinate, y, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate recommendation initi...
DOMPointReadOnly.z - Web APIs
for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification. candidate recommendation initi...
DOMRectReadOnly.bottom - Web APIs
the bottom read-only property of the domrectreadonly interface returns the bottom coordinate value of the domrect. (has the same value as y + height, or y if height is negative.) syntax var recbottom = domrect.bottom; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'bottom' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.height - Web APIs
the height read-only property of the domrectreadonly interface represents the height of the domrect. syntax var recheight = domrect.height; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'height' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.left - Web APIs
the left read-only property of the domrectreadonly interface returns the left coordinate value of the domrect. (has the same value as x, or x + width if width is negative.) syntax var recleft = domrect.left; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'left' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.right - Web APIs
the right read-only property of the domrectreadonly interface returns the right coordinate value of the domrect. (has the same value as x + width, or x if width is negative.) syntax var recright = domrect.right; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'right' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.top - Web APIs
the top read-only property of the domrectreadonly interface returns the top coordinate value of the domrect. (has the same value as y, or y + height if height is negative.) syntax var rectop = domrect.top; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'top' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.width - Web APIs
the width read-only property of the domrectreadonly interface represents the width of the domrect. syntax var recwidth = domrect.width; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'width' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.x - Web APIs
Web › API › DOMRectReadOnly › x
the x read-only property of the domrectreadonly interface represents the x coordinate of the domrect's origin. syntax var recx = domrect.x; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.y - Web APIs
Web › API › DOMRectReadOnly › y
the y read-only property of the domrectreadonly interface represents the y coordinate of the domrect's origin. syntax var recy = domrect.y; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate recommendation latest spec version is an ed. ...
DeviceMotionEventAcceleration: x - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the x axis in a devicemotioneventacceleration object. syntax var xaccel = devicemotioneventacceleration.x; return value x a double indicating the amount of acceleration along the x axis. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventacceleration: x' in that specification. editor's draft ...
DeviceMotionEventAcceleration: y - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the y axis in a devicemotioneventacceleration object. syntax var yaccel = devicemotioneventacceleration.y; return value y a double indicating the amount of acceleration along the y axis. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventacceleration: y' in that specification. editor's draft ...
DeviceMotionEventAcceleration: z - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the z axis in a devicemotioneventacceleration object. syntax var zaccel = devicemotioneventacceleration.z; return value z a double indicating the amount of acceleration along the z axis. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventacceleration: z' in that specification. editor's draft ...
DeviceMotionEventRotationRate: alpha - Web APIs
this property indicates the rate of rotation around the z axis -- in degrees per second -- in a devicemotioneventrotationrate object. syntax var alpha = devicerotationrate.alpha; this property is read-only. return value alpha a double indicating the rate of rotation around the z axis, in degrees per second. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventrotationrate: alpha' in that specification. editor's draft ...
DeviceMotionEventRotationRate: beta - Web APIs
this property indicates the rate of rotation around the x axis -- in degrees per second -- in a devicemotioneventrotationrate object. syntax var beta = devicerotationrate.beta; this property is read-only. return value beta a double indicating the rate of rotation around the x axis, in degrees per second. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventrotationrate: beta' in that specification. editor's draft ...
DeviceMotionEventRotationRate: gamma - Web APIs
this property indicates the rate of rotation around the y axis -- in degrees per second -- in a devicemotioneventrotationrate object. syntax var gamma = devicerotationrate.gamma; this property is read-only. return value gamma a double indicating the rate of rotation around the y axis, in degrees per second. see accelerometer values explained for details. specifications specification status comment deviceorientation event specificationthe definition of 'devicemotioneventrotationrate: gamma' in that specification. editor's draft ...
DocumentFragment.querySelector() - Web APIs
ent in the documentfragment with the class "myclass" is returned: var el = documentfragment.queryselector(".myclass"); css syntax and the method's argument the string argument pass to queryselector must follow the css syntax. ...
Element: click event - Web APIs
element before the button is released, the event is fired on the most specific ancestor element that contained both elements. click fires after both the mousedown and mouseup events have fired, in that order. usage notes the mouseevent object passed into the event handler for click has its detail property set to the number of times the target was clicked. in other words, detail will be 2 for a double-click, 3 for triple-click, and so forth. this counter resets after a short interval without any clicks occurring; the specifics of how long that interval is may vary from browser to browser and across platforms. the interval is also likely to be affected by user preferences; for example, accessibility options may extend this interval to make it easier to perform multiple clicks with adaptive inte...
FileSystemEntry.moveTo() - Web APIs
ry interface's method moveto() moves the file specified by the entry to a new location on the file system, or renames the file if the destination directory is the same as the source. 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. however, a file can replace a file and a directory can replace a directory. you can only overwrite a directory if it's empty. syntax filesystemen...
Gamepad.buttons - Web APIs
Web › API › Gamepad › buttons
ton that is not pressed, and 1.0 representing a button that is fully pressed. syntax readonly attribute gamepadbutton[] buttons; example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stores as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are. in this simple example i've just allowed either. function gameloop() { if(navigator.webkitgetgamepads) { var gp...
GamepadButton.value - Web APIs
the gamepadbutton.value property of the gamepadbutton interface returns a double value used to represent the current state of analog buttons on many modern gamepads, such as the triggers. the values are normalized to the range 0.0 — 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. syntax readonly attribute double value; example var gp = navigator.getgamepads()[0]; if(gp.buttons[0].value > 0) { // respond to analog button being pressed in } value a double. specifications specification status comment gamepadthe definition of 'gamepadbutton.value' in that specification. working draft initial definition ...
GamepadHapticActuator.pulse() - Web APIs
the pulse() method of the gamepadhapticactuator interface makes the hardware pulse at a certain intensity for a specified duration. 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. return value a promise that resolves with a value of true when the pulse has successfully completed. examples tbc specifications specification status comment gamepad extens...
Using the Gamepad API - Web APIs
check if one of four buttons is being pressed; if so, we update the values of the a and b movement variables appropriately, then update the left and top properties, changing their values to the current values of a and b respectively. this has the effect of moving the ball around the screen. in current versions of chrome (version 34 as of this writing) the button values are stored as an array of double values, instead of gamepadbutton objects. this is fixed in development versions. after all this is done, we use our requestanimationframe() to request the next animation frame, running gameloop() again. function buttonpressed(b) { if (typeof(b) == "object") { return b.pressed; } return b == 1.0; } function gameloop() { var gamepads = navigator.getgamepads ? navigator.getgamepads() ...
GeolocationCoordinates.accuracy - Web APIs
the geolocationcoordinates.accuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the geolocationcoordinates.latitude and geolocationcoordinates.longitude properties expressed in meters. syntax let acc = geolocationcoordinatesinstance.accuracy value a positive double representing the accuracy, with a 95% confidence level, of the geolocationcoordinates.latitude and geolocationcoordinates.longitude properties expressed in meters. specifications specification status comment geolocation apithe definition of 'coordinates.accuracy' in that specification. recommendation initial definition ...
GeolocationCoordinates.altitude - Web APIs
the geolocationcoordinates.altitude read-only property is a double representing the altitude of the position in meters, relative to sea level. this value is null if the implementation cannot provide this data. syntax let alt = geolocationcoordinatesinstance.altitude value a double representing the altitude of the position in meters, relative to sea level. specifications specification status comment geolocation apithe definition of 'coordinates.altitude' in that specification. recommendation initial definition ...
GeolocationCoordinates.altitudeAccuracy - Web APIs
the geolocationcoordinates.altitudeaccuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters. this value is null if the implementation doesn't support measuring altitude. syntax let altacc = geolocationcoordinatesinstance.altitudeaccuracy value a positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.altitudeaccuracy' in that specification. recommendation initial specification. ...
GeolocationCoordinates.heading - Web APIs
the geolocationcoordinates.heading read-only property is a double representing the direction in which the device is traveling. this value, specified in degrees, indicates how far off from heading due north the device is. 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. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.heading' in that specifi...
GeolocationCoordinates.latitude - Web APIs
the geolocationcoordinates.latitude read-only property is a double representing the latitude of the position in decimal degrees. syntax let lat = geolocationcoordinatesinstance.latitude value a double representing the latitude of the position in decimal degrees. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.latitude' in that specification. recommendation initial specification. ...
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. syntax let longitude = geolocationcoordinatesinstance.longitude value the value in longitude is the geographical longitude of the location on earth described by the coordinates object, in decimal degrees. ...
GeolocationCoordinates.speed - Web APIs
the geolocationcoordinates.speed read-only property is a double representing the velocity of the device in meters per second. this value is null if the implementation is not able to measure it. syntax let speed = geolocationcoordinatesinstance.speed value a double representing the velocity of the device in meters per second. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.speed' in that specification. recommendation initial specification. ...
Gyroscope.x - Web APIs
Web › API › Gyroscope › x
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var x = gyroscope.x value a number. example the gyroscope is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Gyroscope.y - Web APIs
Web › API › Gyroscope › y
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var y = gyroscope.y value a number. example the gyroscope is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Gyroscope.z - Web APIs
Web › API › Gyroscope › z
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var z = gyroscope.z value a number. example the gyroscope is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Gyroscope - Web APIs
Web › API › Gyroscope
e' device sensor through the permissions api. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. constructor gyroscope.gyroscope() creates a new gyroscope object. properties gyroscope.x read only returns a double, containing the angular velocity of the device along the device's x axis. gyroscope.y read only returns a double, containing the angular velocity of the device along the device's y axis. gyroscope.z read only returns a double, containing the angular velocity of the device along the device's z axis. example the gyroscope is typically read in the sensor.onreading event callback. in the exa...
HTMLCanvasElement.captureStream() - Web APIs
the htmlcanvaselement capturestream() method returns a mediastream which includes a canvascapturemediastreamtrack containing a real-time video capture of the canvas's contents. syntax mediastream = canvas.capturestream(framerate); parameters framerate optional a double-precision floating-point value that indicates the rate of capture of each frame. if not set, a new frame will be captured each time the canvas changes; if set to 0, frames will not be captured automatically; instead, they will only be captured when the returned track's requestframe() method is called. return value a reference to a mediastream object, which has a single canvascapturemediastreamtrack in it. exceptions notsupportederror the value of framerate is negative. example // find the canvas element to capt...
HTMLInputElement - Web APIs
ments at which a numeric or date-time value can be set. it can be the string any or a positive floating point number. if this is not set to any, the control accepts only values at multiples of the step value greater than the minimum. valueasdate date object: returns / sets the value of the element, interpreted as a date, or null if conversion is not possible. valueasnumber double: returns the value of the element, interpreted as one of the following, in order: a time value a number nan if conversion is impossible autocapitalize string: defines the capitalization behavior for user input. valid values are none, off, characters, words, or sentences. inputmode provides a hint to browsers as to the type of virtual keyboard conf...
HTMLMediaElement.currentTime - Web APIs
the htmlmediaelement interface's currenttime property specifies the current playback time in seconds. changing the value of currenttime this value seeks the media to the new time. syntax var currenttime = htmlmediaelement.currenttime; htmlmediaelement.currenttime = 35; value a double-precision floating-point value indicating the current playback time in seconds. if the media is not yet playing, the value of currenttime indicates the time position within the media at which playback will begin once the play() method is called. setting currenttime to a new value seeks the media to the given time, if the media is available. for media without a known duration—such as media being streamed live—it's possible that the browser may not be able to obtain parts of the media that have expired fr...
HTMLMediaElement.defaultPlaybackRate - Web APIs
1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. the value 0.0 is invalid and throws a not_supported_err exception. ...
HTMLMediaElement.duration - Web APIs
if no media data is available, the value nan is returned. if the element's media doesn't have a known duration—such as for live media streams—the value of duration is +infinity. ...
HTMLMediaElement.fastSeek() - Web APIs
return value none. example this example quickly seeks to 20-second position of the video element. ...
HTMLMediaElement.initialTime - Web APIs
the htmlmediaelement.initialtime is the initial playback position in seconds. this property is obsolete, you can use a media fragments uri in the htmlmediaelement.src attribute instead. syntax ... value a double. example ... specifications this was previously defined within the whatwg html living standard, though was removed because of missing use cases. ...
HTMLMediaElement.playbackRate - Web APIs
n the fast forward or slow motion is outside a useful range (for example, gecko mutes the sound outside the range 0.25 to 5.0). the pitch of the audio is corrected by default and is the same for every speed. some browsers implement the non-standard htmlmediaelement.preservespitch property to control this. syntax // video video.playbackrate = 1.5; // audio audio.playbackrate = 1.0; value a double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. (default: 1.0) example var obj = document.createelement('video'); console.log(obj.playbackrate); // expected output: 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.playbackrate' in that speci...
HTMLMediaElement.volume - Web APIs
the htmlmediaelement.volume property sets the volume at which the media will be played. syntax var volume ​= video.volume; //1 value a double values must fall between 0 and 1, where 0 is effectively muted and 1 is the loudest possible value. example var obj = document.createelement('audio'); console.log(obj.volume); // 1 obj.volume = 0.75; specifications specification status comment html living standardthe definition of 'htmlmediaelement.volume' in that specification. living standard html5the definition of 'htmlmediaelement.volume' in that specification. recommendation ...
HTMLSelectElement.selectedOptions - Web APIs
ber of options is used to let the user order various food items. html the html that creates the selection box and the <option> elements representing each of the food choices looks like this: <label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <button name="order" id="order"> order now </button> <p id="output"> </p> the <select> element is set to allow multiple items to be selected, and it is 7 rows tall. note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using ...
HTMLVideoElement - Web APIs
ve been decoded into images. htmlvideoelement.mozpresentedframes read only returns an unsigned long with the count of decoded frames that have been presented to the rendering pipeline for painting. htmlvideoelement.mozpaintedframes read only returns an unsigned long with the count of presented frames which were painted on the screen. htmlvideoelement.mozframedelay read only returns an double with the time which the last painted video frame was late by, in seconds. htmlvideoelement.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 fli...
KeyboardEvent.keyCode - Web APIs
vent) { if (event.defaultprevented) { return; // should do nothing if the default action has been cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true. } else if (event.keycode !== undefined) { // handle the event with keyboardevent.keycode and set handled true. } if (handled) { // suppress "double action" if event handled event.preventdefault(); } }, true); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.keycode' in that specification. obsolete initial definition; specified as deprecated ...
LinearAccelerationSensor.x - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var xlinearaccelerationsensor = linearaccelerationsensor.x value a number. example linear acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
LinearAccelerationSensor.y - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var yacceleration = accelerometer.y value a number. example linear acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
LinearAccelerationSensor.z - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var zacceleration = accelerometer.z value a number. example linear acceleration is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
LinearAccelerationSensor - Web APIs
policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. constructor linearaccelerationsensor.linearaccelerationsensor() creates a new linearaccelerationsensor object. properties linearaccelerationsensor.x read only returns a double containing the linear acceleration of the device along the device's x axis. linearaccelerationsensor.y read only returns a double containing the linear acceleration of the device along the device's y axis. linearaccelerationsensor.z read only returns a double containing the linear acceleration of the device along the device's z axis. example linear acceleration is typically read in the s...
Magnetometer.x - Web APIs
Web › API › Magnetometer › x
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometerx = magnetometer.x value a number. example the magnetometer is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Magnetometer.y - Web APIs
Web › API › Magnetometer › y
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometery = magnetometer.x value a number. example the magnetometer is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Magnetometer.z - Web APIs
Web › API › Magnetometer › z
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometerz = magnetometer.z value a number. example the magnetometer is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a second. ...
Magnetometer - Web APIs
nsor through the permissions api. if a feature policy blocks use of a feature, it's because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. constructor magnetometer.magnetometer() creates a new magnetometer object. properties magnetometer.x read only returns a double containing the magnetic field around the device's x axis. magnetometer.y read only returns a double containing the magnetic field around the device's y axis. magnetometer.z read only returns a double containing the magnetic field around the device's z axis. example the magnetometer is typically read in the sensor.onreading event callback. in the example below this occurs sixty times a se...
MediaPositionState.playbackRate - Web APIs
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 browser it by calling navigator.mediasession.setpositionstate(). let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate. specifications specification s...
MediaPositionState - Web APIs
ng the total duration of the current media in seconds. this should always be a positive number, with positive infinity (infinity) indicating media without a defined end, such as a live stream. playbackrate a floating-point value indicating the rate at which the media is being played, as a ratio relative to its normal playback speed. thus, a value of 1 is playing at normal speed, 2 is playing at double speed, and so forth. negative values indicate that the media is playing in reverse; -1 indicates playback at the normal speed but backward, -2 is double speed in reverse, and so on. position a floating-point value indicating the last reported playback position of the media in seconds. this must always be a positive value. specifications specification status comment ...
MediaSettingsRange.max - Web APIs
the max read-only property of the mediasettingsrange interface returns the maximum value of the settings range. syntax var max = mediasettingsrange.max value a double integer. specifications specification status comment mediastream image capturethe definition of 'max' in that specification. working draft initial definition. ...
MediaSettingsRange.min - Web APIs
the min read-only property of the mediasettingsrange interface returns the minimum value of the settings range. syntax var min = mediasettingsrange.min value a double integer. specifications specification status comment mediastream image capturethe definition of 'min' in that specification. working draft initial definition. ...
MediaSettingsRange.step - Web APIs
the step read-only property of the mediasettingsrange interface returns the minimum difference between consecutive values of the settings range. syntax var step = mediasettingsrange.step value a double integer. specifications specification status comment mediastream image capturethe definition of 'step' in that specification. working draft initial definition. ...
MediaSource.duration - Web APIs
a value in seconds is expected. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set a duration value that was negative, or nan. ...
MouseEvent() - Web APIs
number for the screen and client fields will throw a typeerror. the mouseeventinit dictionary also accepts fields from uieventinit and from eventinit dictionaries. specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft redefines screen and client fields long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent()' in that specification. obsolete initial definition. ...
MouseEvent.offsetX - Web APIs
the offsetx read-only property of the mouseevent interface provides the offset in the x coordinate of the mouse pointer between that event and the padding edge of the target node. syntax var xoffset = instanceofmouseevent.offsetx; return value a double floating point value. early versions of the spec defined this as an integer. see the browser compatibility section for details. specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft initial definition ...
MouseEvent.offsetY - Web APIs
the offsety read-only property of the mouseevent interface provides the offset in the y coordinate of the mouse pointer between that event and the padding edge of the target node. syntax var yoffset = instanceofmouseevent.offsety; return value a double floating point value. early versions of the spec defined this as an integer. see the browser compatibility section for details. specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft initial definition ...
MouseEvent.pageY - Web APIs
Web › API › MouseEvent › pageY
the pagey read-only property of the mouseevent interface returns the y (vertical) coordinate in pixels of the event relative to the whole document. this property takes into account any vertical scrolling of the page. syntax var pos = event.pagey; 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. examples var pagey = event.pagey; specifications specification status comment css object model (cssom) view modulethe definition of 'pagey' in that specification. working draft redefined from long to double. touch eventsthe definition of 'pagey' in that specification. unknown initial definition. ...
NetworkInformation.downlink - Web APIs
bandwidth measurement data, the attribute value is determined by the properties of the underlying connection technology. note that chrome-based browsers do not conform to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. similar caps exist for the reported latency. syntax var downlink = networkinformation.downlink value a double. specifications specification status comment network information apithe definition of 'downlink' in that specification. draft initial definition. ...
NetworkInformation.downlinkMax - Web APIs
the networkinformation.downlinkmax read-only property returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. note: this feature is available in web workers. syntax var max = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. function logconnectiontype() { var connectiontype = 'not supported'; var downlinkmax = 'not supported'; if ('connection' in navigator) { connectiontype = navigator.connection.effectivetype; if ('downlinkmax' in navigator.connection) { downlinkmax = na...
OfflineAudioContext.suspend() - Web APIs
uantum and the specified suspension time will be rounded down to the nearest render quantum boundary. 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. syntax offlineaudiocontext.suspend(suspendtime).then(function() { ... }); parameters suspendtime a double specifying the suspend time, in seconds. returns a promise resolving to void. exceptions the promise is rejected when any exception is encountered. invalidstateerror if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time ...
OscillatorNode.start() - Web APIs
the start method of the oscillatornode interface specifies the exact time to start playing the tone. its parameter is optional and default to 0. syntax oscillator.start(when); // start playing oscillator at the point in time specified by when parameters when optional an optional double representing the time (in seconds) when the oscillator should start, in the same coordinate system as audiocontext's currenttime attribute. if a value is not included or is less than currenttime, the oscillator starts playing immediately. example the following example shows basic usage of an audiocontext to create an oscillator node. for an applied example, check out our violent theremin demo (see app.js for relevant code). // create web audio api context var audioctx = new (window.audiocontext || wi...
OscillatorNode.stop() - Web APIs
if a value is not included, it defaults to 0. if the time is equal to or before the current audio context time, the oscillator will stop playing immediately. ...
Paint​Worklet​.device​Pixel​Ratio - Web APIs
the paintworklet.devicepixelratio read-only property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the definition of 'paintworklet.devicepixelratio' in that specification. working draft initial definition. ...
PaintWorklet.devicePixelRatio - Web APIs
the paintworklet.devicepixelratio read-only property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the definition of 'paintworklet.devicepixelratio' in that specification. working draft initial definition. ...
PaintWorklet.devicePixelRatio - Web APIs
the paintworklet.devicepixelratio read-only property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the definition of 'paintworklet.devicepixelratio' in that specification. working draft initial definition. ...
PannerNode.refDistance - Web APIs
the distance at which the volume reduction starts taking effect. this value is used by all distance models. the refdistance property's default value is 1. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.refdistance = 1; value a non-negative number. if the value is set to less than 0, a rangeerror is thrown. exceptions rangeerror the property has been given a value that is outside the accepted range. ...
PannerNode.rolloffFactor - Web APIs
this value is used by all distance models.the rollofffactor property's default value is 1. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.rollofffactor = 1; value a number whose range depends on the distancemodel of the panner as follows (negative values are not allowed): "linear" the range is 0 to 1. "inverse" the range is 0 to infinity. "exponential" the range is 0 to infinity. exceptions rangeerror the property has been given a value that is outside the accepted range. ...
PerformanceServerTiming.duration - Web APIs
syntax servertiming.duration; specifications specification status comment server timingthe definition of 'duration' in that specification. ...
PerformanceServerTiming - Web APIs
in, 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. example given a server that sends the server-timing header, for example a node.js server like th...
Using the Performance API - Web APIs
additionally, there must be a way to create a timestamp for a specific point in time; this is done with the now() method. web performance interfaces are defined in a suite of standards. the base interface for these standards is the performance interface and its methods and properties are extended by different standards. this guide describes how to use the performance interfaces that are defined in the high-resolution time standard. ...
Performance API - Web APIs
platform's system clock is subject to various skews (such as ntp adjustments), the interfaces support a monotonic clock i.e. a clock that is always increasing. as such, the performance api defines a domhighrestimestamp type rather than using the date.now() interface. domhighrestimestamp the domhighrestimestamp type, as its name implies, represents a high resolution point in time. this type is a double and is used by the performance interfaces. the value could be a discrete point in time or the difference in time between two discrete points in time. the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds). however, if the browser is unable to provide a time value accurate to 5 microseconds (because, for example, due to hardware or software constraints), th...
PointerEvent.PointerEvent() - Web APIs
vent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types). pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid. width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. height — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.height. pressure — optional and defaulting to 0, of type float, that sets the value of the instance's pointerevent.pressure. tangentialpressure — optional and defaulting to 0, of type float, that sets the value of the inst...
PointerEvent.pointerType - Web APIs
nt pointer eventsthe definition of 'pointertype' in that specification. obsolete initial definition. pointer events – level 2the definition of 'pointertype' in that specification. recommendation non-stable version. css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft redefines mouseevent from long to double. this means that a pointerevent whose pointertype is mouse will be a double. ...
RTCRtpContributingSource.audioLevel - Web APIs
the read-only audiolevel property of the rtcrtpcontributingsource interface indicates the audio level contained in the last rtp packet played from the described source. audiolevel will be the level value defined in [rfc6465] if the rfc 6465 header extension is present, and otherwise null. syntax var audiolevel = rtcrtpcontributingsource.audiolevel value a double-precision floating-point number which indicates the volume level of the audio in the most recently received rtp packet from the source described by the rtcrtpcontributingsource. this value, which is in the range 0.0 to 1.0, is on a linear scale and its value is defined in dbov, or decibels (overload). this is the amplitude relative to the point at which clipping of the audio begins to occur. a value of 1.0 represents 0 dbov (maximu...
RTCRtpContributingSource - Web APIs
the rtcrtpcontributingsource dictionary of the the webrtc api is used by getcontributingsources() to provide information about a given contributing source (csrc), including the most recent time a packet that the source contributed was played out. the information provided is based on the last ten seconds of media received. properties audiolevel optional a double-precision floating-point value between 0 and 1 specifying the audio level contained in the last rtp packet played from this source. rtptimestamp optional the rtp timestamp of the media played out at the time indicated by timestamp. this value is a source-generated time value which can be used to help with sequencing and synchronization. source optional a 32-bit unsigned integer value specifying the csrc identifier of the contri...
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
the rtcrtpencodingparameters dictionary's scaleresolutiondownby property can be used to specify a factor by which to reduce the size of a video track during encoding. this property is only available for tracks whose kind is video. syntax rtpencodingparameters.scaleresolutiondownby = scalingfactor; rtpencodingparameters = { scaleresolutiondownby: scalingfactor }; value a double-precison floating-point number specifying the amount by which to reduce the size of the video during encoding. the default value, 1.0, means that the video will be encoded at its original size. a value of 2.0 would reduce the size of the video by a factor of 2 both horizontally and vertically, resulting in a video 25% the original size. a value less than 1.0 would cause the video to get larger rather than smalle...
Resource Timing API - Web APIs
e timing phases figure. the performanceresourcetiming interface extends the performanceentry for performance entries which have an entrytype of "resource". high-resolution timestamps several of the resource timing properties return high-resolution timestamps. these timestamps have a domhighrestimestamp type and as its name implies, they represent a high-resolution point in time. this type is a double and its value is a discrete point in time or the difference in time between two discrete points in time. the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds). however, if the browser is unable to provide a time value accurate to 5 µs (because, for example, due to hardware or software constraints), the browser can represent a the value as a time in milli...
Screen.mozBrightness - Web APIs
indicates how bright the screen's backlight is, on a scale from 0 (very dim) to 1 (full brightness); this value is a double-precision float. you can read and write this attribute even when the screen is disabled, but the backlight is off while the screen is disabled. if you write a value of x into this attribute, the attribute may not have the same value x when you later read it. most screens don't support as many different brightness levels as there are doubles between 0 and 1. the value's precision might be reduced before storing it. syntax let screenbrightness = window.screen.mozbrightness; specifications not part of specification. ...
Screen - Web APIs
Web › API › Screen
norientation instance associated with this screen. screen.pixeldepth gets the bit depth of the screen. screen.top returns the distance in pixels from the top side of the current screen. screen.width returns the width of the screen. screen.mozenabled boolean. setting to false will turn off the device's screen. screen.mozbrightness controls the brightness of a device's screen. a double between 0 and 1.0 is expected. events handler screen.onorientationchange a handler for the orientationchange event. methods screen.lockorientation lock the screen orientation (only works in fullscreen or for installed apps) screen.unlockorientation unlock the screen orientation (only works in fullscreen or for installed apps) methods inherited from eventtarget: eventtarget.ad...
ScrollToOptions.left - Web APIs
examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
ScrollToOptions.top - Web APIs
examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
SourceBuffer.appendWindowEnd - Web APIs
window, a timestamp range that can be used to filter what media data is appended to the sourcebuffer. coded media frames with timestamps wthin this range will be appended, whereas those outside the range will be filtered out. the default value of appendwindowend is positive infinity. syntax var myappendwindowend = sourcebuffer.appendwindowend; sourcebuffer.appendwindowend = 120.0; value a double, indicating the end time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan. invalidstateerror this sourcebuffer object is being updated ...
SourceBuffer.appendWindowStart - Web APIs
ta is appended to the sourcebuffer. coded media frames with timestamps wthin this range will be appended, whereas those outside the range will be filtered out. the default value of appendwindowstart is the presentation start time, which is the beginning time of the playable media. syntax var myappendwindowstart = sourcebuffer.appendwindowstart; sourcebuffer.appendwindowstart = 2.0; value a double, indicating the start time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than 0, or a value greater than or equal to sourcebuffer.appendwindowend. invalidstateerror this sourcebuffer objec...
SourceBuffer.remove() - Web APIs
the remove() method of the sourcebuffer interface removes media segments within a specific time range from the sourcebuffer. this method can only be called when sourcebuffer.updating equals false. if sourcebuffer.updating is not equal to false, call sourcebuffer.abort(). syntax sourcebuffer.remove(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 undefined. exceptions exception explanation invalidaccesserror the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan. invalidstateerror the so...
SourceBuffer.removeAsync() - Web APIs
cess 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 function, emptysourcebuffer(), which simply clears the contents of the specif...
SourceBuffer.timestampOffset - Web APIs
exceptions the following exceptions may be thrown when setting a new value for this property. ...
TextMetrics.actualBoundingBoxAscent - Web APIs
the read-only actualboundingboxascent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the top of the bounding rectangle used to render the text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxascent; // 8; specifications specification html living standardthe definition of 'textmetrics.actualboundingboxascent' in that specification. ...
TextMetrics.actualBoundingBoxDescent - Web APIs
the read-only actualboundingboxdescent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the bottom of the bounding rectangle used to render the text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxdescent; // 0; specifications specification html living standardthe definition of 'textmetrics.actualboundingboxdescent' in that specification. ...
TextMetrics.actualBoundingBoxLeft - Web APIs
the read-only actualboundingboxleft property of the textmetrics interface is a double giving the distance parallel to the baseline from the alignment point given by the canvasrenderingcontext2d.textalign property to the left side of the bounding rectangle of the given text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxleft; // 0; specifications specification html living standardthe definition of 'textmetrics.actualboundingboxleft' in that specification. ...
TextMetrics.actualBoundingBoxRight - Web APIs
the read-only actualboundingboxright property of the textmetrics interface is a double giving the distance parallel to the baseline from the alignment point given by the canvasrenderingcontext2d.textalign property to the right side of the bounding rectangle of the given text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxright; // 15.633333333333333; specifications specification html living standardthe definition of 'textmetrics.actualboundingboxright' in that specification. ...
TextMetrics.alphabeticBaseline - Web APIs
the read-only alphabeticbaseline property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the alphabetic baseline of the line box, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.alphabeticbaseline; // -0; specifications specification html living standardthe definition of 'textmetrics.alphabeticbaseline' in that specification. ...
TextMetrics.emHeightAscent - Web APIs
the read-only emheightascent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the top of the em square in the line box, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.emheightascent; // 7.59765625; specifications specification html living standardthe definition of 'textmetrics.emheightascent' in that specification. ...
TextMetrics.emHeightDescent - Web APIs
the read-only emheightdescent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the bottom of the em square in the line box, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.emheightdescent; // -2.40234375; specifications specification html living standardthe definition of 'textmetrics.emheightdescent' in that specification. ...
TextMetrics.fontBoundingBoxAscent - Web APIs
the read-only fontboundingboxascent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the top of the highest bounding rectangle of all the fonts used to render the text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.fontboundingboxascent; // 10; specifications specification html living standardthe definition of 'textmetrics.fontboundingboxascent' in that specification. ...
TextMetrics.fontBoundingBoxDescent - Web APIs
the read-only fontboundingboxdescent property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the bottom of the bounding rectangle of all the fonts used to render the text, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.fontboundingboxdescent; // 3; specifications specification html living standardthe definition of 'textmetrics.fontboundingboxdescent' in that specification. ...
TextMetrics.hangingBaseline - Web APIs
the read-only hangingbaseline property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the hanging baseline of the line box, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.hangingbaseline; // 6.078125; specifications specification html living standardthe definition of 'textmetrics.hangingbaseline' in that specification. ...
TextMetrics.ideographicBaseline - Web APIs
the read-only ideographicbaseline property of the textmetrics interface is a double giving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the ideographic baseline of the line box, in css pixels. examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.ideographicbaseline; // -1.201171875; specifications specification html living standardthe definition of 'textmetrics.ideographicbaseline' in that specification. ...
TextTrackCue - Web APIs
ich the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information. properties this interface also inherits properties from eventtarget. texttrackcue.track read only the texttrack that this cue belongs to, or null if it doesn't belong to any. texttrackcue.id a domstring that identifies the cue. texttrackcue.starttime a double that represents the video time that the cue will start being displayed, in seconds. texttrackcue.endtime a double that represents the video time that the cue will stop being displayed, in seconds. texttrackcue.pauseonexit a boolean for whether the video will pause when this cue stops being displayed. event handlers texttrackcue.onenter the event handler for the enter event. texttrackcu...
Using Touch Events - Web APIs
aces to gestures an application may consider different factors when defining the semantics of a gesture. for instance, the distance a touch point traveled from its starting location to its location when the touch ended. another potential factor is time; for example, the time elapsed between the touch's start and the touch's end, or the time lapse between two consecutive taps intended to create a double-tap gesture. the directionality of a swipe (for example left to right, right to left, etc.) is another factor to consider. the touch list(s) an application uses depends on the semantics of the application's gestures. for example, if an application supports a single touch (tap) on one element, it would use the targettouches list in the touchstart event handler to process the touch point in an app...
VTTCue() - Web APIs
Web › API › VTTCue › VTTCue
the vttcue() constructor creates and returns a new vttcue object. syntax vttcue = new vttcue(starttime, endtime, text); parameters starttime this is a double representing the initial text track cue start time. this is the time, given in seconds and fractions of a second, denoting the beginning of the range of the media data to which this cue applies. for example, if a cue is to be visible from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0. endtime this is a double representing the ending time for this text track cue. this is the time at which the cue should stop being presented to the user, given in seconds and fractions thereof. given the example cue mentioned under starttime, the value of endtime would be 65.5. text a domstring...
VTTCue - Web APIs
Web › API › VTTCue
line. vttcue.position returns the indentation of the cue within the line. this can be the string auto or a number representing the percentage of the vttcue.region, or the video size if vttcue.region is null. vttcue.positionalign returns an enum representing the alignment of the cue. this is used to determine what the vttcue.position is anchored to. the default is auto. vttcue.size returns a double representing the size of the cue, as a percentage of the video size. vttcue.textalign returns an enum representing the alignment of all the lines of text within the cue box. vttcue.text returns a domstring with the contents of the cue. methods getcueashtml() returns the cue text as a documentfragment. example html <video controls src="https://udn.realityripple.com/samples/c6/f8a3489...
VideoPlaybackQuality.totalFrameDelay - Web APIs
obsolete since gecko 30 (firefox 30 / thunderbird 30 / seamonkey 2.27 / firefox os 1.4)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the videoplaybackquality.totalframedelay read-only property returns a double containing the sum of the frame delay since the creation of the associated htmlvideoelement. the frame delay is the difference between a frame's theoretical presentation time and its effective display time. syntax value = videoplaybackquality.totalframedelay; example var videoelt = document.getelementbyid('my_vid'); var quality = videoelt.getvideoplaybackquality(); alert(quality.totalframedelay); ...
VideoPlaybackQuality - Web APIs
deoframes read only an unsigned long giving the number of video frames created and dropped since the creation of the associated htmlvideoelement. obsolete properties corruptedvideoframes read only an unsigned long giving the number of video frames corrupted since the creation of the associated htmlvideoelement. a corrupted frame may be created or dropped. totalframedelay read only a double containing the sum of the frame delay since the creation of the associated htmlvideoelement. the frame delay is the difference between a frame's theoretical presentation time and its effective display time. methods the videoplaybackquality interface has no methods, and does not inherit any. specifications specification status comment media playback qualitythe definiti...
VisualViewport.height - Web APIs
the height read-only property of the visualviewport interface returns the height of the visual viewport, in css pixels. syntax var height = visualviewport.height value a double. specifications specification status comment visual viewport apithe definition of 'height' in that specification. draft initial definition. ...
VisualViewport.offsetTop - Web APIs
the offsettop read-only property of the visualviewport interface returns the offset of the top edge of the visual viewport from the top edge of the layout viewport in css pixels. syntax var offsettop = visualviewport.offsettop value a double. specifications specification status comment visual viewport apithe definition of 'offsettop' in that specification. draft initial definition. ...
VisualViewport.offsetleft - Web APIs
the offsetleft read-only property of the visualviewport interface returns the offset of the left edge of the visual viewport from the left edge of the layout viewport in css pixels. syntax var offsetleft = visualviewport.offsetleft value a double. specifications specification status comment visual viewport apithe definition of 'offsetleft' in that specification. draft initial definition. ...
VisualViewport.pageLeft - Web APIs
specifications specification status comment visual viewport apithe definition of 'pageleft' in that specification. draft initial definition. ...
VisualViewport.pageTop - Web APIs
specifications specification status comment visual viewport apithe definition of 'pagetop' in that specification. draft initial definition. ...
VisualViewport.scale - Web APIs
the scale read-only property of the visualviewport interface returns the pinch-zoom scaling factor applied to the visual viewport. syntax var scale = visualviewport.scale value a double. specifications specification status comment visual viewport apithe definition of 'scale' in that specification. draft initial definition. ...
VisualViewport.width - Web APIs
the width read-only property of the visualviewport interface returns the width of the visual viewport, in css pixels. syntax var width = visualviewport.width value a double. specifications specification status comment visual viewport apithe definition of 'width' in that specification. draft initial definition. ...
WaveShaperNode.oversample - Web APIs
les (up-sampling) before applying a distortion effect to the audio signal. once applied, the number of samples is reduced to its initial numbers. this leads to better results by avoiding some aliasing, but comes at the expense of a lower precision shaping curve. the possible oversample values are: value effect 'none' do not perform any oversampling. '2x' double the amount of samples before applying the shaping curve. '4x' multiply by 4 the amount of samples before applying the shaping curve. syntax distortion.oversample = enumeratedvalue; values distortion is a waveshapernode. enumeratedvalue is one of 'none', '2x', or '4x'. example the following example shows basic usage of an audiocontext to create a wave shaper node. for ...
Fundamentals of WebXR - Web APIs
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 115° across — we have depth perception. outside that overlap area, our vision is monocular and lacks good depth perception. the drawing shown here demonstrates the concept of fov. the blue wedge represents the field of view of the leflt...
Geometry and reference spaces in WebXR - Web APIs
> deg * radians_per_degree; let radianstodegrees = (rad) => rad / radians_per_degree; times and durations note that for security reasons, domhighrestimestamp usually introduces a small amount of imprecision to the clock in order to prevent it from being used in fingerprinting and timing-based attacks. all times and durations in webxr are measured using the domhighrestimestamp type, which is a double-precision floating-point value specifying the time in milliseconds relative to the starting time. since the value is a floating-point number, it may be accurate to well better than the millisecond level, depending on the platform and hardware. time is primarily used to determine the amount of time that's elapsed since the scene's previous animation frame was drawn. as such the time is typically ...
Using the Web Audio API - Web APIs
, so the input is connected to the gain, then the gain node is connected to the destination: track.connect(gainnode).connect(audiocontext.destination); this will make our audio graph look like this: the default value for gain is 1; this keeps the current volume the same. gain can be set to a minimum of about -3.4 and a max of about 3.4. here we'll allow the boombox to move the gain up to 2 (double the original volume) and down to 0 (this will effectively mute our sound). let's give the user control to do this — we'll use a range input: <input type="range" id="volume" min="0" max="2" value="1" step="0.01"> note: range inputs are a really handy input type for updating values on audio nodes. you can specify a range's values and use them directly with the audio node's parameters. so l...
WheelEvent() - Web APIs
the wheelevent() constructor returns a newly created wheelevent object. syntax var wheelevent = new wheelevent(typearg, wheeleventinit); properties typearg is a domstring representing the name of the event. wheeleventinit optional is a wheeleventinit dictionary, having the following fields: "deltax", optional and defaulting to 0.0, is a double representing the horizontal scroll amount in the deltamode unit. "deltay", optional and defaulting to 0.0, is a double representing the vertical scroll amount in the deltamode unit. "deltaz", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltamode unit. "deltamode", optional and defaulting to 0, is a unsigned long representing the unit of the delta values scroll amount. permitted value...
WheelEvent.deltaX - Web APIs
Web › API › WheelEvent › deltaX
the wheelevent.deltax read-only property is a double representing the horizontal scroll amount in the wheelevent.deltamode unit. syntax var dx = event.deltax; example var syntheticevent = new wheelevent("syntheticwheel", {"deltax": 4, "deltamode": 0}); console.log(syntheticevent.deltax); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltax' in that specification. obsolete initial definition. ...
WheelEvent.deltaY - Web APIs
Web › API › WheelEvent › deltaY
the wheelevent.deltay read-only property is a double representing the vertical scroll amount in the wheelevent.deltamode unit. syntax var dy = event.deltay; example var syntheticevent = new wheelevent("syntheticwheel", {"deltay": 4, "deltamode": 0}); console.log(syntheticevent.deltay); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltay' in that specification. obsolete initial definition. ...
WheelEvent.deltaZ - Web APIs
Web › API › WheelEvent › deltaZ
the wheelevent.deltaz read-only property is a double representing the scroll amount along the z-axis, in the wheelevent.deltamode unit. syntax var dz = event.deltaz; example var syntheticevent = new wheelevent("syntheticwheel", {"deltaz": 4, "deltamode": 0}); console.log(syntheticevent.deltaz); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltaz' in that specification. obsolete initial definition. ...
WheelEvent - Web APIs
consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">wheelevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor wheelevent() creates a wheelevent object. properties this interface inherits properties from its ancestors, mouseevent, uievent, and event. wheelevent.deltaxread only returns a double representing the horizontal scroll amount. wheelevent.deltayread only returns a double representing 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 ...
Window.scrollX - Web APIs
Web › API › Window › scrollX
scrollx property of the window interface returns the number of pixels that the document is currently scrolled horizontally. this value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. you can get the number of pixels the document is scrolled vertically from the scrolly property. syntax var x = window.scrollx; value in practice, the returned value is a double-precision floating-point value indicating the number of pixels the document is currently scrolled horizontally from the origin, where a positive value means the content is scrolled to the left. if the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. if the document isn't scrolled at all left or right, then scr...
Window.scrollY - Web APIs
Web › API › Window › scrollY
y scrolly property of the window interface returns the number of pixels that the document is currently scrolled vertically. this value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. you can get the number of pixels the document is scrolled horizontally from the scrollx property. syntax var y = window.scrolly value in practice, the returned value is a double-precision floating-point value indicating the number of pixels the document is currently scrolled vertically from the origin, where a positive value means the content is scrolled to upward. if the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. if the document isn't scrolled at all up or down, then scrolly is...
Window - Web APIs
Web › API › Window
lers.onbeforeunload an event handler property for before-unload events on the window. globaleventhandlers.onblur called after the window loses focus, such as due to a popup. globaleventhandlers.onchange an event handler property for change events on the window. globaleventhandlers.onclick called after the any mouse button is pressed & released globaleventhandlers.ondblclick called when a double click is made with any mouse button. globaleventhandlers.onclose called after the window is closed globaleventhandlers.oncontextmenu called when the right mouse button is pressed globaleventhandlers.onerror called when a resource fails to load or when an error occurs at runtime. see error event. globaleventhandlers.onfocus called after the window receives or regains focus. see focus event...
XRRenderState.inlineVerticalFieldOfView - Web APIs
the inlineverticalfieldofview read-only property of the xrrenderstate interface defines the angle of the field of view in radians used when computing projection matrices for "inline" xrsession objects. this option must be null for immersive sessions. syntax var adouble = xrrenderstate.inlineverticalfieldofview; value a number. specifications specification status comment unknownthe definition of 'xrrenderstate.inlineverticalfieldofview' in that specification. unknown initial definition. ...
XRRenderState.depthFar - Web APIs
the depthfar read-only property of the xrrenderstate interface returns the distance in meters of the far clip plane from the viewer. syntax var adouble = xrrenderstate.depthfar; value a number. specifications specification status comment unknownthe definition of 'xrrenderstate.depthfar' in that specification. unknown initial definition. ...
XRRenderState.depthNear - Web APIs
the depthnear read-only property of the xrrenderstate interface returns the distance in meters of the near clip plane from the viewer. syntax var adouble = xrrenderstate.depthnear; value a number. specifications specification status comment unknownthe definition of 'xrrenderstate.depthnear' in that specification. unknown initial definition. ...
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
e of the frame buffer to use when rendering the scene, relative to the default xr device display resolution. 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. see managing rendering quality in webxr performance guide for more information. you can determine the scaling factor that you would need to apply to match the default frame buffer resolution by using the xrwebgllayer.getnativeframebufferscalefactor() static function. syntax let layerinit = { fram...
ARIA live regions - Accessibility
"polite" when using this role. alert error or warning message that flashes on the screen. alerts are particularly important for client side validation notices to users. (tbd: link to aria form tutorial with aria info) to maximize compatibility, some people recommend adding a redundant aria-live="assertive" when using this role. however, adding both aria-live and role="alert" causes double speaking issues in voiceover on ios. progressbar a hybrid between a widget and a live region. use this with aria-valuemin, aria-valuenow and aria-valuemax. (tbd: add more info here). marquee for text which scrolls, such as a stock ticker. timer or any kind of timer or clock, such as a countdown timer or stopwatch readout. advanced live region...
ARIA Test Cases - Accessibility
as the user moves the slider, jaws announces the new position. the same is true for the second thumb (slider). markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard)...
Architecture - Accessibility
lopers of nvda. (f) to get the line of text at the caret: many editors, including the mozilla editor, have a strange issue with caret offsets. the caret can sometimes visually appear at the end of a line, but logically it is on the first character on the next line. you can test this in a given editor by pressing the end key on a line, to see whether the caret is shown past the end of the line. to doublecheck, hit the delete key and see if it removes the first char of the next line. therefore, as the user arrows up and down, if you use the accessibletext::caretoffset and retrieve the line with that offset, you may not get the line with the visual caret returned. you are getting the line starting with the logical caret offset, which may be the next line. to get around this problem, mozilla allows ...
system - CSS: Cascading Style Sheets
must be specified in the symbols descriptor or the counter style is not valid. also an optional <integer> can be specified after the the system, as the value of the first symbol. if this integer is omitted, value of the first integer is taken as 1. symbolic cycles through the provided list of symbols. on each successive pass through the cycle, the symbols used for the counter representation are doubled, tripled, and so on. for example, if the original symbols provided were "◽" and "◾", on each successive pass, they will become "◽◽" and "◾◾", "◽◽◽" and "◾◾◾" and so on. at least one symbol must be specified in the symbols descriptor or the counter style is not valid. this counter system works for positive counter values only. alphabetic interprets the specified symbols ...
@document - CSS: Cascading Style Sheets
Web › CSS › @document
e document url is on the domain provided (or a subdomain of it). media-document(), with the parameter of video, image, plugin or all. regexp(), which matches if the document url is matched by the regular expression provided. the expression must match the entire url. the values provided to the url(), url-prefix(), domain(), and media-document() functions can be optionally enclosed by single or double quotes. the values provided to the regexp() function must be enclosed in quotes. escaped values provided to the regexp() function must additionally be escaped from the css. for example, a . (period) matches any character in regular expressions. to match a literal period, you would first need to escape it using regular expression rules (to \.), then escape that string using css rules (to \\.). @...
Attribute selectors - CSS: Cascading Style Sheets
ivs in us english are blue. */ div[lang~="en-us"] { color: blue; } /* all divs in portuguese are green. */ div[lang="pt"] { color: green; } /* all divs in chinese are red, whether simplified (zh-cn) or traditional (zh-tw). */ div[lang|="zh"] { color: red; } /* all divs with a traditional chinese `data-lang` are purple. ...
Box alignment in grid layout - CSS: Cascading Style Sheets
box alignment specification and renamed to row-gap, column-gap, and gap. this allows them to be used for other layout methods where a gap between items makes sense. the updated properties have not yet been implemented in all browsers. therefore, to use the gap properties in grid layout, you should use the grid-row-gap, grid-column-gap and grid-gap versions to ensure full compatibility. you could double up the properties and use both as you would for vendor prefixes. reference css properties justify-content align-content place-content justify-items align-items place-items justify-self align-self place-self row-gap column-gap gap glossary entries cross axis main axis guides alignment in grid layout external resources box alignment cheatsheet css grid, flexbox ...
CSS Box Alignment - CSS: Cascading Style Sheets
, and a 2em gap between column tracks. in this example i am using the grid-gap property in addition to gap. the gap properties were originally prefixed with grid- in the grid layout specification and some browsers only support these prefixed versions. grid-row-gap grid-column-gap grid-gap the prefixed versions will be maintained as an alias of the unprefixed ones, however you can always double up in the way that you would with vendor prefixes, adding the grid-gap property and then the gap property with the same values. also, be aware that other things may increase the visual gap displayed, for example using the space distribution keywords or adding margins to items. pages detailing individual alignment properties as the css box alignment properties are implemented differently depend...
Color picker tool - CSS: Cascading Style Sheets
x dashed rgb(221, 221, 221); border-radius: 15px; position: absolute; top: 50px; left: 20%; } #canvas[data-tutorial='drop']:after { content: "adjust, change or modify"; width: 40%; font-size: 24px; position: absolute; top: 130px; left: 32%; z-index: 2; } #canvas [data-tutorial='dblclick'] { background-color: #999 !important; } #canvas [data-tutorial='dblclick']:before { content: "double click to activate"; width: 80px; color: #fff; position: absolute; top: 10%; left: 20%; z-index: 2; } #canvas .sample { width: 100px; height: 100px; min-width: 20px; min-height: 20px; position: absolute; border: 1px solid rgba(255, 255, 255, 0.3); } #canvas .sample:hover { cursor: move; } #canvas .sample[data-active='true']:after { content: ""; position: absolute; background: ur...
CSS selectors - CSS: Cascading Style Sheets
added the || column combinator, grid structural selectors, logical combinators, location, time-demensional, resource state, linguistic and ui pseudo-classes, modifier for ascii case-sensitive and case-insensitive attribute value selection. selectors level 3 recommendation added the ~ general sibling combinator and tree-structural pseudo-classes. made pseudo-elements use a :: double-colon prefix. additional attribute selectors css level 2 (revision 1) recommendation added the > child and + adjacent sibling combinators. added the universal and attribute selectors. css level 1 recommendation initial definition. see the pseudo-class and pseudo-element specification tables for details on those. ...
CSS values and units - CSS: Cascading Style Sheets
accept. below is an overview of most of these data types. refer to the page for each value type for more detailed information. textual data types <custom-ident> pre-defined keywords as an <ident> <string> <url> text data types are either <string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string. a <string> must be quoted with either single or double quotes. css identifiers, listed in the specifications as <ident> or <custom-ident>, must be unquoted. in the css specifications, values that can be defined by the web developer, like keyframe animations, font-family names, or grid areas are listed as a <custom-ident>, <string>, or both. when both quoted and unquoted user defined text values are permitted, the specification will list <custom-id...
Pseudo-elements - CSS: Cascading Style Sheets
* the first line of every <p> element. */ p::first-line { color: blue; text-transform: uppercase; } note: in contrast to pseudo-elements, pseudo-classes can be used to style an element based on its state. syntax selector::pseudo-element { property: value; } you can use only one pseudo-element in a selector. it must appear after the simple selectors in the statement. note: as a rule, double colons (::) should be used instead of a single colon (:). this distinguishes pseudo-classes from pseudo-elements. however, since this distinction was not present in older versions of the w3c spec, most browsers support both syntaxes for the original pseudo-elements. index of standard pseudo-elements ::after (:after) ::backdrop ::before (:before) ::cue ::cue-region ::first-letter (:fi...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
ferenced in multiple other places. an additional benefit is semantic identifiers. for example, --main-text-color is easier to understand than #00ff00, especially if this same color is also used in other contexts. custom properties are subject to the cascade and inherit their value from their parent. basic usage declaring a custom property is done using a custom property name that begins with a double hyphen (--), and a property value that can be any valid css value. like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in. a common best practice is to define custom properties on the :root pseudo-class, so that it can be applied globally acro...
background-clip - CSS: Cascading Style Sheets
content-box examples html <p class="border-box">the background extends behind the border.</p> <p class="padding-box">the background extends to the inside edge of the border.</p> <p class="content-box">the background extends only to the edge of the content box.</p> <p class="text">the background is clipped to the foreground text.</p> css p { border: .8em darkviolet; border-style: dotted double; margin: 1em 0; padding: 1.4em; background: linear-gradient(60deg, red, yellow, red, yellow, red); font: 900 1.2em sans-serif; text-decoration: underline; } .border-box { background-clip: border-box; } .padding-box { background-clip: padding-box; } .content-box { background-clip: content-box; } .text { background-clip: text; -webkit-background-clip: text; color: rgba(0,0,0,.2); ...
background-origin - CSS: Cascading Style Sheets
ng box. content-box the background is positioned relative to the content box. formal definition initial valuepadding-boxapplies toall elements. ...
border-bottom-left-radius - CSS: Cascading Style Sheets
a square: an arc of circle is used as the border div { border-bottom-left-radius: 40%; } . the box is not a square: an arc of ellipse is used as the border div { border-bottom-left-radius: 40%; } . the background color is clipped at the border div { border-bottom-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-left-radius' in that specification. candidate recommendation initial definition ...
border-bottom-right-radius - CSS: Cascading Style Sheets
quare: an arc of circle is used as the border div { border-bottom-right-radius: 40%; } . the box is not a square: an arc of ellipse is used as the border div { border-bottom-right-radius: 40%; } . the background color is clipped at the border div { border-bottom-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-right-radius' in that specification. candidate recommendation initial definition ...
border-bottom - CSS: Cascading Style Sheets
) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgb...
border-left - CSS: Cascading Style Sheets
) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgb...
border-right - CSS: Cascading Style Sheets
) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgb...
border-top-left-radius - CSS: Cascading Style Sheets
candidate recommendation initial definition ...
border-top-right-radius - CSS: Cascading Style Sheets
the box is a square: an arc of circle is used as the border div { border-top-right-radius: 40%; } . the box is not a square: an arc of ellipse is used as the border div { border-top-right-radius: 40%; } the background color is clipped at the border div { border-top-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-right-radius' in that specification. candidate recommendation initial definition ...
border-top - CSS: Cascading Style Sheets
) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgb...
border - CSS: Cascading Style Sheets
Web › CSS › border
) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgb...
column-rule-style - CSS: Cascading Style Sheets
this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-style'> values */ column-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 sty...
Computed value - CSS: Cascading Style Sheets
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 width, margin-right, text-indent, and top), percentage-specified values turn into percentage-computed values. additionally, unitless numbers specified on the line-height property become the computed value, as specified. the relative values that remain in t...
<custom-ident> - CSS: Cascading Style Sheets
aracter (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. forbidden values a <custom-ident> must not be placed between single or double quotes as this would be identical to a <string>. moreover, the first character must not be a decimal digit, nor a hyphen (-) followed by a decimal digit or another hyphen. to prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none. counter-reset counter-incremen...
brightness() - CSS: Cascading Style Sheets
rkens 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 */ brightness(1) /* no effect */ brightness(200%) /* double brightness */ specifications specification status filter effects module level 1the definition of 'brightness()' in that specification. working draft ...
contrast() - CSS: Cascading Style Sheets
0% 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 */ contrast(1) /* no effect */ contrast(200%) /* double contrast */ specifications specification status filter effects module level 1the definition of 'contrast()' in that specification. working draft ...
saturate() - CSS: Cascading Style Sheets
fied 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%) /* double saturation */ specifications specification status filter effects module level 1the definition of 'saturate()' in that specification. working draft ...
font-family - CSS: Cascading Style Sheets
xample ui-sans-serif text. ui-monospace the default user interface monospace font. this is example ui-monospace text. ui-rounded the default user interface font that has rounded features. this is example ui-rounded text. math this is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. this is some example math text: ax² + bx + c = 0. emoji fonts that are specifically designed to render emoji. this is some example emoji text: ✝♾. fangsong a particular style of chinese characters that are between serif-style song and cursive-style kai forms. this style is often used for government documents. this is some example fangsong text wi...
Inheritance - CSS: Cascading Style Sheets
nherited and non-inherited properties. you can control inheritance for all properties at once using the all shorthand property, which applies its value to all properties. for example: font { all: revert; font-size: 200%; font-weight: bold; } this reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead. then it doubles the font size and applies a font-weight of "bold". see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, s...
text-emphasis - CSS: Cascading Style Sheets
. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), and the open circle is '○' (u+25cb). this is the default shape in horizontal writing modes when no other shape is given. double-circle display double circles as marks. the filled double-circle is '◉' (u+25c9), and the open double-circle is '◎' (u+25ce). triangle display triangles as marks. the filled triangle is '▲' (u+25b2), and the open triangle is '△' (u+25b3). sesame display sesames as marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). this is the default shape in vertical ...
touch-action - CSS: Cascading Style Sheets
handling of all panning and zooming gestures. pan-x enable single-finger horizontal panning gestures. may be combined with pan-y, pan-up, pan-down and/or pinch-zoom. pan-y enable single-finger vertical panning gestures. may be combined with pan-x, pan-left, pan-right and/or pinch-zoom. manipulation enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. disabling double-tap to zoom removes the need for browsers to delay the generation of click events when the user taps the screen. this is an alias for "pan-x pan-y pinch-zoom" (which, for compatibility, is itself still valid). pan-left, pan-right, pan-up, pan-down enable single-finger gestures that begin by scrolling in the given direction(s). once scrolling has started, the d...
url() - CSS: Cascading Style Sheets
Web › CSS › url()
ibed only true urls. in css level 2, the definition of url() was extended to describe any uri, including urns. css values and units level 3 returned to the narrower, initial definition. now, url() denotes only true <url>s. syntax values <string> <url> a url, which is a relative or absolute address, or pointer, to the web resource to be included, or a data uri, optionally in single or double quotes. quotes are required if the url includes parentheses, whitespace, or quotes, unless these characters are escaped, or if the address includes control characters above 0x7e. double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped. the following are all valid and equivalent: <css_property>: url("https://example.com/image.png") <css_...
<url> - CSS: Cascading Style Sheets
Web › CSS › url
te 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. <a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.e...
user-select - CSS: Cascading Style Sheets
s all otherwise, if the used value of user-select on the parent of this element is none, the used value is none otherwise, the used value is text text the text can be selected by the user. all the content of the element shall be selected atomically: if a selection would contain part of the element, then the selection must contain the entire element including all its descendants. if a double-click or context-click occurred in sub-elements, the highest ancestor with this value will be selected. contain enables selection to start within the element; however, the selection will be contained by the bounds of that element. element (ie-specific alias) same as contain. supported only in internet explorer. note: css ui 4 renames user-select: element to contain. formal definition i...
Audio and video manipulation - Developer guides
o inside 3d scenes. note: you can find the source code of this demo on github (see it live also). playback rate we can also adjust the rate that audio and video plays at using an attribute of the <audio> and <video> element called playbackrate. playbackrate is a number that represents a multiple to be applied to the rate of playback, for example 0.5 represents half speed while 2 represents double speed. note that the playbackrate property works with both <audio> and <video>, but in both cases, it changes the playback speed but not the pitch. to manipulate the audio's pitch you need to use the web audio api. see the audiobuffersourcenode.playbackrate property. html <video id="my-video" controls src="https://udn.realityripple.com/samples/6f/08625b424a.m4v"> </video> javascript v...
Block formatting context - Developer guides
html <section> <div class="float">try to resize this outer float</div> <div class="box"><p>normal</p></div> </section> <section> <div class="float">try to resize this outer float</div> <div class="box" ...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
thing that isn't a date — which is helpful — but you can leave the field empty or enter an invalid date in browsers where the input falls back to type text (like the 32nd of april). if you use min and max to restrict the available dates (see setting maximum and minimum dates), supporting browsers will display an error if you try to submit a date that is out of bounds. however, you'll need to double-check the submitted results to ensure the value is within these dates, if the date picker isn't fully supported on the user's device. you can also use the required attribute to make filling in the date mandatory — an error will be displayed if you try to submit an empty date field. this should work in most browsers, even if they fall back to a text input. let's look at an example of minimum a...
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
t going on. let's break it down. the table and base styles table { border: 1px solid black; font: 16px "open sans", helvetica, arial, sans-serif; border-spacing: 0; border-collapse: collapse; } here we've added the border-spacing and border-collapse properties to eliminate spacing between cells and collapse borders that touch one another to be a single border instead of winding up with double borders. th, td { border: 1px solid black; padding:4px 6px; } th { vertical-align: bottom; } 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: ...
MIME types (IANA media types) - HTTP
ogg an audio or video file using the ogg container format. theora is the usual video codec used within it; vorbis is the usual audio codec. multipart/form-data the multipart/form-data type can be used when sending the values of a completed html form from browser to server. as a multipart document format, it consists of different parts, delimited by a boundary (a string starting with a double dash --). each part is its own entity with its own http headers, content-disposition, and content-type for file uploading fields. content-type: multipart/form-data; boundary=aboundarystring (other headers associated with the multipart document as a whole) --aboundarystring content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundarystring conten...
Clear-Site-Data - HTTP
ite-data header accepts one or more directives. if all types of data should be cleared, the wildcard directive ("*") can be used. // single directive clear-site-data: "cache" // multiple directives (comma separated) clear-site-data: "cache", "cookies" // wild card clear-site-data: "*" directives all directives must comply with the quoted-string grammar. a directive that does not include the double quotes is invalid. "cache" indicates that the server wishes to remove locally cached data (i.e. the browser cache, see http caching) for the origin of the response url. depending on the browser, this might also clear out things like pre-rendered pages, script caches, webgl shader caches, or address bar suggestions. "cookies" indicates that the server wishes to remove all cookies for the ori...
ETag - HTTP
Web › HTTP › Headers › ETag
efficiently. weak etag values of two representations of the same resources might be semantically 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 ...
If-Match - HTTP
Web › HTTP › Headers › If-Match
as fetched. if the request cannot be fulfilled, the 412 (precondition failed) response is returned. header type request header forbidden header name no syntax if-match: <etag_value> if-match: <etag_value>, <etag_value>, … directives <etag_value> entity tags uniquely representing the requested resources. they are a string of ascii characters placed between double quotes (like "675af34563dc-tr34"). they may be prefixed by w/ to indicate that they are "weak", i.e. that they represent the resource semantically, but not byte-for-byte. however, in an if-match header, weak entity tags will never match. * the asterisk is a special value representing any resource. examples if-match: "bfc13a64729c4290ef5b2c2730249c88ca92d82d" if-match: "67ab43", "54ed21", "7...
If-None-Match - HTTP
evious put; this problem is a variation of the lost update problem. header type request header forbidden header name no syntax if-none-match: "<etag_value>" if-none-match: "<etag_value>", "<etag_value>", … if-none-match: * directives <etag_value> entity tags uniquely representing the requested resources. they are a string of ascii characters placed between double quotes (like "675af34563dc-tr34") and may be prefixed by w/ to indicate that the weak comparison algorithm should be used (this is useless with if-none-match as it only uses that algorithm). * the asterisk is a special value representing any resource. they are only useful when uploading a resource, usually with put, to check if another resource with the identity has already been uploaded before...
If-Range - HTTP
Web › HTTP › Headers › If-Range
the stored resource has not been modified since the last fragment has been received. header type request header forbidden header name no syntax if-range: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt if-range: <etag> directives <etag> an entity tag uniquely representing the requested resource. it is a string of ascii characters placed between double quotes (like "675af34563dc-tr34") and may be prefixed by w/ to indicate that the weak comparison algorithm should be used. <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> one of "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" (case sensitive). <year> 4 digit ye...
Set-Cookie - HTTP
ookie-name>=<cookie-value>; domain=<domain-value>; secure; httponly attributes <cookie-name>=<cookie-value> a cookie begins with a name-value pair: a <cookie-name> can be any us-ascii characters, except control characters, spaces, or tabs. it also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. a <cookie-value> can optionally be wrapped in double quotes and include any us-ascii characters excluding control characters, whitespace, double quotes, comma, semicolon, and backslash. encoding: many implementations perform url encoding on cookie values, however it is not required per the rfc specification. it does help satisfying the requirements about which characters are allowed for <cookie-value> though. __secure- prefix: cookies names start...
Proxy Auto-Configuration (PAC) file - HTTP
client ip address (the remote_addr environment variable in cgi). usage of isinnet(), isresolvable() and dnsresolve() functions should be carefully considered, as they require the dns server to be consulted. all the other autoconfig-related functions are mere string-matching functions that don't require the use of a dns server. if a proxy is used, the proxy will perform its dns lookup which would double the impact on the dns server. most of the time these functions are not necessary to achieve the desired result. history and implementation proxy auto-config was introduced into netscape navigator 2.0 in the late 1990s, at the same time when javascript was introduced. open-sourcing netscape eventually lead to firefox itself. the most "original" implementation of pac and its javascript librarie...
Details of the object model - JavaScript
the next figure illustrates using these javascript definitions to create new objects and shows the property values for the new objects. note: th...
Numbers and dates - JavaScript
his chapter introduces the concepts, objects and functions used to work with and perform calculations using numbers and dates in javascript. this includes using numbers written in various bases including decimal, binary, and hexadecimal, as well as the use of the global math object to perform a wide variety of mathematical operations on numbers. numbers in javascript, numbers are implemented in double-precision 64-bit binary format ieee 754 (i.e., a number between ±2−1022 and ±2+1023, or about ±10−308 to ±10+308, with a numeric precision of 53 bits). integer values up to ±253 − 1 can be represented exactly. in addition to being able to represent floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan (not-a-number). a more recent addition t...
SyntaxError: invalid regular expression flag "x" - JavaScript
les there are only six valid regular expression flags. /foo/bar; // syntaxerror: invalid regular expression flag "b" did you intend to create a regular expression? an expression containing two slashes is interpreted as a regular expression literal. let obj = { url: /docs/web }; // syntaxerror: invalid regular expression flag "w" or did you mean to create a string instead? add single or double quotes to create a string literal. let obj = { url: '/docs/web' }; valid regular expression flags see the table above for the six valid regular expression flags that are allowed in javascript. /foo/g; /foo/gims; /foo/uy; ...
SyntaxError: missing } after function body - JavaScript
(function() { if (true) { return false; } }); ...
SyntaxError: missing ; before statement - JavaScript
ings properly, or using var wrongly. you might also have too many parenthesis somewhere. carefully check the syntax when this error is thrown. examples unescaped strings this error can occur easily when not escaping strings properly and the javascript engine is expecting the end of your string already. for example: var foo = 'tom's bar'; // syntaxerror: missing ; before statement you can use double quotes, or escape the apostrophe: var foo = "tom's bar"; var foo = 'tom\'s bar'; declaring properties with var you cannot declare properties of an object or array with a var declaration. var obj = {}; var obj.foo = 'hi'; // syntaxerror missing ; before statement var array = []; var array[0] = 'there'; // syntaxerror missing ; before statement instead, omit the var keyword: var obj = {}; ...
Arrow function expressions - JavaScript
= () => {}; (() => 'foobar')(); // returns "foobar" // (this is an immediately invoked function expression) var simple = a => a > 15 ? 15 : a; simple(16); // 15 simple(10); // 10 let max = (a, b) => a > b ? a : b; // easy array filtering, mapping, ... var arr = [5, 6, 13, 0, 1, 18, 23]; var sum = arr.reduce((a, b) => a + b); // 66 var even = arr.filter(v => v % 2 == 0); // [6, 0, 18] var double = arr.map(v => v * 2); // [10, 12, 26, 0, 2, 36, 46] // more concise promise chains promise.then(a => { // ... }).then(b => { // ... }); // parameterless arrow functions that are visually easier to parse settimeout( () => { console.log('i happen sooner'); settimeout( () => { // deeper code console.log('i happen later'); }, 1); }, 1); specifications specification ...
Array.prototype.reduceRight() - JavaScript
ut of the last one. /** * function composition is way in which result of one function can * be passed to another and so on. * * h(x) = f(g(x)) * * function execution happens right to left * * https://en.wikipedia.org/wiki/function_composition */ const compose = (...args) => (value) => args.reduceright((acc, fn) => fn(acc), value) // increment passed number const inc = (n) => n + 1 // doubles the passed value const double = (n) => n * 2 // using composition function console.log(compose(double, inc)(2)); // 6 // using composition function console.log(compose(inc, double)(2)); // 5 specifications specification ecmascript (ecma-262)the definition of 'array.prototype.reduceright' in that specification. ...
Array.prototype.length - JavaScript
o false, any attempts to delete the property or change its attributes (writable, configurable, or enumerable) will fail. enumerable: if this attribute set to true, the property will be iterated over during for or for..in loops. examples iterating over an array in the following example, the array numbers is iterated through by looking at the length property. the value in each element is then doubled. var numbers = [1, 2, 3, 4, 5]; var length = numbers.length; for (var i = 0; i < length; i++) { numbers[i] *= 2; } // numbers is now [2, 4, 6, 8, 10] shortening an array the following example shortens the array numbers to a length of 3 if the current length is greater than 3. var numbers = [1, 2, 3, 4, 5]; if (numbers.length > 3) { numbers.length = 3; } console.log(numbers); // [1, 2,...
Boolean - JavaScript
var x = new boolean(false); if (x) { // this code is executed } this behavior does not apply to boolean primitives. for example, the condition in the following if statement evaluates to false: var x = false; if (x) { // this code is not executed } do not use a boolean object to convert a non-boolean value to a boolean value. to perform this task, instead, use boolean as a function, or a double not operator: var x = boolean(expression); // use this... var x = !!(expression); // ...or this var x = new boolean(expression); // don't use this! if you specify any object, including a boolean object whose value is false, as the initial value of a boolean object, the new boolean object has a value of true. var myfalse = new boolean(false); // initial value of false var g = bo...
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.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. ...
Float64Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
Float64Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor float64array() creates a new float64array object. static properties float64array.bytes_per_element returns a number value of the element size. 8 in the case of an float64array. float64array.name returns the string value of the constructor name. ...
Intl.Locale.prototype.numberingSystem - JavaScript
kali kayah li digits khmr khmer digits knda kannada digits lana tai tham hora (secular) digits lanatham tai tham tham (ecclesiastical) digits laoo lao digits latn latin digits lepc lepcha digits limb limbu digits mathbold mathematical bold digits mathdbl mathematical double-struck digits mathmono mathematical monospace digits mathsanb mathematical sans-serif bold digits mathsans mathematical sans-serif digits mlym malayalam digits modi modi digits mong mongolian digits mroo mro digits mtei meetei mayek digits mymr myanmar digits mymrshan myanmar sh...
Math.fround() - JavaScript
the math.fround() function returns the nearest 32-bit single precision float representation of a number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax var singlefloat = math.fround(doublefloat); parameters doublefloat a number. if the parameter is of a different type, it will get converted to a number or to nan if it cannot be converted. return value the nearest 32-bit single precision float representation of the given number. description javascript uses 64-bit double floating-point numbers internally, which offer a very high precision. however, sometimes you may be working with 32-bit floating-poi...
Math.log1p() - JavaScript
o contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.log1p(x) parameters x a number. return value the natural logarithm (base e) of 1 plus the given number. if the number is less than -1, nan is returned. description for very small values of x, adding 1 can reduce or eliminate precision. the double floats used in js give you about 15 digits of precision. 1 + 1e-15 = 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. when you calculate log(1 + x), you should get an answer very close to x, if x is small (that's why these are called 'natural' logarithms). if you calculate math.log(1 + 1.1111111111e-15)...
Number.MAX_SAFE_INTEGER - JavaScript
-examples and send us a pull request. 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() f...
Number.MIN_SAFE_INTEGER - JavaScript
s and send us a pull request. property 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_i...
Number.isSafeInteger() - JavaScript
feinteger() method determines whether the provided value is a number that is a safe integer. 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 safe integer is an integer that can be exactly represented as an ieee-754 double precision number, and whose ieee-754 representation cannot be the result of rounding any other integer to fit the ieee-754 representation. for example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any ieee-754 rounding mode. in contrast, 253 is not a safe integer: it can be exactly represented in ieee-754, but the integer 253 + 1 can't be di...
TypedArray.prototype.map() - JavaScript
[1, 2, 3], // numbers is still uint8array [1, 4, 9] mapping a typed array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it. the argument will automatically be assigned to each element of the typed array as map loops through the original typed array. const numbers = new uint8array([1, 4, 9]); const doubles = numbers.map(function(num) { return num * 2; }); // doubles is now uint8array [2, 8, 18] // numbers is still uint8array [1, 4, 9] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.map' in that specification. ...
Logical AND (&&) - JavaScript
onverted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the && operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive. to explicitly convert its return value (or any expression in general) to the corresponding boolean value, use a double not operator or the boolean constructor. short-circuit evaluation the logical and expression is evaluated left to right, it is tested for possible "short-circuit" evaluation using the following rule: (some falsy expression) && expr is short-circuit evaluated to the falsy expression; short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take e...
Logical OR (||) - JavaScript
onverted to false are: null; nan; 0; empty string ("" or '' or ``); undefined. even though the || operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive. to explicitly convert its return value (or any expression in general) to the corresponding boolean value, use a double not operator or the boolean constructor. short-circuit evaluation the logical or expression is evaluated left to right, it is tested for possible "short-circuit" evaluation using the following rule: (some truthy expression) || expr is short-circuit evaluated to the truthy expression. short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take ...
Object initializer - JavaScript
e used to describe an object. values of object properties can either contain primitive data types or other objects. object literal notation vs json the object literal notation is not the same as the javascript object notation (json). although they look similar, there are differences between them: json permits only property definition using "property": value syntax. the property name must be double-quoted, and the definition cannot be a shorthand. in json the values can only be strings, numbers, arrays, true, false, null, or another (json) object. a function value (see "methods" above) can not be assigned to a value in json. objects like date will be a string after json.parse(). json.parse() will reject computed property names and an error will be thrown. examples creating objects a...
Pipeline operator (|>) - JavaScript
alent call in traditional syntax looks like this: let url = decodeuri("%21"); syntax expression |> function the value of the specified expression is passed into the function as its sole parameter. parameters expression any valid expression. function any function. examples chaining function calls the pipeline operator can improve readability when chaining several functions. const double = (n) => n * 2; const increment = (n) => n + 1; // without pipeline operator double(increment(double(double(5)))); // 42 // with pipeline operator 5 |> double |> double |> increment |> double; // 42 specifications specification pipeline operatorthe definition of 'pipeline operator' in that specification. ...
import - JavaScript
me from "module-name"; import "module-name"; var promise = import("module-name"); defaultexport name that will refer to the default export from the module. module-name the module to import from. this is often a relative or absolute path name to the .js file containing the module. certain bundlers may permit or require the use of the extension; check your environment. only single quoted and double quoted strings are allowed. name name of the module object that will be used as a kind of namespace when referring to the imports. exportn name of the exports to be imported. aliasn names that will refer to the named imports. description the name parameter is the name of the "module object" which will be used as a kind of namespace to refer to the exports. the export parameters specify i...
Template literals (Template strings) - JavaScript
ti-line strings and string interpolation features with them. they were called "template strings" in prior editions of the es2015 specification. syntax `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag`string text ${expression} string text` description template literals are enclosed by the backtick (` `) (grave accent) character instead of double or single quotes. template literals can contain placeholders. these are indicated by the dollar sign and curly braces (${expression}). the expressions in the placeholders and the text between the backticks (` `) get passed to a function. the default function just concatenates the parts into a single string. if there is an expression preceding the template literal (tag here), this is called a ta...
<mi> - MathML
Web › MathML › Element › mi
typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. ...
<mn> - MathML
Web › MathML › Element › mn
which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. ...
<mo> - MathML
Web › MathML › Element › mo
which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. ...
<mtext> - MathML
Web › MathML › Element › mtext
which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. ...
MathML documentation index - MathML
Web › MathML › Index
their respective operands (such as <mi> and <mn>). this element renders as a horizontal row containing its arguments. 27 <ms> mathml, 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 (&quot;); 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:eleme...
CSS and JavaScript animation performance - Web Performance
a performance test, using firefox, to see what animation method seems better overall. enabling fps tools before going through the example, please enable fps tools first to see the current frame rate: in the url bar, enter about:config; click the i’ll be careful, i promise! button to enter the config screen. in the search bar, search for the layers.acceleration.draw-fps preference. double-click the entry to set the value to true. now you will be able to see three little purple boxes at the upper left corner of the firefox window. the first box represents fps. running the performance test initially in the test seen below, a total of 1000 <div> elements are transformed by css animation. the animation can be switched to requestanimationframe() by clicking the toggle button.
Populating the page: how browsers work - Web Performance
nters the links during parsing, described below. tcp slow start / 14kb rule the first response packet will be 14kb. this is part of tcp slow start, an algorithm which balances the speed of a network connection. slow start gradually increases the amount of data transmitted until the network's maximum bandwidth can be determined. in tcp slow start, after receipt of the initial packet, the server doubles the size of the next packet to around 28kb. subsequent packets increase in size until a predetermined threshold is reached, or congestion is experienced. if you’ve ever heard of the 14kb rule for initial page load, tcp slow start is the reason why the initial response is 14kb, and why web performance optimization calls for focusing optimizations with this initial 14kb response in mind. tcp ...
Media - Progressive web apps (PWAs)
ng the media type. these are ways of separating styling rules for different media types into different files. for full details of media types, see media in the css specification. there are more examples of the display property in a later page in this tutorial: xml data. printing css has specific support for printing and for paged media in general. a @page rule can set the page margins. for double-sided printing, you can specify the margins separately for @page:left and @page:right. for print media, you normally use appropriate length units like inches (in) and points (pt = 1/72 inch), or centimeters (cm) and millimeters (mm). it is equally appropriate to use ems (em) to match the font size, and percentages (%). you can control how the content of the document breaks across page boundarie...
name - SVG: Scalable Vector Graphics
Web › SVG › Attribute › name
me 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 'name for <color-profile>' in that specification. reco...
<view> - SVG: Scalable Vector Graphics
Web › SVG › Element › view
xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="gradient"> <stop offset="0%" stop-color="#8cffa0" /> <stop offset="100%" stop-color="#8ca0ff" /> </radialgradient> </defs> <circle r="50" cx="180" cy="50" style="fill:url(#gradient)"/> <view id="halfsizeview" viewbox="0 0 1200 400"/> <view id="normalsizeview" viewbox="0 0 600 200"/> <view id="doublesizeview" viewbox="0 0 300 100"/> <a xlink:href="#halfsizeview"> <text x="5" y="20" font-size="20">half size</text> </a> <a xlink:href="#normalsizeview"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesizeview"> <text x="5" y="60" font-size="20">double size</text> </a> </svg> result dom interface this element implements the svgviewelem...
Clipping and masking - SVG: Scalable Vector Graphics
ns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="200" height="200" fill="blue" /> <circle cx="100" cy="100" r="50" stroke="yellow" stroke-width="40" stroke-opacity=".5" fill="red" /> </svg> screenshotlive sample you see in this example the red circle on blue background. the yellow stroke is set to 50% opacity, which leads effectively to a double-color stroke. using well-known css techniques one of the most powerful tools in a web developer's toolbox is display: none. it is therefore little surprise, that it was decided to take this css property into svg as well, together with visibility and clip as defined by css 2. for reverting a previously set display: none it is important to know, that the initial value for all svg elements is inli...
Positions - SVG: Scalable Vector Graphics
unit. <svg width="200" height="200" viewbox="0 0 100 100"> the whole svg canvas here is 200px by 200px in size. however, the viewbox attribute defines the portion of that canvas to display. these 200x200 pixels display an area that starts at user unit (0,0) and spans 100x100 user units to the right and to the bottom. this effectively zooms in on the 100x100 unit area and enlarges the image to double size. the current mapping (for a single element or the whole image) of user units to screen units is called user coordinate system. apart from scaling the coordinate system can also be rotated, skewed and flipped. the default user coordinate system maps one user pixel to one device pixel. (however, the device may decide, what it understands as one pixel.) lengths in the svg file with specific di...
Same-origin policy - Web security
esource from another origin. it helps isolate potentially malicious documents, reducing possible attack vectors. definition of an origin two urls have the same origin if the protocol, port (if specified), and host are the same for both. you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
XML introduction - XML: Extensible Markup Language
es like html, xml offers methods (called entities) for referring to some special reserved characters (such as a greater than sign which is used for tags). there are five of these characters that you should know: entity character description &lt; < less than sign &gt; > greater than sign &amp; & ampersand &quot; " one double-quotation mark &apos; ' one apostrophe (or single-quotation mark) even though there are only 5 declared entities, more can be added using the document's document type definition. for example, to create a new &warning; entity, you can do this: <?xml version="1.0" encoding="utf-8"?> <!doctype body [ <!entity warning "warning: something bad happened... please refresh and try...
Introduction to using XPath in JavaScript - XPath
he 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 = document.evaluate( 'count(//p)', docum...
Understanding WebAssembly text format - WebAssembly
nstantiation time and are similar to the .data sections in native executable formats. our final wasm module looks like this: (module (import "console" "log" (func $log (param i32 i32))) (import "js" "mem" (memory 1)) (data (i32.const 0) "hi") (func (export "writehi") i32.const 0 ;; pass offset 0 to log i32.const 2 ;; pass length 2 to log call $log)) note: above, note the double semi-colon syntax (;;) for allowing comments in webassembly files. now from javascript we can create a memory with 1 page and pass it in. this results in "hi" being printed to the console: var memory = new webassembly.memory({initial:1}); var importobject = { console: { log: consolelogstring }, js: { mem: memory } }; webassembly.instantiatestreaming(fetch('logger2.wasm'), importobject) .th...