Search completed in 0.99 seconds.
Index - Web APIs
cssstyledeclaration.getpropertyvalue() api, cssom, method, reference the cssstyledeclaration.getpropertyvalue() method interface returns a domstring containing the value of a specified css property. 460 cssstyledeclaration.item() api, cssom, method, reference the cssstyledeclaration.item() method interface returns a css property name from a cssstyledeclaration by
index 461 cssstyledeclaration.length api, cssom, property, reference the read-only property returns an integer that represents the number of style declarations in this css declaration block. 462 cssstyledeclaration.parentrule api, cssom, property, reference the cssstyledeclaration.parentrule read-only property returns a cssrule that is the parent of this style ...
... the cssunparsedvalue.foreach() method executes a provided function once for each element of the cssunparsedvalue. 489 cssunparsedvalue.keys() api, css typed object model api, cssunparsedvalue, constructor, experimental, houdini, method, needsexample, reference, keys() the cssunparsedvalue.keys() method returns a new array iterator object that contains the keys for each
index in the array. 490 cssunparsedvalue.length api, css typed object model api, cssunparsedvalue, constructor, experimental, houdini, needsexample, property, reference, length the length read-only property of the cssunparsedvalue interface returns the number of items in the object. 491 cssunparsedvalue.values() api, css typed object model api, cssunparsedvalue, cons...
... the length read-only property of the cssunparsedvalue interface returns the number of items in the object. 491 cssunparsedvalue.values() api, css typed object model api, cssunparsedvalue, constructor, experimental, houdini, method, needsexample, reference, values() the cssunparsedvalue.values() method returns a new array iterator object that contains the values for each
index in the cssunparsedvalue object. 492 cssvalue api, cssvalue, dom, interface, needsexample, reference the cssvalue interface represents the current computed value of a css property. 493 cssvalue.csstext api, cssvalue, property, reference, csstext the csstext property of the cssvalue interface represents the current computed css property value. 494 ...
...And 150 more matches
Using IndexedDB - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser. because it lets you create web applications with rich query abilities regardless of network availability, your applications can work both online and offline. about this document this tutorial walks you through using the asynchronous api of
indexeddb. if you are not familiar with
indexeddb, you should first read basic concepts about
indexeddb. for the reference documentation on the
indexeddb api, see the
indexeddb article and its subpages. this article documents the types of objects used by
indexeddb, as well as the methods of the asynchronous api (the synchronous api was removed from spec). basic pattern the basic pattern that
indexeddb encourages is the following: open a database. create an object sto...
...ion and make a request to do some database operation, like adding or retrieving data. wait for the operation to complete by listening to the right kind of dom event. do something with the results (which can be found on the request object). with these big concepts under our belts, we can get to more concrete stuff. creating and structuring the store using an experimental version of
indexeddb in case you want to test your code in browsers that still use a prefix, you can use the following code: // in the following line, you should include the prefixes of implementations you want to test. window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function. // moreover, you may...
...bkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) beware that implementations that use a prefix may be buggy, or incomplete, or following an old version of the specification. therefore, it is not recommended to use it in production code. it may be preferable to not support a browser than to claim to support it and fail: if (!window.
indexeddb) { console.log("your browser doesn't support a stable version of
indexeddb. such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var request = window.
indexeddb.open("mytestdatabase", 3); see that? opening a database is just like any other operation — you have to "request" it. the open request doesn'...
...And 49 more matches
String.prototype.indexOf() - JavaScript
the
indexof() method returns the
index within the calling string object of the first occurrence of the specified value, starting the search at from
index. returns -1 if the value is not found. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: for the array method, see array.prototype.
indexof(). syntax str.
indexof(searchvalue [, from
index]) parameters searchvalue the string value to search for. if no string is explicitly provided, searchvalue will be coerced to "undefined", and this value will be searched for in str. ...
...ttps://github.com/mdn/interactive-examples and send us a pull request. note: for the array method, see array.prototype.
indexof(). syntax str.
indexof(searchvalue [, from
index]) parameters searchvalue the string value to search for. if no string is explicitly provided, searchvalue will be coerced to "undefined", and this value will be searched for in str. so, for example: 'undefined'.
indexof() will return 0, as undefined is found at position 0 in the string undefined. 'undefine'.
indexof() however will return -1, as undefined is not found in the string undefine. from
index optional an integer representing the
index at which to start the search. defaults to 0. ...
...ll be coerced to "undefined", and this value will be searched for in str. so, for example: 'undefined'.
indexof() will return 0, as undefined is found at position 0 in the string undefined. 'undefine'.
indexof() however will return -1, as undefined is not found in the string undefine. from
index optional an integer representing the
index at which to start the search. defaults to 0. for from
index values lower than 0, or greater than str.length, the search starts at
index 0 and str.length, respectively. for example, 'hello world'.
indexof('o', -5) will return 4, as it starts at position 0, and o is found at position 4. ...
...And 24 more matches
Index - Archive of obsolete content
no summary! 43 clipboard add-on sdk interact with the system clipboard, setting and getting its contents. 44 context-menu add-on sdk, add-ons, extensions, firefox, sdk adds items, submenus, and menu separators to the page's context menu. 45 hotkeys add-on sdk assign hotkey combinations to functions in your add-on. 46
indexed-db add-on sdk exposes the
indexeddb api to add-ons. 47 l10n add-on sdk localize strings appearing in the add-on's javascript code. 48 notifications add-on sdk, notifications display transient, toaster-style desktop messages to the user. 49 page-mod add-on sdk run scripts in the context of web pages whose url matches a give...
...olor xul attributes, xul reference no summary! 811 colorpicker.type xul attributes, xul reference no summary! 812 cols xul attributes, xul reference no summary! 813 command xul attributes, xul reference no summary! 814 commandupdater xul attributes, xul reference no summary! 815 completedefault
index xul attributes, xul reference no summary! 816 completeselected
index no summary! 817 container xul attributes, xul reference no summary! 818 containment xul attributes, xul reference no summary! 819 contentcontextmenu xul attributes, xul reference no summary! 820 contenttooltip xul attribu...
... 823 control xul attributes, xul reference no summary! 824 crop xul attributes, xul reference no summary! 825 curpos xul attributes, xul reference no summary! 826 current xul attributes, xul reference no summary! 827 currentset needshelp, xul attributes, xul reference no summary! 828 custom
index xul attributes, xul reference no summary! 829 customizable xul attributes, xul reference no summary! 830 cycler xul attributes, xul reference no summary! 831 datasources xul attributes, xul reference no summary! 832 datepicker.type xul attributes, xul reference no summary! 833 datepicker.value...
...And 23 more matches
Index
ding xpcom objects in c++ using visual studio. xpcom is mozilla’s cross platform component object model, similar to microsoft’s com technology. xpcom components can be implemented in c, c++, and javascript, and can be used from c, c++, and javascript. that means you can call javascript methods from c++ and vice versa. for more information on the workings of xpcom look elsewhere. 12
index found 1275 pages: 13 interfacing with the xpcom cycle collector firefox 3, xpcom this is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection. if you have a class that you think is involved in a cyclical-ownership leak, t...
...n the error console if not caught than simply throwing an nsresult's value will. 19 components.id xpcom:language bindings, xpconnect components.id is a constructor that creates native objects that conform to the nsijsid interface. 20 components.classes xpcom:language bindings, xpconnect components.classes is a read-only object whose properties are classes
indexed by contractid. 21 components.classesbyid xpcom:language bindings, xpconnect components.classesbyid is a read-only object whose properties are classes
indexed by cid. 22 components.interfaces xpcom:language bindings, xpconnect components.interfaces is a read-only object whose properties are interfaces
indexed by their names. 23 components.inte...
... 24 components.issuccesscode xpcom, xpcom:language bindings, xpconnect determines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively. ...
...And 21 more matches
Array.prototype.indexOf() - JavaScript
the
indexof() method returns the first
index at which a given element can be found in the array, or -1 if it is not present. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.
indexof(searchelement[, from
index]) parameters searchelement element to locate in the array. from
index optional the
index to start the search at. if the
index is greater than or equal to the array's length, -1 is returned, which means the array will not be searched. if the provided
index value is a negative number, it is taken as the offset from the end of the array. ...
....
indexof(searchelement[, from
index]) parameters searchelement element to locate in the array. from
index optional the
index to start the search at. if the
index is greater than or equal to the array's length, -1 is returned, which means the array will not be searched. if the provided
index value is a negative number, it is taken as the offset from the end of the array. note: if the provided
index is negative, the array is still searched from front to back. if the provided
index is 0, then the whole array will be searched. default: 0 (entire array is searched). return value the first
index of the element in the array; -1 if not found. ...
...searched. if the provided
index value is a negative number, it is taken as the offset from the end of the array. note: if the provided
index is negative, the array is still searched from front to back. if the provided
index is 0, then the whole array will be searched. default: 0 (entire array is searched). return value the first
index of the element in the array; -1 if not found. description
indexof() compares searchelement to elements of the array using strict equality (the same method used by the === or triple-equals operator). note: for the string method, see string.prototype.
indexof(). polyfill
indexof() was added to the ecma-262 standard in the 5th edition; as such it may not be present in all browsers. you can work around this by utilizing the following code at the beginning of...
...And 20 more matches
Index - Archive of obsolete content
color xul attributes, xul reference no summary! 64 colorpicker.type xul attributes, xul reference no summary! 65 cols xul attributes, xul reference no summary! 66 command xul attributes, xul reference no summary! 67 commandupdater xul attributes, xul reference no summary! 68 completedefault
index xul attributes, xul reference no summary! 69 completeselected
index no summary! 70 container xul attributes, xul reference no summary! 71 containment xul attributes, xul reference no summary! 72 contentcontextmenu xul attributes, xul reference no summary! 73 contenttooltip xul attributes, ...
... 76 control xul attributes, xul reference no summary! 77 crop xul attributes, xul reference no summary! 78 curpos xul attributes, xul reference no summary! 79 current xul attributes, xul reference no summary! 80 currentset needshelp, xul attributes, xul reference no summary! 81 custom
index xul attributes, xul reference no summary! 82 customizable xul attributes, xul reference no summary! 83 cycler xul attributes, xul reference no summary! 84 datasources xul attributes, xul reference no summary! 85 datepicker.type xul attributes, xul reference no summary! 86 datepicker.value ...
... no summary! 154 ignorekeys xul attributes, xul reference no summary! 155 image xul attributes, xul reference no summary! 156 image.onload no summary! 157 inactivetitlebarcolor xul attributes, xul reference no summary! 158 increment xul attributes, xul reference no summary! 159
index xul attributes, xul reference no summary! 160 inputtooltiptext xul attributes, xul reference no summary! 161 insertafter xul attributes, xul reference no summary! 162 insertbefore xul attributes, xul reference no summary! 163 instantapply xul attributes, xul reference no summary! 164 inverted ...
...And 18 more matches
Content Index API - Web APIs
the content
index api allows developers to register their offline enabled content with the browser. concepts and usage as it stands, offline web content is not easily discoverable by users. content
indexing allows developers to tell the browser about their specific offline content. this allows users to discover and view what is available, whilst giving developers the ability to add and manage this content. examples could be a news website prefetching the latest articles in the background, or a content streaming app registering downloaded content. the content
index api is an extension to service workers, which allows developers to add urls and metadata of already cached pages, under the scope of the current service worker. the browser can then use these entries to display offline r...
...ground, or a content streaming app registering downloaded content. the content
index api is an extension to service workers, which allows developers to add urls and metadata of already cached pages, under the scope of the current service worker. the browser can then use these entries to display offline reading to a user. as a developer you can also display these entries within your application.
indexed entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically remove older entries. the api supports
indexing urls corresponding to html documents. a url for a cached media file, for example, can't be
indexed directly. instead, you need to provide a url for a page that displays media, and which works offline. interfaces conte...
... entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically remove older entries. the api supports
indexing urls corresponding to html documents. a url for a cached media file, for example, can't be
indexed directly. instead, you need to provide a url for a page that displays media, and which works offline. interfaces content
index the content
index interface provides functionality to register content available offline. content
indexevent the content
indexevent interface of the content
index api defines the object used to represent the contentdelete event. ...
...And 18 more matches
IDBIndex - Web APIs
idb
index interface of the
indexeddb api provides asynchronous access to an
index in a database. an
index is a kind of object store for looking up records in another object store, called the referenced object store. you use this interface to retrieve data. you can retrieve records in an object store through the primary key or by using an
index. an
index lets you look up records in an object store using properties of the values in the object stores records other than the primary key the
index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. the records in an
index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. ...
...in an object store using properties of the values in the object stores records other than the primary key the
index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. the records in an
index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. each record in an
index can point to only one record in its referenced object store, but several
indexes can reference the same object store. when the object store changes, all
indexes that refers to the object store are automatically updated. you can grab a set of keys within a range. ...
... or deleted. each record in an
index can point to only one record in its referenced object store, but several
indexes can reference the same object store. when the object store changes, all
indexes that refers to the object store are automatically updated. you can grab a set of keys within a range. to learn more, see idbkeyrange. note: this feature is available in web workers. properties idb
index.isautolocale read only returns a boolean indicating whether the
index had a locale value of auto specified upon its creation (see create
index()'s optionalparameters.) idb
index.locale read only returns the locale of the
index (for example en-us, or pl) if it had a locale value specified upon its creation (see create
index()'s optionalparameters.) idb
index.name the name of this
index. id...
...And 17 more matches
IDBIndex.getKey() - Web APIs
if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...And 13 more matches
IndexedDB API - Web APIs
indexeddb is a low-level api for client-side storage of significant amounts of structured data, including files/blobs. this api uses
indexes to enable high-performance searches of this data. while web storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data.
indexeddb provides a solution. this is the main landing page for mdn's
indexeddb coverage — here we provide links to the full api reference and usage guides, browser support details, and some explanation of key concepts. note: this feature is available in web workers. note:
indexeddb api is powerful, but may seem too complicated for simple cases. if you'd prefer a simple api, try libraries such as localforage, dexie.js, zangodb, pouchdb, idb, idb-keyval, jsstore and lovefie...
...re we provide links to the full api reference and usage guides, browser support details, and some explanation of key concepts. note: this feature is available in web workers. note:
indexeddb api is powerful, but may seem too complicated for simple cases. if you'd prefer a simple api, try libraries such as localforage, dexie.js, zangodb, pouchdb, idb, idb-keyval, jsstore and lovefield that make
indexeddb more programmer-friendly. key concepts and usage
indexeddb is a transactional database system, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables,
indexeddb is a javascript-based object-oriented database.
indexeddb lets you store and retrieve objects that are
indexed with a key; any objects supported by the structured clone algorithm can be stored. yo...
...lumn tables,
indexeddb is a javascript-based object-oriented database.
indexeddb lets you store and retrieve objects that are
indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. read more about the concepts behind
indexeddb. learn to use
indexeddb asynchronously from first principles with our using
indexeddb guide. combine
indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers. note: like most web storage solutions,
indexeddb follows a same-origin policy. so while you can access stored data within a domain, you cannot ...
...And 12 more matches
Array.prototype.findIndex() - JavaScript
the find
index() method returns the
index of the first element in the array that satisfies the provided testing function. otherwise, it returns -1, indicating that no element passed the test. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see also the find() method, which returns the value of an array element, instead of its
index. syntax arr.find
index(callback( element[,
index[, array]] )[, thisarg]) parameters callback a function to execute on each value in the array until the function returns true, indicating that the satisfying element was found. it takes three arguments: element the current el...
...hod, which returns the value of an array element, instead of its
index. syntax arr.find
index(callback( element[,
index[, array]] )[, thisarg]) parameters callback a function to execute on each value in the array until the function returns true, indicating that the satisfying element was found. it takes three arguments: element the current element being processed in the array.
index optional the
index of the current element being processed in the array. array optional the array find
index() was called upon. thisarg optional optional object to use as this when executing callback. return value the
index of the first element in the array that passes the test. otherwise, -1. ...
... element the current element being processed in the array.
index optional the
index of the current element being processed in the array. array optional the array find
index() was called upon. thisarg optional optional object to use as this when executing callback. return value the
index of the first element in the array that passes the test. otherwise, -1. description the find
index() method executes the callback function once for every
index in the array until it finds the one where callback returns a truthy value. if such an element is found, find
index() immediately returns the element's
index. if callback never returns a truthy value (or the array's length is 0), find
index() returns -1. edge case alert: unlike other array methods such as array.some(), callback is run e...
...And 12 more matches
Indexed collections - JavaScript
so emp[0] would be employee number zero, emp[1] employee number one, and so on. javascript does not have an explicit array data type. however, you can use the predefined array object and its methods to work with arrays in your applications. ...
...so emp[0] would be employee number zero, emp[1] employee number one, and so on. javascript does not have an explicit array data type. however, you can use the predefined array object and its methods to work with arrays in your applications. ...
...so emp[0] would be employee number zero, emp[1] employee number one, and so on. javascript does not have an explicit array data type. however, you can use the predefined array object and its methods to work with arrays in your applications. ...
...And 11 more matches
IDBIndex.get() - Web APIs
if this value is null or missing, the browser will use an unbound key range. ...
...e thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange. if a value is found, then a structured clone of it is created and set as the result of the request object: this returns the record the key is associated with. note: this feature is available in web workers. syntax var request = my
index.get(key); parameters key optional a key or idbkeyrange that identifies the record to be retrieved. if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description ...
... idbkeyrange that identifies the record to be retrieved. if this value is null or missing, the browser will use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...And 10 more matches
IDBObjectStore.createIndex() - Web APIs
the create
index() method of the idbobjectstore interface creates and returns a new idb
index object in the connected database. it creates a new field/column defining a new data point for each database record to contain. bear in mind that
indexeddb
indexes can contain any javascript data type;
indexeddb uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects. note that this method must be called only from a versionchange transaction mode callback. note: this feature is available in web workers. syntax var myidb
index = objectstore.create
index(
indexname, keypath); var myidb
index = objectstore.create
index(
indexname, keypath, objectparameters); parameters
indexname the name of the
index to create. note that it is possible t...
... objects. note that this method must be called only from a versionchange transaction mode callback. note: this feature is available in web workers. syntax var myidb
index = objectstore.create
index(
indexname, keypath); var myidb
index = objectstore.create
index(
indexname, keypath, objectparameters); parameters
indexname the name of the
index to create. note that it is possible to create an
index with an empty name. keypath the key path for the
index to use. note that it is possible to create an
index with an empty keypath, and also to pass in a sequence (array) as a keypath. ...
...yidb
index = objectstore.create
index(
indexname, keypath, objectparameters); parameters
indexname the name of the
index to create. note that it is possible to create an
index with an empty name. keypath the key path for the
index to use. note that it is possible to create an
index with an empty keypath, and also to pass in a sequence (array) as a keypath. objectparameters optional an idb
indexparameters object, which can include the following properties: attribute description unique if true, the
index will not allow duplicate values for a single key. multientry if true, the
index will add an entry in the
index for each array element when the keypath resolves to an array. if false, it will add one single entry containing the array.
...And 10 more matches
IDBObjectStore.deleteIndex() - Web APIs
return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback. ...
... return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback. ...
... return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback. ...
...And 10 more matches
Index
ne section related to debugging and another section related to drafting optimizations. many of these tips only apply to debug builds of the js shell; they will not function in a release build. 10 how to embed the javascript engine embedding mozilla, javascript, spidermonkey, tutorial see also jsapi user guide. in particular, it has more and better code examples! 11
index index, mdn meta, spidermonkey found 550 pages: 12 introduction to the javascript shell spidermonkey to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your platform from the nightly builds. 13 jit optimization outcomes beginner, firefox, intro, needscontent, spidermonkey spidermon...
...erence, reference, référence(2), spidermonkey js_addfinalizecallback add a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the callback function to add. 188 js_aliaselement jsapi reference, obsolete, spidermonkey js_aliaselement assigns an alternate
index number for an element or numeric property associated with a native object. obj is the object to which the element belongs. name is the element's current
index in the object, and alias is the alternate
index to assign to the element. 189 js_aliasproperty jsapi reference, obsolete, spidermonkey js_aliasproperty assigns an alternate name for a property associated with a native o...
... defines an object property with a tiny id. js_defineucpropertywithtinyid is the unicode version of the function. except for the tinyid parameter, these functions behave exactly as js_defineproperty and js_defineucproperty. see those functions for more details. 237 js_deleteelement jsapi reference, spidermonkey js_deleteelement removes a specified element or numeric property,
index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. 238 js_deleteelement2 jsapi reference, obsolete, spidermonkey js_deleteelement2 removes a specified numeric propert...
...And 9 more matches
IDBIndex.count() - Web APIs
the count() method of the idb
index interface returns an idbrequest object, and in a separate thread, returns the number of records within a key range. note: this feature is available in web workers. syntax var request = my
index.count(); var request = my
index.count(key); parameters key optional the key or key range that identifies the record to be counted. return value a idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. dataerror the key or key range provided contains an invalid key. ...
...request object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idb
index has been deleted or removed. ...
...one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idb
index has been deleted or removed. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. ...
...And 9 more matches
String.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the
index within the calling string object of the last occurrence of the specified value, searching backwards from from
index. returns -1 if the value is not found. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.last
indexof(searchvalue[, from
index]) parameters searchvalue a string representing the value to search for. if searchvalue is an empty string, then from
index is returned. from
index optional the
index of the last character in the string to be considered as the beginning of a match. the default value is +infinity. ...
...b.com/mdn/interactive-examples and send us a pull request. syntax str.last
indexof(searchvalue[, from
index]) parameters searchvalue a string representing the value to search for. if searchvalue is an empty string, then from
index is returned. from
index optional the
index of the last character in the string to be considered as the beginning of a match. the default value is +infinity. if from
index >= str.length, the whole string is searched. if from
index < 0, the behavior will be the same as if it would be 0. return value the
index of the last occurrence of searchvalue; -1 if not found. description characters in a string are
indexed from left to right. ...
...ex of the last character in the string to be considered as the beginning of a match. the default value is +infinity. if from
index >= str.length, the whole string is searched. if from
index < 0, the behavior will be the same as if it would be 0. return value the
index of the last occurrence of searchvalue; -1 if not found. description characters in a string are
indexed from left to right. the
index of the first character is 0, and the
index of the last character is str.length - 1. ...
...And 9 more matches
ContentIndex - Web APIs
the content
index interface of the content
index api allows developers to register their offline enabled content with the browser. properties there are no properties of this interface. methods content
index.add registers an item with the content
index. content
index.delete unregisters an item from the currently
indexed content. content
index.getall returns a promise that resolves with an iterable list of content
index entries. examples feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the
index property, which gives us access to the content
index interface. ...
...etall returns a promise that resolves with an iterable list of content
index entries. examples feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the
index property, which gives us access to the content
index interface. // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('
index' in registration) { // content
index api functionality const content
index = registration.
index; } adding to the content
index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content
index. // our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisi...
...method to register it with the content
index. ...
...And 8 more matches
IDBIndex.openCursor() - Web APIs
the method sets the position of the cursor to the appropriate record, based on the specified direction. if the key range is not specified or is null, then the range includes all the records. a success event is always fired on the result object. if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. if no records match the key range then then the result property of the event is set to null. ...
...ct. if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. if no records match the key range then then the result property of the event is set to null. note: this feature is available in web workers. syntax var request = my
index.opencursor(); var request = my
index.opencursor(range); var request = my
index.opencursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value...
...lects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idb
index has been deleted or removed. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. ...
...And 8 more matches
<isindex> - HTML: Hypertext Markup Language
summary <is
index> was an obsolete html element that put a text field in a page for querying the document. <is
index> provided a single line text input for entering a query string. when sent, the server would return a list of pages matching the query. its support depended on both the browser and the server to react to the query. <is
index> is removed html standard. it was deprecated in html 4.01. the same behaviour can be achieved with an html form. all major browsers have now removed <is
index>. attributes like all other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. ...
...ndard. it was deprecated in html 4.01. the same behaviour can be achieved with an html form. all major browsers have now removed <is
index>. attributes like all other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <is
index prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <label> search document... ...
...attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <is
index prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <label> search document... <input name="is
index"> </label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor type instead of is
index. on november 1992,
indexes as links rather than documents started by dan connolly who is pushing the idea that
indexes are more links than documents. in this thread, different type of solutions are proposed. the question of forms for making queries is mentioned in reference t...
...And 8 more matches
Array.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the last
index at which a given element can be found in the array, or -1 if it is not present. the array is searched backwards, starting at from
index. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.last
indexof(searchelement[, from
index]) parameters searchelement element to locate in the array. from
index optional the
index at which to start searching backwards. defaults to the array's length minus one (arr.length - 1), i.e. the whole array will be searched. if the
index is greater than or equal to the length of the array, the whole array will be searched. if negati...
...helement element to locate in the array. from
index optional the
index at which to start searching backwards. defaults to the array's length minus one (arr.length - 1), i.e. the whole array will be searched. if the
index is greater than or equal to the length of the array, the whole array will be searched. if negative, it is taken as the offset from the end of the array. note that even when the
index is negative, the array is still searched from back to front. if the calculated
index is less than 0, -1 is returned, i.e. the array will not be searched. return value the last
index of the element in the array; -1 if not found. description last
indexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator). polyfil...
...ative, the array is still searched from back to front. if the calculated
index is less than 0, -1 is returned, i.e. the array will not be searched. return value the last
index of the element in the array; -1 if not found. description last
indexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator). polyfill last
indexof was added to the ecma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of last
indexof in implementations which do not natively support it. this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, typeerror, ...
...And 8 more matches
TypedArray.prototype.findIndex() - JavaScript
the find
index() method returns an
index in the typed array, if an element in the typed array satisfies the provided testing function. otherwise -1 is returned. see also the find() method, which returns the value of a found element in the typed array instead of its
index. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.find
index(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three arguments: element the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. ...
...://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.find
index(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three arguments: element the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array find
index was called upon. thisarg optional. object to use as this when executing callback. return value an
index in the array if an element passes the test; otherwise, -1. ...
...ing three arguments: element the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array find
index was called upon. thisarg optional. object to use as this when executing callback. return value an
index in the array if an element passes the test; otherwise, -1. description the find
index method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, find
index immediately returns the
index of that element. otherwise, find
index returns -1. ...
...And 8 more matches
indexed-db - Archive of obsolete content
experimental exposes the
indexeddb api to add-ons. usage scripts running in web pages can access
indexeddb via the window object. for example: window.
indexeddb = window.
indexeddb || window.webkit
indexeddb || window.moz
indexeddb || window.ms
indexeddb; var request = window.
indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. ...
...t. for example: window.
indexeddb = window.
indexeddb || window.webkit
indexeddb || window.moz
indexeddb || window.ms
indexeddb; var request = window.
indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. ...
...ddb || window.webkit
indexeddb || window.moz
indexeddb || window.ms
indexeddb; var request = window.
indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. so you can use the
indexed-db module to access the same api: var {
indexeddb } = require('sdk/
indexed-db'); var request =
indexeddb.open('mydatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the
indexeddb api, such as idbtransaction, idbopendbrequest, and idbobjectstore, are accessible through the
indexeddb object itself. the api exposed b...
...And 7 more matches
PR_NewThreadPrivateIndex
this function can be specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure. ...
...this function can be specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure. ...
...this function can be specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure. ...
...And 7 more matches
HTMLSelectElement.selectedIndex - Web APIs
the htmlselectelement.selected
index is a long that reflects the
index of the first or last selected <option> element, depending on the value of multiple. the value -1 indicates that no element is selected. ...
... the htmlselectelement.selected
index is a long that reflects the
index of the first or last selected <option> element, depending on the value of multiple. the value -1 indicates that no element is selected. ...
... the htmlselectelement.selected
index is a long that reflects the
index of the first or last selected <option> element, depending on the value of multiple. the value -1 indicates that no element is selected. ...
...And 7 more matches
IDBIndex.multiEntry - Web APIs
the multientry read-only property of the idb
index interface returns a boolean value that affects how the
index behaves when the result of evaluating the
index's key path yields an array. this is decided when the
index is created, using the idbobjectstore.create
index method. this method takes an optional options parameter whose multientry property is set to true/false. note: this feature is available in web workers. syntax var ismultientry = my
index.multientry; value a boolean: value effect true there is one record in the
index for each item in an array of keys. false there is one record for each key that is an array. ...
...alse. note: this feature is available in web workers. syntax var ismultientry = my
index.multientry; value a boolean: value effect true there is one record in the
index for each item in an array of keys. false there is one record for each key that is an array. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the multi-entry status of the
index is logged to the console: it should be returned as false. finally, ...
... works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the multi-entry status of the
index is logged to the console: it should be returned as false. finally, we iterate through each record, and insert the data into an html table. ...
...And 7 more matches
IDBIndex.name - Web APIs
the name property of the idb
index interface contains a string which names the
index. note: this feature is available in web workers. syntax var
indexname = idb
index.name; idb
index.name =
indexname; value a domstring specifying a name for the
index. exceptions there are a several exceptions which can occur when you attempt to change an
index's name. invalidstateerror the
index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. you can only rename
indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an
index is already using the specified name. example in the following example we open a transaction and an object store, then ...
..., has been deleted; or the current transaction is not an upgrade transaction. you can only rename
indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an
index is already using the specified name. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor() — this works the same as opening a cursor directly on an idbobjectstore using opencursor() except that the returned records are sorted based on the
index, not the primary key. the name of the
index is logged to the console: it should be returned as lname. finally, we iterate through eac...
...dex.opencursor() — this works the same as opening a cursor directly on an idbobjectstore using opencursor() except that the returned records are sorted based on the
index, not the primary key. the name of the
index is logged to the console: it should be returned as lname. finally, we iterate through each record, inserting the data into an html table. for a complete working example, see our idb
index-example demo repo (view the example live). ...
...And 7 more matches
IDBIndex.objectStore - Web APIs
the objectstore property of the idb
index interface returns the name of the object store referenced by the current
index. note: this feature is available in web workers. syntax var myidbobjectstore = my
index.objectstore; value an idbobjectstore. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. ...
... then open a basic cursor on the
index using idb
index.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id",
indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. ...
...d based on the
index, not the primary key. the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id",
indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. ...
...And 7 more matches
IDBIndex.openKeyCursor() - Web APIs
the method sets the position of the cursor to the appropriate key, based on the specified direction. if the key range is not specified or is null, then the range includes all the keys. a success event is always fired on the result object. if at least one key matches the key range, then the result property of the event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. ...
...y of the event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. if no keys match the key range, then then the result property of the event is set to null. note: cursors returned by openkeycursor() do not make the referenced value available as idb
index.opencursor does. this makes obtaining a list of keys much more efficient. note: this feature is available in web workers. syntax var request = my
index.openkeycursor(); var request = my
index.openkeycursor(range); var request = my
index.openkeycursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range. if nothing is passed, this will default to a k...
...lects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...And 7 more matches
IDBIndex.unique - Web APIs
the unique read-only property returns a boolean that states whether the
index allows duplicate keys. this is decided when the
index is created, using the idbobjectstore.create
index method. this method takes an optional parameter, unique, which if set to true means that the
index will not be able to accept duplicate entries. note: this feature is available in web workers. syntax var isunique = idb
index.unique; value a boolean: value effect true the current
index does not allow duplicate values for a key. false the current
index allows duplicate key values. ...
...duplicate entries. note: this feature is available in web workers. syntax var isunique = idb
index.unique; value a boolean: value effect true the current
index does not allow duplicate values for a key. false the current
index allows duplicate key values. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the unique status of the
index is logged to the console: it should be returned as false. finally, we it...
... this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the unique status of the
index is logged to the console: it should be returned as false. finally, we iterate through each record, and insert the data into an html table. ...
...And 7 more matches
IDBObjectStore.index() - Web APIs
the
index() method of the idbobjectstore interface opens a named
index in the current object store, after which it can be used to, for example, return a series of records sorted by that
index using a cursor. note: this feature is available in web workers. syntax var
index = objectstore.
index(name); parameters name the name of the
index to open. return value an idb
index object for accessing the
index. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no
index with the given name (case-sensitive) in the database. example in the following exa...
...on of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no
index with the given name (case-sensitive) in the database. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. finally, we iterate through each record, and insert the data into an html table. for a complete working ...
... contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. finally, we iterate through each record, and insert the data into an html table. ...
...And 7 more matches
IDBIndex.keyPath - Web APIs
the keypath property of the idb
index interface returns the key path of the current
index. if null, this
index is not auto-populated. note: this feature is available in web workers. syntax var mykeypath = my
index.keypath; value any data type that can be used as a key path. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the key path of the current
index is logged to the console: it should be returned as lname. finally, we iterate through each record...
...is works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the key path of the current
index is logged to the console: it should be returned as lname. finally, we iterate through each record, and insert the data into an html table. ...
...dbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the key path of the current
index is logged to the console: it should be returned as lname. finally, we iterate through each record, and insert the data into an html table. ...
...And 6 more matches
IDBIndexSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idb
indexsync interface of the
indexeddb api provides synchronous access to an
index in a database. method overview any add (in any value, in optional any key) raises (idbdatabaseexception); any get (in any key) raises (idbdatabaseexception); any getobject (in any key) raises (idbdatabaseexception); void opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range...
...void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this
index. if this attribute is null, this
index is not auto-populated. name readonly domstring the name of this
index. storename readonly domstring this
index's referenced object store. unique readonly boolean if true, a key can have only one value within the
index; if false, a key can have duplicate values. methods add() stores the given value into th...
...f this attribute is null, this
index is not auto-populated. name readonly domstring the name of this
index. storename readonly domstring this
index's referenced object store. unique readonly boolean if true, a key can have only one value within the
index; if false, a key can have duplicate values. methods add() stores the given value into this
index, optionally with the specified key. if a record already exists with the given key, an exception is raised. any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following code: value the value to store into the
index. key a key to use for identifying the record. any the key ...
...And 6 more matches
Using z-index - CSS: Cascading Style Sheets
the first part of this article, stacking without the z-
index property, explains how stacking is arranged by default. if you want to create a custom stacking order, you can use the z-
index property on a positioned element. the z-
index property can be specified with an integer value (positive, zero, or negative), which represents the position of the element along the z-axis. if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. layers are rendered in numerical order, with larger numbers above smaller numbers. bottom layer (farthest from the observer) ... layer -3 layer -2 layer -1 layer 0 (default rendering layer) layer 1 layer 2 layer 3 ... ...
...is. if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. layers are rendered in numerical order, with larger numbers above smaller numbers. bottom layer (farthest from the observer) ... layer -3 layer -2 layer -1 layer 0 (default rendering layer) layer 1 layer 2 layer 3 ... ...
...in numerical order, with larger numbers above smaller numbers. bottom layer (farthest from the observer) ... layer -3 layer -2 layer -1 layer 0 (default rendering layer) layer 1 layer 2 layer 3 ... top layer (closest to the observer) notes: when no z-
index property is specified, elements are rendered on the default rendering layer 0 (zero). if several elements share the same z-
index value (i.e., they are placed on the same layer), stacking rules explained in the section stacking without the z-
index property apply. in the following example, the layers' stacking order is rearranged using z-
index. the z-
index of element #5 has no effect since it is not a positioned element. source code for the example html <div id="abs1"> <b>div #1</b> <br />position: absolute; <b...
...And 6 more matches
HTMLOrForeignElement.tabIndex - Web APIs
the tab
index property of the htmlorforeignelement interface represents the tab order of the current element. tab order is as follows: elements with a positive tab
index. elements that have identical tab
index values should be navigated in the order they appear. navigation proceeds from the lowest tab
index to the highest tab
index. elements that do not support the tab
index attribute or support it and assign tab
index to 0, in the order they appear. elements that are disabled do not participate in the tabbing order. values don't need to be sequential, nor must they begin with any particular value. they may even be negative, though each browser trims very large values. ...
... living standard no change from document object model (dom) level 2 html specification. ...
... living standard no change from document object model (dom) level 2 html specification. ...
...And 5 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web. 2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource. ...
...les of copyleft licenses are the gnu gpl (for software) and the creative commons sa (share alike) licenses (for works of art). 93 crawler browser, crawler, glossary, infrastructure a web crawler is a program, often called a bot or robot, which systematically browses the web to collect data from webpages. typically search engines (e.g. google, bing, etc.) use crawlers to build
indexes. 94 cross axis css, glossary, cross axis, flexbox the cross axis in flexbox runs perpendicular to the main axis, therefore if your flex-direction is either row or row-reverse then the cross axis runs down the columns. 95 cross-site scripting cross site scripting, dom, glossary, security, xss, exploit cross-site scripting (xss) is a security exploit whic...
... most common web app vulnerability in 2017. 96 cryptanalysis cryptography, glossary, privacy, security cryptanalysis is the branch of cryptography that studies how to break codes and cryptosystems. cryptanalysis creates techniques to break ciphers, in particular by methods more efficient than a brute-force search. in addition to traditional methods like frequency analysis and
index of coincidence, cryptanalysis includes more recent methods, like linear cryptanalysis or differential cryptanalysis, that can break more advanced ciphers. 97 cryptographic hash function cryptography, glossary, security a cryptographic hash function, also sometimes called a digest function, is a cryptographic primitive transforming a message of arbitrary size into a message of...
...And 4 more matches
ContentIndex.add() - Web APIs
title: a string title for the item. used in user-visible lists of content. title: a string title of the item. used in user-visible lists of content. description: a string description of the item. used in user-visible lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the current service worker. category: optional a string defining the category of content. ...
...ror if the service worker's registration is not present or the service worker does not contain a fetchevent. if the id, title, description or url are missing, not of type string, or an empty string. if icons images are not of image type. examples here we're declaring an item in the correct format and creating an asynchronous function which uses the add method to register it with the content
index. ...
...method to register it with the content
index. ...
...And 4 more matches
IDBIndex.getAllKeys() - Web APIs
if this value is null or missing, the browser will use an unbound key range. count optional the number records to return. if this value exceeds the number of records in the query, the browser will only retrieve the first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. ...
... the query, the browser will only retrieve the first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...wer than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. invalidstateerror the idb
index has been deleted or removed. ...
...And 4 more matches
IDBIndex.locale - Web APIs
the locale read-only property of the idb
index interface returns the locale of the
index (for example en-us, or pl) if it had a locale value specified upon its creation (see create
index()'s optionalparameters.) note that this property always returns the current locale being used in this
index, in other words, it never returns "auto". syntax var my
index = objectstore.
index('
index'); console.log(my
index.locale); value a domstring. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. ...
....) note that this property always returns the current locale being used in this
index, in other words, it never returns "auto". syntax var my
index = objectstore.
index('
index'); console.log(my
index.locale); value a domstring. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the locale value is logged to the console. ...
...nd an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the locale value is logged to the console. ...
...And 4 more matches
tabindex - HTML: Hypertext Markup Language
it's mostly useful to create accessible widgets with javascript. ...
...ion (usually with the tab key, hence the name). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lly tab
index="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with javascript or visually by clicking with the mouse. it's mostly useful to create accessible widgets with javascript. a negative value is useful when you have off-screen content that appears on a specific event. the user won't be able to focus any element with a negative tab
index using the keyboard, but a script can do so by calling the focus() method. tab
index="0" means that the element should be focusable in sequential keyboard navigation, after any positive tab
index values and its order is defined by the document's source order. a positive value means the element should be focusable in sequential keyboard navigation, with its order defined by the value of the nu...
...And 4 more matches
HTMLIsIndexElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement. ...
... methods no specific method; inherits methods from its parent, htmlelement. ...
... methods no specific method; inherits methods from its parent, htmlelement. ...
...And 3 more matches
IDBIndex.isAutoLocale - Web APIs
the isautolocale read-only property of the idb
index interface returns a boolean indicating whether the
index had a locale value of auto specified upon its creation (see create
index()'s optionalparameters.) syntax var my
index = objectstore.
index('
index'); console.log(my
index.isautolocale); value a boolean. example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. ...
...object store, then get the
index lname from a simple contacts database. we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the isautolocale value is logged to the console. ...
... cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key. the isautolocale value is logged to the console. ...
...And 3 more matches
IDBObjectStore.indexNames - Web APIs
the
indexnames read-only property of the idbobjectstore interface returns a list of the names of
indexes on objects in this object store. note: this feature is available in web workers. syntax var my
indexnames = objectstore.
indexnames; value a domstringlist. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.
indexnames to the console. ...
...ndexnames; value a domstringlist. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.
indexnames to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb ...
...ything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 3 more matches
application/http-index-format specification - Archive of obsolete content
syntax every line in the file must conform to the following generic syntax: number: data where number is at least a three digit number (note that more digits are possible in the future) and data is separated from number by a colon and a space. the syntax of data is defined by the syntax spec for every number type. if a number is encountered that a parser does not understand the parser is required to ignore that line. there is no line length limit. all lines must be terminated by a carriage return followed by a line feed. number codes 100 a human readable comment line. ...
...his data should be presented to the user when they are viewing data drawn from the file. 102 a human readable information line in html format. this data is intended for the end user of the file format data if there is one. this data should be presented to the user when they are viewing data drawn from the file. this data should be parsed as html. 200 defines the field names for the 201 file
index code. a valid 200 line consists of one or more white space separated tokens that describe the name or purpose of the associated column of data. tokens may not contain spaces. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that multiple 200 lines override previous 200 lines. 201 data whose definition stems from a prior 200 line. a valid 201 line con...
...0 line. tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that a 201 line encountered before a 200 line should be ignored. 300 a url pointing to the directory represented by the
index if there is one. a valid path token must be url escaped. valid 200 tokens note that all tokens are case insensitive. filename the name of file that can be used to retrieve the file when combined with the full path provided by the 300 line. white space and 8 bit characters must be url encoded. content-length base 10 digits representing the size of the file in bytes. only digits are legal.
...And 2 more matches
Index - Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites. 2 accessibility aria, accessibility, articles, beginner, css, codingscripting, html, javascript, landing, learn, module learning some html, css, and javascript is useful if you want to become a web developer. ...
...tor a website consists mostly of text files, so for a fun, pleasant development experience you should choose your text editor wisely. 35 front-end web developer beginner, css, front-end, html, javascript, learn, tools, web standards welcome to our front-end web developer learning pathway! 36 getting started with the web beginner, css, design, guide, html,
index, l10n:priority, publishing, theory it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small. you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there. 37 css basics beginner, css, codingscripting, learn, styling, web, l10n:priority like html...
... paragraphs. 46 how to contribute to the learning area on mdn beginner, contribute, documentation, guide, learn, mdn meta, l10n:priority on this page, you'll find everything you need to start helping improve mdn's learning content. there are many things you can do, depending on how much time you have and whether you are a beginner, a web developer, or a teacher. 47
index index, learn, mdn meta found 348 pages: 48 javascript — dynamic client-side scripting beginner, codingscripting, javascript, javascripting beginner, landing, module, topic, l10n:priority javascript is a programming language that allows you to implement complex things on web pages. every time a web page does more than just sit there and display static information f...
...And 2 more matches
Index
he interface that must be implemented by new filelink providers. 27 folder pane interfaces this page contains a list of the interfaces that you'll will most likely use when writing extensions that affect the folder pane. see working with the folder pane for examples and code snippets. 28 gloda thunderbird 3, thunderbird thunderbird includes a new message
indexing and search system (gloda) that improves search performance, provides sophisticated full-text search capabilities and categorized search results. "gloda" is short for the thunderbird "global database". 29 gloda debugging the gloda code has log4moz logging statements spread throughout. the following preferences are supported to control how this gets logged: 30 ...
...hunderbird "global database". 29 gloda debugging the gloda code has log4moz logging statements spread throughout. the following preferences are supported to control how this gets logged: 30 gloda examples thunderbird 3, thunderbird this page provides some examples for using gloda. see creating a gloda message query for more examples. ...
...e gloda code has log4moz logging statements spread throughout. the following preferences are supported to control how this gets logged: 30 gloda examples thunderbird 3, thunderbird this page provides some examples for using gloda. see creating a gloda message query for more examples. ...
...And 2 more matches
ContentIndex.getAll() - Web APIs
return value returns a promise that resolves with an array of contentdescription items. contentdescription each item returned is an object containing the following data: id: a unique string identifier. title: a string title for the item. used in user-visible lists of content. title: a string title of the item. used in user-visible lists of content. description: a string description of the item. used in user-visible lists of content. ...
... default. homepage article video audio icons: optional an array of image resources, defined as an object with the following data: src: a url string of the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. ...
...the following data: src: a url string of the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. if there are no items in the content
index, an empty array is returned. examples the below example shows an asynchronous function that retrieves items within the content
index and iterates over each entry, building a list for the interface. ...
...And 2 more matches
HTMLTableRowElement.rowIndex - Web APIs
example this example uses javascript to label all the row numbers in a table. ...
... example this example uses javascript to label all the row numbers in a table. ...
... example this example uses javascript to label all the row numbers in a table. ...
...And 2 more matches
SourceBufferList: indexed property getter - Web APIs
example tbd. specifications specification status comment media source extensionsthe definition of 'sourcebuffer() getter' in that specification. ...
... example tbd. specifications specification status comment media source extensionsthe definition of 'sourcebuffer() getter' in that specification. ...
... example tbd. specifications specification status comment media source extensionsthe definition of 'sourcebuffer() getter' in that specification. ...
...And 2 more matches
z-index - CSS: Cascading Style Sheets
the z-
index css property sets the z-order of a positioned element and its descendants or flex items. overlapping elements with a larger z-
index cover those with a smaller one. 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. for a positioned box (that is, one with any position other than static), the z-
index property specifies: the stack level of the box in the current stacking context. whether the box establishes a local stacking context. ...
...'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. for a positioned box (that is, one with any position other than static), the z-
index property specifies: the stack level of the box in the current stacking context. whether the box establishes a local stacking context. syntax /* keyword value */ z-
index: auto; /* <integer> values */ z-
index: 0; z-
index: 3; z-
index: 289; z-
index: -1; /* negative values to lower the priority */ /* global values */ z-
index: inherit; z-
index: initial; z-
index: unset; the z-
index property is specified as either the keyword auto or an <integer>. values auto the box does not establish a new local stacking context. the stack level of the generated box in the cu...
...uto or an <integer>. values auto the box does not establish a new local stacking context. the stack level of the generated box in the current stacking context is the same as its parent's box. <integer> this <integer> is the stack level of the generated box in the current stacking context. the box also establishes a local stacking context in which its stack level is 0. this means that the z-
indexes of descendants are not compared to the z-
indexes of elements outside this element. formal definition initial valueautoapplies topositioned elementsinheritednocomputed valueas specifiedanimation typean integercreates stacking contextyes formal syntax auto | <integer> examples visually layering elements html <div class="dashed-box">dashed box <span class="gold-box">gold box</span> <s...
...And 2 more matches
HTML documentation index - HTML: Hypertext Markup Language
spelling errors. 30 style global attributes, html, reference the style global attribute contains css styling declarations to be applied to the element. note that it is recommended for styles to be defined in a separate file or files. this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. 31 tab
index global attributes, html, reference the tab
index global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation (usually with the tab key, hence the name). 32 title global attributes, html, reference, title the title global attribute contains text representing advisory information related to the element it belo...
...he browser as to the type of information expected in the field. 52 disabled attribute, attributes, constraint validation, forms, required the boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. the user can neither edit nor focus on the control, nor it's form control descendants. 53 html documentation
index html,
index, mdn meta a comprehensive
index list of all the available html documentation. 54 html elements reference basic, element, html, reference, web, l10n:priority this page lists all the html elements, which are created using tags. 55 <a>: the anchor element content, element, html, html text-level semantics, html:flow content, html:interactive c...
...t types, reference, week, weeks <input> elements of type week create input fields allowing easy entry of a year plus the iso 8601 week number during that year (i.e., week 1 to 52 or 53). 142 <ins> element, html, html edits, inserted text, insertion, reference, web, ins the html <ins> element represents a range of text that has been added to a document. 143 <is
index> deprecated, element, html, reference, web <is
index> was an obsolete html element that put a text field in a page for querying the document. 144 <kbd>: the keyboard input element displaying input, displaying keys, displaying keystrokes, displaying user input, element, html, html text-level semantics, keyboard input, keystroke, reference, web, keyboard, user input th...
...And 2 more matches
RegExpInstance.lastIndex - JavaScript
the last
index is a read/write integer property of regular expression instances that specifies the
index at which to start the next match. property attributes of regexpinstance.last
index writable yes enumerable no configurable no description this property is set only if the regular expression instance used the g flag to indicate a global search, or the y flag to indicate a sticky search. the following rules apply: if last
index is greater than the length of the string, test() and exec() fail, then last
index is set to 0. ...
... yes enumerable no configurable no description this property is set only if the regular expression instance used the g flag to indicate a global search, or the y flag to indicate a sticky search. the following rules apply: if last
index is greater than the length of the string, test() and exec() fail, then last
index is set to 0. ...
...the g flag to indicate a global search, or the y flag to indicate a sticky search. the following rules apply: if last
index is greater than the length of the string, test() and exec() fail, then last
index is set to 0. if last
index is equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches input starting from last
index. if last
index is equal to the length of the string and if the regular expression does not match the empty string, then the regular expression mismatches input, and last
index is reset to 0. otherwise, last
index is set to the next position following the most recent match. examples using last
index consider the following sequence of statements: var re = /(hi)?/g; matches the empty string. c...
...And 2 more matches
TypedArray.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the last
index at which a given element can be found in the typed array, or -1 if it is not present. the typed array is searched backwards, starting at from
index. this method has the same algorithm as array.prototype.last
indexof(). typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.last
indexof(searchelement[, from
index = typedarray.length]) parameters searchelement element to locate in the typed array. from
index optional. the
index at which to start searching backwards. defaults to the typed array's length, i.e. t...
...ject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.last
indexof(searchelement[, from
index = typedarray.length]) parameters searchelement element to locate in the typed array. from
index optional. the
index at which to start searching backwards. defaults to the typed array's length, i.e. the whole typed array will be searched. if the
index is greater than or equal to the length of the typed array, the whole typed array will be searched. if negative, it is taken as the offset from the end of the typed array. note that even when the
index is negative, the typed array is still searched from back to front. ...
...rching backwards. defaults to the typed array's length, i.e. the whole typed array will be searched. if the
index is greater than or equal to the length of the typed array, the whole typed array will be searched. if negative, it is taken as the offset from the end of the typed array. note that even when the
index is negative, the typed array is still searched from back to front. if the calculated
index is less than 0, -1 is returned, i.e. the typed array will not be searched. return value the last
index of the element in the array; -1 if not found. ...
...And 2 more matches
Using IndexedDB in chrome
the
indexeddb api is typically used to store data in the user's browser from content javascript. (see using
indexeddb for an overview.) however, the apis can also be accessed from system-privileged javascript using the components.utils.importglobalproperties() function: components.utils.importglobalproperties(["
indexeddb"]); // from here on, it's like using
indexeddb from content var req =
indexeddb.open("my-database"); // ... ...
... content javascript. (see using
indexeddb for an overview.) however, the apis can also be accessed from system-privileged javascript using the components.utils.importglobalproperties() function: components.utils.importglobalproperties(["
indexeddb"]); // from here on, it's like using
indexeddb from content var req =
indexeddb.open("my-database"); // ... ...
...he components.utils.importglobalproperties() function: components.utils.importglobalproperties(["
indexeddb"]); // from here on, it's like using
indexeddb from content var req =
indexeddb.open("my-database"); // ... ...
...y-database"); // ... if you are creating a sandbox, and want
indexeddb to be available in it, use the wantglobalproperties option in the sandbox constructor: var options = { "wantglobalproperties": ["
indexeddb"] } var principal = cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); var sandbox = components.utils.sandbox(principal, options); // the sandbox will have access to
indexeddb var sandboxscript = 'var req =
indexeddb.open("my-database");'; components.utils.evalinsandbox(sandboxscript, sandbox); before firefox 33, you would access
indexeddb from chrome code using the initwindowless method of the nsi
indexeddatabasemanager service. this method was removed in firefox 33. ...
IndexedDB - Firefox Developer Tools
when you select an origin inside the
indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin. note: the data shown in an
indexeddb database is a snapshot of the data as it was when you opened the storage inspector tool. databases have the following details: database name — the name of the database. storage — the storage type specified for the database. origin — the origin of the database. version — the database version. object stores — the number of object stores in the database. when an
indexeddb database is selected in the storage tree, details about all the object stores are listed in the table. any object store has the following details: object store name — the name of the objec...
... stores — the number of object stores in the database. when an
indexeddb database is selected in the storage tree, details about all the object stores are listed in the table. any object store has the following details: object store name — the name of the object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? ...
...r of object stores in the database. when an
indexeddb database is selected in the storage tree, details about all the object stores are listed in the table. any object store has the following details: object store name — the name of the object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? ...
...object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? ...
IDBIndex.getAll() - Web APIs
the getall() method of the idb
index interface retrieves all objects that are inside the
index. there is a performance cost associated with looking at the value property of a cursor, because the object is created lazily. to use a feature like getall(), the browser has to create all the objects at once. if you are just interested in looking at each of the keys, for instance, it is more efficient to use a cursor. if you are trying to get an array of all the objects in an object store, though, you should use getall(). syntax var getallkeysrequest = idb
index.getall(); var getallkeysrequest = idb
index.getall(query); var getallkeysrequest = idb
index.getall(query, count); parameters query optional a key or an idbkeyrange identifying the records to retrieve. if this value is null or missing, ...
... the query, the browser will only retrieve the first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. ...
...wer than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. invalidstateerror the idb
index has been deleted or removed. ...
... operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive. invalidstateerror the idb
index has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var my
index = objectstore.
index('
index'); var getallrequest = my
index.getall(); getallrequest.onsuccess = function() { console.log(getallrequest.result); } specification specification status comment
indexed database api draftthe definition of 'getall()' in that specification. recommendation initial definition. ...
color-index - CSS: Cascading Style Sheets
the color-
index css media feature can be used to test the number of entries in the output device's color lookup table. syntax the color-
index feature is specified as an <integer> value representing the number of entries in the output device's color lookup table. (this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-
index and max-color-
index variants to query minimum and maximum values, respectively. ...
...epresenting the number of entries in the output device's color lookup table. (this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-
index and max-color-
index variants to query minimum and maximum values, respectively. ...
... color lookup table. (this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-
index and max-color-
index variants to query minimum and maximum values, respectively. examples basic example html <p>this is a test.</p> css p { color: black; } @media (color-
index) { p { color: red; } } @media (min-color-
index: 15000) { p { color: #1475ef; } } result custom stylesheet this html will apply a special stylesheet for devices that have at least 256 colors. ...
...l <p>this is a test.</p> css p { color: black; } @media (color-
index) { p { color: red; } } @media (min-color-
index: 15000) { p { color: #1475ef; } } result custom stylesheet this html will apply a special stylesheet for devices that have at least 256 colors. <link rel="stylesheet" href="http://foo.bar.com/base.css" /> <link rel="stylesheet" media="all and (min-color-
index: 256)" href="http://foo.bar.com/color-stylesheet.css" /> specifications specification status comment media queries level 4the definition of 'color-
index' in that specification. candidate recommendation the value can now be negative, in which case it computes to false. media queriesthe definition of 'color-
index' in that specification. recommendation...
Understanding CSS z-index - CSS: Cascading Style Sheets
in css 2.1, each box has a position in three dimensions. ...
... when boxes overlap visually. (from css 2.1 section 9.9.1 - layered presentation) this means that css style rules allow you to position boxes on layers in addition to the normal rendering layer (layer 0). the z position of each layer is expressed as an integer representing the stacking order for rendering. greater numbers mean closer to the observer. z position can be controlled with the css z-
index property. using z-
index appears extremely easy: a single property, assigned a single integer number, with an easy-to-understand behaviour. however, when z-
index is applied to complex hierarchies of html elements, its behaviour can be hard to understand or predict. this is due to complex stacking rules. in fact a dedicated section has been reserved in the css specification css-2.1 appendix e to e...
...r, when z-
index is applied to complex hierarchies of html elements, its behaviour can be hard to understand or predict. this is due to complex stacking rules. in fact a dedicated section has been reserved in the css specification css-2.1 appendix e to explain these rules better. this article will try to explain those rules, with some simplification and several examples. stacking without the z-
index property: the stacking rules that apply when z-
index is not used. stacking with floated blocks: how floating elements are handled with stacking. using z-
index: how to use z-
index to change default stacking. the stacking context: notes on the stacking context. ...
...s, with some simplification and several examples. stacking without the z-
index property: the stacking rules that apply when z-
index is not used. stacking with floated blocks: how floating elements are handled with stacking. using z-
index: how to use z-
index to change default stacking. the stacking context: notes on the stacking context. stacking context example 1: 2-level html hierarchy, z-
index on the last level stacking context example 2: 2-level html hierarchy, z-
index on all levels stacking context example 3: 3-level html hierarchy, z-
index on the second level original document information author(s): paolo lombardi this article is the english translation of an article i wrote in italian for yappy. i grant the right to share all the content under the creative commons: attribu...
TypedArray.prototype.indexOf() - JavaScript
the
indexof() method returns the first
index at which a given element can be found in the typed array, or -1 if it is not present. this method has the same algorithm as array.prototype.
indexof(). typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.
indexof(searchelement[, from
index = 0]) parameters searchelement element to locate in the typed array. from
index the
index to start the search at. if the
index is greater than or equal to the typed array's length, -1 is returned, which means the typed array will not be searched. ...
...lone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.
indexof(searchelement[, from
index = 0]) parameters searchelement element to locate in the typed array. from
index the
index to start the search at. if the
index is greater than or equal to the typed array's length, -1 is returned, which means the typed array will not be searched. if the provided
index value is a negative number, it is taken as the offset from the end of the typed array. note: if the provided
index is negative, the typed array is still searched from front to back. if the calculated
index is less than 0, then the whole typed array will be searched. default: 0 (entire typed array is searched). return value the first
index of the element in the array; -1 if not found. descript...
...e is a negative number, it is taken as the offset from the end of the typed array. note: if the provided
index is negative, the typed array is still searched from front to back. if the calculated
index is less than 0, then the whole typed array will be searched. default: 0 (entire typed array is searched). return value the first
index of the element in the array; -1 if not found. description
indexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator). ...
...ront to back. if the calculated
index is less than 0, then the whole typed array will be searched. default: 0 (entire typed array is searched). return value the first
index of the element in the array; -1 if not found. description
indexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator). examples using
indexof var uint8 = new uint8array([2, 5, 9]); uint8.
indexof(2); // 0 uint8.
indexof(7); // -1 uint8.
indexof(9, 2); // 2 uint8.
indexof(2, -1); // -1 uint8.
indexof(2, -3); // 0 specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.
indexof' in that specification. ...
Index of archived content - Archive of obsolete content
ecycle sdk and xul comparison testing the add-on sdk two types of scripts working with events xul migration guide high-level apis addon-page base64 clipboard context-menu hotkeys
indexed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers u...
... xulrunner 2.0 release notes xulrunner faq xulrunner hall of fame xulrunner tips xulrunner/old releases toolkit.defaultchromefeatures toolkit.defaultchromeuri toolkit.singletonwindowtype xulauncher ant script to assemble an extension application/http-
index-format specification calicalendarview calicalendarviewcontroller califiletype mozilla.dev.platform faq reftest opportunities files symsrv_convert xbdesignmode.js archived open web documentation browser detection and cross browser support browser feature detectio...
... underscores in class and id names xml data xul user interfaces case sensitivity in class and id names creating a dynamic status bar extension creating a status bar extension element title gecko compatibility handbook getting the page url in npapi plugin
index index of archived content inner-browsing extending the browser navigation paradigm install.js jxon list of former mozilla-based applications list of mozilla-based applications localizing an extension mmgc makefile - .mk files misc top level bypassing security restrictions and signing code...
currentIndex - Archive of obsolete content
for trees with focus, the caret's position is indicated by the focus ring, but unfocused trees won't show a focus ring, naturally. for unfocused trees, the (undrawn) caret's position can still be obtained by this property. if the caret isn't present for any row (for example, because the tree has never been focused), the value will be -1. you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single". ...
....) to reliably change or determine a selection, instead use the nsitreeselection interface methods available via tree.view.selection. example // one way of retrieving the text of a cell. ...
... </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> see also listbox.current
index ...
selectedIndex - Archive of obsolete content
by assigning -1 to this property, all items will be deselected. ...
...by assigning -1 to this property, all items will be deselected. ...
...by assigning -1 to this property, all items will be deselected. ...
IndexedDB - MDN Web Docs Glossary: Definitions of Web-related terms
indexeddb is a web api for storing large data structures within browsers and
indexing them for high-performance searching. like an sql-based rdbms,
indexeddb is a transactional database system. however, it uses javascript objects rather than fixed columns tables to store data. ...
...
indexeddb is a web api for storing large data structures within browsers and
indexing them for high-performance searching. like an sql-based rdbms,
indexeddb is a transactional database system. however, it uses javascript objects rather than fixed columns tables to store data. ...
...
indexeddb is a web api for storing large data structures within browsers and
indexing them for high-performance searching. like an sql-based rdbms,
indexeddb is a transactional database system. however, it uses javascript objects rather than fixed columns tables to store data. ...
nsIDirIndex
netwerk/streamconv/public/nsidir
index.idlscriptable a class holding information about a directory
index. because this has no reference back to their original source, changing these attributes won't affect the directory. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown. unspecified for directories. description wstring a description for the filename, which should be displayed by a viewer. lastmodified prtime last-modified time in seconds-since-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. this is encoded with the encoding specified in the nsidir
indexparser, and is also escaped. si...
...ile size; if the size is unknown, this value is -1. ...
...e is unknown, this value is -1. ...
Index - Firefox Developer Tools
eyedropper firefox, tools, web development:tools the eyedropper tool enables you to select colors in the current page. it works like a magnifying glass over the page, enabling you to select with pixel precision. underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: 34
index tools found 158 pages: 35 json viewer firefox includes a json viewer. if you open a json file in the browser, or view a remote url with the content-type set to application/json, it is parsed and given syntax highlighting. arrays and objects are shown collapsed, and you can expand them using the "+" icons. 36 measure a portion of the page design, devt...
... settings beginning with firefox 62, the icon to open developer tools settings has been moved into a menu accessed by clicking/touching ... (the elipsis) on the right of the tab. 104 shader editor the shader editor enables you to see and edit the vertex and fragment shaders used by webgl. 105 storage inspector cookies, dev tools, firefox, guide,
indexeddb, local storage, session storage, storage, tools the storage inspector enables you to inspect various types of storage that a web page can use. currently it can be used to inspect the following storage types: 106 cache storage cache storage, devtools, firefox, guide, storage, storage inspector, tools, l10n:priority under the cache storage type within the storage insp...
... extension storage dev tools, extension storage, firefox, guide, storage, storage inspector, tools, l10n:priority this storage type is only shown when debugging extensions. when selecting an extension id in the storage tree of the storage inspector, a table lists the details of all the extension storage present for the extension. this table contains the following columns: 109
indexeddb dev tools, firefox, guide,
indexeddb, storage, storage inspector, tools, l10n:priority when you select an origin inside the
indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin. 110 local storage / session storage dev tools, firefox, guide, local storage, session storage, storage, ...
ContentIndexEvent - Web APIs
the content
indexevent interface of the content
index api defines the object used to represent the contentdelete event. this event is sent to the global scope of a serviceworker. it contains the id of the
indexed content to be removed. the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the content
index.delete method is called. constructor content
indexevent() creates and returns a new content
indexevent object whose type and other options are configured as specified. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, extendableevent. ...
...when the content
index.delete method is called. constructor content
indexevent() creates and returns a new content
indexevent object whose type and other options are configured as specified. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, extendableevent. id read only a string which identifies the deleted content
index via it's id. methods while content
indexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script listening for the contentdelete event and logs the removed content
index id. ...
...deleted content
index via it's id. methods while content
indexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script listening for the contentdelete event and logs the removed content
index id. self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content
index id, which can then be used to determine what content to delete from your cache }); specifications specification status comment unknownthe definition of 'content
indexevent' in that specification. unknown initial definition. ...
MathML documentation index - MathML
this is an alphabetical list of mathml attributes. more details for each attribute are available on particular element pages. 7 values guide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. 8 mathml documentation
index index, mathml found 40 pages: 9 mathml element reference mathml, mathml reference this is an alphabetical list of mathml presentation elements. 10 <maction> mathml, mathml reference, mathml:element, mathml:enlivening expressions the following example uses the "toggle" actiontype: 11 <math> mathml, mathml reference, mathml:element ...
... <mphantom> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mphantom> element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept. 25 <mroot> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mroot> element is used to display roots with an explicit
index. two arguments are accepted, which leads to the syntax: <mroot> base
index </mroot>. 26 <mrow> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as <mi> and <mn>). this element renders as a horizontal row containin...
...<mglyph> and <malignmark> elements. 28 <mspace> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mspace> element is used to display a blank space, whose size is set by its attributes. 29 <msqrt> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <msqrt> element is used to display square roots (no
index is displayed). the square root accepts only one argument, which leads to the following syntax: <msqrt> base </msqrt>. 30 <mstyle> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mstyle> element is used change the style of its children. it accepts all attributes of all mathml presentation elements with some exceptions and additional attribu...
IndexInParent
« nsiaccessible page summary the 0-based
index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent. ...
... « nsiaccessible page summary the 0-based
index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent. ...
ContentIndex.delete() - Web APIs
the delete() method of the content
index interface unregisters an item from the currently
indexed content. calling delete() only affects the
index. it does not delete anything from the cache. syntax content
index.delete(id).then(...); parameters this method receives no parameters. return value returns a promise that resolves with undefined exceptions no exceptions are thrown. examples below is an asynchronous function, that removes an item from the content
index. we receive a reference to the current serviceworkerregistration, which allows us to access the
index property and thus access the delete method. ...
... examples below is an asynchronous function, that removes an item from the content
index. we receive a reference to the current serviceworkerregistration, which allows us to access the
index property and thus access the delete method. async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content
index if (!registration.
index) return; // unregister content from
index await registration.
index.delete(article.id); } the delete method can also be used within the service worker scope. self.registration.
index.delete('my-id'); specifications specification status comment unknownthe definition of 'delete' in that specification. unknown initial definition. ...
ContentIndexEvent() - Web APIs
the content
indexevent() constructor creates a new content
indexevent object whose type and other options are configured as specified. syntax var content
indexevent = new content
indexevent(type, content
indexeventinit); parameters type a domstring indicating the event which occurred. for content
indexevent, this is always delete. eventinitdict optional an options object containing any initialization data you want to populate the content
indexevent object with. the options are: id: the id of the
indexed content you want the content
indexevent to remove. return value a content
indexevent object configured using the given inputs. examples this examples constructs a new content
indexevent with the relevant id. var removedata = { id : 'unique-content-id' } var cievent = n...
...on data you want to populate the content
indexevent object with. the options are: id: the id of the
indexed content you want the content
indexevent to remove. return value a content
indexevent object configured using the given inputs. examples this examples constructs a new content
indexevent with the relevant id. var removedata = { id : 'unique-content-id' } var cievent = new content
indexevent('contentdelete', removedata); cievent.id; // should return 'unique-content-id' specifications specification status comment unknownthe definition of 'content
indexevent' in that specification. unknown initial definition. ...
OES_element_index_uint - Web APIs
the oes_element_
index_uint extension is part of the webgl api and adds support for gl.unsigned_int types to webglrenderingcontext.drawelements(). webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int. ...
...ion, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int. examples var ext = gl.getextension('oes_element_
index_uint'); gl.drawelements(gl.points, 8, gl.unsigned_int, 0); specifications specification status comment oes_element_
index_uintthe definition of 'oes_element_
index_uint' in that specification. recommendation initial definition. ...
RTCIceCandidate.sdpMLineIndex - Web APIs
the read-only sdpmline
index property on the rtcicecandidate interface is a zero-based
index of the m-line describing the media associated with the candidate. this value is specified when creating the rtcicecandidate by setting the corresponding sdpmline
index value in the rtcicecandidateinit object when creating a new candidate with new rtcicecandidate(). if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of sdpmline
index is extracted from the m-line. syntax var sdpmline
index = rtcicecandidate.sdpmline
index; value a number containing a 0-based
index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. note: attempting to...
...om the m-line. syntax var sdpmline
index = rtcicecandidate.sdpmline
index; value a number containing a 0-based
index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmline
index will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.sdpmline
index' in that specification. candidate recommendation initial definition. ...
ServiceWorkerRegistration.index - Web APIs
the
index read-only property of the serviceworkerregistration interface returns a reference to the content
index interface, which allows for
indexing of offline content. syntax var a content
index object = serviceworkerregistration.
index; value a content
index object examples you can access the property from either your main script or the registered service worker. ...
...ich allows for
indexing of offline content. syntax var a content
index object = serviceworkerregistration.
index; value a content
index object examples you can access the property from either your main script or the registered service worker. here is an example from the main script: // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('
index' in registration) { // content
index api functionality const content
index = registration.
index; } from the service worker: // service worker script const content
index = self.registration.
index; specifications specification status comment unknownthe definition of '
index' in that specification. unknown initial definition. ...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
the webgl2renderingcontext.get
indexedparameter() method of the webgl 2 api returns
indexed information about a given target. syntax any gl.get
indexedparameter(target,
index); parameters target a glenum specifying the target for which to return information. possible values: gl.transform_feedback_buffer_binding: returns a webglbuffer. gl.transform_feedback_buffer_size: returns a glsizeiptr. gl.transform_feedback_buffer_start: returns a glintptr. gl.uniform_buffer_binding: returns a webglbuffer. gl.uniform_buffer_size: returns a glsizeiptr. gl.uniform_buffer_start: returns a glintptr.
index a gluint specifying the
index of the target that is queried. return value depends on the requested information (as specified with target). examples var binding = gl.ge...
...sizeiptr. gl.transform_feedback_buffer_start: returns a glintptr. gl.uniform_buffer_binding: returns a webglbuffer. gl.uniform_buffer_size: returns a glsizeiptr. gl.uniform_buffer_start: returns a glintptr.
index a gluint specifying the
index of the target that is queried. return value depends on the requested information (as specified with target). examples var binding = gl.get
indexedparameter(gl.transform_feedback_buffer_binding, 0); specifications specification status comment webgl 2.0the definition of 'get
indexedparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glget' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
the webgl2renderingcontext.getuniformblock
index() method of the webgl 2 api retrieves the
index of a uniform block within a webglprogram. syntax gluint gl.getuniformblock
index(program, uniformblockname); parameters program a webglprogram containing the uniform block. uniformname a domstring specifying the name of the uniform block to whose
index to retrieve. return value a gluint indicating the uniform block
index. ...
... parameters program a webglprogram containing the uniform block. uniformname a domstring specifying the name of the uniform block to whose
index to retrieve. return value a gluint indicating the uniform block
index. examples // assuming a shader with the following declaration: // uniform ubodata { // mat4 foo; // } instancename; // use the block name, not the instance name: var block
index = gl.getuniformblock
index(program, 'ubodata'); specifications specification status comment webgl 2.0the definition of 'getuniformblock
index' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetuniformblock
index' in that specification. standard man page of the (similar) opengl api. ...
WindowOrWorkerGlobalScope.indexedDB - Web APIs
the
indexeddb read-only property of the windoworworkerglobalscope mixin provides a mechanism for applications to asynchronously access the capabilities of
indexed databases. syntax var idbfactory = self.
indexeddb; value an idbfactory object. example the following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired: var db; function opendb() { var dbopenrequest = window.
indexeddb.open('todolist'); dbopenrequest.onsuccess = function(e) { db = dbopenrequest.result; } } specifications specification status comment
indexed database api draftthe definition of '
indexeddb' in that specification. recommendation defined in a windoworworkerglobalscope partial in the n...
...; function opendb() { var dbopenrequest = window.
indexeddb.open('todolist'); dbopenrequest.onsuccess = function(e) { db = dbopenrequest.result; } } specifications specification status comment
indexed database api draftthe definition of '
indexeddb' in that specification. recommendation defined in a windoworworkerglobalscope partial in the newest spec.
indexed database api 2.0the definition of '
indexeddb' in that specification. recommendation initial definition. ...
Index - Event reference
sent to notify code of interesting things that have taken place. ...
...otify code of interesting things that have taken place. ...
HTTP Index - HTTP
r feature policy allows you to control which origins can use which features, both in the top-level page and in embedded frames. essentially, you write a policy, which is an allowed list of origins for each feature. for every feature controlled by feature policy, the feature is only enabled in the current document or frame if its origin matches the allowed list of origins. 39 http
index http,
index this page lists all mdn http pages along with their summary and tags. 40 http messages guide, http, webmechanics http messages are how data is exchanged between a server and a client. there are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server. 41 http public key pi...
...ce, request header the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date. if the resource has been modified after the given date, the response will be a 412 (precondition failed) error. 161
index http, http header,
index found 122 pages: 162 keep-alive general header, http, http header, reference the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests. 163 large-allocation http, http header, non-standard, reference, response header, header the non-stan...
tabindex - SVG: Scalable Vector Graphics
the tab
index attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation. all elements are using this attribute. html, body, svg { height: 100%; } <?xml version="1.0"?> <svg viewbox="0 0 260 260" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="15" tab
index="1" /> <circle cx="60" cy="160" r="30" tab
index="3" /> <circle cx="160" cy="60" r="30" tab
index="2" /> <circle cx="160" cy="160" r="60" tab
index="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation. specifications specificatio...
...> <circle cx="160" cy="160" r="60" tab
index="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation. specifications specification status comment scalable vector graphics (svg) 2the definition of 'tab
index' in that specification. candidate recommendation initial definition ...
SVG documentation index - SVG: Scalable Vector Graphics
211 surfacescale filters, needscompattable, svg, svg attribute the surfacescale attribute represents the height of the surface for a light filter primitive. 212 systemlanguage svg, svg attribute the systemlanguage attribute represents a list of supported language tags. this list is matched against the language defined in the user preferences. 213 tab
index svg, svg attribute the tab
index attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation. 214 tablevalues svg, svg attribute the tablevalues attribute defines a list of numbers defining a lookup table of values for a for a color component transfer function. ...
...h smil animation, firefox 4, gecko 2.0, svg, svg animation firefox 4 introduced support for animating svg using synchronized multimedia integration language (smil). smil allows you to: 291 svg as an image images, needscontent, svg svg images can be used as an image format, in a number of contexts. many browsers support svg images in: 292 svg documentation
index svg found 383 pages: 293 svg element reference drawing, elements, responsive design, svg, svg reference, vector graphics, l10n:priority svg drawings and images are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams. here you'll find reference documentation for each of the svg elements. ...
XML Index - XML: Extensible Markup Language
it stands for extensible markup language and is a w3c recommended specification as a general purpose markup language. ...
...it stands for extensible markup language and is a w3c recommended specification as a general purpose markup language. ...
Index - WebAssembly
of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as c/c++ with a compilation target so that they can run on the web. it is also designed to run alongside javascript, allowing both to work together. 2 caching compiled webassembly modules caching,
indexeddb, javascript, module, webassembly, compile, wasm caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. 3 compiling a new c/c++ module to webassembly c, c++, compiling, emscripten, webassembly, was...
...and how to use available tools to covert text format files to the .wasm assembly format. 7 exported webassembly functions guide, javascript, webassembly, export, exported functions, exported wasm functions, wasm exported webassembly functions are how webassembly functions are represented in javascript. this article describes what they are in a little more detail. 8
index index, webassembly found 12 pages: 9 loading and running webassembly code fetch, javascript, webassembly, xmlhttprequest, bytecode to use webassembly in javascript, you first need to pull your module into memory before compilation/instantiation. this article provides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as ...
completedefaultindex - Archive of obsolete content
« xul reference home completedefault
index new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, the best match value will be filled into the textbox as the user types. if set to false or omitted, the value must be selected from the list. ...
Speed index - MDN Web Docs Glossary: Definitions of Web-related terms
it is the average time at which visible parts of the page are displayed. expressed in milliseconds, and dependent on the size of the viewport, the lower the score, the better. the calculation calculates what percent of the page is visually complete at every 100ms interval until the page is visually complete. ...
Index
age, then the listing page needs to encourage them to click the add to firefox button. the content you add to a listing is therefore vital: from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user’s attention from a category list, to screenshots that show how useful your add-on is. 676
index add-ons, glossary, guide,
index found 689 pages: 677 signing and distributing your add-on add-ons, extensions, webextensions, distribution, publication, reviews, signing add-ons need to be signed before they can be installed into release and beta versions of firefox. this signing process takes place through addons.mozilla.org (amo), whether you choose to distribute ...
Index
l as potentially some sites that have been pinned to always appear in that space. 11 firefox and the "about" protocol firefox, guide, mozilla, protocols there is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. 141
index firefox,
index, mozilla found 168 pages: 142 linux compatibility matrix the following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox. 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, cus...
Index
3 bootstrapping a new locale localization, mercurial, translate, bit bucket (see also https://developer.mozilla.org/en/create_a_new_localization) 4 encodings for localization files internationalization, localization when creating a localization for mozilla products, it’s important to be aware of the encoding of the files that you generate. 5
index localization found 42 pages: 6 l10n checks internationalization, localization, localization:tools, tools l10n checks is a python script and library similar to compare-locales. it allows mozilla localizers to easily check their work. 7 l10n testing with xcode firefox for ios, localization once you have your l10n testing environment set up in xcod...
Index
found 1 pages: # page tags and summary 1
index found 1 pages: ...
Index
15 http delegation advanced, guide, nss up to version 3.11, nss connects directly over http to an ocsp responder to make the request and fetch the response. it does so in a blocking fashion, and also directly to the responder, ignoring any proxy the application may wish to use. this causes ocsp requests to fail if the network environment requires the use of a proxy. 16
index found 353 pages: 17 introduction to network security services introduction, mozilla, nss network security services (nss) is a set of libraries designed to support cross-platform development of communications applications that support ssl, s/mime, and other internet security standards. for a general overview of nss and the standards it supports, see overview of nss.
nsIDirIndexListener
netwerk/streamconv/public/nsidir
indexlistener.idlscriptable this interface is used to receive contents of directory
index listings from a protocol. they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void on
indexavailable(in nsirequest arequest, in nsisupports actxt, in nsidir
index a
index); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods on
indexavailable() called for each directory entry. void on
indexavailable( in nsirequest arequest, in nsisupports actxt, in nsidir
index a
index ); parameters arequest the request. actxt opaque parameter a
index new
index to add. oninfo...
nsIDirIndexParser
netwerk/streamconv/public/nsidir
indexlistener.idlscriptable a parser for 'application/http-
index-format' directories. inherits from: nsistreamlistener last changed in gecko 1.7 called for each directory entry. attributes attribute type description comment string the comment given, if any. this result is only valid after onstoprequest has occurred, because it can occur anywhere in the datastream. read only. encoding string the encoding to use. listener nsidir
indexlistener the interface to use as a callback for new entries. ...
ContentIndexEvent.id - Web APIs
the read-only id property of the content
indexevent interface is a string which identifies the deleted content
index via it's id. syntax var id = content
indexevent.id; value a string representation of the deleted content
index id. examples this example listens for the contentdelete event and logs the removed content
index id. the content
indexevent is only available to the {domxref('serviceworkerglobalscope','global scope')}} of a serviceworker. self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content
index id, which can then be used to determine what content to delete from your cache }); specifications specification status comment unknownthe definition of 'id' in that specification. unknown initial defini...
Gamepad.index - Web APIs
the gamepad.
index property of the gamepad interface returns an integer that is auto-incremented to be unique for each device currently connected to the system. this can be used to distinguish multiple controllers; a gamepad that is disconnected and reconnected will retain the same
index. syntax readonly attribute long
index; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at
index " + gp.
index + ": " + gp.id + "."; }); value a number. specifications specification status comment gamepadthe definition of 'gamepad.
index' in that specification. working draft initial definition ...
RTCIceCandidateInit.sdpMLineIndex - Web APIs
the optional property sdpmline
index in the rtcicecandidateinit dictionary specifies the value of the rtcicecandidate object's sdpmline
index property. value a number containing a 0-based
index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmline
index will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.sdpmline
index' in that specification. candidate recommendation initial specification. ...
SpeechRecognitionEvent.resultIndex - Web APIs
the result
index read-only property of the speechrecognitionevent interface returns the lowest
index value result in the speechrecognitionresultlist "array" that has actually changed. the speechrecognitionresultlist object is not an array, but it has a getter that allows it to be accessed by array syntax. syntax var myresult
index = event.result
index; value a number. examples recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.result
index); // returns 0 if there is only one result } specifications specification status comment web speech apithe definition of 'result
index' in that specification. draft...
SpeechSynthesisEvent.charIndex - Web APIs
the char
index read-only property of the speechsynthesisutterance interface returns the
index position of the character in the speechsynthesisutterance.text that was being spoken when the event was triggered. syntax event.char
index; value a number. examples utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } specifications specification status comment web speech apithe definition of 'char
index' in that specification. draft ...
VideoTrackList.selectedIndex - Web APIs
the read-only videotracklist property selected
index returns the
index of the currently selected track, if any, or -1 otherwise. syntax var
index = videotracklist.selected
index; value a number indicating the
index of the currently selected track, if any, or -1 otherwise. specifications specification status comment html living standardthe definition of 'videotracklist: selected
index' in that specification. living standard ...
Accessibility documentation index - Accessibility
html. 83 accessibility and spacial patterns accessibility, braille, patterns, photosensitive seizures nasa conducted research on the perception of color, and found that luminance contrast mattered greatly as to how they were perceived. the two images below are from nasa research, specifically, from the article, "designing with blue" 84 accessibility documentation
index accessibility,
index this document provides a list of links to all accessibility articles on the mozilla developer network. 85 accessibility: what users can do to browse more safely color, epilepsy, photosensitivity, prefers-reduced-motion, reflex epilepsy, saturation, seizure disorders, seizures, user settings, web animation this article discusses making web conten...
Index - Developer guides
28 guide to web apis api, guide, landing, web the web includes a wide array of apis that can be used from javascript to build increasingly more powerful and capable applications, running either on the web, locally, or through technology such as node.js, on a server. on this page you'll find a complete list of all of the apis provided by the full web technology stack. 29
index guide,
index found 31 pages: 30 introduction to web development beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started. 31 localizations and character encodings charact...
Index - HTTP
nce, request header the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date. if the resource has been modified after the given date, the response will be a 412 (precondition failed) error. 82
index http, http header,
index found 115 pages: 83 keep-alive general header, http, http header, reference the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests. 84 large-allocation http, http header, non-standard, reference, response header, header the non-standa...
Index - XPath
cters to translate and returns the translated string. 53 true xslt, xslt_reference the true function returns a boolean value of true. 54 unparsed-entity-url xslt, xslt_reference the unparsed-entity-url() function returns the uri of the unparsed entity with the given name. this is non-xml data referenced in the dtd of the source document. 55
index index, reference, xpath, xslt found 57 pages: 56 introduction to using xpath in javascript add-ons, dom, extensions, javascript, transforming_xml_with_xslt, web development, xml, xpath, xslt this document describes the interface for using xpath in javascript internally, in extensions, and from websites. mozilla implements a fair amount of the dom 3 xpath, which mean...
Index - XSLT: Extensible Stylesheet Language Transformations
junction with specialized processing software, for the transformation of xml documents. 2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. to find out the current type, load the file in mozilla and look at the page info. or use a download tool, those usually tell the mime type. 3
index index, reference, xslt found 54 pages: 4 pi parameters xslt no summary! 5 the xslt/javascript interface in gecko xslt no summary! 6 advanced example xslt this advanced example sorts several divs based on their content. the example allows sorting the content multiple times, alternating between ascending and descending order. ...
Bytecode Descriptions
l 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 bigint
index) stack: ⇒ bigint push the bigint constant script->getbigint(bigint
index). string operands: (uint32_t atom
index) stack: ⇒ string push the string constant script->getatom(atom
index). format: jof_atom symbol operands: (uint8_t symbol (the js::symbolcode of the symbol to use)) stack: ⇒ symbol push a well-known symbol. symbol must be in range for js::symbolcode. expressions unary operat...
...ns topropertykey stack: propertynamevalue ⇒ propertykey convert a value to a property key. implements: topropertykey, except that if the result would be the string representation of some integer in the range 0..2^31, we push the corresponding int32 value instead. this is because the spec insists that array indices are strings, whereas for us they are integers. this is used for code like ++obj[
index], which must do both a jsop::getelem and a jsop::setelem with the same property key. both instructions would convert
index to a property key for us, but the spec says to convert it only once. the conversion can call .tostring()/.valueof() methods and can throw. format: jof_ic tonumeric, tostring stack: val ⇒ tonumeric(val) convert a value to a numeric value (a number or bigint). implements: ...
...promise dynamic import of the module specified by the string value on the top of the stack. implements: import calls. importmeta stack: ⇒ import.meta push the import.meta object. this must be used only in module code. objects creating objects newinit stack: ⇒ obj create and push a new object with no properties. format: jof_ic newobject, newobjectwithgroup operands: (uint32_t baseobj
index) stack: ⇒ obj create and push a new object of a predetermined shape. the new object has the shape of the template object script->getobject(baseobj
index). subsequent initprop instructions must fill in all slots of the new object before it is used in any other way. for jsop::newobject, the new object has a group based on the allocation site (or a new group if the template's group is a singleton).
...And 61 more matches
IAccessibleTable
other-licenses/ia2/accessibletable.idlnot scriptable this interface gives access to a two-dimensional table. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) typically all accessible objects that represent cells or cell-clusters of a table will be at the same time children of the table. in this case iaccessible2.
indexinparent() will return the child
index which then can be used when calling row
index() and column
index(). however, in some cases that kind of implementation will not be possible. when the table cells are not direct children of a table, the object representing the cell can define a "table-cell-
index" object attribute identifying the 0 based table cell
index. this object attribute is obtained by parsing the att...
...the range of valid coordinates for this interface are implementation dependent. ...
... that kind of implementation will not be possible. when the table cells are not direct children of a table, the object representing the cell can define a "table-cell-
index" object attribute identifying the 0 based table cell
index. this object attribute is obtained by parsing the attribute string returned by iaccessible2.attributes(). the "table-cell-
index" attribute can be used just like a child
index of the typical case. ats should first test for the presence of the "table-cell-
index" attribute and if it is not present then iaccessible2.
indexinparent() can be used as in the typical case where cells are direct children of the table. the range of valid coordinates for this interface are implementation dependent. however, that range includes at least the intervals from the from the first row or ...
...And 39 more matches
JavaScript Daemons Management - Archive of obsolete content
*/ daemon.prototype; daemon.context.constructor = object; /* these properties can be manually reconfigured after the cr...
... of the daemon */ daemon.prototype.owner = daemon.context; daemon.prototype.task = null; daemon.prototype.rate = 100; daemon.prototype.length = infinity; daemon.prototype.reversals = 0; daemon.prototype.onstart = null; daemon.prototype.onstop = null; /* these properties should be read-only after the creation of the daemon */ daemon.prototype.session = -1; daemon.prototype.
index = 0; daemon.prototype.paused = true; daemon.prototype.backw = true; /* system required daemon global object methods */ daemon.forcecall = function (odmn) { odmn.
index += odmn.backw ? -1 : 1; var bbreak = odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false, bend = odmn.isatend(), binvert = odmn.reversals > 0; if (bend && !binvert || bbreak)...
...corporate(@func) will modify the @func.prototype property! ...
...And 34 more matches
nsINavBookmarksService
ts.interfaces.nsinavbookmarksservice); method overview void addobserver(in nsinavbookmarkobserver observer, in boolean ownsweak); void beginupdatebatch(); obsolete since gecko 1.9 void changebookmarkuri(in long long aitemid, in nsiuri anewuri); long long createdynamiccontainer(in long long aparentfolder, in autf8string aname, in astring acontractid, in long a
index); note: renamed from createcontainer in gecko 1.9 obsolete since gecko 13.0 long long createfolder(in long long aparentfolder, in autf8string name, in long
index); void endupdatebatch(); obsolete since gecko 1.9 void exportbookmarkshtml(in nsifile file); obsolete since gecko 1.9 nsiuri getbookmarkedurifor(in nsiuri auri); void getbookmarkfolderstarray(...
...ong afolder, in astring asubfolder); obsolete since gecko 2.0 long long getfolderidforitem(in long long aitemid); boolean getfolderreadonly(in long long aitemid); astring getfoldertitle(in print64 folder); obsolete since gecko 1.9 nsiuri getfolderuri(in print64 folder); obsolete since gecko 1.9 long long getidforitemat(in long long aparentid, in long a
index); prtime getitemdateadded(in long long aitemid); astring getitemguid(in long long aitemid); obsolete since gecko 14.0 long long getitemidforguid(in astring aguid); obsolete since gecko 14.0 long getitem
index(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); u...
...rdforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obsolete since gecko 1.9 void importbookmarkshtmltofolder(in nsiuri url, in print64 folder); obsolete since gecko 1.9 print32
indexoffolder(in print64 parent, in print64 folder); obsolete since gecko 1.9 print32
indexofitem(in print64 folder, in nsiuri uri); obsolete since gecko 1.9 long long insertbookmark(in long long aparentid, in nsiuri auri, in long a
index, in autf8string atitle); void insertitem(in print64 folder, in nsiuri item, in print32
index); obsolete since gecko 1.9 long long ...
...And 34 more matches
Basic concepts - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser. because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline.
indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in
indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of
indexeddb, see big concepts. ...
... don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in
indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of
indexeddb, see big concepts. to learn more about
indexeddb terms, see the definitions section. for a detailed tutorial on how to use the api, see using
indexeddb. for the reference documentation on the
indexeddb api, refer back to the main
indexeddb api article and its subpages, which document the types of objects used by
indexeddb. for more information on how the browser handles storing your data in the background, read browser storage limits and...
...ction. for a detailed tutorial on how to use the api, see using
indexeddb. for the reference documentation on the
indexeddb api, refer back to the main
indexeddb api article and its subpages, which document the types of objects used by
indexeddb. for more information on how the browser handles storing your data in the background, read browser storage limits and eviction criteria. overview of
indexeddb
indexeddb lets you store and retrieve objects that are
indexed with a "key." all changes that you make to the database happen within transactions. like most web storage solutions,
indexeddb follows a same-origin policy. so while you can access stored data within a domain, you cannot access data across different domains. ...
...And 31 more matches
mozIStorageBindingParams
ng mozistoragestatement.executeasync(). storage/public/mozistoragebindingparams.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). ...
...executeasync(). storage/public/mozistoragebindingparams.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). ...
...ams.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). ...
...And 27 more matches
StringView - Archive of obsolete content
/* ...or...: ntranscrtype ^= number(this.encoding !== "utf-32") << 1; */ nstartidx = ncharstart = noffset ? math.max((noutptlen + noffset) % noutptlen, 0) : 0; nendidx = ncharend = (number.isinteger(nlength) ? math.min(math.max(nlength, 0) + nstartidx, noutptlen) : noutptlen) - 1; } else { /* input is stringview */ vsource = vinput.rawdata; ninptlen = vinput.make
index(); nstartidx = ncharstart = noffset ? math.max((ninptlen + noffset) % ninptlen, 0) : 0; noutptlen = number.isinteger(nlength) ? math.min(math.max(nlength, 0), ninptlen - ncharstart) : ninptlen; nendidx = ncharend = noutptlen + ncharstart; if (vinput.encoding === "utf-8") { fgetinptchrsize = stringview.getutf8charlength; fgetinptchrcode = stringview.loadutf...
...coding, nbyteoffset, nlength) { return new stringview(sencoding === "utf-16" || sencoding === "utf-32" ? stringview.base64tobytes(sb64inpt, sencoding === "utf-16" ? 2 : 4).buffer : stringview.base64tobytes(sb64inpt), sencoding, nbyteoffset, nlength); }; /* default values */ stringview.prototype.encoding = "utf-8"; /* default encoding... ...
...-8"; /* default encoding... ...
...And 26 more matches
nsITreeView
ast changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implementing a nsitreeview in lieu of dom methods for tree creation can improve performance dramatically, and removes the need to make changes to the tree manually when changes to the database occur. further information about creating treeviews is given in the xul tutorial. ...
... dom methods for tree creation can improve performance dramatically, and removes the need to make changes to the tree manually when changes to the database occur. further information about creating treeviews is given in the xul tutorial. ...
...ed to make changes to the tree manually when changes to the database occur. further information about creating treeviews is given in the xul tutorial. ...
...And 25 more matches
IAccessibleText
[propget] hresult ncharacters([out] long ncharacters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult removeselection([in] long selection
index ); hresult scrollsubstringto([in] long start
index, [in] long end
index, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long start
index, [in] long end
index, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selection
index, [out] long startoffset, [out] long endoffset ); hresult setcaretoffset([in] long of...
...ex, [in] long end
index, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long start
index, [in] long end
index, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selection
index, [out] long startoffset, [out] long endoffset ); hresult setcaretoffset([in] long offset ); hresult setselection([in] long selection
index, [in] long startoffset, [in] long endoffset ); [propget] hresult text([in] long startoffset, [in] long endoffset, [out] bstr text ); [propget] hresult textafteroffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); [propget] hresult textatoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] ...
...t(). its height typically being the maximal height of all the characters in the text() or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. [propget] hresult characterextents( [in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); parameters offset
index of the character for which to return its bounding box. the valid range is 0..length. coordtype specifies if the coordinates are relative to the screen or to the parent window. x x coordinate of the top left corner of the bounding box of the referenced character. y y coordinate of the top left corner of the bounding box of the referenced character. width width of the bounding box of the referenced...
...And 24 more matches
How to implement a custom autocomplete search component
re/modules/xpcomutils.jsm'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} default
index * @param {string} errordescription * @param {array.<string>} results * @param {array.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, default
index, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._default
index = default
index; this._errordescription = errordescription; this.
...eteresult(searchstring, searchresult, default
index, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._default
index = default
index; this._errordescription = errordescription; this._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _default
index: 0, _errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_su...
...*/ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the
index of the default item that should be entered if * none is selected */ get default
index() { return this._default
index; }, /** * @return {string} description of the cause of a search failure */ get errordescription() { return this._errordescription; }, /** * @return {number} the number of matches */ get matchcount() { return this._results.length; }, ...
...And 20 more matches
Keyboard-navigable JavaScript widgets - Accessibility
overview web applications often use javascript to mimic desktop widgets such as menus, tree views, rich text fields, and tab panels. these widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do. this document describes techniques to make javascript widgets accessible with the keyboard. using tab
index by default, when people use the tab key to browse a webpage, only interactive elements (like links, form controls) get focused. with the tab
index global attribute, authors can make other elements focusable, too. when set to 0, the element becomes focusable by keyboard and script. when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order. th...
...ents focusable, too. when set to 0, the element becomes focusable by keyboard and script. when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order. the order in which elements gain focus when using a keyboard, is the source order by default. in exceptional circumstances, authors may want to redefine the order. ...
...d and script. when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order. the order in which elements gain focus when using a keyboard, is the source order by default. in exceptional circumstances, authors may want to redefine the order. to do this, authors can set tab
index to any positive number. warning: avoid using positive values for tab
index. ...
...And 20 more matches
Box-shadow generator - CSS: Cascading Style Sheets
es" class="category"> <div class="title"> class element properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> border </div> <div class="ui-checkbox" data-topic='border-state' data-state="true"></div> </div> <div id="z-
index" class="slidergroup"> <div class="ui-slider-name"> z-
index </div> <div class="ui-slider-btn-set" data-topic="z-
index" data-type="sub"></div> <div class="ui-slider" data-topic="z-
index" data-min="-10" data-max="10" data-step="1"></div> <div class="ui-slider-btn-set" data-topi...
...ss="slidergroup"> <div class="ui-slider-name"> z-
index </div> <div class="ui-slider-btn-set" data-topic="z-
index" data-type="sub"></div> <div class="ui-slider" data-topic="z-
index" data-min="-10" data-max="10" data-step="1"></div> <div class="ui-slider-btn-set" data-topic="z-
index" data-type="add"></div> <div class="ui-slider-input" data-topic="z-
index"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> top </div> <div class="ui-slider-btn-set" data-topic="top" data-type="sub"></div> <div class="ui-slider" data-topic="top...
...0;"> <div class="output" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute] width height top left z-
index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <div class="output" data-topic="after" data-name="element:after" data-prop="content=[""] position=[absolute] width height top left z-
index background-color box-shadow transform -webkit-transform -ms-transform"> </div> ...
...And 20 more matches
nsIAccessibleTable
accessible/public/nsiaccessibletable.idlscriptable please add a summary to this article. ...
... accessible/public/nsiaccessibletable.idlscriptable please add a summary to this article. ...
... accessible/public/nsiaccessibletable.idlscriptable please add a summary to this article. ...
...And 19 more matches
Client-side storage - Learn web development
toring client-side data, therefore we won't be teaching you how to use cookies in this article. however, this does not mean cookies are completely useless on the modern-day web — they are still used commonly to store data related to user personalization and state, e.g. session ids and access tokens. for more information on cookies see our using http cookies article. ...
...this can be used for things from complete sets of customer records to even complex data types like audio or video files. you'll learn more about these apis below. the future: cache api some modern browsers support the new cache api. ...
... you can find the example html at personal-greeting.html — this contains a simple website with a header, content, and footer, and a form for entering your name. let's build up the example, so you can understand how it works. first, make a local copy of our personal-greeting.html file in a new directory on your computer. next, note how our html references a javascript file called
index.js (see line 40). we need to create this and write our javascript code into it. create an
index.js file in the same directory as your html file. we'll start off by creating references to all the html features we need to manipulate in this example — we'll create them all as constants, as these references do not need to change in the lifecycle of the app. add the following lines to your ja...
...And 18 more matches
nsIMsgDBView
void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); void getcommandstatus(in nsmsgviewcommandtypevalue command, out boolean selectable_p, out nsmsgviewcommandcheckstatevalue selected_p); void viewnavigate(in nsmsgnavigationtypevalue motion, out nsmsgkey resultid, out nsmsgview
index result
index, out nsmsgview
index thread
index, in boolean wrap); boolean navigatestatus(in nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgview
index index); nsimsgdbhdr getmsghdrat(in nsmsgview
index index); nsimsgfolder getfolderforview
index(in nsmsgview
index index); acstring geturiforview
index(in nsmsgview
index index); nsimsgdbview ...
...ew
index index); acstring geturiforview
index(in nsmsgview
index index); nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgview
index indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyview
index(in nsmsgview
index a
index); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey ake...
...gkey amsgkey); void loadmessagebyview
index(in nsmsgview
index a
index); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); nsmsgview
index find
indexfromkey(in nsmsgkey amsgkey, in boolean aexpand); void expandandselectthreadby
index(in nsmsgview
index a
index, in boolean aaugment); void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); void removecolumnhandler(in astring acolumn); nsimsgcustomcolumnhandler getcolumnhandler(in astring acolumn); attributes at...
...And 17 more matches
The stacking context - CSS: Cascading Style Sheets
the stacking context is a three-dimensional conceptualization of html elements along an imaginary z-axis relative to the user, who is assumed to be facing the viewport or the webpage. html elements occupy this space in priority order based on element attributes. the stacking context in the previous part of this article, using z-
index, the rendering order of certain elements is influenced by their z-
index value. this occurs because these elements have special properties which cause them to form a stacking context. a stacking context is formed, anywhere in the document, by any element in the following scenarios: root element of the document (<html>). element with a position value absolute or relative and z-
index value other than auto. element with a position value fixed or sticky (sticky...
... element with a opacity value less than 1 (see the specification for opacity). ...
... element with a opacity value less than 1 (see the specification for opacity). element with a mix-blend-mode value other than normal. ...
...And 17 more matches
Eclipse CDT
introduction eclipse cdt (c/c++ development tools) is an open-source ide for c and c++ development with advanced code assistance (inheritance/call graph explorer, jump to definition, refactoring, autocomplete, syntax highlighting, and so on). system requirements eclipse will use a lot of memory to fully
index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after
indexing is complete). therefore, it is not recommended for use if your machine only has 4 gb of ram. installing eclipse regarding llvm4eclipsecdt, do not install or select this toolchain for mozilla development. this plugin is intended mainly for managed projects but we use an unmanaged project for mozilla (since it has its own build...
...ipse/ on mac). (while package managers like snap sometimes provide an eclipse package, they do not include the c++ developer tools. since it's a pain to install them and keep them up to date we do not recommend getting eclipse this way.) increase eclipse's memory limits! make sure you do this! before you use eclipse with the mozilla source you must increase its memory limits. when eclipse's
indexer tries to process the mozilla source, eclipse will need considerably more memory than the limits imposed by its default configuration. you can increase eclipse's memory limits using the eclipse.ini that lives alongside the eclipse binary. set an initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you f...
...imposed by its default configuration. you can increase eclipse's memory limits using the eclipse.ini that lives alongside the eclipse binary. set an initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you fail to increase these limits, then you will likely find that eclipse either hangs when it tries to
index the mozilla source or else that the code intelligence is very broken after the
indexing "completes". express setup for the eclipse
indexer to work well you must first build mozilla, so that it includes headers from the objdir etc. these can be found and processed by eclipse. note: your moz_objdir must be outside the mozilla source directory. once your build is complete, mach can then genera...
...And 16 more matches
nsITreeSelection
layout/xul/base/src/tree/public/nsitreeselection.idlscriptable this interface is used by the tree widget to get information about what is selected. ...
... layout/xul/base/src/tree/public/nsitreeselection.idlscriptable this interface is used by the tree widget to get information about what is selected. ...
... layout/xul/base/src/tree/public/nsitreeselection.idlscriptable this interface is used by the tree widget to get information about what is selected. ...
...And 16 more matches
Color picker tool - CSS: Cascading Style Sheets
-topic="picker" data-mode="hsl"></div> <div id="picker-samples" sample-id="master"></div> <div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="z
index" class="ui-input-slider" data-topic="z-
index" data-info="z-
index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } ...
...-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("https://mdn.mozillademos.org/files/5705/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-
index: 1; } .ui-color-picker .preview-color { width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); position: absolute; z-
index: 1; } .ui-color-picker .switch_mode { width: 10px; height: 20px; position: relative; border-radius: 5px 0 0 5px; border: 1px solid #ddd; background-color: #eee; left: -12px; top: -1px; z-
index: 1; transition: all 0.5s; } .ui-color-picker .switch_...
...mples .sample:hover { cursor: pointer; border-color: #bbb; transform: scale(1.15); border-radius: 3px; } #picker-samples .sample[data-active='true'] { border-color: #999; } #picker-samples .sample[data-active='true']:after { content: ""; position: absolute; background: url('https://mdn.mozillademos.org/files/6065/arrow.png') center no-repeat; width: 100%; height: 12px; top: -12px; z-
index: 2; } #picker-samples #add-icon { width: 100%; height: 100%; position: relative; box-shadow: inset 0px 0px 2px 0px #ddd; } #picker-samples #add-icon:hover { cursor: pointer; border-color: #ddd; box-shadow: inset 0px 0px 5px 0px #ccc; } #picker-samples #add-icon:before, #picker-samples #add-icon:after { content: ""; position: absolute; background-color: #eee; box-shadow: 0 0 1px 0 #e...
...And 16 more matches
mozIStorageStatement
(firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage overview document. ...
...) for an introduction on how to use this interface, see the storage overview document. ...
... method overview void initialize(in mozistorageconnection adbconnection, in autf8string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8string getparametername(in unsigned long aparam
index); unsigned long getparameter
index(in autf8string aname); autf8string getcolumnname(in unsigned long acolumn
index); unsigned long getcolumn
index(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparam
index, in autf8string avalue); ...
...And 15 more matches
Array - JavaScript
ray's length can change at any time, and data can be stored at non-contiguous locations in the array, javascript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them. in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays. arrays cannot use strings as element
indexes (as in an associative array) but must use integers. setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection. the array's object properties and list of array elements are separate, and the array's traversal and mutation o...
...tself, but will set or access a variable associated with that array's object property collection. the array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. ...
...lements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. ...
...And 15 more matches
RegExp - JavaScript
ties have both long and short (perl-like) names. both names always refer to the same value. (perl is the programming language from which javascript modeled its regular expressions.). see also deprecated regexp properties. constructor regexp() creates a new regexp object. static properties get regexp[@@species] the constructor function that is used to create derived objects. regexp.last
index the
index at which to start the next match. instance properties regexp.prototype.flags a string that contains the flags of the regexp object. regexp.prototype.dotall whether . matches newlines or not. regexp.prototype.global whether to test the regular expression against all possible matches in a string, or only against the first. regexp.prototype.ignorecase whether to ignore case wh...
...verrides the object.prototype.tostring() method. regexp.prototype[@@match]() performs match to given string and returns match result. regexp.prototype[@@matchall]() returns all matches of the regular expression against a string. regexp.prototype[@@replace]() replaces matches in given string with new substring. regexp.prototype[@@search]() searches the match in given string and returns the
index the pattern found in the string. regexp.prototype[@@split]() splits given string into an array by separating the string into substrings. examples using a regular expression to change data format the following script uses the replace() method of the string instance to match a name in the format first last and output it in the format last, first. in the replacement text, the script uses $1 a...
...xpression matters. using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes[^]*day/); // returns ["yes\nmake my day"] using a regular expression with the sticky flag the sticky flag indicates that the regular expression performs sticky matching in the target string by attempting to match starting at regexp.prototype.last
index. ...
...And 15 more matches
Creating a Help Content Pack - Archive of obsolete content
tation into your application using the mozilla help viewer. documentation contained in the help viewer can be accessed using any xul application or program that embeds mozilla. what is a content pack? a content pack is a packaged set of files that describe help content. content packs include help documents written in xhtml, a content pack descriptor file written in rdf, and a table of contents,
index, and glossary (also written in rdf). you can create a content packs which inherit from existing mozilla help content packs. the contents of a content pack content packs consist of a general pack description file, table of contents,
index, search, glossary, and help documents. the help documents are written in xhtml, and the rest are written in rdf. the content pack descriptor file outlines the ...
...the glossary file is written in rdf and consists of a simple list of terms with corresponding urls to the term definition. ...
...the glossary file is written in rdf and consists of a simple list of terms with corresponding urls to the term definition. creating a content pack the content pack descriptor file as mentioned earlier, the content pack descriptor file is written using rdf. ...
...And 14 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
plete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox. the sessions can be set using the searchsessions attribute or by calling the addsession method. ...
...forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tab
index, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefault
index, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupo...
...tch, completedefault
index, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tab
index, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) attributes accesskey type: chara...
...And 14 more matches
listbox - Archive of obsolete content
d to contain listitem elements. all the rows in the listbox are the same height, which is the height of the tallest item in the list. if you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...listbox are the same height, which is the height of the tallest item in the list. if you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...te a list with variable height rows, or with non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...And 14 more matches
richlistbox - Archive of obsolete content
s used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
..., similar to a listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...And 14 more matches
How to build custom form controls - Learn web development
m has already been implemented for the click event. defining the html structure and (some) semantics now that the control's basic functionality has been decided upon, it's time to start building it. the first step is to define its html structure and to give it some basic semantics. here is what we need to rebuild a <select> element: <!-- this is our main container for our control. the tab
index attribute is what allows the user to focus the control. we'll see later that it's better to set it through javascript. --> <div class="select" tab
index="0"> <!-- this container will be used to display the current value of the control --> <span class="value">cherry</span> <!-- this container will contain all the options available for our control. because it's a list, it makes s...
...te-space : nowrap; text-overflow: ellipsis; vertical-align: top; } we don't need an extra element to design the down arrow; instead, we're using the :after pseudo-element. it could also be implemented using a simple background image on the select class. ...
.../* this will be important to keep the arrow from overlapping the list of options */ top : 0; right : 0; box-sizing : border-box; height : 100%; width : 2em; padding-top : .1em; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; text-align : center; } next, let's style the list of options: .select .optlist { z-
index : 2; /* we explicitly said the list of options will always be on top of the down arrow */ /* this will reset the default style of the ul element */ list-style: none; margin : 0; padding: 0; box-sizing : border-box; /* if the values are smaller than the control, the list of options will be as wide as the control itself */ min-width : 100%; /* in case the list is too long, ...
...And 14 more matches
nsINavBookmarkObserver
1.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32
index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 old
index, in print64 newparent, in print32 new
index); obsolete since gecko 1.9 void onfolderremoved(in print64 folder, in print64 parent, in print32
index); obsolete since gecko 1.9 ...
...in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 old
index, in print64 newparent, in print32 new
index); obsolete since gecko 1.9 void onfolderremoved(in print64 folder, in print64 parent, in print32
index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long a
index, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); ...
...adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aold
index, in long long anewparentid, in long anew
index, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long a
index, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in...
...And 14 more matches
IDBObjectStore - Web APIs
idbobjectstore.keypath read only the key path of this object store. if this attribute is null, the application must provide a key for each modification operation. idbobjectstore.name the name of this object store. idbobjectstore.transaction read only the idbtransaction object to which this object store belongs. ...
... idbobjectstore.keypath read only the key path of this object store. if this attribute is null, the application must provide a key for each modification operation. idbobjectstore.name the name of this object store. idbobjectstore.transaction read only the idbtransaction object to which this object store belongs. ...
...brequest object, and clears this object store in a separate thread. this is for deleting all current records out of an object store. idbobjectstore.count() returns an idbrequest object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange. if no arguments are provided, it returns the total number of records in the store. ...
...And 14 more matches
IDBObjectStoreSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the
indexeddb api provides synchronous access to an object store of a database. ...
...and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the
indexeddb api provides synchronous access to an object store of a database. ...
...ly removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the
indexeddb api provides synchronous access to an object store of a database. ...
...And 14 more matches
Image file type and format guide - Web media technologies
f bits used to represent each pixel in memory. apng (animated portable network graphics) apng is a file format first introduced by mozilla which extends the png standard to add support for animated images. conceptually similar to the animated gif format which has been in use for decades, apng is more capable in that it supports a variety of color depths, whereas animated gif supports only 8-bit
indexed color. apng is ideal for basic animations that do not need to synchronize to other activities or to a sound track, such as progress indicators, activity throbbers, and other animated sequences. for example, apng is one of the formats supported when creating animated stickers for apple's imessage application (and the messages application on ios). they're also commonly used for the animated port...
...s per component (d) description greyscale 1, 2, 4, 8, and 16 each pixel consists of a single d-bit value indicating the brightness of the greyscale pixel. true color 8 and 16 each pixel is represented by three d-bit values indicating the level of the red, green, and blue color components.
indexed color 1, 2, 4, and 8 each pixel is a d-bit value indicating an
index into a color palette which is contained within a plte chunk in the apng file; the colors in the palette all use an 8-bit depth. greyscale with alpha 8 and 16 each pixel is represented by two d-bit values: the intensity of the greyscale pixel and an alpha sample, indicating how o...
...monly used, form of bmp file is an uncompressed raster image, with each pixel occupying 3 bytes representing its red, green, and blue components, and each row padded with 0x00 bytes to a multiple of 4 bytes wide. while other data representations are defined in the specification, they are not widely used and often completely unimplemented. these features include: support for different bit depths,
indexed color, alpha channels, and different pixel orders (by default, bmp is written from bottom-left corner toward the right and top, rather than from the top-left corner toward the right and bottom). theoretically, several compression algorithms are supported, and the image data can also be stored in jpeg or png format within the bmp file. mime type image/bmp file extension(s)...
...And 13 more matches
Understanding WebAssembly text format - WebAssembly
r type, for example (local i32). parameters are basically just locals that are initialized with the value of the corresponding argument passed by the caller. getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions. the local.get/local.set commands refer to the item to be got/set by its numeric
index: parameters are referred to first, in order of their declaration, followed by locals in order of their declaration. so given the following function: (func (param i32) (param f32) (local f64) local.get 0 local.get 1 local.get 2) the instruction local.get 0 would get the i32 parameter, local.get 1 would get the f32 parameter, and local.get 2 would get the f64 local. there is another issue...
... a lot more examples as you go along. for a full list of the available opcodes, consult the webassembly.org semantics reference. calling the function our function won’t do very much on its own — now we need to call it. how do we do that? like in an es2015 module, wasm functions must be explicitly exported by an export statement inside the module. like locals, functions are identified by an
index by default, but for convenience, they can be named. let's start by doing this — first, we'll add a name preceded by a dollar sign, just after the func keyword: (func $add … ) now we need to add an export declaration — this looks like so: (export "add" (func $add)) here, add is the name the function will be identified by in javascript whereas $add picks out which webassembly function ins...
...te: you can find this example in github as add.html (see it live also). also see webassembly.instantiatestreaming() for more details about the instantiate function. exploring fundamentals now we’ve covered the real basics, let’s move on to look at some more advanced features. calling functions from other functions in the same module the call instruction calls a single function, given its
index or name. for example, the following module contains two functions — one just returns the value 42, the other returns the result of calling the first plus one: (module (func $getanswer (result i32) i32.const 42) (func (export "getanswerplus1") (result i32) call $getanswer i32.const 1 i32.add)) note: i32.const just defines a 32-bit integer and pushes it onto the stack. you ...
...And 13 more matches
Using the Gamepad API - Web APIs
ads are only exposed to a page when the user interacts with one with the page visible. this helps prevent gamepads being used for fingerprinting the user. once one gamepad has been interacted with, other gamepads that are connected will automatically be visible. you can use gamepadconnected like this: window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s. %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); each gamepad has a unique id associated with it, which is available on the event's gamepad property. disconnecting a gamepad when a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. gamepadconnected), a second event is dispatched ...
...nique id associated with it, which is available on the event's gamepad property. disconnecting a gamepad when a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. gamepadconnected), a second event is dispatched to the focused window, gamepaddisconnected: window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from
index %d: %s", e.gamepad.
index, e.gamepad.id); }); the gamepad's
index property will be unique per-device connected to the system, even if multiple controllers of the same type are used. the
index property also functions as the
index into the array returned by navigator.getgamepads(). var gamepads = {}; function gamepadhandler(event, connecting) { var gamepad = event.gamepad; // note: // g...
...); }); the gamepad's
index property will be unique per-device connected to the system, even if multiple controllers of the same type are used. the
index property also functions as the
index into the array returned by navigator.getgamepads(). ...
...And 12 more matches
ARIA: grid role - Accessibility
s of cells. the position of each cell is significant and can be focused using keyboard input. ...
...is significant and can be focused using keyboard input. ...
... input. ...
...And 12 more matches
Array.prototype.reduce() - JavaScript
you provide) on each element of the array, resulting in single output value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... it takes four arguments: accumulator the accumulator accumulates callback's return values. ...
...execute on each element in the array (except for the first, if no initialvalue is supplied). it takes four arguments: accumulator the accumulator accumulates callback's return values. it is the accumulated value previously returned in the last invocation of the callback—or initialvalue, if it was supplied (see below). currentvalue the current element being processed in the array.
index optional the
index of the current element being processed in the array. starts from
index 0 if an initialvalue is provided. otherwise, it starts from
index 1. array optional the array reduce() was called upon. initialvalue optional a value to use as the first argument to the first call of the callback. if no initialvalue is supplied, the first element in the array will be used as the ...
...And 12 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
ox with a popup containing a list of possible completions for what the user has started to type. toolkit applications (such as firefox) use a different autocomplete mechanism than the mozilla suite. the example below will create an autocomplete textbox that will search the user's history. ...
...ing a list of possible completions for what the user has started to type. toolkit applications (such as firefox) use a different autocomplete mechanism than the mozilla suite. the example below will create an autocomplete textbox that will search the user's history. ...
...chparam, completedefault
index, completeselected
index,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tab
index, tabscrolling, timeout, type, value properties accessibletype, completedefault
index, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentco...
...And 11 more matches
Manipulating Lists - Archive of obsolete content
ch you might wish to use in a script. similarly, there is also an insertitemat() and a removeitemat() function which inserts a new item and removes an existing item respectively. the syntax is as follows: list.insertitemat(3, "thursday", "thu"); list.removeitemat(3); the insertitemat() function takes an additional argument, the position to insert the new item. the new item is inserted at this
index, so, in the example, the new item will be added at position 3 while the item previously at that position will now be at position 4. remember that the first item is 0. the removeitemat() function will remove the item at a specific
index. these three methods are also available for several other xul elements and work in the same manner. in fact, these methods are part of the nsidomxulselectcontrole...
...nt interface so any xul elements which implement this interface have these methods. this includes the menulist, radiogroup and tabs elements. for example, to add a new item to a menulist, you can use the same syntax as for a listbox. the right kind of element will be appended in each situation. list selection the nsidomxulselectcontrolelement interface provides two additonal properties, selected
index and selecteditem. the former returns the
index of the selected item while the latter returns the selected element. for instance the selecteditem of a menulist will be the menuitem that is selected. if no item is selected, selected
index will return -1, while selecteditem will return null. getting the selected item these two properties are commonly inspected during a select event, as in the follo...
...null before continuing. the select event is also fired when a radio button in a radiogroup is selected and when a tab is selected in a tabs element. however, menulists do not fire the select event; instead you can listen to the command event to handle when an item is selected. for the tabs element, it is often more convenient to use functions of the tabbox element instead. it also has a selected
index function which will return the
index of the selected tab. however, to get the selected item, use the tabbox's selectedtab property instead. or, use the selectedpanel property to get the selected panel, that is, return the content associated with the tab. changing the selection all of the selection related properties described above may also be assigned a new value to change the selection. in th...
...And 11 more matches
Creating hyperlinks - Learn web development
rg/. urls use paths to find files. paths specify where the file you're interested in is located in the filesystem. let's look at an example of a directory structure, see the creating-hyperlinks directory. the root of this directory structure is called creating-hyperlinks. when working locally with a web site, you'll have one directory that contains the entire site. inside the root, we have an
index.html file and a contacts.html. in a real website,
index.html would be our home page or landing page (a web page that serves as the entry point for a website or a particular section of a website.). there are also two directories inside our root — pdfs and projects. these each have a single file inside them — a pdf (project-brief.pdf) and an
index.html file, respectively. note that you can hav...
...file and a contacts.html. in a real website,
index.html would be our home page or landing page (a web page that serves as the entry point for a website or a particular section of a website.). there are also two directories inside our root — pdfs and projects. these each have a single file inside them — a pdf (project-brief.pdf) and an
index.html file, respectively. note that you can have two
index.html files in one project, as long as they're in different filesystem locations. the second
index.html would perhaps be the main landing page for project-related information. ...
...s and projects. these each have a single file inside them — a pdf (project-brief.pdf) and an
index.html file, respectively. note that you can have two
index.html files in one project, as long as they're in different filesystem locations. the second
index.html would perhaps be the main landing page for project-related information. same directory: if you wanted to include a hyperlink inside
index.html (the top level
index.html) pointing to contacts.html, you would specify the filename that you want to link to, because it's in the same directory as the current file. the url you would use is contacts.html: <p>want to contact a specific staff member? find details on our <a href="contacts.html">contacts page</a>.</p> moving down into subdirectories: if you wanted to include a hyperli...
...And 11 more matches
Displaying Places information using views
ntainer. you can queryinterface acontainer to an nsinavhistorycontainerresultnode. showroot boolean if true the root nsinavhistorycontainerresultnode is shown as the first row in the tree. at least one of showroot and flatlist must be false. ...
...rycontainerresultnode. showroot boolean if true the root nsinavhistorycontainerresultnode is shown as the first row in the tree. at least one of showroot and flatlist must be false. ...
...erresultnode. showroot boolean if true the root nsinavhistorycontainerresultnode is shown as the first row in the tree. at least one of showroot and flatlist must be false. ...
...And 11 more matches
IAccessibleTable2
rence to it is returned, else a null pointer is returned. return value s_false if there is nothing to return, [out] value is null. s_ok. cellat() returns the accessible object at the specified row and column in the table. this object could be an iaccessible or an iaccessible2. [propget] hresult cellat( [in] long row, [in] long column, [out] iunknown cell ); parameters row the 0 based row
index for which to retrieve the cell. column the 0 based column
index for which to retrieve the cell. cell if both row and column
index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. columndescription() returns ...
...bject is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. columndescription() returns the description text of the specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based
index of the column for which to retrieve the description. description returns the description text of the specified column in the table if such a description exists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. iscolumnselected() returns a boolean value indicating whether the ...
...xists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. iscolumnselected() returns a boolean value indicating whether the specified column is completely selected. [propget] hresult iscolumnselected( [in] long column, [out] boolean isselected ); parameters column 0 based
index of the column for which to determine whether it is selected. isselected returns true if the specified column is selected completely and false otherwise. return value e_invalidarg if bad [in] passed, [out] value is false. s_ok. isrowselected() returns a boolean value indicating whether the specified row is completely selected. [propget] hresult isrowselected( [in] long row, [out] boolean isse...
...And 11 more matches
nsISupportsArray
xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
...please add a summary to this article. ...
...ng a
index); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates the xpcom interface guidelines long get
indexof(in nsisupports apossibleelement); long get
indexofstartingat(in nsisupports apossibleelement, in unsigned long astart
index); long getlast
indexof(in nsisupports apossibleelement); long
indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long
indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astart
index); violates the xpcom in...
...And 11 more matches
ARIA: cell role - Accessibility
grid, table or treegrid. if a cell contains column or row header information, use the colheader or rowheader roles, respecitively. if the cell does not contain header information and is nested in a grid or treegrid, the role of gridcell may be more appropriate. a cell can contain a number of property attributes clarifying the cell's position within the tabular data structure, including aria-col
index, aria-colspan, aria-row
index, and aria-rowspan. using the native html table element (<table>) along with the table row element (<tr>) and table cell element (<td>) whenever possible is strongly encouraged. associated wai-aria roles, states, and properties context roles role="row" an element with role="row" is a row of cells within a tabular structure. a row contains one or more cells, ...
...ope. unlike a plain cell, the rowheader role establishes a relationship between it and all cells in the corresponding row. states and properties aria-colspan similar to the html <th> and <td> colspan attribute, it defines the number of columns spanned by the cell. aria-rowspan similar to the html <th> and <td> rowspan attribute, it defines the number of rows spanned by the cell. aria-col
index attribute the aria-col
index attribute is only needed if columns are hidden from the dom. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. the aria-col
index defines an element's column
index or position with respect to the total number of columns within a row. if all the columns are in the dom, this attribute is not necess...
...e aria-col
index attribute is only needed if columns are hidden from the dom. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. the aria-col
index defines an element's column
index or position with respect to the total number of columns within a row. if all the columns are in the dom, this attribute is not necessary. aria-row
index attribute the aria-row
index attribute is only needed if rows are hidden from the dom, to indicate which row, in the list of total rows, the current cell is in. the attribute, takes as its value an integer between 1 and the total number of rows within the table, grid, or treegrid, indicating the position, or
index, of the cell. for example, a cell in the first row of the first header would lik...
...And 11 more matches
XBL Example - Archive of obsolete content
e pages will be specified in the xul file, not in xbl, but we'll need to add it inside the deck. the children tag will need to be used. along the bottom, we'll need a button to go the previous page, a label to display the current page number, and a button to go to the next page. example 1 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selected
index" selected
index="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext"/> <xul:label flex="1"/> <xul:button xbl:inherits="label=nexttext"/> </xul:hbox> </xul:vbox> </content> </binding> this binding creates the slideshow structure that we want. the flex attribute has been added to a number of elements ...
...attribute has been added to a number of elements so that it stretches in the right way. the label attributes on the two buttons inherit their values from the bound element. here, they inherit from two custom attributes, previoustext and nexttext. this makes it easy to change the labels on the buttons. the children of the element that the xbl is bound to will be placed inside the deck. the selected
index is inherited by the deck, so we may set the initial page in the xul. the following xul file produces the result in the image. <box class="slideshow" previoustext="previous" nexttext="next" flex="1"> <button label="button 1"/> <checkbox label="checkbox 2"/> <textbox/> </box> the style sheet used here is: .slideshow { -moz-binding: url("slideshow.xml#slideshow"); } the first button...
..."slideshow.xml#slideshow"); } the first button, button 1 has been used as the first page of the deck. the label widget has not appeared as no value has been specified for it. we could set a value, but instead it will calculated later. page property next, a property that holds the current page will be added. when getting this custom property, it will need to retrieve the value of the selected
index attribute of the deck, which holds the number of the currently displayed page. similarly, when setting this property, it will need to change the selected
index attribute of the deck. in addition, the text widget will need to be updated to display which page is the current one. <property name="page" onget="return parseint(document.getanonymousnodes(this)[0].childnodes[0].getattribute('selected...
...And 10 more matches
mozIStorageValueArray
interface obtains provides methods to obtain data from a given result. for an introduction on how to use this interface, see the storage overview document. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
...des methods to obtain data from a given result. for an introduction on how to use this interface, see the storage overview document. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
...for an introduction on how to use this interface, see the storage overview document. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
...And 10 more matches
nsITreeBoxObject
d in gecko 1.9 (firefox 3) inherits from: nsisupports to get the treeboxobject for a tree: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); or simply: let boxobject = tree.treeboxobject; method overview long getfirstvisiblerow(); long getlastvisiblerow(); long getpagelength(); void ensurerowisvisible(in long
index); void ensurecellisvisible(in long row, in nsitreecolumn col); void scrolltorow(in long
index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); ...
...); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long
index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long start
index, in long end
index); void invalidatecolumnrange(in long start
index, in long end
index, in nsitreecolumn col); long getrowat(in long x, in long y); void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); void...
... view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view at...
...And 10 more matches
jspage - Archive of obsolete content
++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","
indexof","join","last
indexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","
indexof","last
indexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash"...
...ument.prototype[b]=a;}});document.prototype={$family:{name:"document"}}; new document(document);array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; },filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); },
indexof:function(c,d){var a=this.length;for(var b=(d<0)?math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; }}return false;},associate:function(c){var d={},b=math.min(this.length,c.length...
...me:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; }}return false;},associate:function(c){var d={},b=math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.
indexof(a,b)!=-1; },extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getlast:function(){return(this.length)?this[this.length-1]:null;},getrandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; },include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; },...
...And 9 more matches
tabs - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a row of tabs. a tabs element should be placed inside a tabbox and should contain tab elements. nb: you can add some other elements to tabs such as button, but they will receive an
index. activating them will not change the selected
index. more information is available in the xul tutorial. ...
...d ] a row of tabs. a tabs element should be placed inside a tabbox and should contain tab elements. nb: you can add some other elements to tabs such as button, but they will receive an
index. activating them will not change the selected
index. more information is available in the xul tutorial. ...
...s. a tabs element should be placed inside a tabbox and should contain tab elements. nb: you can add some other elements to tabs such as button, but they will receive an
index. activating them will not change the selected
index. more information is available in the xul tutorial. ...
...And 9 more matches
Package management basics - Learn web development
ess return to accept the default parcel-experiment. version: the starting version number for the app: again, just press return to accept the default 1.0.0. description: a quick description of the app's purpose. type in something really simple, like "a simple npm package to learn about using npm", then press return. entry point: this will be the top-level javascript file of the app. the default
index.js is fine for now — press return. test command, git repository, and keywords: press return to leave each of these blank for now. author: the author of the project. type your own name, and press return. license: the license to publish the package under: press return to accept the default for now. press return one more time to accept these settings. go into your parcel-experiment directory...
...the package under: press return to accept the default for now. press return one more time to accept these settings. go into your parcel-experiment directory and you should now find you've got a package.json file. open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "
index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package. this is good for now, so let's move on. installing parcel run the following command to install parcel locally: npm install parcel-bundler once that's done all the things, we're now ready for some "modern clien...
...hine, you can recreate the same set up by running the command npm install, and npm will look at the dependencies and install them for you. one disadvantage is that parcel is only available inside our parcel-experiment app; you won't be able to run it in a different directory. but the advantages outweigh the disadvantages. setting up our example app anyway, on with the setup. ...
...And 9 more matches
IAccessibleHyperlink
s an image map. linked objects and anchors are implementation dependent. this interface is derived from iaccessibleaction. iaccessibleaction.nactions() is one greater than the maximum value for the indices used with the methods of this interface. furthermore, the object that implements this interface has to be connected implicitly or explicitly with an object that implements iaccessibletext. start
index() and end
index() are indices with respect to the text exposed by iaccessibletext. this interface provides access to a single object which can have multiple actions. an example is an image map which is an image with multiple links each of which is associated with a separate non-overlapping area of the image. this interface could also be applied to other kinds of objects with multiple actions such ...
...t and their anchortargets would reference urls or the objects that would be activated. this use case demonstrates that in some cases there is no need for iaccessiblehyperlink to derive from iaccessibleaction. as a result it may be removed in a later version of the idl and it is suggested that implementations should not rely on the inheritance. method overview [propget] hresult anchor([in] long
index, [out] variant anchor ); [propget] hresult anchortarget([in] long
index, [out] variant anchortarget ); [propget] hresult end
index([out] long
index ); [propget] hresult start
index([out] long
index ); [propget] hresult valid([out] boolean valid ); methods anchor() returns an object that represents the link anchor, as appropriate for the link at the specified
index. [propget] hresult anch...
...anchor this is an implementation dependent value. ...
...And 9 more matches
Stacking context example 2 - CSS: Cascading Style Sheets
the reason is that they do not belong to the same stacking context. ...
...the reason is that they do not belong to the same stacking context. ...
...the reason is that they do not belong to the same stacking context. ...
...And 9 more matches
Iteration protocols - JavaScript
le's @@iterator method doesn't return an iterator object, then it's considered a non-well-formed iterable. ...
...n it's considered a non-well-formed iterable. ...
...ng one is likely to result in runtime errors or buggy behavior: let nonwellformediterable = {}; nonwellformediterable[symbol.iterator] = () => 1; [...nonwellformediterable]; // typeerror: [] is not a function iterator examples simple iterator function makeiterator(array) { let next
index = 0 return { next: function() { return next
index < array.length ? ...
...And 9 more matches
menulist - Archive of obsolete content
element. to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. the command event may be used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
...n changes. more information is available in the xul tutorial. ...
...tion is available in the xul tutorial. ...
...And 8 more matches
tree - Archive of obsolete content
utorial. also tree widget changes. relevant accessbility guidelines provide alternative access (for example, via menus) to column picker and for header behaviors like sorting (these have no default keyboard access). ...
...rovide alternative access (for example, via menus) to column picker and for header behaviors like sorting (these have no default keyboard access). ...
...access). ...
...And 8 more matches
Debugging Table Reflow
ell 3</td> <td>cell 4</td> </tr> </table> rendering: <colgroup><col><col width="50%"><col width="1*"><col></colgroup>cell 1cell 2cell 3cell 4 it will produce the following log at the entrance of assignnonpctcolwidths: assignnonpctcolwidths en max=4500 count=0 ***start table dump*** mcolwidths=-1 -1 -1 -1 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** col
index=0 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=2 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=3 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -...
...rance (ex for leaving a routine). the first line of the data dump shows that no width has yet been assigned to the columns mcolwidths=-1 -1 -1 -1, -1 stands for: #define width_not_set -1 this is followed by a reference to the column frame pointers: col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 this is followed by the information which width has been set for each column. the
index of the column, whether it is anonymous and what kind of constrained has been appliedcol
index=0 isanonymous=0 constraint=0. the following constraint types are known: enoconstraint = 0, epixelconstraint = 1, // pixel width epercentconstraint = 2, // percent width eproportionconstraint = 3, // 1*, 2*, etc. cols attribute assigns 1* e0proportionconstraint = 4 ...
... width after the table has been balanced, considering all of the others in the last log snippet none of these width's has been set. ...
...And 8 more matches
Eclipse CDT Manual Setup
hat the eclipse cdt page isn't hugely cluttered with mostly redundant information, make setting up eclipse look much more complicated than it is nowadays. setup time some points in the rest of this document below are old and taken care of by the mach commands described above (although some of the project configuration is not done automatically yet). some of it like the section on building the
index and usage tips are still relevant, and other parts still may provide useful background information to understand it in more detail on how eclipse works. you can expect it to take an hour or so to work through these instructions if you're doing so for the first time. (this assumes that you already have a copy of the mozilla source, and that you have also built the source so that you have a pre-...
...essary), this section provides some background on what ides need in order to provide advanced code assistance, and what eclipse cdt needs in particular. to be able to provide really good code assistance for a project's source code, ides like eclipse need to carry out a thorough static analysis of the project's source files, to build up a picture of the code (what eclipse is trying to do when it "
indexes" the source.) static analysis involves parsing the source files, so naturally it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file. since eclipse doesn't initially have any of this information, the code assistance that it's able to provide out of the box is pretty broken. for projects the size and complexi...
... these requirements aren't a very good fit with the typical mozilla developer's wish to minimize build times, implying parallelized, silenced builds. the consequences of the above observations are this: it is strongly recommended that you invoke your normal (re)builds from the command line, externally of eclipse. below we will configure eclipse's build step so that you use it on...
...And 8 more matches
IAccessibleAction
on-screen keyboards and voice command software. by providing actions directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. ...
... directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. ...
...he user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. ...
...And 8 more matches
nsINavHistoryResultObserver
annoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long anew
index); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodelastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aold
index, in nsinavhistorycontainerresultnode anewparent, in unsigned long anew
index); void noderemove...
...elastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aold
index, in nsinavhistorycontainerresultnode anewparent, in unsigned long anew
index); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode aitem, in unsigned long aold
index); void nodereplaced(in nsinavhistorycontainerresultnode aparentnode, in nsinavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long a
index); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); vo...
... value for the last visit date and time for the node. anewaccesscount the new access count value for the node. nodeiconchanged() called right after a node's icon property has changed. void nodeiconchanged( in nsinavhistoryresultnode anode ); parameters anode the node whose icon has changed. nodeinserted() called when an item is inserted into a container. ...
...And 8 more matches
Dragging and Dropping Multiple Items - Web APIs
th a moz prefix (such as mozsetdataat() are gecko specific interfaces. these interfaces will only work with gecko based browsers. mozilla supports the ability to drag multiple items using some additional non-standard methods. these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the
index of the item to retrieve, modify or remove. the drag processing described in this document use the datatransfer interface. this processing does not use the datatransferitem interface nor the datatransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.dat...
...atransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain", "data to drag", 0); dt.mozsetdataat("text/plain", "second data to drag", 1); this example adds two items to be dragged. the last argument specifies the
index of the item to add. you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the
index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing t...
...add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the
index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular
index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. for example: var dt = event.datatransfer; dt.mozsetdataat("text/uri-list", "url1", 0); dt.mozsetdataat("text/plain", "url1", 0); dt.mozsetdataat("text/uri-list", "url2", 1); dt.mozsetdataat("text/plain", "url2", 1); dt.mozsetdataat("text/uri-list", "url3", 2); dt.mozsetdataat(...
...And 8 more matches
SVGLengthList - Web APIs
svg length list interface the svglengthlist defines a list of svglength objects. an svglengthlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ted as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...in an exception being thrown. ...
...And 8 more matches
SVGNumberList - Web APIs
svg number list interface the svgnumberlist defines a list of svgnumber objects. an svgnumberlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. note: starting in gecko 5.0,the svgnumberlist dom interface is now
indexable and can be accessed like arrays. ...
...s read only, which means that attempts to modify the object will result in an exception being thrown. note: starting in gecko 5.0,the svgnumberlist dom interface is now
indexable and can be accessed like arrays. ...
...exception being thrown. note: starting in gecko 5.0,the svgnumberlist dom interface is now
indexable and can be accessed like arrays. ...
...And 8 more matches
SVGStringList - Web APIs
st interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... to modify the object will result in an exception being thrown. ...
...And 8 more matches
SVGTransformList - Web APIs
svg transform list interface the svgtransformlist defines a list of svgtransform objects. an svgtransformlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
..., which means that attempts to modify the object will result in an exception being thrown. ...
...hrown. ...
...And 8 more matches
ARIA: tab role - Accessibility
s required above for accessible tabs with content. example this example combines the role tab with tablist and elements with tabpanel to create an interactive group of tabbed content. here we are enclosing our group of content in a div, with our tablist having an aria-label to label it for assistive technology. each tab is a button with the attributes previously mentioned. ...
...nts with tabpanel to create an interactive group of tabbed content. here we are enclosing our group of content in a div, with our tablist having an aria-label to label it for assistive technology. each tab is a button with the attributes previously mentioned. the first tab has tab
index=0 on it, which we will later change to whatever tab has aria-selected=true. all of the tabpanel elements have tab
index=0 to make them tabbable, and all but the currently active one have the hidden attribute, which we will change with javascript. there is some basic styling applied that restyles the buttons and changes the z-
index to of tab elements to give the illusion of it connecting to the tabpanel for active elements, and the illusion that inactive elements are behind the active tabpanel. <div class="tabs"> ...
...ere is some basic styling applied that restyles the buttons and changes the z-
index to of tab elements to give the illusion of it connecting to the tabpanel for active elements, and the illusion that inactive elements are behind the active tabpanel. ...
...And 8 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
: border-box; box-sizing: border-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("images/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-
index: 1; } .ui-color-picker .preview-color { width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); position: absolute; z-
index: 1; } .ui-color-picker .switch_mode { width: 10px; height: 20px; position: relative; border-radius: 5px 0 0 5px; border: 1px solid #ddd; background-color: #eee; left: -12px; top: -1px; z-
index: 1; transition: all 0.5s; } .ui-color-picker .switch_...
...8b20; } /* dropdown select button */ .ui-dropdown-select { padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 1px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-
index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='rig...
...container { width: 1000px; height: 100%; display: table; margin: 0 auto; } #gradient-container { width: 450px; height: 250px; min-width: 8px; min-height: 8px; margin: 100px auto; border: 1px solid #ddd; position: relative; } #gradient-container[data-alpha="true"]:after { content: ""; width: 100%; height: 100%; background: url('images/canvas-pattern.png'); position: absolute; z-
index: -1; } /** * gradient axis */ .gradient-axis { width: 125%; height: 4px; margin: -3px 0 0 0; border: 1px solid #ccc; position: absolute; top: 50%; left: 0; opacity: 0.5; } .gradient-axis[data-active='true'] { opacity: 1; z-
index: 1; } .gradient-axis:after { content: ""; width: 25px; height: 100%; background-color: #ccc; position: absolute; left: 0; top: 0; } .gradient-axi...
...And 8 more matches
Routing in Ember - Learn web development
ed to reorganize it a bit to handle a different view for the "active" and "completed" todos. an ember application has a default "application" route, which is tied to the app/templates/application.hbs template. because that application template is the entry point to our todo app, we'll need to make some changes to allow for routing. creating the routes let's start by creating three new routes: "
index", "active" and "completed". to do this you’ll need to enter the following commands into your terminal, inside the root directory of your app: ember generate route
index ember generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js. it contains the following contents: import e...
...ckly see how the entire app is structured. it also tells ember how to interact with your route, such as when loading arbitrary data, handling errors while loading that data, or interpreting dynamic segments of the url. since our data is static, we won't get to any of those fancy features, but we'll still make sure that the route provides the minimally required data to view a page. creating the "
index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "
index" is a special word that indicates the default route to render, load, etc. to adjust our old way of rendering the todolist app, we'll first need to replace the todolist component invocation from the application template with an {{outlet}} call, which means "any sub-route...
...d that indicates the default route to render, load, etc. to adjust our old way of rendering the todolist app, we'll first need to replace the todolist component invocation from the application template with an {{outlet}} call, which means "any sub-route will be rendered in place here". go to the todomvc/app/templates/application.hbs file and replace <todolist /> with {{outlet}} next, in our
index.hbs, completed.hbs, and active.hbs templates (also found in the templates directory) we can for now just enter the todolist component invocation. in each case, replace {{outlet}} with <todolist /> so at this point, if you try the app again and visit any of the three routes localhost:4200 localhost:4200/active localhost:4200/completed you'll see exactly the same thing. at each url, the te...
...And 7 more matches
Getting started with React - Learn web development
browser tab. your browser will display something like this: application structure create-react-app gives us everything we need to develop a react application. its initial file structure looks like this: moz-todo-react ├── readme.md ├── node_modules ├── package.json ├── package-lock.json ├── .gitignore ├── public │ ├── favicon.ico │ ├──
index.html │ └── manifest.json └── src ├── app.css ├── app.js ├── app.test.js ├──
index.css ├──
index.js ├── logo.svg └── serviceworker.js the src directory is where we'll spend most of our time, as it's where the source code for our application lives. the public directory contains files that will be read by your br...
...react injects your code into this file so that your browser can run it. there's some other markup that helps create-react-app function, so take care not to edit it unless you know what you're doing. you very much should change the text inside the <title> element in this file to reflect the title of your application. ...
...: function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> hello, world! </p> </header> </div> ); } export statements at the very bottom of the app.js file, the statement export default app makes our app component available to other modules. ...
...And 7 more matches
source-editor.jsm
back); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettop
index(); boolean hasfocus(); void settop
index(number atop
index); content management operations number getcharcount(); string getindentationstring(); string getlinedelimiter(); number getlinecount(); number getlineend(number aline
index, boolean aincludedelimiter); number getlinestart(number aline
index); string ge...
...you can then use this value to detect when the contents of the text are ...
...you can then use this value to detect when the contents of the text are different from your most recent save. in addition, when this value changes, the "dirtychanged" event is sent. ...
...And 7 more matches
Places Developer Guide
kmarked. var bookmarkuri = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice) .newuri("http://www.mozilla.com", null, null); var bookmarkid = bookmarks.insertbookmark( bookmarks.toolbarfolder, // the id of the folder the bookmark will be placed in. bookmarkuri, // the uri of the bookmark - an nsiuri object. ...
...uri of the bookmark - an nsiuri object. bookmarks.default_
index, // the position of the bookmark in its parent folder. "my bookmark title"); // the title of the bookmark. creating a folder var folderid = bookmarks.createfolder( bookmarks.toolbarfolder, // the id of the folder the new folder will be placed in. "my folder title", // the title of the new folder. bookmarks.default_
index); // the position of the new folder in its parent folder. creating a separator var separatorid = bookmarks.insertseparator( bookmarks.toolbarfolder, // the id of the folder the separator will be placed in. bookmarks.default_
index); // the position of the separator in its parent folder. creating a livemark var ioservice = cc["@mozilla.org/network/io-service;1"] .getserv...
...k-service;2"] .getservice(ci.nsilivemarkservice); livemarks.createlivemark(bookmarks.toolbarfolder, // the id of the folder the livemark will be placed in "my livemark title", // the title of the livemark siteuri, // the uri of the site. a nsiuri object. feeduri, // the uri of the actual feed. a nsiuri object. ...
...And 7 more matches
nsIAccessibleText
if set < 0 then caret will be placed a...
...if set < 0 then caret will be placed at the end of the t...
...if set < 0 then caret will be placed at the end of the text. charactercount long read only. defaulttextattributes nsipersistentproper...
...And 7 more matches
nsIDOMXULSelectControlElement
dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
... dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
...rfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
...And 7 more matches
nsINavHistoryResultViewer
detailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aold
index, in nsinavhistorycontainerresultnode anewparent, in unsigned long anew
index); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aold
index); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged...
...although this attribute is read-write, you should n...
...although this attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer. methods containerclosed() called...
...And 7 more matches
Add to iPhoto
tead of a typed pointer. that's not really the ideal way to do things but saved some time for this simple example. some of this may change as i refine the example in the future; i'll update the article if and when that happens. some global types there are a few global data types used by all of our frameworks. these are declared near the top of the code: const osstatus = ctypes.int32_t; const cf
index = ctypes.long; const optionbits = ctypes.uint32_t; osstatus used to represent the status code resulting from an operation. cf
index a core foundation long integer type used to represent
indexes into lists. i debated including this in the corefoundation object, and probably would have if i were being more formal, but opted against it for clarity's sake. optionbits a 32-bit bit field data t...
...the shutdown() method comes in: shutdown: function() { this.lib.close(); } select api declarations let's take a look at a few of the key apis we declare for core foundation, to see how it's done. cfrange cfrange is a structure that identifies a range; that is, it identifies an offset to an item in a list and a number of items. in c, the declaration looks like this: typedef struct { cf
index location; cf
index length; } cfrange; to declare this for use with js-ctypes, we use the following code: this.cfrange = new ctypes.structtype("cfrange", [ {'location': ctypes.int32_t}, {'length': ctypes.int32_t}]); this defines corefoundation.cfrange to represent this data type, comprised of two 32-bit integer fields called location and length. g...
...the interesting things to note about the declaration of corefoundation.cfurlcreatefromfilesystemrepresentation() are: it returns a cfurlref, which is an opaque pointer similar to the cfstringref we noted above. ...
...And 7 more matches
Using Fetch - Web APIs
sumes the text is utf-8, and doesn't handle fetch errors). ...
... await fetch(fileurl); const reader = response.body.getreader(); let { value: chunk, done: readerdone } = await reader.read(); chunk = chunk ? utf8decoder.decode(chunk) : ''; const re = /\n|\r|\r\n/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({ value: chunk, done: readerdone } = await reader.read()); chunk = remainder + (chunk ? ...
...decoder.decode(chunk) : ''; const re = /\n|\r|\r\n/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({ value: chunk, done: readerdone } = await reader.read()); chunk = remainder + (chunk ? ...
...And 7 more matches
ReadableStreamDefaultReader.read() - Web APIs
ding on line boundaries and converting from uint8array to strings. ...
...onse = await fetch(fileurl); let reader = response.body.getreader(); let {value: chunk, done: readerdone} = await reader.read(); chunk = chunk ? utf8decoder.decode(chunk) : ""; let re = /\r\n|\n|\r/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({value: chunk, done: readerdone} = await reader.read()); chunk = remainder + (chunk ? ...
...utf8decoder.decode(chunk) : ""; let re = /\r\n|\n|\r/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({value: chunk, done: readerdone} = await reader.read()); chunk = remainder + (chunk ? ...
...And 7 more matches
SVGPathSegList - Web APIs
svg path segment list interface this interface defines a list of svgpathseg objects. ...
...ist of svgpathseg objects. ...
... also implement none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long
index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long
index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long
index) svgpathseg removeitem(in unsigned long
index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properti...
...And 7 more matches
SVGPointList - Web APIs
pointlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ify the object will result in an exception being thrown. ...
...erview also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long
index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long
index) svgpoint replaceitem(in svgpoint newitem, in unsigned long
index) svgpoint removeitem(in unsigned long
index) svgpoint appenditem(in svgpoint newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties ...
...And 7 more matches
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
v0, v1, v2, v3 a floating point number for the vertex attribute value. ...
... v0, v1, v2, v3 a floating point number for the vertex attribute value. ...
... v0, v1, v2, v3 a floating point number for the vertex attribute value. ...
...And 7 more matches
Tree Selection - Archive of obsolete content
e items, the event handler is not called until the user stops. this results in a performance improvement. this also means that the highlight will appear on several items even though the select event is never fired for those items. the syntax of the onselect() event handler is shown below. <tree id="treeset" onselect="alert('you selected something!');"> tree indices the tree has a property current
index, which can be used to get the currently selected item, where the first row is 0. child items are included in the count just after their parents. this means that if there are 3 top-level items and each has two child items, there will be a total of 9 items. the first item (at
index 0) will be the first top-level item. the next item at
index 1 will be its first child. the second child will be at ind...
...multiple selection for trees that allow multiple selection, getting the list of selected rows is a bit more complicated. ...
...multiple selection for trees that allow multiple selection, getting the list of selected rows is a bit more complicated. the tree's view has a selection property which holds information about the selected rows. ...
...And 6 more matches
Tree View Details - Archive of obsolete content
st rows and higher values for inner rows. the tree will use this information to determine the hierarchical structure of the rows. in addition to the getlevel method, there is a hasnextsibling function which, given a row, should return true if there is another row afterwards at the same level. this function is used, specifically, to draw the nesting lines along the side of the tree. the getparent
index method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value. all of these methods must be implemented by the view for children to be handled properly. containers there are also three functions, iscontainer, iscontainerempty and iscontaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if ...
...ill be treated like a container. when the user clicks the twisty to open a row, the tree will call the view's toggleopenstate method. the view should then perform any necessary operations to retrieve the child rows and then update the tree with the new rows. ...
... tree with the new rows. note: as of this writing (gecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row
index which returns true for a call to iscontainer, regardless of whether the container is empty. review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, after
index) getparent
index(row) iscontainer(row) iscontainerempty(row) iscontaineropen(row) toggleopenstate(row) the after
index argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point. for instance, the caller might already know where the next sibling might possibly be. imagine a situation where a row had subrows and those subrows had child r...
...And 6 more matches
Setting up CDT to work on SpiderMonkey
rested in getting code hints, autocompletion, function, and field usage information and general ide goodness for c/c++. there is a guide for setting up cdt to work with the mozilla codebase, but it does not cover setting things up for just spidermonkey instead of the whole mozilla codebase. hence, here is a short-ish guide for doing just that. step 1 - preparing a spidermonkey build for cdt to
index all code, spidermonkey has to be built with debug information. the full process of and requisites for doing so are described here. please follow those instructions up until the point of invoking configure. the initial build was in clang, so the modified build commands look like this: mkdir _dbg.obj cd _dbg.obj cc='clang -qunused-arguments -fcolor-diagnostics' cxx='clang++ -qunused-arguments -fc...
...ate a workspace somewhere. select "new > makefile project with existing code" from the "file" menu. give the project a name that you like ("spidermonkey" has a nice ring to it) and use the "browser…" button to select your checkout's js/src folder for the "existing code location". choose the correct toolchain for your platform (i.e. macos x gcc on mac) and click "finish". ...
...ith existing code" from the "file" menu. give the project a name that you like ("spidermonkey" has a nice ring to it) and use the "browser…" button to select your checkout's js/src folder for the "existing code location". choose the correct toolchain for your platform (i.e. macos x gcc on mac) and click "finish". at this point, the
indexer starts running and already produces a pretty decent
index of much of spidermonkey. ...
...And 6 more matches
nsISessionStore
ls to be successful. starting in firefox 3.5, this preference is no longer used. ...
...o longer used. ...
...will always be false when in private browsing mode. methods deletetabvalue() deletes a value from a specified tab. void deletetabvalue( in nsidomnode atab, in astr...
...And 6 more matches
Element.classList - Web APIs
early compliant behavior for ie 6-9. check it out: // 1. ...
...implement the barebones domtokenlist livelyness polyfill if (typeof domtokenlist !== "function") (function(window){ var document = window.document, object = window.object, hasownprop ...
...reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, ws
index = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((ws
index=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v[ws
index]+"') contains html space characters, which are not valid in tokens."); } // 2. implement the barebones domtokenlist livelyness polyfill if (typeof domtokenlist !== "function") (function(window){ var document = window.document, object = window.object, hasownprop = object.prototype.hasownproperty; var defineproperty = object.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0...
...And 6 more matches
IDBDatabase - Web APIs
thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
...thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
... object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. the interface provides the only way to get and manage versions of the database. note: this feature is available in web workers. note: everything you do in
indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in
indexeddb — including object stores,
indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; p...
...And 6 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
rkers. syntax idbopendbrequest.onupgradeneeded = function(event) { ... }; example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // request version 3 of the database. var request = window.
indexeddb.open("library", 3); // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.
indexeddb.open line above. request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading da...
...r has been submitted via the // window.
indexeddb.open line above. request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading database.</li>'; }; if (event.oldversion < 1) { // version 1 is the first version of the database. var store = db.createobjectstore("books", {keypath: "isbn"}); var title
index = store.create
index("by_title", "title", {unique: true}); var author
index = store.create
index("by_author", "author"); } if (event.oldversion < 2) { // version 2 introduces a new
index of books by year. ...
...t version of the database. var store = db.createobjectstore("books", {keypath: "isbn"}); var title
index = store.create
index("by_title", "title", {unique: true}); var author
index = store.create
index("by_author", "author"); } if (event.oldversion < 2) { // version 2 introduces a new
index of books by year. var bookstore = request.transaction.objectstore("books"); var year
index = bookstore.create
index("by_year", "year"); } if (event.oldversion < 3) { // version 3 introduces a new object store for magazines with two
indexes. ...
...And 6 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. ...
... size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. ...
... size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. ...
...And 6 more matches
ARIA: row role - Accessibility
nested within a grid, table or treegrid. a group of rows can be nested within a grid, table or treegrid directly, or within a rowgroup in one of those containers. each row contains child cells. these cells can be of different types, depending on whether they are column or row headers, or grid or regular cells. a row can contain a number of attributes clarifying the row's role, including aria-col
index, aria-level, aria-row
index, and aria-selected. if the row is within a treegrid, rows can include the aria-expanded attribute, using the attribute to indicate the present status. this is not the case for an ordinary table or grid, in which the aria-expanded attribute is not present. to create an interactive widget that has a tabular structure, use the grid pattern instead. if the interaction pro...
...elevant if the row is in an interactive container, such as a grid or treegrid, but not relevant if the row is in a table. the aria-selected attribute can take one of three values, or be omitted: aria-selected="true: row is currently selected aria-selected="false": row is not currently selected. aria-selected="undefined" or the attribute is missing: the row is not selectable. aria-col
index attribute the aria-col
index attribute is only needed if columns are hidden from the dom. it is generally placed on row children, rather than on the row itself. if the columns displayed are contiguous, then it can be placed on the row. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. when placed on the row, the aria-c...
...ttribute the aria-col
index attribute is only needed if columns are hidden from the dom. it is generally placed on row children, rather than on the row itself. if the columns displayed are contiguous, then it can be placed on the row. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. when placed on the row, the aria-col
index defines an element's column
index or position with respect to the total number of columns within a row. for example, in a table with 15 columns, and columns 4, 5, and 6 are in the dom, aria-col
index="4" could be set on every row. ...
...And 6 more matches
Border-image generator - CSS: Cascading Style Sheets
own select button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-
index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='rig...
...l:focus { box-shadow: 0px 0px 3px -1px #379b4a; /*#68ace8; */ border-color: rgba(55, 155, 74, 0.5); width: 450px; } /* * visible area */ #preview_section { position: relative; min-height: 400px; } /* image control */ #subject { width: 300px; height: 300px; background-repeat: no-repeat; background-size: 100%; background-color: #fff; border: 1px solid #ccc; position: absolute; z-
index: 10; top: 15%; left: 10%; box-shadow: 0 0 3px 0 #bababa; transition-property: width, height; transition-duration: 0.1s; } #subject .guideline { background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.3); position: absolute; } #subject .guideline:hover { background-color: #f00; } #subject .guideline[data-active] { background-color: #f00; z-
index: 10; } #subjec...
...fo='top'] { top: -10px; left: -50px; } #subject .tooltip2[data-info='right'] { top: -30px; right: -20px; } #subject .tooltip2[data-info='bottom'] { top: -10px; right: -50px; } #subject .tooltip2[data-info='left'] { bottom: -30px; right: -20px; } /* preview */ #preview { width: 30%; height: 50%; background-color: #fff; text-align: center; overflow: hidden; position: absolute; z-
index: 10; left: 60%; top: 15%; border-radius: 2px; border-image-width: 20px; border-image-repeat: round; border-style: solid; box-shadow: 0 0 3px 0 #bababa; } #preview .resize-handle { width: 10px; height: 10px; background: url("https://mdn.mozillademos.org/files/6027/resize.png") center center no-repeat; position: absolute; bottom: 0; right: 0; } #preview .resize-handle:hover { c...
...And 6 more matches
Stacking context example 1 - CSS: Cascading Style Sheets
« css « understanding css z-
index stacking context example 1 let's start with a basic example. in the root stacking context we have two divs (div #1 and div #3), both relatively positioned, but without z-
index properties. inside div #1 there is an absolutely positioned div #2, while in div #3 there is an absolutely positioned div #4, both without z-
index properties. the only stacking context is the root context. without z-
indexes, elements are stacked in order of occurrence. if div #2 is assigned a positive (non-zero and non-auto) z-
index value, it is rendered above all the other divs. then if div #4 is also assigned a positive z-
index greater than div #2's z-
index, it is rendered above all the other divs including div #2. in this last example you can see that div #2 and div #4 a...
...this means that all their content, including div #2 and div #4, belongs to the same root stacking context. ...
...e z-
index greater than div #2's z-
index, it is rendered above all the other divs including div #2. in this last example you can see that div #2 and div #4 are not siblings, because they belong to different parents in the html elements' hierarchy. even so, stacking of div #4 with respect of div #2 can be controlled through z-
index. it happens that, since div #1 and div #3 are not assigned any z-
index value, they do not create a stacking context. this means that all their content, including div #2 and div #4, belongs to the same root stacking context. ...
...And 6 more matches
Array.prototype.filter() - JavaScript
the filter() method creates a new array with all elements that pass the test implemented by the provided function. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let newarray = arr.filter(callback(element[,
index, [array]])[, thisarg]) parameters callback function is a predicate, to test each element of the array. return true to keep the element, false otherwise. it accepts three arguments: element the current element being processed in the array.
indexoptional the
index of the current element being processed in the array. arrayoptional the array filter was called upon. thisargo...
... value to use as this when executing callback. return value a new array with the elements that pass the test. if no elements pass the test, an empty array will be returned. description filter() calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a value that coerces to true. ...
...ray with the elements that pass the test. if no elements pass the test, an empty array will be returned. description filter() calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a value that coerces to true. callback is invoked only for
indexes of the array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values. ...
...And 6 more matches
BigInt64Array - JavaScript
constructor bigint64array() creates a new bigint64array object. ...
....prototype.length returns the number of elements hold in the bigint64array. this is fixed at construction time and thus read only. instance methods bigint64array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). bigint64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). bigint64array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). bigint64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). bigint64array.prototype.filter() creates a n...
...ay.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). bigint64array.prototype.find() returns the found value in the array if an element in the array satisfies the provided testing function, or undefined if not found. see also array.prototype.find(). bigint64array.prototype.find
index() returns the found
index in the array if an element in the array satisfies the provided testing function, or -1 if not found. see also array.prototype.find
index(). bigint64array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). bigint64array.prototype.includes() determines whether a typed array includes a certain element, returning true ...
...And 6 more matches
BigUint64Array - JavaScript
constructor biguint64array() creates a new biguint64array object. ...
...ototype.length returns the number of elements hold in the biguint64array. this is fixed at construction time and thus read only. instance methods biguint64array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). biguint64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). biguint64array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). biguint64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). biguint64array.prototype.filter() creates ...
....prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). biguint64array.prototype.find() returns the found value in the array if an element in the array satisfies the provided testing function, or undefined if not found. see also array.prototype.find(). biguint64array.prototype.find
index() returns the found
index in the array if an element in the array satisfies the provided testing function, or -1 if not found. see also array.prototype.find
index(). biguint64array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). biguint64array.prototype.includes() determines whether a typed array includes a certain element, returning tru...
...And 6 more matches
Float32Array - JavaScript
the float32array typed array represents an array of 32-bit floating point numbers (corresponding to the c float data type) in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation). constructor float32array() creates a new float32array object. static properties float32array.bytes_per_element returns a number value of the element size. 4 in the case of an float32array. float32array.name returns the string value of the constructor name. in the case of the float32array type: "float32array". static methods float32array.from() creates a new float32array from an ...
...loat32array.prototype.length returns the number of elements hold in the float32array. fixed at construction time and thus read only. instance methods float32array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). float32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). float32array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). float32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). float32array.prototype.filter() creates a new ...
...rray.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). float32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). float32array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). float32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). float32array.prototype.includes() determines whether a typed array includes a certain element, returning true or...
...And 6 more matches
Float64Array - JavaScript
the float64array typed array represents an array of 64-bit floating point numbers (corresponding to the c double data type) in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation). 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. in the case of the float64array type: "float64array". static methods float64array.from() creates a new float64array from an...
...loat64array.prototype.length returns the number of elements hold in the float64array. fixed at construction time and thus read only. instance methods float64array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). float64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). float64array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). float64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). float64array.prototype.filter() creates a new ...
...rray.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). float64array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). float64array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). float64array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). float64array.prototype.includes() determines whether a typed array includes a certain element, returning true or...
...And 6 more matches
Uint16Array - JavaScript
constructor uint16array() creates a new uint16array object. ...
.... uint16array.prototype.length returns the number of elements hold in the uint16array. fixed at construction time and thus read only. instance methods uint16array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). uint16array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). uint16array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). uint16array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). uint16array.prototype.filter() creates a new arr...
...6array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). uint16array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). uint16array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). uint16array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint16array.prototype.includes() determines whether a typed array includes a certain element, returning true or f...
...And 6 more matches
Uint32Array - JavaScript
constructor uint32array() creates a new uint32array object. ...
.... uint32array.prototype.length returns the number of elements hold in the uint32array. fixed at construction time and thus read only. instance methods uint32array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). uint32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). uint32array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). uint32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). uint32array.prototype.filter() creates a new arr...
...2array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). uint32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). uint32array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). uint32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint32array.prototype.includes() determines whether a typed array includes a certain element, returning true or f...
...And 6 more matches
Uint8ClampedArray - JavaScript
the uint8clampedarray typed array represents an array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation). constructor uint8clampedarray() creates a new uint8clampedarray object. static properties uint8clampedarray.bytes_per_element returns a number value of the element size. 1 in the case of an uint8clampedarray. uint8clampedarray.name returns the string value of the constructor name. in the case of the uint8clampedarray type: "uint8clampedarray"...
...totype.length returns the number of elements hold in the uintclamped8array. fixed at construction time and thus read only. instance methods uint8clampedarray.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). uint8clampedarray.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). uint8clampedarray.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). uint8clampedarray.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). uint8clampedarray.prototype.filter() ...
...type.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). uint8clampedarray.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). uint8clampedarray.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). uint8clampedarray.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint8clampedarray.prototype.includes() determines whether a typed array includes a certain element, returni...
...And 6 more matches
places/bookmarks - Archive of obsolete content
roup: group }) ]; // save `bookmarks` array -- notice we don't have `group` in the array, // although it needs to be saved since all bookmarks are children // of `group`. this will be saved implicitly. save(bookmarks).on("data", function (saved, input) { // a data event is called once for each item saved, as well // as implicit items, like `group` console.log(input === group || ~bookmarks.
indexof(input)); // true }).on("end", function (saves, inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves. only explicitly saved // items are returned in this array -- the `group` won't be // present here. console.log(saves[0].title); // "ran" console.log(saves[2].group.title); // "guitars" }); searching for bookmarks bookmarks can be q...
...s : object required options: name type title string the title for the bookmark. required. url string the url for the bookmark. required. optional options: name type group group the parent group that the bookmark lives under. defaults to the bookmarks.unsorted group.
index number the
index of the bookmark within its group. last item within the group by default. tags set a set of tags to be applied to the bookmark. group(options) creates an unsaved bookmark group instance. parameters options : object required options: name type title string the title for the group. required. ...
...ns) creates an unsaved bookmark group instance. parameters options : object required options: name type title string the title for the group. required. optional options: name type group group the parent group that the bookmark group lives under. defaults to the bookmarks.unsorted group.
index number the
index of the bookmark group within its parent group. last item within the group by default. separator(options) creates an unsaved bookmark separator instance. parameters options : object optional options: name type group group the parent group that the bookmark group lives under. defaults to the bookmarks.unsorted grou...
...And 5 more matches
radiogroup - Archive of obsolete content
dio buttons. only one radio button inside the group can be selected at a time. the radio buttons may either direct children of the radiogroup or descendants. place the radiogroup inside a groupbox if you would like a border or caption for the group. the radiogroup defaults to vertical orientation. more information is available in the xul tutorial. ...
...o buttons may either direct children of the radiogroup or descendants. place the radiogroup inside a groupbox if you would like a border or caption for the group. the radiogroup defaults to vertical orientation. more information is available in the xul tutorial. attributes disabled, focused, preference, tab
index, value properties accessibletype, disabled, focuseditem, itemcount, selected
index, selecteditem, tab
index, value methods appenditem, checkadjacentelement, get
indexofitem, getitemat
index, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not. if...
...ems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. ...
...And 5 more matches
Useful string methods - Learn web development
browsertype[browsertype.length-1]; the length of "mozilla" is 7, but because the count starts at 0, the character position is 6; using length-1 gets us the last character. finding a substring inside a string and extracting it sometimes you'll want to find if a smaller string is present inside a larger one (we generally say if a substring is present inside a string). ...
...ing a substring inside a string and extracting it sometimes you'll want to find if a smaller string is present inside a larger one (we generally say if a substring is present inside a string). this can be done using the
indexof() method, which takes a single parameter — the substring you want to search for. if the substring is found inside the main string, it returns a number representing the
index position of the substring — which character number of the main string the substring starts at. if the substring is not found inside the main string, it returns a value of -1. try this: browsertype.
indexof('zilla'); this gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 — so 3 characters in) inside "mozilla". such code could be used to filter strings. ...
...a'); this gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 — so 3 characters in) inside "mozilla". such code could be used to filter strings. for example, we may have a list of web addresses and only want to print out the ones that contain "mozilla". this can be done in another way, which is possibly even more effective. ...
...And 5 more matches
XPCOM array guide
the standard array classes are: nsiarray - a scriptable container for scriptable xpcom objects. ...
...g and removing members. nsimutablearray - a scriptable container for scriptable xpcom objects, which allows addition and removal of member objects. this interface actually derives from nsiarray. nstarray<t> - a c++ class which provides a typesafe container for objects or primitive types (pointers, integers, and so on). the objects must define a default constructor and a copy constructor. to use
indexof without providing a comparator, they must also define an operator==. for sorting without providing a comparator they must define an operator<. note that this class differs from the other array types by using unsigned indices. nscomarray<t> - a c++ class which provides a typesafe, reference-counted container for pointers to a single type of com object. nsautotarray<t, n> - a version of nstarra...
...ence counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const. for example: // handlelist cannot modify the array because of const void handlelist(const nstarray<t>&); in-place enumeration most of the arrays presented here provide callback-style means to enumerate members of an array. instead of incrementally accessing each element of the array by its
index, the arrays provide a way to pass in a callback function that will be called for each element in the array. for most concrete c++ classes like nstarray<t> and nscomarray<t>,
indexing should be faster than the callback-style enumeration, because accessing an
indexed member of such an array is usually very fast, while enumeration has slight function call overhead. in the case of scriptable arrays ...
...And 5 more matches
IAccessibleEditableText
] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattributes([in] long startoffset, [in] long endoffset, [in] bstr attributes ); methods copytext() copies the text range into the clipboard. the specified text between the two given indices is copied into the system clipboard. hresult copytext( [in] long startoffset, [in] long endoffset ); parameters startoffset start
index of the text to moved into the clipboard. the valid range is 0..length. endoffset end
index of the text to moved into the clipboard. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. cuttext() deletes a range of text and copies it to the clipboard. the text between the two given indices is deleted from the text represented by this object and copied to the clipboard...
...ext to moved into the clipboard. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. cuttext() deletes a range of text and copies it to the clipboard. the text between the two given indices is deleted from the text represented by this object and copied to the clipboard. hresult cuttext( [in] long startoffset, [in] long endoffset ); parameters startoffset start
index of the text to be deleted. the valid range is 0..length. endoffset end
index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. deletetext() deletes a range of text. the text between and including the two given indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset )...
...alid range is 0..length. endoffset end
index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. deletetext() deletes a range of text. the text between and including the two given indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset ); parameters startoffset start
index of the text to be deleted. the valid range is 0..length. endoffset end
index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. inserttext() inserts text at the specified position. the specified string is inserted at the given
index into the text represented by this object. hresult inserttext( [in] long offset, [in] bstr text ); para...
...And 5 more matches
IAccessibleHypertext
rits from: iaccessibletext last changed in gecko 1.9 (firefox 3) the iaccessiblehypertext interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents. a typical implementation is to implement this interface on the smallest text object such as a paragraph of text. method overview [propget] hresult hyperlink([in] long
index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlink
index([in] long char
index, [out] long hyperlink
index ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link. the returned iaccessiblehyperlink object encapsulates the hyperlink and provides several kinds of information describing it. [propget] hresult hyperlink( [in] ...
...t] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlink
index([in] long char
index, [out] long hyperlink
index ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link. the returned iaccessiblehyperlink object encapsulates the hyperlink and provides several kinds of information describing it. [propget] hresult hyperlink( [in] long
index, [out] iaccessiblehyperlink hyperlink ); parameters
index this 0 based
index specifies the hyperlink to return. hyperlink if the given
index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. if the
index is invalid then a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] va...
...nk hyperlink ); parameters
index this 0 based
index specifies the hyperlink to return. hyperlink if the given
index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. if the
index is invalid then a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. hyperlink
index() returns the
index of the hyperlink that is associated with this character
index. this is the case when a link spans the given character
index. [propget] hresult hyperlink
index( [in] long char
index, [out] long hyperlink
index ); parameters char
index a 0 based
index of the character for which to return the link
index. if iaccessibletext is used to represent the text containing the link, then...
...And 5 more matches
nsIControllers
nstance, as you normally need to alter the window or element's existing list of controllers. ...
...void appendcontroller( in nsicontroller controller ); parameter...
...void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to the list of controllers. exceptions thrown ns_error_out_of_memory getcontrollerat() returns the co...
...And 5 more matches
nsIMsgThread
the nsimsgfolder interface is used to interact with threads in thunderbird. ...
... the nsimsgfolder interface is used to interact with threads in thunderbird. ...
... with threads in thunderbird. ...
...And 5 more matches
nsIRadioInterfaceLayer
@mozilla.org/telephony/system-worker-manager;1. ...
...ce(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long call
index); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long call
index); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long call
index); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappa...
...void dial( in domstr...
...And 5 more matches
IDBTransaction - Web APIs
all reading and writing of data is done within transactions. you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g. is it readonly or readwrite), and you access an idbobjectstore to make a request. you can also use an idbtransaction object to abort transactions. note: this feature is available in web workers. ...
...", "key"); objectstore1.put("1", "key"); after the code is executed the object store should contain the value "2", since trans2 should run after trans1. transaction failures transactions can fail for a fixed number of reasons, all of which (except the user agent crash) will trigger an abort callback: abort due to bad requests, e.g. trying to add() the same key twice, or put() with the same
index key with a uniqueness constraint. this causes an error on the request, which can bubble up to an error on the transaction, which aborts the transaction. this can be prevented by using preventdefault() on the error event on the request. an explicit abort() call from script. an uncaught exception in the request's success/error handler. an i/o error (e.g. an actual failure to write to disk, or ot...
...hich aborts the transaction. this can be prevented by using preventdefault() on the error event on the request. an explicit abort() call from script. an uncaught exception in the request's success/error handler. an i/o error (e.g. an actual failure to write to disk, or other os/hardware failure). quota exceeded. a user agent crash. firefox durability guarantees note that as of firefox 40,
indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the comple...
...And 5 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
wner; } this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } } minidaemon.prototype.owner = null; minidaemon.prototype.task = null; minidaemon.prototype.rate = 100; minidaemon.prototype.length = infinity; /* these properties should be read-only */ minidaemon.prototype.session = -1; minidaemon.prototype.
index = 0; minidaemon.prototype.paused = true; minidaemon.prototype.backw = true; /* global methods */ minidaemon.forcecall = function (odmn) { odmn.
index += odmn.backw ? -1 : 1; if (odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false || odmn.isatend()) { odmn.pause(); return false; } return true; }; /* instances methods */ minidaemon.prototype.isatend = function () ...
...rototype.backw = true; /* global methods */ minidaemon.forcecall = function (odmn) { odmn.
index += odmn.backw ? -1 : 1; if (odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false || odmn.isatend()) { odmn.pause(); return false; } return true; }; /* instances methods */ minidaemon.prototype.isatend = function () { return this.backw ? ...
...true; /* global methods */ minidaemon.forcecall = function (odmn) { odmn.
index += odmn.backw ? -1 : 1; if (odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false || odmn.isatend()) { odmn.pause(); return false; } return true; }; /* instances methods */ minidaemon.prototype.isatend = function () { return this.backw ? ...
...And 5 more matches
Standard metadata names - HTML: Hypertext Markup Language
etadata names that have not been formally accepted yet; however, some of the names included there are already used quite commonly in practice — including the following: creator: the name of the creator of the document, such as an organization or institution. if there are more than one, several <meta> elements should be used. googlebot, a synonym of robots, is only followed by googlebot (the
indexing crawler for google). publisher: the name of the document's publisher. robots: the behaviour that cooperative crawlers, or "robots", should use with the page. it is a comma-separated list of the values below: values for the content of <meta name="robots"> value description used by
index allows the robot to
index the page (default). ...
.... publisher: the name of the document's publisher. robots: the behaviour that cooperative crawlers, or "robots", should use with the page. it is a comma-separated list of the values below: values for the content of <meta name="robots"> value description used by
index allows the robot to
index the page (default). all no
index requests the robot to not
index the page. ...
... by
index allows the robot to
index the page (default). all no
index requests the robot to not
index the page. all follow allows the robot to follow the links on the page (default). all nofollow requests the robot to not follow the links on the page. all all equivalent to
index, follow google none equivalent to no
index, nofollow google noarchive requests the search engine not to cache the page content. google, yahoo, bing nosnippet prevents displaying any description of the page in search engine results. ...
...And 5 more matches
Array.prototype.reduceRight() - JavaScript
ray (from right-to-left) to reduce it to a single value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see also array.prototype.reduce() for left-to-right. ...
... arrayoptional the array reduceright() was called upon. initialvalueoptional value to use as accumulator to the first call of the callback. if no initial value is supplied, the last element in the array will be used and skipped. ...
... arrayoptional the array reduceright() was called upon. initialvalueoptional value to use as accumulator to the first call of the callback. if no initial value is supplied, the last element in the array will be used and skipped. ...
...And 5 more matches
Array.prototype.every() - JavaScript
every() method tests whether all elements in the array pass the test implemented by the provided function. it returns a boolean value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.every(callback(element[,
index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three arguments: element the current element being processed in the array.
index optional the
index of the current element being processed in the array. array optional the array every was called upon. thisarg optional a value to use as this when executing callback. return value true ...
...allback function once for each element present in the array until it finds the one where callback returns a falsy value. if such an element is found, the every method immediately returns false. otherwise, if callback returns a truthy value for all elements, every returns true. caution: calling this method on an empty array will return true for any condition! callback is invoked only for array
indexes which have assigned values. it is not invoked for
indexes which have been deleted, or which have never been assigned values. callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed. if a thisarg parameter is provided to every, it will be used as callback's this value. otherwise, the value undefined will be used as its ...
...value, k, o); else testresult = callbackfn(kvalue,k,o) // iii. if toboolean(testresult) is false, return false. if (!testresult) { return false; } } k++; } return true; }; } examples testing size of all array elements the following example tests whether all elements in the array are bigger than 10. function isbigenough(element,
index, array) { return element >= 10; } [12, 5, 8, 130, 44].every(isbigenough); // false [12, 54, 18, 130, 44].every(isbigenough); // true using arrow functions arrow functions provide a shorter syntax for the same test. [12, 5, 8, 130, 44].every(x => x >= 10); // false [12, 54, 18, 130, 44].every(x => x >= 10); // true​ affecting initial array (modifying, appending, and deleting) the fol...
...And 5 more matches
Array.prototype.find() - JavaScript
the find() method returns the value of the first element in the provided array that satisfies the provided testing function. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if you need the
index of the found element in the array, use find
index(). if you need to find the
index of a value, use array.prototype.
indexof(). (it’s similar to find
index(), but checks each element for equality with the value instead of using a testing function.) if you need to find if a value exists in an array, use array.prototype.includes(). again, it checks each element for equality with the value instead of using a testing function. ...
...ach element for equality with the value instead of using a testing function.) if you need to find if a value exists in an array, use array.prototype.includes(). again, it checks each element for equality with the value instead of using a testing function. if you need to find if any element satisfies the provided testing function, use array.prototype.some(). syntax arr.find(callback(element[,
index[, array]])[, thisarg]) parameters callback function to execute on each value in the array, taking 3 arguments: element the current element in the array.
index optional the
index (position) of the current element in the array. array optional the array that find was called on. thisarg optional object to use as this inside callback. return value the value of the first ele...
...this means it may be less efficient for sparse arrays, compared to methods that only visit assigned values. ...
...And 5 more matches
Array.prototype.includes() - JavaScript
he includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate. 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. ...
...his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.includes(valuetofind[, from
index]) parameters valuetofind the value to search for. note: when comparing strings and characters, includes() is case-sensitive. from
index optional the position in this array at which to begin searching for valuetofind. the first element to be searched is found at from
index for positive values of from
index, or at arr.length + from
index for negative values of from
index (using the absolute value of from
index as the number of elements from the end of the array at which to start the search). defaults to 0. return value a boolean w...
... values of zero are all considered to be equal, regardless of sign. (that is, -0 is considered to be equal to both 0 and +0), but false is not considered to be the same as 0. note: technically speaking, includes() uses the samevaluezero algorithm to determine whether the given element is found. ...
...And 5 more matches
Array.prototype.map() - JavaScript
ew array populated with the results of calling a provided function on every element in the calling array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... arrayoptional the array map was called upon. thisargoptional value to use as this when executing callback. return value a new array with each element being the result of the callback function. ...
... arrayoptional the array map was called upon. thisargoptional value to use as this when executing callback. return value a new array with each element being the result of the callback function. ...
...And 5 more matches
Array.prototype.splice() - JavaScript
existing elements and/or adding new elements in place. 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. ...
... deletecount optional an integer indicating the number of elements in the array to remove from start. ...
...than the length of the array, start will be set to the length of the array. in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. if negative, it will begin that many elements from the end of the array. (in this case, the origin -1, meaning -n is the
index of the nth last element, and is therefore equivalent to the
index of array.length - n.) if array.length + start is less than 0, it will begin from
index 0. deletecount optional an integer indicating the number of elements in the array to remove from start. if deletecount is omitted, or if its value is equal to or larger than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all...
...And 5 more matches
RegExp.prototype.sticky - JavaScript
sticky is a read-only property of an individual regular expression object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ub.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.sticky writable no enumerable no configurable yes description the value of sticky is a boolean and true if the "y" flag was used; otherwise, false. ...
...ples and send us a pull request. property attributes of regexp.prototype.sticky writable no enumerable no configurable yes description the value of sticky is a boolean and true if the "y" flag was used; otherwise, false. ...
...And 5 more matches
String.prototype.charAt() - JavaScript
object's charat() method returns a new string consisting of the single utf-16 code unit located at the specified offset into the string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let character = str.charat(
index) parameters
index an integer between 0 and str.length - 1. if the
index cannot be converted to the integer or no
index is provided, the default is 0, so the first character of str is returned. return value a string representing the character (exactly one utf-16 code unit) at the specified
index. if
index is out of range, charat() returns an empty string. description characters in a stri...
...meters
index an integer between 0 and str.length - 1. if the
index cannot be converted to the integer or no
index is provided, the default is 0, so the first character of str is returned. return value a string representing the character (exactly one utf-16 code unit) at the specified
index. if
index is out of range, charat() returns an empty string. description characters in a string are
indexed from left to right. the
index of the first character is 0, and the
index of the last character—in a string called stringname—is stringname.length - 1. if the
index you supply is out of this range, javascript returns an empty string. if no
index is provided to charat(), the default is 0. examples displaying characters at different locations in a string the following example displays char...
...—is stringname.length - 1. if the
index you supply is out of this range, javascript returns an empty string. if no
index is provided to charat(), the default is 0. ...
...And 5 more matches
String.prototype.slice() - JavaScript
the slice() method extracts a section of a string and returns it as a new string, without modifying the original string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the slice() method extracts a section of a string and returns it as a new string, without modifying the original string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... method extracts a section of a string and returns it as a new string, without modifying the original string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.slice(begin
index[, end
index]) parameters begin
index the zero-based
index at which to begin extraction. if negative, it is treated as str.length + begin
index. (for example, if begin
index is -3 it is treated as str.length - 3.) if begin
index is greater than or equal to str.length, slice() returns an empty string. end
index optional the zero-based
index before which to end extraction. the character at this
index will not be included. if e...
...And 5 more matches
TypedArray - JavaScript
nly. typedarray.prototype.length returns the number of elements held in the typed array. fixed at construction time and thus read only. instance methods typedarray.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). typedarray.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). typedarray.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). typedarray.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). typedarray.prototype.filter() creates a new array ...
...edarray.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). typedarray.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function, or undefined if not found. see also array.prototype.find(). typedarray.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). typedarray.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). typedarray.prototype.includes() determines whether a typed array includes a certain element, returning true or fal...
... the provided testing function or -1 if not found. see also array.prototype.find
index(). typedarray.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). typedarray.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). typedarray.prototype.
indexof() returns the first (least)
index of an element within the array equal to the specified value, or -1 if none is found. see also array.prototype.
indexof(). typedarray.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). typedarray.prototype.keys() returns a new array iterator that contains the keys for each
index in the array. see also array.protot...
...And 5 more matches
Creating Event Targets - Archive of obsolete content
s places api. it will emit events when the user adds and visits bookmarks, enabling users of the module to listen for these events using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm init, accepting all the defaults. ...
...pm init, accepting all the defaults. ...
... and add the following code: var { emit, on, once, off } = require("sdk/event/core"); var {cc, ci} = require("chrome"); var { xpcomutils }= require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, a
index) { emit(exports, "added", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: function(aitemid, avisitid, time) { emit(exports, "visited", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; bookmarkservice.addobserver(bookmarkobserver, false); exports.on = on.bind(null, exports); exports.once = onc...
...And 4 more matches
Bookmarks - Archive of obsolete content
the documentation for the new api is available at places. the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to perform common bookm...
... .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method. for example, to create a new folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_
index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it. specifying default_
index as the
index at which to insert the new folder places it at the end of the list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a ...
...w bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var newbkmkid = bmsvc.insertbookmark(newfolderid, uri, bmsvc.default_
index, ""); this example instantiates the nsiioservice and uses it to create an nsiuri referring to the google web site, then calls nsinavbookmarksservice.insertbookmark() to create a new bookmark to google, placing it at the end of the bookmarks folder referenced by newbkmkid. finding bookmark items if you know the uri of a site and wish to find all bookmarks that link to it, you can use the nsina...
...And 4 more matches
arrowscrollbox - Archive of obsolete content
provides scroll arrows along its edges for scrolling through the contents of the box. the user only needs to hover the mouse over the arrows to scroll the box. this element is typically used for large popup menus. hovering the mouse over one of the (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...x. the user only needs to hover the mouse over the arrows to scroll the box. this element is typically used for large popup menus. hovering the mouse over one of the (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...arrows to scroll the box. this element is typically used for large popup menus. hovering the mouse over one of the (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...And 4 more matches
menu - Archive of obsolete content
s | methods | related ] an element, much like a button, that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
...d. this element is also used to create submenus. more information is available in the xul tutorial. ...
...bmenus. more information is available in the xul tutorial. ...
...And 4 more matches
tabbrowser - Archive of obsolete content
ack, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowserat
index, getbrowser
indexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, goto
index, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, rem...
...serfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, goto
index, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, removetab, removetabsprogresslistener,replacegroup, selecttabat
index, seticon, showonlythesetabs, stop, unpintab attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields. autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll type: boolean set to false to disable autoscroll for this browser. if this attribute is set to true or om...
...for details. appendgroup( group ) return type: no return value not in firefox add several new tabs to the end of the existing tabs. the argument should be an array of objects, one for each document to load. the objects may be defined in script and contain a uri property for the url of the page to load. a referreruri property may also be optionally used to set the referrer page. getbrowserat
index(
index ) return type: browser element returns a browser at the specified tab
index. getbrowser
indexfordocument( document ) return type: integer returns the
index of the browser for the specified document in the tabbrowser the method was invoked on. the returned
index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to track p...
...And 4 more matches
WAI-ARIA basics - Learn web development
a xmlhttprequest, or dom apis. enhancing keyboard accessibility: there are built-in html elements that have native keyboard accessibility; when other elements are used along with javascript to simulate similar interactions, keyboard accessibility and screenreader reporting suffers as a result. where this is unavoidable, wai-aria provides a means to allow other elements to receive focus (using tab
index). accessibility of non-semantic controls: when a series of nested <div>s along with css/javascript is used to create a complex ui-feature, or a native control is greatly enhanced/changed via javascript, accessibility can suffer — screenreader users will find it difficult to work out what the feature does if there are no semantics or other clues. in these situations, aria can help to provide wh...
...rks menu or treated like a notable landmark, beyond the actual input being called out as a search input (<input type="search">). in addition, some older browsers (most notably ie8) don't recognise the semantics of the html5 elements. let's improve it by the use of some aria features. first, we'll add some role attributes to our html structure. ...
... however, sometimes you will end up having to write code that either uses non-semantic elements as buttons (or other types of control), or uses focusable controls for not quite the right purpose. you might be trying to fix some bad code you've inherited, or you might be building some kind of complex widget that requires it. in terms of making non-focusable code focusable, wai-aria extends the tab
index attribute with some new values: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable. this is the most useful value of tab
index. tab
index="-1" — this allows not normally tabbable elements to receive focus programmatically, e.g. via javascript, or as the target of links. we discussed this in more detail and showed a typical impl...
...And 4 more matches
Practical positioning examples - Learn web development
and left of their <div> container — this part is absolutely key to this whole layout feature, as it makes the panels sit on top of one another. the rule also gives the panels the same set height as the container, and gives the content some padding, a text color, and a background-color. ...
... makes the panels sit on top of one another. the rule also gives the panels the same set height as the container, and gives the content some padding, a text color, and a background-color. the second rule we'll add here makes it so that a panel with a class of active-panel set on it will have a z-
index of 1 applied to it, which will make it sit above the other panels (positioned elements have a z-
index of 0 by default, which would put them below). ...
...
index of 1 applied to it, which will make it sit above the other panels (positioned elements have a z-
index of 0 by default, which would put them below). again, we'll add this class using javascript at the appropriate time. .info-box article { position: absolute; top: 0; left: 0; height: 352px; padding: 10px; color: white; background-color: #a60000; } .info-box .active-panel { z-
index: 1; } adding our javascript the final step to getting this feature working is to add some javascript. put the following block of code, exactly as written in between your opening and closing <script> tags (you'll find these below the html content): var tabs = document.queryselectorall('.info-box li a'); var panels = document.queryselectorall('.info-box article'); for(i = 0; i < tabs.length; i+...
...And 4 more matches
MathML Accessibility in Mozilla
__________ the square root of the quantity a b c end root __________ square root of a, end of root. see webkit's bug 146452 square root of a b c. root end. a b c square root a2 __________ the second root of a __________ square root of a, end of root square root of a. root end. ...
... of a b c. root end. a b c square root a2 __________ the second root of a __________ square root of a, end of root square root of a. root end. a base root
index root a3 __________ the third root of a __________ cube root of a, end of root cube root of a. root end. a base 3 root
index root a3+4 __________ the 3 plus 4 root of a __________ 3 + 4 root of a, end of root 3 plus 4 root of a. root end. a base 3+4 root
index root a34 __________ the 3 over 4 root of a __________ fraction start, 3 over 4, end of fraction root of a, end of root fraction start. 3 over...
... a __________ 3 + 4 root of a, end of root 3 plus 4 root of a. root end. a base 3+4 root
index root a34 __________ the 3 over 4 root of a __________ fraction start, 3 over 4, end of fraction root of a, end of root fraction start. 3 over 4. fraction end. root of a. root end. a base 3 numerator 4 denominator root-
index fraction ab __________ the the square root of b root of a __________ square root of b, end of root root of a, end of root square root of b. root end. root of a. root end. ...
...And 4 more matches
JS_DefineElement
creates a numeric property on a specified object. ...
... a numeric property on a specified object. ...
... unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject o...
...And 4 more matches
JS_SetElement
assign a value to a numeric property of an object. ...
... assign a value to a numeric property of an object. ...
... assign a value to a numeric property of an object. ...
...And 4 more matches
IAccessibleTableCell
l table. ...
... 66 introduced gecko 1.9.2 inherits from: iunknown last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview [propget] hresult columnextent([out] long ncolumnsspanned ); [propget] hresult columnheadercells([out, size_is(, ncolumnheadercells,)] iunknown cellaccessibles, [out] long ncolumnheadercells ); [propget] hresult column
index([out] long column
index ); [propget] hresult isselected([out] boolean isselected ); [propget] hresult rowcolumnextents([out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult rowextent([out] long nrowsspanned ); [propget] hresult rowheadercells([out, size_is(, nrowheadercells,)] iunknown cellaccessibles, [out] long nrowheadercells ); [pr...
...the result is greater than 1 if the specified cell spans multiple columns. [propget] hresult columnextent( [out] long ncolumnsspanned ); parameters ncolumnsspanned returns the 1 based column extent of the specified cell. return val...
...And 4 more matches
GetChildAt
exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ...
...exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ...
...exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ...
...And 4 more matches
nsIArray
for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. the convention is that the elements of the array should not be modified. ...
...for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. the convention is that the elements of the array should not be modified. ...
...for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. the convention is that the elements of the array should not be modified. ...
...And 4 more matches
nsIDialogParamBlock
embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog. ...
... embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog. ...
... embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog. ...
...And 4 more matches
nsISHistory
ust create a instance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
...nstance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
... in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
...And 4 more matches
WebIDL bindings
the webidl bindings are generated at build time based on two things: the actual webidl file and a configuration file that lists some metadata about how the webidl should be reflected into gecko-internal code. all webidl files should be placed in dom/webidl and added to the list in the moz.build file in that directory. note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. this is a signal that you need to get a review from a dom peer. ...
... the interface is left up to the developer. with that in mind, the generated iterable bindings expect the wrapper object to provide certain methods for the interface to access. iterable interfaces have different requirements, based on if they are single or pair value iterators. example interface for a single value iterator: interface longiterable { iterable<long>; getter long(unsigned long
index); readonly attribute unsigned long length; }; for single value iterator interfaces, we treat the interface as an
indexed getter, as required by the spec. see the
indexed getter implementation section for more information on building this kind of structure. example interface for a pair value iterator: interface stringandlongiterable { iterable<domstring, long>; }; the bindings for this pai...
... of structure. example interface for a pair value iterator: interface stringandlongiterable { iterable<domstring, long>; }; the bindings for this pair value iterator interface require the following methods be implemented in the c++ object: class stringandlongiterable { public: // returns the number of items in the iterable storage size_t getiterablelength(); // returns key of pair at a
index in iterable storage nsastring& getkeyat
index(uint32_t a
index); // returns value of pair at a
index in iterable storage uint32_t& getvalueat
index(uint32_t a
index); } stringifiers named stringifiers operations in webidl will just invoke the corresponding c++ method. anonymous stringifiers in webidl will invoke the c++ method called stringify. so, for example, given this idl: interface fir...
...And 4 more matches
Working with ArrayBuffers
so, for the size of 640,000 it takes about 98ms. ...
...size of 640,000 it takes about 98ms. ...
... about 98ms. ...
...And 4 more matches
Checking when a deadline is due - Web APIs
in this article we look at a complex example involving checking the current time and date against a deadline stored via
indexeddb. the main complication here is checking the stored deadline info (month, hour, day, etc.) against the current time and date taken from a date object. the main example application we will be referring to in this article is to-do list notifications, a simple to-do list application that stores task titles and deadline times and dates via
indexeddb, and then provides users with notifications when deadline dates are reached, via the notification, and vibration apis. you can download the to-do list notifications app from github and play around with the source code, or view the app running live. the basic problem in the to-do app, we wanted to first record ti...
...o the database. the next few lines open the database transaction and provide messages to notify the user if this was successful or failed.then an objectstore is created into which the new item is added. the notified property of the data object indicates that the to-do list item's deadline has not yet come up and been notified - more on this later! note: the db variable stores a reference to the
indexeddb database instance; we can then use various properties of this variable to manipulate the data. request.onsuccess = function(event) { note.innerhtml += '<li>new item added to database.</li>'; title.value = ''; hours.value = null; minutes.value = null; day.value = 01; month.value = 'january'; year.value = 2020; }; } this next section cre...
...we then loop through all the items in the cursor for as long as there is a valid item left in the cursor. switch(cursor.value.month) { case "january": var monthnumber = 0; break; case "february": ...
...And 4 more matches
Using Service Workers - Web APIs
e; this is basically a special kind of worker context, running off the main script execution thread, with no dom access. the service worker is now ready to process events. installation of the worker is attempted when service worker-controlled pages are accessed subsequently. an install event is always the first one sent to a service worker (this can be used to start the process of populating an
indexeddb, and caching site assets). this is really the same kind of procedure as installing a native or firefox os app — making everything available for use offline. when the oninstall handler completes, the service worker is considered installed. next is activation. when the service worker is installed, it then receives an activate event. the primary use of onactivate is for cleanup of resources ...
...e browser’s standard cache, but it is specific to your domain. it persists until you tell it not to — again, you have full control. note: the cache api is not supported in every browser. ...
... a polyfill like the one available in google's topeka demo, or perhaps store your assets in
indexeddb. ...
...And 4 more matches
ARIA: gridcell role - Accessibility
able attribute: <td>potato</td> <td>cabbage</td> <td>onion</td> description gridcells with dynamically added, hidden, or removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, provided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or removed. ...
...tion gridcells with dynamically added, hidden, or removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, provided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or removed. use aria-col
index to describe a gridcell's order in the list of columns, and aria-row
index to describe a gridcell's order in the list of rows. ...
...a-col
index to describe a gridcell's order in the list of columns, and aria-row
index to describe a gridcell's order in the list of rows. use aria-colcount and aria-rowcount on the parent element with role="grid" applied to it to set the total number of columns or rows. this sample code demonstrates a table-style grouping of information where the third and fourth columns have been removed. ...
...And 4 more matches
Architecture - Accessibility
tation that's appropriate. if it has text siblings, then it gets exposed as the unicode char for an embedded object, which is '\xfffc' within the parent nshypertextaccessible. in addition, nsiaccessiblehyperlink is implemented on any non-text child inside a container that also has text. this allows at's to find its position within that text, because the hyperlink interface exposes a start and end
index. in fact, the end
index will always be 1 larger than the start
index, because the object is always represented by a single '\xfffc' character. if you want to know that something is really a link, check to see if it is role_link. html containers are implemented by nshypertextaccessible. they support the nsiaccessiblehypertext is implemented on any container element that has both text and embedde...
...t is used by nshypertextaccessible to collect information about itself it is still exposed in msaa for backward compatibility by old windows assistive technologies. those at's don't yet know about any iaccessibletext yet, and want to see the hierarchy how they always did -- with text in leaf nodes. ...
...ssible to collect information about itself it is still exposed in msaa for backward compatibility by old windows assistive technologies. those at's don't yet know about any iaccessibletext yet, and want to see the hierarchy how they always did -- with text in leaf nodes. how does an at deal with text (a) to get the embedded object for an embedded object char: link
index = iahypertext::getlink
index(offset) iahyperlink*object = iahypertext::getlink(link
index) iaccessible* accessible = qi/qs(object) (b) to get the offset in the parent text for a given embedded object: qi/qa to iahyperlink if not successful, then it is not embedded in text, so it's position in parent should be determined just by ia2::
indexinparent, which will return its child offset within the parent. examples of obj...
...And 4 more matches
Keyboard - Accessibility
mportant exception to this rule is if the element has role="document" applied to it, inside an interactive context (such as role="application"). in such a case, focusing the nested document is the only way of returning assistive technology to a non-interactive state (often called "browse mode"). ...
...ument" applied to it, inside an interactive context (such as role="application"). in such a case, focusing the nested document is the only way of returning assistive technology to a non-interactive state (often called "browse mode"). most interactive elements are focusable by default; you can make an element focusable by adding a tab
index=0 attribute value to it. however, you should only add tab
index if you have also made the element interactive, for example, by defining appropriate event handlers keyboard events. see also tab
index global html attribute global event handlers: onkeydown global event handlers: onkeyup avoid using tab
index attribute greater than zero the tab
index attribute indicates that an element is focusable using the keyboard. a value of zero indicates that the elem...
...dex attribute greater than zero the tab
index attribute indicates that an element is focusable using the keyboard. a value of zero indicates that the element is part of the default focus order, which is based on the ordering of elements in the html document. a positive value puts the element ahead of those in the default ordering; elements with positive values are focused in the order of their tab
index values (1, then 2, then 3, etc.). this creates confusion for keyboard-only users when the focus order differs from the logical order of the page. a better strategy is to structure the html document so that focusable elements are in a logical order, without the need to re-order them with positive tab
index values. ...
...And 4 more matches
Border-radius generator - CSS: Cascading Style Sheets
osition: relative; } #preview .content { width: 100%; height: 100%; display: block; } #preview input { color: #333; border: 1px solid #ccc; border-radius: 3px; } #subject { width: 400px; height: 150px; margin: 0 auto; border: 3px solid #c60; background: #fff; position: relative; } .radius { width: 50%; height: 50%; border: 1px solid #ccc; display: none; position: absolute; z-
index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .handle { width: 16px; height: 16px; position: absolute; z-
index: 2; } .handle-top-left { top: -12px; left: -12px; cursor: se-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top left no-repeat; } .handle-top-right { top: -12px; right: -12px; cursor: sw-r...
...ht { bottom: -12px; right: -12px; cursor: nw-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom right no-repeat; } .handle-bottom-left { bottom: -12px; left: -12px; cursor: ne-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom left no-repeat; } .radius-container { position: absolute; display : block; z-
index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* top left */ #top-left { top: 0; left: 0; } #top-left .radius { border-top-left-radius: 100%; top: 0; left: 0; } /* top right */ #top-right { top: 0; right: 0; } #top-right .radius { border-top-right-radius: 100%; top: 0; right: 0; } /* bottom right */ #bottom-right { bottom: 0; righ...
...adius: 100%; top: 0; right: 0; } /* bottom right */ #bottom-right { bottom: 0; right: 0; } #bottom-right .radius { border-bottom-right-radius: 100%; bottom: 0; right: 0; } /* bottom left */ #bottom-left { bottom: 0; left: 0; } #bottom-left .radius { border-bottom-left-radius: 100%; bottom: 0; } /* input sliders */ #preview .ui-input-slider { margin: 10px; position: absolute; z-
index: 10; } #radius-ui-sliders { width: 100%; height: 100%; min-height: 75px; min-width: 150px; padding: 20px 50px; top: -20px; left: -50px; position: relative; } #tlr { top: -30px; left: -50px; display: none; } #tlw { top: -30px; left: 30px; } #tlh { top: 20px; left: -50px; } #trr { top: -30px; right: -50px; display: none; } #trw { top: -30px; right: 30px; } #trh { top: 20...
...And 4 more matches
Stacking context example 3 - CSS: Cascading Style Sheets
let's take as an example a three-level hierarchical menu made from several positioned divs. second-level and third-level divs appear when hovering or clicking on their parents. usually this kind of menu is script-generated either client-side or server-side, so style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. the first-level menu is only relatively positioned, so no stacking context is created. ...
...server-side, so style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. the first-level menu is only relatively positioned, so no stacking context is created. the second-level menu is absolutely positioned inside the parent element. in order to put it above all first-level menus, a z-
index is used. the problem is that for each second-level menu, a stacking context is created and each third-level menu belongs to the context of its parent. so a third-level menu will be stacked under the following second-level menus, because all second-level menus share the same z-
index value and the default stacking rules apply. to better understand the situation, here is the stacking context hiera...
... context is created and each third-level menu belongs to the context of its parent. so a third-level menu will be stacked under the following second-level menus, because all second-level menus share the same z-
index value and the default stacking rules apply. to better understand the situation, here is the stacking context hierarchy: root stacking context level #1 level #2 (z-
index: 1) level #3 ... level #3 level #2 (z-
index: 1) ... level #2 (z-
index: 1) level #1 ... ...
...And 4 more matches
Event reference
th each event) as well as a link to the specification or specifications that define the event. event name event type specification fired when... abort uievent dom l3 the loading of a resource has been aborted. abort progressevent progress and xmlhttprequest progression has been terminated (not due to an error). abort event
indexeddb a transaction has been aborted. afterprint event html5 the associated document has started printing or the print preview has been closed. animationcancel animationevent css animations a css animation has aborted. animationend animationevent css animations a css animation has completed. animationiteration animationevent ...
... agent has started to capture audio for speech recognition. beforeprint event html5 the associated document is about to be printed or previewed for printing. beforeunload beforeunloadevent html5 the window, the document and its resources are about to be unloaded. beginevent timeevent svg a smil animation element begins. blocked
indexeddb an open connection to a database is blocking a versionchange transaction on the same database. blur focusevent dom l3 an element has lost focus (does not bubble). boundary speechsynthesisevent web speech api the spoken utterance reaches a word or sentence boundary canplay event html5 media the user agent can play the media, but esti...
...rgingchange event battery status the battery begins or stops charging. chargingtimechange event battery status the chargingtime attribute has been updated. click mouseevent dom l3 a pointing device button has been pressed and released on an element. close event websocket a websocket connection has been closed. complete
indexeddb a transaction successfully completed. complete offlineaudiocompletionevent web audio apithe definition of 'offlineaudiocompletionevent' in that specification. the rendering of an offlineaudiocontext is terminated. compositionend compositionevent dom l3 the composition of a passage of text has been completed or canceled. compositionstart com...
...And 4 more matches
Int16Array - JavaScript
constructor int16array() creates a new int16array object. ...
...only. int16array.prototype.length returns the number of elements hold in the int16array. fixed at construction time and thus read only. instance methods int16array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). int16array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). int16array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). int16array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). int16array.prototype.filter() creates a new array ...
...t16array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). int16array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). int16array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). int16array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int16array.prototype.includes() determines whether a typed array includes a certain element, returning true or fal...
...And 4 more matches
Int32Array - JavaScript
constructor int32array() creates a new int32array object. ...
...only. int32array.prototype.length returns the number of elements hold in the int32array. fixed at construction time and thus read only. instance methods int32array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). int32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). int32array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). int32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). int32array.prototype.filter() creates a new array ...
...t32array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). int32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). int32array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). int32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int32array.prototype.includes() determines whether a typed array includes a certain element, returning true or fal...
...And 4 more matches
Int8Array - JavaScript
constructor int8array() creates a new int8array object. static properties int8array.bytes_per_element returns a number value of the element size. 1 in the case of an int8array. int8array.name returns the string value of the constructor name. ...
...ead only. int8array.prototype.length returns the number of elements hold in the int8array. fixed at construction time and thus read only. instance methods int8array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). int8array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). int8array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). int8array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). int8array.prototype.filter() creates a new array wit...
... int8array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). int8array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). int8array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). int8array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int8array.prototype.includes() determines whether a typed array includes a certain element, returning true or false...
...And 4 more matches
RegExp.prototype.exec() - JavaScript
using this internally, exec() can be used to iterate over multiple matches in a string of text (with capture groups), as opposed to getting just the matching strings with string.prototype.match(). ...
...tive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexobj.exec(str) parameters str the string against which to match the regular expression. return value if the match succeeds, the exec() method returns an array (with extra properties
index and input; see below) and updates the last
index property of the regular expression object. the returned array has the matched text as the first item, and then one item for each parenthetical capture group of the matched text. if the match fails, the exec() method returns null, and sets last
index to 0. description consider the following example: // match "quick brown" followed by "jumps", igno...
...turns null, and sets last
index to 0. description consider the following example: // match "quick brown" followed by "jumps", ignoring characters in between // remember "brown" and "jumps" // ignore case let re = /quick\s(brown).+?(jumps)/ig; let result = re.exec('the quick brown fox jumps over the lazy dog'); the following table shows the results for this script: object property/
index description example result [0] the full string of characters matched "quick brown fox jumps" [1], ...[n] the parenthesized substring matches, if any. the number of possible parenthesized substrings is unlimited. result[1] === "brown" result[2] === "jumps"
index the 0-based
index of the match in the string. ...
...And 4 more matches
Uint8Array - JavaScript
constructor uint8array() creates a new uint8array object. static properties uint8array.bytes_per_element returns a number value of the element size. 1 in the case of an uint8array. uint8array.name returns the string value of the constructor name. in the case of the uint8array type: "uint8array". ...
...only. uint8array.prototype.length returns the number of elements held in the uint8array. fixed at construction time and thus read only. instance methods uint8array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). uint8array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array. see also array.prototype.entries(). uint8array.prototype.every() tests whether all elements in the array pass the test provided by a function. see also array.prototype.every(). uint8array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value. see also array.prototype.fill(). uint8array.prototype.filter() creates a new array ...
...nt8array.prototype.filter() creates a new array with all of the elements of this array for which the provided filtering function returns true. see also array.prototype.filter(). uint8array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. see also array.prototype.find(). uint8array.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found. see also array.prototype.find
index(). uint8array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint8array.prototype.includes() determines whether a typed array includes a certain element, returning true or fal...
...And 4 more matches
Modules - Archive of obsolete content
erfaces: ci } = components; var instance = cc["@mozilla.org/moz/jssubscript-loader;1"]; var loader = instance.getservice(ci.mozijssubscriptloader); function loadscript(url) { loader.loadsubscript(url); } when a script is loaded, it is evaluated in the scope of the global object of the script that loaded it. any property defined on the global object will be accessible from both scripts: //
index.js: loadscript("www.foo.com/a.js"); foo; // => 3 // a.js: foo = 3; exporting names the script loader we obtained from the components object allows us load scripts from other locations, but its api is rather limited. for instance, it does not know how to handle relative urls, which is cumbersome if you want to organize your project hierarchically. a more serious problem with the loadscript func...
...s from other locations, but its api is rather limited. for instance, it does not know how to handle relative urls, which is cumbersome if you want to organize your project hierarchically. a more serious problem with the loadscript function, however, is that it evaluates all scripts in the scope of the same global object. this becomes a problem when two scripts try to define the same property: //
index.js: loadscript("www.foo.com/a.js"); loadscript("www.foo.com/b.js"); foo; // => 5 // a.js: foo = 3; // b.js: foo = 5; in the above example, the value of foo depends on the order in which the subscripts are loaded: there is no way to access the property foo defined by "a.js", since it is overwritten by "b.js". to prevent scripts from interfering with each other, loadscript should evaluate each s...
...ading script. the script loader we obtained from components allows us to do just that: function loadscript(url) { let global = {}; loader.loadsubscript(url, global); return global; } if present, the loadsubscript function evaluates the script to be loaded in the scope of the second argument. ...
...And 3 more matches
Tabbox - Archive of obsolete content
owsers, its use is discouraged since it could be removed at any time. try to avoid using it. ...
...ouraged since it could be removed at any time. try to avoid using it. ...
...d be removed at any time. try to avoid using it. ...
...And 3 more matches
enumKeys - Archive of obsolete content
returns the name if it succeeded; null if the referenced value does not exist. description enumkeys can be used to iterate through the subkeys at a given key location. ...
... returns the name if it succeeded; null if the referenced value does not exist. description enumkeys can be used to iterate through the subkeys at a given key location. ...
... returns the name if it succeeded; null if the referenced value does not exist. description enumkeys can be used to iterate through the subkeys at a given key location. ...
...And 3 more matches
Building accessible custom components in XUL - Archive of obsolete content
and assign the appropriate role attributes, and firefox handles exposing the elements properly to the underlying assistive technology. further reading table of supported roles and states in firefox focus issues download stage-3.zip install stage-3.xpi the next step on the road to an accessible spreadsheet is the focus problem. in html documents, you can make any element focusable with the tab
index attribute. in xul, there is no tab
index attribute; to make a xul element focusable, you need to use a mozilla-specific css property, -moz-user-focus: normal. <code> grid.spreadsheet { border: thin solid; -moz-user-focus: normal; } </code> in html documents, firefox draws a focus rectangle around the currently focused element. in xul, we will need to handle this ourselves, again with css rules...
...null : arsiblings[row - 1]; } function f...
... function spreadsheet_right(current) { var next = find_cell_right(current); if (next) { next.focus(); } } function get_
index_within_parent(current) { var arsiblings = current.parentnode.childnodes; for (var i = 0; i < arsiblings.length; i++) { if (arsiblings[i] == current) { return i; } } return -1; } function find_cell_up(current) { var row = get_
index_within_parent(current); var arsiblings = current.parentnode.childnodes; return row == 0 ? ...
...And 3 more matches
textbox - Archive of obsolete content
displayed by default. the multiline attribute can be specified to display a field with multiple rows. more information is available in the xul tutorial. ...
... decimalplaces ty...
... type="text" spellcheck="false" /><br /> <textarea spellcheck="false"></textarea> <div contenteditable="true" spellcheck="false">i am some content</div> you can use spellcheck on input, textarea, and contenteditable elements. thespellcheck attribute works well paired with the autocomplete, autocapitalize, and autocorrect attributes too! added from david walsh's article on spell check. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions. the default is 50 milliseconds. for search textboxes, the nu...
...And 3 more matches
Positioning - Learn web development
und: aqua; border: 3px solid blue; padding: 10px; margin: 10px; } span { background: red; border: 1px solid black; } .positioned { position: absolute; background: yellow; top: 30px; left: 30px; } the positioned element now sits relative to the <body> element. note: you can see the example at this point live at 4_positioning-context.html (see source code). introducing z-
index all this absolute positioning is good fun, but there is another thing we haven't considered yet — when elements start to overlap, what determines which elements appear on top of which other elements? in the example we've seen so far, we only have one positioned element in the positioning context, and it appears on the top, since positioned elements win over non-positioned elements. what about ...
...nd positioned a bit above from where it originally was. it is also stacked below the original .positioned paragraph, where the two overlap. this is because the .positioned paragraph is the second paragraph in the source order, and positioned elements later in the source order win over positioned elements earlier in the source order. can you change the stacking order? yes, you can, by using the z-
index property. "z-
index" is a reference to the z-axis. you may recall from previous points in the course where we discussed web pages using horizontal (x-axis) and vertical (y-axis) coordinates to work out positioning for things like background images and drop shadow offsets. (0,0) is at the top left of the page (or element), and the x- and y-axes run across to the right and down the page (for left to...
...ut positioning for things like background images and drop shadow offsets. (0,0) is at the top left of the page (or element), and the x- and y-axes run across to the right and down the page (for left to right languages, anyway.) web pages also have a z-axis: an imaginary line that runs from the surface of your screen, towards your face (or whatever else you like to have in front of the screen). ...
...And 3 more matches
JS_GetReservedSlot
v js::value (in js_setreservedslot) the value to store. ...
... v js::value (in js_setreservedslot) the value to store. ...
... v js::value (in js_setreservedslot) the value to store. ...
...And 3 more matches
Secure Development Guidelines
unsigned int 0 - +4294967295 64 signed long long -9223372036854775808 - +9223372036854775807 unsigned long long 0 - +18446744073709551615 int vuln_funct(int size) { char buf[1024]; if (size > sizeof(buf) - 1) return -1; } signedness issues: don’t mix signed and unsigned integers use unsigned integers for sizes, offsets, and
indexes casting and truncation example: void vuln_funct() { u_int32_t size1 = 0xffffffff; u_int16_t size2 = size1; void *ptr = malloc(size2); if (!ptr) exit(exit_failure); memcpy(ptr, user_data, size1); } casting issues: sign extension example: int main() { int32_t new_size = 0; int8_t size = 0xff; new_size = size; printf("0x%08x\r\n", ne...
...a/b : 0; }...
...ar c[12]; strcpy(c, bar); } int main(int argc, char **argv) { foo(argv[1]); } bbv: stack overflow before the stack overflow bbv: stack overflow after the stack overflow bbv: heap overflow dynamic memory malloc() calloc() heapalloc() mmap() not on the stack segment! ...
...And 3 more matches
Manipulating bookmarks using Places
.getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method. for example, to create a new folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_
index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it. specifying default_
index as the
index at which to insert the new folder places it at the end of the list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a ...
...w bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var newbkmkid = bmsvc.insertbookmark(newfolderid, uri, bmsvc.default_
index, ""); this example instantiates the nsiioservice and uses it to create an nsiuri referring to the google web site, then calls nsinavbookmarksservice.insertbookmark() to create a new bookmark to google, placing it at the end of the bookmarks folder referenced by newbkmkid. finding bookmark items if you know the uri of a site and wish to find all bookmarks that link to it, you can use the nsina...
... bookmark for a site that's already bookmarked -- you can use the nsinavbookmarksservice.isbookmarked() method. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://mozilla.com/", null, null); if (!bmsvc.isbookmarked(uri)) { bmsvc.insertbookmark(bmsvc.toolbarfolder, uri, bmsvc.default_
index, "mozilla"); } this example looks to see if the user already has a bookmark for the mozilla web site, and, if not, creates one, adding it to the user's bookmarks toolbar. finding the folder containing an item if you need to know what folder contains an item (this can be especially handy after using nsinavbookmarksservice.getbookmarkidsforuri() to find bookmarks for a given uri), you can use t...
...And 3 more matches
IAccessible2
] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult
indexinparent([out] long
indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([out] bstr localizedextendedrole ); [propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstates), length_is(, nlocalizedextendedstates)] bstr localizedextendedstates, [out] long nlocalizedextendedstates )...
...propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstates), length_is(, nlocalizedextendedstates)] bstr localizedextendedstates, [out] long nlocalizedextendedstates ); [propget] hresult nextendedstates([out] long nextendedstates ); [propget] hresult nrelations([out] long nrelations ); [propget] hresult relation([in] long relation
index, [out] iaccessiblerelation relation ); [propget] hresult relations([in] long maxrelations, [out, size_is(maxrelations), length_is( nrelations)] iaccessiblerelation relations, [out] long nrelations ); hresult role([out] long role ); hresult scrollto([in] enum ia2scrolltype scrolltype ); hresult scrolltopoint([in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget...
...for collections of non-text objects. [propget] hresult groupposition( [out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); parameters grouplevel 1 based, 0 indicates that this value is not applicable. similaritemsingroup 1 based, 0 indicates that this value is not applicable. positioningroup 1 based, 0 indicates that this value is not applicable. ...
...And 3 more matches
GetRelation
refer to relations documentation for more info. ...
...refer to relations documentation for more info. ...
...refer to relations documentation for more info. ...
...And 3 more matches
nsIAccessibleSelectable
accessible/public/nsiaccessibleselectable.idlscriptable an interface for the accessibility module and in-process accessibility clients for dealing with getting and changing the selection of accessible nodes. inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long
index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long
index); nsiaccessible refselection(in long
index); void removechildfromselection(in long
index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected. read only. constants constant value description eselection_add 0 eselection_remove 1 eselection_getstate ...
...t long the number of accessible children currently selected. read only. constants constant value description eselection_add 0 eselection_remove 1 eselection_getstate 2 methods addchildtoselection() adds the specified accessible child of the object to the object's selection. if the specified object is already selected, then it does nothing. void addchildtoselection( in long
index ); parameters
index the zero-based accessible child
index. exceptions thrown ns_error_failure if the specified object is not selectable. clearselection() clears the selection in the object so that no children in the object are selected. void clearselection(); parameters none. getselectedchildren() returns an nsiarray of the selected nsiaccessible children. nsiarray getselectedchildren(); p...
...on() clears the selection in the object so that no children in the object are selected. void clearselection(); parameters none. getselectedchildren() returns an nsiarray of the selected nsiaccessible children. nsiarray getselectedchildren(); parameters none. return value an nsiarray. ischildselected() determines if the current child of this object is selected. boolean ischildselected( in long
index ); parameters
index the zero-based accessible child
index. return value true if the child is selected, false if not. refselection() returns a reference to the accessible object representing the specified selected child of the object. nsiaccessible refselection( in long
index ); parameters
index zero-based selected accessible child
index. return value the selected accessible child. removec...
...And 3 more matches
nsIAutoCompleteInput
toolkit/components/autocomplete/public/nsiautocompleteinput.idlscriptable this interface monitors the input in a text field and displays an autocomplete panel at the appropriate time. ...
...ocomplete panel at the appropriate time. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long
index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long start
index, in long end
index); attributes attribute type description completedefault
index boolean if a search result has its default
index set, this will optionally try to complete the text in the textbox to the entire text of the result at the default
index as the user types. this means that auto-fill is enabled. completeselecte...
... consumerollupevent boolean if true, the event that rolls up the popup should be consumed by the popup itself. if false, the rollup event will be dispatched. read only. ...
...And 3 more matches
nsICollection
represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32
index); void queryelementat(in pruint32
index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32
index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisupports item ) parameters item nsisupports item to be append...
...e collection. void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. ...
...umber of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the specified
index into the collection. ...
...And 3 more matches
nsIDOMWindowUtils
a dom utility interface that provides useful dom methods and attributes. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 49.0 (firefox 49.0 / thunderbird 49.0 / seamonkey 2.46) implemented by: window. ...
...sshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring
indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscrip...
...a possible type of a style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. methods activatenativemenuitemat() see nsiwidget.activatenativemenuitemat(). cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. void activatenativemenuitemat( in astring
indexstring ); parameters
indexstring clearmozafterpaintevents() void clearmozafterpaintevents(); parameters none. comparecanvases() compare the two canvases, returning the number of differing pixels and the maximum difference in a channel. this will throw an error if the dimensions of the two canvases are different. this method requires universalxpconnect privileges. pruint32 compare...
...And 3 more matches
nsILivemarkService
ace is obsolete. implemented by: @mozilla.org/browser/livemark-service;2. ...
...lasses["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); method overview long long createlivemark(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index); long long createlivemarkfolderonly(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index); nsiuri getfeeduri(in long long container); long long getlivemarkidforfeeduri(in nsiuri afeeduri); nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); void reloadlivemarkfolder(in long long folderid); void setfeeduri(in long long container, in nsiuri feeduri); void...
...long long folderid); void setfeeduri(in long long container, in nsiuri feeduri); void setsiteuri(in long long container, in nsiuri siteuri); void start(); void stopupdatelivemarks(); methods createlivemark() creates a new livemark. long long createlivemark( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index ); parameters folder the id of the parent folder. name the name to show when displaying the livemark. siteuri the uri of the site from which the livemark was created. feeduri the uri of the actual rss feed.
index the
index to insert at, or -1 to append to the end of the list. return value the id of the folder for the livemark. createlivemarkfolderonly() this method also creates...
...And 3 more matches
nsIMutableArray
array, then it is guaranteed that nsiarray.queryelementat() will never return a null value. any of these methods may throw ns_error_out_of_memory when the array must grow to complete the call, but the allocation fails. method overview void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long
index, in boolean weak); void removeelementat(in unsigned long
index); void replaceelementat(in nsisupports element, in unsigned long
index, in boolean weak); methods appendelement() append an element at the end of the array. void appendelement( in nsisupports element, in boolean weak ); parameters element the element to append. weak whether or not to stor...
... reference is requested, but the element does not support nsiweakreference. clear() clear the entire array, releasing all stored objects. void clear(); parameters none. insertelementat() insert an element at the given position, moving the element currently located in that position, and all elements in higher position, up by one. ...
... clear the entire array, releasing all stored objects. void clear(); parameters none. insertelementat() insert an element at the given position, moving the element currently located in that position, and all elements in higher position, up by one. void insertelementat( in nsisupports element, in unsigned long
index, in boolean weak ); parameters element the element to insert.
index the position in the array: if the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up. if the position is equal to the current length of the array, the new element is appended. an
index lower than 0 or higher than the current length of the array is invalid and will be ignored. weak whether or not to store the ele...
...And 3 more matches
DataTransferItemList.DataTransferItem() - Web APIs
the returned value is never null. example this example shows how to use drag and drop. ...
...the returned value is never null. example this example shows how to use drag and drop. ...
...the returned value is never null. example this example shows how to use drag and drop. ...
...And 3 more matches
HTMLSelectElement.item() - Web APIs
return value item is a htmloptionelement. ...
... return value item is a htmloptionelement. ...
... return value item is a htmloptionelement. ...
...And 3 more matches
IDBDatabase.createObjectStore() - Web APIs
the method takes the name of the store as well as a parameter object that lets you define important optional properties. you can use the property to uniquely identify individual objects in the store. as the property is an identifier, it should be unique to every object, and every object should have that property. this method can be called only within a versionchange transaction. note: this feature is available in web workers. ...
...eading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string. example // let us open our database var request = window.
indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.
indexeddb.open(). // this handler is only supported in recent browsers. request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { n...
... in recent browsers. ...
...And 3 more matches
IDBFactory.deleteDatabase() - Web APIs
od, with its result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. note: this feature is available in web workers. syntax for the current standard: var request =
indexeddb.deletedatabase(name); for the experimental version with options (see below): var request =
indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete. note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store d...
...delete. note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store does not exist. ...
... attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store does not exist. ...
...And 3 more matches
IDBLocaleAwareKeyRange - Web APIs
methods this interface inherits all the methods of its parent interface, idbkeyrange. properties this interface inherits all the properties of its parent interface, idbkeyrange. bear in mind however that idblocaleawarekeyrange has its own implementation of idbkeyrange.bound. ...
... methods this interface inherits all the methods of its parent interface, idbkeyrange. properties this interface inherits all the properties of its parent interface, idbkeyrange. bear in mind however that idblocaleawarekeyrange has its own implementation of idbkeyrange.bound. ...
...herits all the methods of its parent interface, idbkeyrange. properties this interface inherits all the properties of its parent interface, idbkeyrange. bear in mind however that idblocaleawarekeyrange has its own implementation of idbkeyrange.bound. this is because when you use bound(), it checks if lower bound < upper bound, and throws an exception if that’s not the case. with locale-aware
indexes, the meaning of < depends on the locale, so for example in lithuanian y is sorted between i and k. the only difference between idbkeyrange and idblocaleawarekeyrange is that the latter doesn’t do the aforementioned check. developers should always use idblocaleawarekeyrange when dealing with locale-aware
indexes. examples function displaydata() { var keyrangevalue = idblocaleawarekeyrange...
...And 3 more matches
IDBTransaction.oncomplete - Web APIs
previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. ...
...previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. ...
.... note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.
indexeddb.experimental pref is set to true in about:config. syntax transaction.oncomplete = function(event) { ... }; example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note t...
...And 3 more matches
Using Pointer Events - Web APIs
delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. ...
...terup event is sent. we handle this event by calling the handleend() function below. its job is to draw the last line segment for the touch that ended and remove the touch point from the ongoing touch list. ...
...t, without adding in the updated information. the result is that we stop tracking that touch point. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouch
indexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we're done } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment. convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear. selecting a color for each touch...
...And 3 more matches
TouchList.item() - Web APIs
example this code example illustrates the use of the touchlist interface's item method and the length property. ...
... example this code example illustrates the use of the touchlist interface's item method and the length property. ...
... example this code example illustrates the use of the touchlist interface's item method and the length property. ...
...And 3 more matches
Touch events - Web APIs
ate the cached touch information and to draw a line from the previous position to the current position of each touch. ...
... last line segment for each touch that ended and remove the touchpoint from the ongoing touch list. ...
...uchpoint. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the touchcancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { evt.preventdefault(); console.log("touchcancel."); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var idx = ongoingtouch
indexbyid(touches[i].identifier); ongoingtouches.splice(idx, 1); // remove it; we're done } } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment. convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear. selecting a color ...
...And 3 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
ny columns that will fit into a container” are included. alignment control grid contains alignment features so we can control how the items align once placed into a grid area, and how the entire grid is aligned. control of overlapping content more than one item can be placed into a grid cell or area and, they can partially overlap each other. this layering may then be controlled with the z-
index property. grid is a powerful specification that, when combined with other parts of css such as flexbox, can help you create layouts that were previously impossible to build in css. it all starts by creating a grid in your grid container. the grid container we create a grid container by declaring display: grid or display: inline-grid on an element. as soon as we do this, all direct children of ...
...tion, we would edit the above nested grid example to change the track definition of grid-template-columns: repeat(3, 1fr), to grid-template-columns: subgrid. the nested grid will then use the parent grid tracks to layout items. .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; display: grid; grid-template-columns: subgrid; } layering items with z-
index grid items can occupy the same cell. if we return to our example with items positioned by line number, we can change this to make two items overlap. <div class="wrapper"> <div class="box box1">one</div> <div class="box box2">two</div> <div class="box box3">three</div> <div class="box box4">four</div> <div class="box box5">five</div> </div> .wrapper { display: grid; grid-templat...
... { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .box { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } the item box2 is now overlapping box1, it displays on top as it comes later in the source order. ...
...And 3 more matches
Regular expressions - JavaScript
ation or null on a mismatch. test() tests for a match in a string. it returns true or false. match() returns an array containing all of the matches, including capturing groups, or null if no match is found. matchall() returns an iterator containing all of the matches, including capturing groups. search() tests for a match in a string. it returns the
index of the match, or -1 if the search fails. replace() executes a search for a match in a string, and replaces the matched substring with a replacement substring. replaceall() executes a search for all matches in a string, and replaces the matched substrings with a replacement substring. split() uses a regular expression or a fixed string to break a string into an ...
... (see different behaviors for further info about the different behaviors.) if you want to construct the regular expression from a string, yet another alternative is this script: var myre = new regexp('d(b+)d', 'g'); var myarray = myre.exec('cdbbdbsbz'); with these scripts, the match succeeds and returns the array and updates the properties shown in the following tab...
...he different behaviors.) if you want to construct the regular expression from a string, yet another alternative is this script: var myre = new regexp('d(b+)d', 'g'); var myarray = myre.exec('cdbbdbsbz'); with these scripts, the match succeeds and returns the array and updates the properties shown in the following table. results of regular expression execution. ...
...And 3 more matches
String - JavaScript
the string object is used to represent and manipulate a sequence of characters. description strings are useful for holding data that can be represented in text form. some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the
indexof() method, or extracting substrings with the substring() method. creating strings strings can be created as primitives, from string literals, or as objects, using the string() constructor: const string1 = "a string primitive"; const string2 = 'also a string primitive'; const string3 = `yet another string primitive`; const string4 = new string("a string object"); string primitives and string objects can be used interchan...
.... 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 array-like object, where individual characters correspond to a numerical
index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed. the properties involved are neither writable nor configurable. (see object.defineproperty() for more information.) comparing strings in c, the strcmp() function is used for comparing strings. in javascript, you just use the less-than a...
...turns a string created by using the specified sequence of unicode values. string.fromcodepoint(num1 [, ...[, numn) returns a string created by using the specified sequence of code points. string.raw() returns a string created from a raw template string. instance properties string.prototype.length reflects the length of the string. read-only. instance methods string.prototype.charat(
index) returns the character (exactly one utf-16 code unit) at the specified
index. string.prototype.charcodeat(
index) returns a number that is the utf-16 code unit value at the given
index. string.prototype.codepointat(pos) returns a nonnegative integer number that is the code point value of the utf-16 encoded code point starting at the specified pos. string.prototype.concat(str [, ...strn ]) c...
...And 3 more matches
WebAssembly.Table.prototype.set() - JavaScript
if value is not an exported webassembly function or null, a typeerror is thrown. ...
... if value is not an exported webassembly function or null, a typeerror is thrown. ...
... if value is not an exported webassembly function or null, a typeerror is thrown. ...
...And 3 more matches
Forms related code snippets - Archive of obsolete content
dchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.removechild(otable); return; } otable.style.z
index = nz
index++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroismonday...
...-1 : 1, othiscal = ainstances[this.id.replace(rbgnnan, "")]; othiscal.current[bismonth ? "setmonth" : "setyear"](othiscal.current[bismonth ? "getmonth" : "getfullyear"]() + ndelta); othiscal.writedays(); return false; } function ondayclick () { const oth...
...-1 : 1, othiscal = ainstances[this.id.replace(rbgnnan, "")]; othiscal.current[bismonth ? "setmonth" : "setyear"](othiscal.current[bismonth ? "getmonth" : "getfullyear"]() + ndelta); othiscal.writedays(); return false; } function ondayclick () { const othiscal = ai...
...And 2 more matches
Tabbed browser - Archive of obsolete content
.org/browser/sessionstore;1", "nsisessionstore"); // create new tab, but don't load the content. var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settabstate(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed,
index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is already open. following this practice minimizes the proliferation of tabs and browsers created by your extension. reusing by url/uri a common f...
...mediator); var browserenumerator = wm.getenumerator("navigator:browser"); // check each browser instance for our url var found = false; while (!found && browserenumerator.hasmoreelements()) { var browserwin = browserenumerator.getnext(); var tabbrowser = browserwin.gbrowser; // check each tab of this browser instance var numtabs = tabbrowser.browsers.length; for (var
index = 0;
index < numtabs;
index++) { var currentbrowser = tabbrowser.getbrowserat
index(
index); if (url == currentbrowser.currenturi.spec) { // the url is already opened. select this tab. tabbrowser.selectedtab = tabbrowser.tabcontainer.childnodes[
index]; // focus *this* browser-window browserwin.focus(); found = true; break; } }...
...rl/uri and focus/select it. if no such tab exists (perhaps the user closed it or we never opened it in the first place), we create a new tab with our custom attribute. function openandreuseonetabperattribute(attrname, url) { var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); for (var found = false,
index = 0, tabbrowser = wm.getenumerator('navigator:browser').getnext().gbrowser;
index < tabbrowser.tabcontainer.childnodes.length && !found;
index++) { // get the next tab var currenttab = tabbrowser.tabcontainer.childnodes[
index]; // does this tab contain our custom attribute? if (currenttab.hasattribute(attrname)) { // yes--select and focus it. tabbrowse...
...And 2 more matches
Tamarin build documentation - Archive of obsolete content
nal flags: --enable-debugger - debugger build --enable-debug - debug build for verbose build of tamarin, you can pass cppflags to make. $ make cppflags=-davmplus_verbose additional instructions for non-android cross-platform tamarin-redux build on osx 10.6 (snow leopard) (to build tamarin-central on mac please see previous cross-platform instructions here: https://developer.mozilla.org/
index.php?title=en/tamarin/tamarin_build_documentation&revision=21 the bug when building on snow leopard (bug 537817) has been fixed in the tamarin-redux repo. the work for that fix also included some changes to the configure.py default behavior to decouple the --target switch from sdk choice: there is a new switch, --mac-sdk, that selects the 10.4u, 10.5 or 10.6 sdk. its options are '104u', '105'...
...dk entirely from publicly available sources. this sdk/ndk *must* be used if you've cloned tamarin at changeset 5844:92ad3ca84a0b or later and will be using the cross-compile build method. steps to create a public sdk/ndk tree on a mac: - create an sdk/ndk top folder under your main volume named /android-public. - download the android 2.3.3 mac sdk zip file from http://developer.android.com/sdk/
index.html. unzip to your sdk/ndk top folder. make sure it's named 'android-sdk-mac_86'. - download the r5b mac ndk zip file from http://developer.android.com/sdk/ndk/
index.html. unzip to your sdk/ndk top folder. rename this folder to 'android-ndk'. - run the android sdk/avd manager at /android-public/android-sdk-mac_86/tools/android and add android sdk platform-tools (to get adb), sdk platform andro...
...ive open the 'c/c++ projects' view (window >> show view >> c/c++ projects) add view filter 'non-c elements' (in the top-right of the 'c/c++ projects' view, click the down-arrow, click 'filters...', check 'non-c elements') increase the threshold for 'editor scalability mode' to 20000 lines. as some tamarin source files have more than the eclipse standard threshold of 5000, they do not appear as
indexed. the threshold can be adjusted in eclipse preferences >> c/c++ >> editor >> scalability. *important* project-specific settings for the cdt
indexer do not appear to work (it looks like a bug in eclipse), so you have to set these manually/globally. what we want is to have the
indexer track the currently selected build config (so the correct conditional compiles are highlighted in the editor). t...
...And 2 more matches
Tree Widget Changes - Archive of obsolete content
there you can get specific columns, the current sort column, and position and size info about the columns. for the most part these objects are readonly; you can modify the columns by just adjusting the treecol attributes directly. the tree and view methods no longer take ids as arguments when columns are used. instead, they use nsitreecolumns. ...
...ition and size info about the columns. for the most part these objects are readonly; you can modify the columns by just adjusting the treecol attributes directly. the tree and view methods no longer take ids as arguments when columns are used. instead, they use nsitreecolumns. for example, nsitreeview.getcellvalue() takes a row
index and a nsitreecolumn as arguments, whereas before it took a row
index and a column id. ...
...the tree and view methods no longer take ids as arguments when columns are used. instead, they use nsitreecolumns. for example, nsitreeview.getcellvalue() takes a row
index and a nsitreecolumn as arguments, whereas before it took a row
index and a column id. ...
...And 2 more matches
wizard - Archive of obsolete content
a manner suitable for the user's selected theme and platform. in newer versions of mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages. more information is available in the xul tutorial. ...
...specify background color of the window's titlebar when it is inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. lastpage type: boolean true if the wizard is on the last page. use the cancancel property to indicate to the user (by disabling the cancel button) that they cannot can pagestep type: integer the
index of the current page. title type: string the text to appear in the title bar of the window. windowtype type: string set to a string which can be used to identify the type of window. this might be used, for example, to distinguish between a browser window and an editor window. some of mozilla's window handling functions use this attribute to group windows of the same type together. ...
...llow moving to the previous page. this has the effect of enabling or disabling the back button. currentpage type: wizardpage element this property returns the wizardpage element that is currently displayed. you can modify this value to change the current page. onfirstpage type: boolean this property is set to true if the user is on the first page, which may or may not be the first
index. onlastpage type: boolean this property is set to true if the user is on the last page of the wizard. pagecount type: integer this property holds the number of pages in the wizard. page
index type: integer this property returns the
index of the currently selected page. you can change the selected page by modifying this property. pagestep type: integer this property ...
...And 2 more matches
Implementation Status - Archive of obsolete content
the sections are marked with their current status: supported, partial support, in progress, and not currently supported. ...
... 292333; 3.4 extension module unsupported 300760; 3.5 mustunderstand module unsupported 300757; 4. processing model (events) section title status notes bugs 4 processing model (events) partial ...
... 7.6.2 is-card-number() unsupported 7.7.1 avg() supported 7.7.2 min() supported 7.7.3 max() supported 7.7.4 count-non-empty() supported 7.7.5
index() partial binds using
index() are not working 292333; 7.7.6 power() supported 7.7.7 random() supported 7.7.8 compare() supported 7.8.1 if() supported 7.8.2 property() partial ...
...And 2 more matches
XForms Repeat Element - Archive of obsolete content
ch node in the nodeset, the contents of the repeat element will be displayed in the form. that node will serve as the context node for any relative xpath expressions in that set of repeated markup. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. node set binding special start
index - optional 1-based initial value of the repeat
index. the default value is 1. number - isn't supported type restrictions the repeat element can be bound to a nodeset. representations the repeat element doesn't have a visual representation. however, it can influence the layout of generated controls depending on its appearance attribute. default layout each generated control set is place...
...visual representation. however, it can influence the layout of generated controls depending on its appearance attribute. default layout each generated control set is placed vertically. compact layout each generated control set is placed horizontally. occurs when the repeat element's appearance attribute has a value of compact. behaviour focusing a generated control may change the current
index of the containing repeat element. the
index is equal to the
index of the control set that the focused control belongs to. actions you can use xforms action module elements to modify the nodeset that the repeat element is bound to. the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and set
index (see the spec) elements. example <...
....25</my:price> </my:line> </my:lines> </instance> </model> <repeat id="lineset" nodeset="/my:lines/my:line"> <input ref="my:price"> <label>line item</label> </input> <input ref="@name"> <label>name</label> </input> </repeat> <trigger> <label>insert a new item after the current one</label> <action ev:event="domactivate"> <insert nodeset="/my:lines/my:line" at="
index('lineset')" position="after"/> <setvalue ref="/my:lines/my:line[
index('lineset')]/@name"/> <setvalue ref="/my:lines/my:line[
index('lineset')]/price">0.00</setvalue> </action> </trigger> <trigger> <label>remove current item</label> <delete ev:event="domactivate" nodeset="/my:lines/my:line" at="
index('lineset')"/> </trigger> attribute based repeat when using...
...And 2 more matches
Example 4 - Learn web development
background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...tive'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select,
index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml; highlightoption(select, optionlist[
index]); }; function get
index(select) { var nativewidget = select.previouselementsibling; return nativewidget.se...
...var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml; highlightoption(select, optionlist[
index]); }; function get
index(select) { var nativewidget = select.previouselementsibling; return nativewidget.selected
index; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = ...
...And 2 more matches
Example 5 - Learn web development
background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...tive'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select,
index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[
index].setattribute('aria-selected', 'true'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml...
...selementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[
index].setattribute('aria-selected', 'true'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml; highlightoption(select, optionlist[
index]); }; function get
index(select) { var nativewidget = select.previouselementsibling; return nativewidget.selected
index; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function (...
...And 2 more matches
Accessibility in React - Learn web development
them both below: import react, { usestate, useref, useeffect } from "react"; then declare a new ref inside the app() function. just above the return statement is a good place: const listheadingref = useref(null); prepare the heading heading elements like our <h2> are not usually focusable. ...
...app() function. just above the return statement is a good place: const listheadingref = useref(null); prepare the heading heading elements like our <h2> are not usually focusable. this isn't a problem — we can make any element programmatically focusable by adding the attribute tab
index="-1" to it. this means only focusable with javascript. ...
...null); prepare the heading heading elements like our <h2> are not usually focusable. this isn't a problem — we can make any element programmatically focusable by adding the attribute tab
index="-1" to it. this means only focusable with javascript. you can't press tab to focus on an element with a tab
index of -1 the same way you could do with a <button> or <a> element (this can be done using tab
index="0", but that's not really appropriate in this case). let's add the tab
index attribute — written as tab
index in jsx — to the heading above our list of tasks, along with our headingref: <h2 id="list-heading" tab
index="-1" ref={listheadingref}> {headingtext} </h2> note: the tab
index attribute is great for accessibility edge-cases, but you should take great care to not overuse it. only app...
...And 2 more matches
Deploying our app - Learn web development
tically trigger the entire build routine. if all is well, we get a live change deployed automatically. the only action we need to perform is that initial "push". however, we do have to set these steps up, and we'll look at that now. the build process again, because we're using parcel for development, the build option is extremely simple to add. instead of running the server with npx parcel src/
index.html, we can run it with npx parcel build src/
index.html and parcel will build everything ready for production instead of just running it for development and testing purposes. this includes doing minification and tree-shaking of code, and cache-busting on filenames. the newly-created production code is placed in a new directory called dist, which contains all the files required to run the websit...
...y on npm run build to always do the complete build step, without needing to remember the specific build command arguments for each project. open the package.json file in your project's root directory, and find the scripts property. we'll add a build command that we can run to build our code. add the following line to your project now: "scripts": { ... "build": "parcel build src/
index.html" } note: if the scripts property already has a command inside it, put a comma at the end of it. keep the json valid. you should now be able to run the following command in the root of your project directory to run the production build step (first quit the running process with ctrl + c if you need to): npm run build this should give you an output like the following, showi...
...our next step is to push the project to github. committing changes to github this section will get you over the line to storing your code in a git repository, but it is a far cry from a git tutorial. there’s many gr...
...And 2 more matches
Gecko info for Windows accessibility vendors
containers along with the event_focus as selection/focus move together in that case. event_selectionwithin is fired on multi selection containers when the current selection changes within. in addition, event_selectionadd and event_selectionremove are fired on the the child who's selection changed. how to track where the event happened, within your own offscreen model ordinary zero-
indexed child ids are not practical for representing events. the problem is that the child id system that is used by msaa doesn't work well when you have a deep tree of objects in a window. it would be impractical to number all of the nodes in a document starting at 0, because whenever a node is inserted or removed it would be computationally very expensive to renumber things. so, the firefox childid h...
...this only applies if the node is html. hresult get_innerhtml([out, retval] bstr *innerhtml); finally we provide a method for getting the current iso 639 language code, such as "en" for english or even possible "en-cockney" for the british cockney di...
...ed to check for this interface if the current node has any msaa or dom children. text nodes always support isimpledomnode as well as isimpledomtext. ...
...And 2 more matches
Multiprocess on Windows
{ // first arraydata definition }, { // second arraydata definition } }; mozilla::mscom::registerarraydata(kmyarraydata); each arraydata struct corresponds to one function; with length_is and/or size_is annotations. if your interface contains two functions with those annotations, then you will need to add two arraydata entries. arraydata contains seven fields: iid miid; ulong mmethod
index; ulong marrayparam
index; vartype marrayparamtype; iid marrayparamiid; ulong mlengthparam
index; flag mflag; miid is the uuid of the interface owning the function. mmethod
index is the vtable
index of the function within its interface. this
index must take into account the vtable(s) of parent interfaces. for example, if interface ifoo inherits from iunknown, the lowest possible mmeth...
... marrayparamtype is the expected variant type of the outparam. ...
... marrayparamtype is the expected variant type of the outparam. this should usually be set to vt_unknown | vt_byref, which is telling the interceptor that the outparam is an iunknown**. marrayparamiid is the uuid of the interface that the outparam array uses. ...
...And 2 more matches
Performance best practices for Firefox front-end engineers
investigate and try to remove those as best you can. sometimes, our graphics layer invalidates regions in ways that might not be clear to you, and a section outside of the thing that just repainted will also repaint. sometimes this can be addressed by ensuring that the thing changing is on its own layer (though this comes at a memory cost). you can put something on its own layer by setting its z-
index, or by setting the will-change on the node, though this should be used sparingly. if you’re unsure why something is repainting, consider talking to our always helpful graphics team in the gfx room on matrix, and they can probably advise you. note that a significant number of the graphics team members are in the us eastern time zone (utc-5 or utc-4 during daylight saving time), so let that info...
...n code of gecko are based on an expectation that the from (0%) and the to (100%) values will be explicitly defined in the @keyframes definition. even though these values may be inferred through the use of initial values or the cascade, the offscreen animation optimizations are dependent on the explicit definition. see this comment and a few previous comments on that bug for more information. ...
...h these values may be inferred through the use of initial values or the cascade, the offscreen animation optimizations are dependent on the explicit definition. see this comment and a few previous comments on that bug for more information. use
indexeddb for storage appcache and localstorage are synchronous storage apis that will block the main thread when you use them. avoid them at all costs!
indexeddb is preferable, as the api is asynchronous (all disk operations occur off of the main thread), and can be accessed from web workers. ...
...And 2 more matches
JIT Optimization Outcomes
hat suggest they are hashtables are turned into dictionary objects and their types marked as such. noprotofound a prototype object was not found for all the object used by this operation. multiprotopaths objects used in this operation had differing prototypes. nonwritableproperty the property being assigned to is not writable for some types of objects which are used in this operation. ...
...nto dictionary objects and their types marked as such. noprotofound a prototype object was not found for all the object used by this operation. multiprotopaths objects used in this operation had differing prototypes. nonwritableproperty the property being assigned to is not writable for some types of objects which are used in this operation. proto
indexedprops the object 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-...
... typedobjectneutered the typed object being accessed at this location may have been neutered (a neutered typed object is one where the underlying byte buffer has been removed or transferred to a worker). typedobjectarrayrange failed to do range check of element access on a typed object. ...
...And 2 more matches
JS_ValueToId
convert a js::value to type jsid. syntax bool js_valuetoid(jscontext *cx, js::handlevalue v, js::mutablehandleid idp); bool js_stringtoid(jscontext *cx, js::handlestring s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_
indextoid(jscontext *cx, uint32_t
index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the js value to convert. s j...
...protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the js value to convert. s js::handlestring the js string to convert.
index uint32_t an unsigned integer
index of array to convert. chars js::twobytechars the string to convert. key jsprotokey the prototype key to convert. idp js::mutablehandleid out parameter. on success, *idp receives the converted jsid. description js_valuetoid converts a specified js::value, v, to a jsid. if v is an integer, *idp receives an ...
...ied js::value, v, to a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a specified string to a jsid. js_
indextoid converts a specified integer
index to an integer jsid. js::protokeytoid converts a specified prototype key to a jsid. on success, js_valuetoid stores the converted value in *idp and returns true. otherwise it returns false. the inverse of js_valuetoid is js_idtovalue. mxr id search for js_valuetoid see also mxr id search for js_idtovalue mxr id search for js_stringtoid mxr id search...
...And 2 more matches
nsIAccessible
ough the accessible tree by the following methods and attributes. nsiaccessible.parent to get the parent accessible nsiaccessible.nextsibling, nsiaccessible.previoussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to navigate through the children by
index accessible position you can use nsiaccessible.
indexinparent to get accessible
index in its parent. use nsiaccessible.groupposition() to get information about this accessible in its group. relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are relat...
... getstate provides a bit fields of accessible states which describe boolean properties of accessible. groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible c...
... groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible child which contains the coordinate at (x, y) in screen pixels. getchildat this method returns nth accessible child using zero-based
index or last child if
index than less than zero. getaccessibletoright this method returns an accessible node geometrically to the right of this one. getaccessibletoleft this method returns an accessible node geometrically to the left of this one. getaccessibleabove this method returns an accessible node geometrically above this one. getaccessibl...
...And 2 more matches
nsIAccessibleHyperLink
accessible/public/nsiaccessiblehyperlink.idlscriptable a cross-platform interface that supports hyperlink-specific properties and methods. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long
index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long
index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink. is normally 1 for anchors. this anchor is, for example, the visible output of the html:a tag. with an image map, reflects the actual areas within the map. read only. note: renamed from a...
... the number of anchors within this hyperlink. is normally 1 for anchors. this anchor is, for example, the visible output of the html:a tag. with an image map, reflects the actual areas within the map. read only. note: renamed from anchors in gecko 1.9 exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. end
index long the end offset of the hyperlink accessible within the parent accessible. the returned value is related to the nsiaccessiblehyperlink interface of the object that owns this hyperlink. read only. note: the link itself is represented by one embedded character within the parent text, so the end
index should be start
index + 1. exceptions thrown ns_error_failure ...
..., so the end
index should be start
index + 1. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. selected boolean determines whether the element currently has the focus, for example after returning from the destination page. read only. note: aria links can only be focused if they have the tab
index attribute set. also, state_focused should then be set on the accessible for this link. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. start
index long the offset of the hyperlink accessible within the parent accessible. the returned value is related to the nsiaccessiblehyperlink interface of...
...And 2 more matches
nsIAccessibleHyperText
able this interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents. a typical implementation is to implement this interface on the small text object such as a paragraph of text. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long link
index); long getlink
index(in long char
index); long getselectedlink
index(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object. read only. note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given lin...
... long getlink
index(in long char
index); long getselectedlink
index(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object. read only. note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given link
index. nsiaccessiblehyperlink getlink( in long link
index ); parameters link
index 0-based
index of the link that is to be retrieved. this can be retrieved via getlink
index(). return value an nsiaccessiblehyperlink object. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg the link
index is invalid. getlin...
... nsiaccessiblehyperlink getlink( in long link
index ); parameters link
index 0-based
index of the link that is to be retrieved. this can be retrieved via getlink
index(). return value an nsiaccessiblehyperlink object. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg the link
index is invalid. getlink
index() the link
index at the given offset (character
index). long getlink
index( in long char
index ); parameters char
index the 0-based character
index. return value the
index of the link if it's presented on the given character
index, otherwise -1. ...
...And 2 more matches
nsINavHistoryContainerResultNode
cluding bookmark folders). 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long a
index); unsigned long getchild
index(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false. read only. childrenreadonly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or ...
...h on. arecursive if true, the search will recurse through all child containers of the current container; if false, only direct children of the container are searched. return value an nsinavhistoryresultnode of a node matching the specified details or null if no match is found. exceptions thrown ns_error_not_available the container is not open. getchild() returns the child node at the specified
index. nsinavhistoryresultnode getchild( in unsigned long a
index ); parameters a
index the
index into the child list of the node to fetch. returns the node located at the specified
index. exceptions thrown ns_error_not_available the containeropen attribute is currently false, indicating that the node isn't open for access. getchild
index() returns the
index of a direct child of this container. ...
...exceptions thrown ns_error_not_available the container isn't open (that is, containeropen is false). ...
...And 2 more matches
nsINavHistoryResultTreeViewer
sult when the tree is detached; this prevents circular references. it's important to be aware of this—if you want to reuse the same viewer, you need to keep your own reference to it, then reinitialize it when the tree changes. if you use this object and attach it to a result without attaching it to a tree, then forget about it, it will leak. method overview nsinavhistoryresultnode nodefortree
index(in unsigned long a
index); unsigned long tree
indexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree. this prevents you from seeing multiple entries for things when you have selected to get visits. when you sort by date, the multiple entries ...
....9 flatitemcount pruint32 this tells you how many items are in the flattened list of results, that is how many rows are in this tree right now. the tree adaptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount. this is only valid when a tree is attached, the result will be 0 otherwise. read only. ...
...how many items are in the flattened list of results, that is how many rows are in this tree right now. the tree adaptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount. this is only valid when a tree is attached, the result will be 0 otherwise. read only. obsolete since gecko 1.9 constants constant value description
index_invisible 0xffffffff returned by tree
indexfornode() when the requested node isn't visible (such as when its parent is collapsed). also returned if there is no tree attached. methods nodefortree
index() returns the node for a given row
index. this is only valid when a tree is attached. nsinavhistoryresultnode nodefortree
index( in unsigned long a
index ); parameters a
index the row
index of the note to return. return value the node loc...
...And 2 more matches
nsITransactionList
editor/txmgr/idl/nsitransactionlist.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long a
index); nsitransaction getitem(in long a
index); long getnumchildrenforitem(in long a
index); boolean itemisbatch(in long a
index); attributes attribute type description numitems long the number of transactions contained in this list. read only. methods getchildlistforitem() returns the list of children associated with the item at a
index. implementations may return null if there are no children, or an empty list. the list returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransactionlist getchildlistforitem( in long ...
...umitems long the number of transactions contained in this list. read only. methods getchildlistforitem() returns the list of children associated with the item at a
index. implementations may return null if there are no children, or an empty list. the list returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransactionlist getchildlistforitem( in long a
index ); parameters a
index the
index of the item in the list. return value the nsitransactionlist of children associated with the item at a
index. getitem() returns the transaction at the given
index in the list. note that a null can be returned here if the item is a batch. the transaction returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransaction getite...
...s a
index the
index of the item in the list. return value the nsitransactionlist of children associated with the item at a
index. getitem() returns the transaction at the given
index in the list. note that a null can be returned here if the item is a batch. the transaction returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransaction getitem( in long a
index ); parameters a
index the
index of the item in the list. return value missing description getnumchildrenforitem() returns the number of child (auto-aggreated) transactions the item at a
index has. long getnumchildrenforitem( in long a
index ); parameters a
index the
index of the item in the list. return value the number of child (auto-aggreated) transactions the item at a
index has. itemisbatc...
...And 2 more matches
Storage Inspector - Firefox Developer Tools
spect various types of storage that a web page can use. currently it can be used to inspect the following storage types: cache storage — any dom caches created using the cache api. cookies — all the cookies created by the page or any iframes inside of the page. cookies created as a part of response of network calls are also listed, but only for calls that happened while the tool is open.
indexeddb — all
indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores. local storage — all local storage items created by the page or any iframes inside the page. session storage — all session storage items created by the page or any iframes inside the page. for the time being, the storage inspector only gives y...
...lled "storage" in the developer toolbox. storage inspector user interface the storage inspector ui is split into three main components: storage tree table widget sidebar storage tree the storage tree lists all the storage types that the storage inspector can inspect: under each type, objects are organized by origin. for cookies, the protocol does not differentiate the origin. ...
... organized by origin. for cookies, the protocol does not differentiate the origin. for
indexed db or local storage an origin is a combination of protocol + hostname. for example, "http://mozilla.org" and "https://mozilla.org" are two different origins so local storage items cannot be shared between them. under "cache storage", objects are organized by origin and then by the name of the cache:
indexeddb objects are organized by origin, then by database name, then by object store name: with the cookies, local storage, and session storage types, there's only one level in the hierarchy, so stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children. the tree is live, so if a new origin gets added (by adding an iframe, for e...
...And 2 more matches
DataTransfer.mozGetDataAt() - Web APIs
return value nsivariant the data item requested. ...
... return value nsivariant the data item requested. ...
... return value nsivariant the data item requested. ...
...And 2 more matches
DataTransferItemList.remove() - Web APIs
return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
... return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
... return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
...And 2 more matches
HTMLSelectElement - Web APIs
control used by servers and dom search functions. htmlselectelement.optionsread only an htmloptionscollection representing the set of <option> (htmloptionelement) elements contained by this element. htmlselectelement.required a boolean reflecting the required html attribute, which indicates whether the user is required to select a value before submitting the form. htmlselectelement.selected
index a long reflecting the
index of the first selected <option> element. the value -1 indicates no element is selected. htmlselectelement.selectedoptionsread only an htmlcollection representing the set of <option> elements that are selected. htmlselectelement.size a long reflecting the size html attribute, which contains the number of visible items in the control. the default is 1, unless multip...
...d whether it satisfies them. if the element fails its constraints, the browser fires a cancelable invalid event at the element (and returns false). htmlselectelement.focus() gives input focus to this element. this method is now implemented on htmlelement. htmlselectelement.item() gets an item from the options collection for this <select> element. you can also access an item by specifying the
index in array-style brackets or parentheses, without calling this method explicitly. htmlselectelement.nameditem() gets the item in the options collection with the specified name. the name string can match either the id or the name attribute of an option node. you can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly. htmlselec...
... this method explicitly. htmlselectelement.nameditem() gets the item in the options collection with the specified name. the name string can match either the id or the name attribute of an option node. you can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly. htmlselectelement.remove() removes the element at the specified
index from the options collection for this select element. htmlselectelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, it fires a cancelable invalid event at the element, and returns false; if there are no problems, it returns true. htmlselectelement.setcustomvalidity() sets the custom validity message for the ...
...And 2 more matches
IDBCursor.source - Web APIs
example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. ...
... example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. ...
...ndex that the cursor is iterating over. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction,
indexnames: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displayda...
...And 2 more matches
IDBCursor - Web APIs
note: not to be confused with idbcursorwithvalue which is just an idbcursor interface with an additional value property. the idbcursor interface of the
indexeddb api represents a cursor for traversing or iterating over multiple records in a database. the cursor has a source that indicates which
index or object store it is iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursor object representing a given cursor. operations are performed on the underlying
index or object store. note: this feature is available in web...
...this function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active. ...
...e. idbcursor.request read only returns the idbrequest that was used to obtain the cursor. methods idbcursor.advance() sets the number of times a cursor should move its position forward. idbcursor.continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. idbcursor.continueprimarykey() sets the cursor to the given
index key and primary key given as arguments. idbcursor.delete() returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. this can be used to delete specific records. idbcursor.update() returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object ...
...And 2 more matches
IDBCursorSync - Web APIs
it enables an application to synchronously process all the records in the cursor's range. ...
...it enables an application to synchronously process all the records in the cursor's range. ...
...it enables an application to synchronously process all the records in the cursor's range. ...
...And 2 more matches
IDBDatabase: abort event - Web APIs
he connection object. bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...ansaction to trigger the event. ...
...enrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('abort', () => { console.log('transaction aborted'); }); // o...
...And 2 more matches
IDBFactory.open() - Web APIs
hod, with its result attribute set to the new idbdatabase object for the connection. if an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method. may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. syntax for the current standard: var idbopendbrequest =
indexeddb.open(name); var idbopendbrequest =
indexeddb.open(name, version); parameters name the name of the database. version optional optional. the version to open the database with. if the version is not provided and the database exists, then a connection to the database will be opened without changing its version. if the version is not provided and the database does not exist, then it will b...
...bopendbrequest object on which subsequent events related to this request are fired. exceptions this method may raise a domexception of the following types: exception description typeerror the value of version is zero or a negative number or not a number. ...
...equest = window.
indexeddb.open("todolist", 4); in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes // of implementations you want to test. window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange |...
...And 2 more matches
IDBOpenDBRequest: blocked event - Web APIs
the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
...st = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision ...
...ique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 =
indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('request was blocked'); }); }; using the onblocked property: // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { co...
...And 2 more matches
IDBOpenDBRequest - Web APIs
note: this feature is available in web workers. ...
...gher than its current version. also available via the onupgradeneeded property. example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these event handlers act on the database being opened. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot below db = dbopenreque...
...// variable. ...
...And 2 more matches
IDBRequest - Web APIs
each reading and writing operation on a database is done using a request. the request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the idbrequest instance. all asynchronous operations immediately return an idbrequest instance. each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. ...
...its properties from eventtarget. idbrequest.error read only returns a domexception in the event of an unsuccessful request, indicating what went wrong. idbrequest.result read only returns the result of the request. if the the request failed and the result is not available, an invalidstateerror exception is thrown. idbrequest.source read only the source of the request, such as an idb
index or an idbobjectstore. if no source exists (such as when calling idbfactory.open), it returns null. idbrequest.readystate read only the state of the request. every request starts in the pending state. the state changes to done when the request completes successfully or when an error occurs. idbrequest.transaction read only the transaction for the request. this property can be null for certai...
... when an idbrequest succeeds. also available via the onsuccess property. example in the following code snippet, we open a database asynchronously and make a request; onerror and onsuccess functions are included to handle the success and error cases. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database. db = dbopenrequest.result; }; specifi...
...And 2 more matches
IDBTransaction: abort event - Web APIs
the abort event is fired when an
indexeddb transaction is aborted. bubbles yes cancelable no interface event event handler property onabort this can happen for any of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same
index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. // open t...
... success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...uest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db tran...
...And 2 more matches
Microdata DOM API - Web APIs
items of a particular type given in the document: var cats = document.getitems("http://example.com/feline"); once an element representing an item has been obtained, its properties can be extracted using the properties idl attribute. this attribute returns an htmlpropertiescollection, which can be enumerated to go through each element that adds one or more properties to the item. it can also be
indexed by name, which will return an object with a list of the elements that add properties with that name. each element that adds a property also has an itemvalue idl attribute that returns its value. code example this sample gets the first item of type "http://example.net/user" and then pops up an alert using the "name" property from that item. var user = document.getitems('http://example.net/us...
...ent that adds a property also has an itemvalue idl attribute that returns its value. code example this sample gets the first item of type "http://example.net/user" and then pops up an alert using the "name" property from that item. var user = document.getitems('http://example.net/user')[0]; alert('hello ' + user.properties['name'][0].itemvalue + '!'); the htmlpropertiescollection object, when
indexed by name in this way, actually returns a propertynodelist object with all the matching properties. the propertynodelist object can be used to obtain all the values at once usingits getvalues method, which returns an array of all the values. code example in an earlier example, a "http://example.org/animals#cat" item had two "http://example.com/color" values. this script looks up the first such ...
...lcollection { // inherits length and item() getter propertynodelist? nameditem(domstring name); // shadows inherited nameditem() readonly attribute domstring[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection . length returns the number of elements in the collection. element = collection . ...
...And 2 more matches
StyleSheet.media - Web APIs
style information. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). ...
...n. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). ...
...object and can be removed with deletemedium() and added with appendmedium(). ...
...And 2 more matches
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
v0, v1, v2, v3 an integer number for the vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. ...
... v0, v1, v2, v3 an integer number for the vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. ...
... v0, v1, v2, v3 an integer number for the vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. ...
...And 2 more matches
WebGLRenderingContext.bindAttribLocation() - Web APIs
this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. ...
...this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. ...
...this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. ...
...And 2 more matches
Window.navigator - Web APIs
ndow.navigator read-only property returns a reference to the navigator object, which has methods and properties about the application running the script. syntax navigatorobject = window.navigator examples example #1: browser detect and return a string var sbrowser, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers. ...
... navigatorobject = window.navigator examples example #1: browser detect and return a string var sbrowser, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers. ...
...1) { sbrowser = "mozilla firefox"; // "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:61.0) gecko/20100101 firefox/61.0" } else if (susrag.
indexof("samsungbrowser") > -1) { sbrowser = "samsung internet"; // "mozilla/5.0 (linux; android 9; samsung sm-g955f build/ppr1.180610.011) applewebkit/537.36 (khtml, like gecko) samsungbrowser/9.4 chrome/67.0.3396.87 mobile safari/537.36 } else if (susrag.
indexof("opera") > -1 || susrag.
indexof("opr") > -1) { sbrowser = "opera"; // "mozilla/5.0 (macintosh; intel mac os x 10_14_0) applewebkit/537.36 (khtml, like gecko) chrome/70.0.3538.102 safari/537.36 opr/57.0.3098.106" } else if (susrag.
indexof("trident") > -1) { sbrowser = "microsoft internet explorer"; // "mozilla/5.0 (windows nt 10.0; wow64; trident/7.0; .net4.0c; .net4.0e; zoom 3.6.0; wbx ...
...And 2 more matches
Web APIs
ent light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture api
indexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver ...
...e 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 content
index content
indexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad d...
...ldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlis
indexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraphelement htmlparamel...
...And 2 more matches
Using the group role - Accessibility
screen magnifiers may enlarge the group. note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: using the group role with a html tree view the snippet below shows how the group role is added directly into the html source code. ...
...ed above is one of those opinions and therefore not normative. examples example 1: using the group role with a html tree view the snippet below shows how the group role is added directly into the html source code. ...
... example 1: using the group role with a html tree view the snippet below shows how the group role is added directly into the html source code. ...
...And 2 more matches
ARIA: button role - Accessibility
the button role should be used for clickable elements that trigger a response when activated by the user. adding role="button" will make an element appear as a button control to a screen reader. this role can be used in combination with the aria-pressed attribute to create toggle buttons. ...
...he enter or space key on the keyboard. (note not the deprecated onkeypress) changing attribute values aria-pressed the value of aria-pressed defines the state of a toggle button. this attribute has one of four possible values: true, false, mixed, undefined examples basic button example in this example, a span element has been given the button role. because a <span> element is used, the tab
index attribute is required to make the button focusable and part of the page's tab order. the included css style is provided to make the <span> element look like a button, and to provide visual cues when the button has focus. the handlebtnclick and handlebtnkeydown event handlers perform the button's action when activated using a mouse click or the space or enter key. in this case, the action is to a...
...ng a mouse click or the space or enter key. in this case, the action is to add a new name to the list of names. try the example by adding a name to the text box. the button will cause the name to be added to a list. ...
...And 2 more matches
Atomics - JavaScript
finished before the next operation starts and that operations are not interrupted. wait and notify the wait() and notify() methods are modeled on linux futexes ("fast user-space mutex") and provide ways for waiting until a certain condition becomes true and are typically used as blocking constructs. static methods atomics.add() adds the provided value to the existing value at the specified
index of the array. returns the old value at that
index. atomics.and() computes a bitwise and on the value at the specified
index of the array with the provided value. returns the old value at that
index. atomics.compareexchange() stores a value at the specified
index of the array, if it equals a value. returns the old value. atomics.exchange() stores a value at the specified
index of the array. ...
... the specified
index of the array. returns the old value. atomics.islockfree(size) an optimization primitive that can be used to determine whether to use locks or atomic operations. returns true if an atomic operation on arrays of the given element size will be implemented using a hardware atomic operation (as opposed to a lock). experts only. atomics.load() returns the value at the specified
index of the array. atomics.notify() notifies agents that are waiting on the specified
index of the array. returns the number of agents that were notified. atomics.or() computes a bitwise or on the value at the specified
index of the array with the provided value. returns the old value at that
index. atomics.store() stores a value at the specified
index of the array. returns the value. atomics.s...
...returns either "ok", "not-equal", or "timed-out". if waiting is not allowed in the calling agent then it throws an error exception. ...
...And 2 more matches
String.prototype.charCodeAt() - JavaScript
the charcodeat() method returns an integer between 0 and 65535 representing the utf-16 code unit at the given
index. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the utf-16 code unit matches the unicode code point for code points which can be represented in a single utf-16 code unit. if the unicode code point cannot be represented in a single utf-16 code unit (because its value is greater than 0xffff) then the code unit returned will be the first part of a surrogate pair for the code point. ...
...it matches the unicode code point for code points which can be represented in a single utf-16 code unit. if the unicode code point cannot be represented in a single utf-16 code unit (because its value is greater than 0xffff) then the code unit returned will be the first part of a surrogate pair for the code point. if you want the entire code point value, use codepointat(). syntax str.charcodeat(
index) parameters
index an integer greater than or equal to 0 and less than the length of the string. if
index is not a number, it defaults to 0. return value a number representing the utf-16 code unit value of the character at the given
index. if
index is out of range, charcodeat() returns nan. description unicode code points range from 0 to 1114111 (0x10ffff). the first 128 unicode code poi...
...rise the real character. because of this, in order to examine (or reproduce) the full character for individual character values of 65536 or greater, for such characters, it is necessary to retrieve not only charcodeat(i), but also charcodeat(i+1) (as if manipulating a string with two letters), or to use codepointat(i) instead. see examples 2 and 3 (below). charcodeat() returns nan if the given
index is less than 0, or if it is equal to or greater than the length of the string. backward compatibility: in historic versions (like javascript 1.2) the charcodeat() method returns a number indicating the iso-latin-1 codeset value of the character at the given
index. the iso-latin-1 codeset ranges from 0 to 255. the first 0 to 127 are a direct match of the ascii character set. examples using char...
...And 2 more matches
String.prototype.matchAll() - JavaScript
iterable). examples regexp.exec() and matchall() prior to the addition of matchall to javascript, it was possible to use calls to regexp.exec (and regexes with the /g flag) in a loop to obtain all the matches: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; let match; while ((match = regexp.exec(str)) !== null) { console.log(`found ${match[0]} start=${match.
index} end=${regexp.last
index}.`); // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." } with matchall available, you can avoid the while loop and exec with g. instead, by using matchall, you get an iterator to use with the more convenient for...of, array spread, or array.from() constructs: const regexp = regexp('foo[a-z]*','g'); const str ...
...h matchall available, you can avoid the while loop and exec with g. ...
...e, you can avoid the while loop and exec with g. instead, by using matchall, you get an iterator to use with the more convenient for...of, array spread, or array.from() constructs: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; const matches = str.matchall(regexp); for (const match of matches) { console.log(`found ${match[0]} start=${match.
index} end=${match.
index + match[0].length}.`); } // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." // matches iterator is exhausted after the for..of iteration // call matchall again to create a new iterator array.from(str.matchall(regexp), m => m[0]); // array [ "football", "foosball" ] matchall will throw an exception if the g flag is missing. const regexp = ...
...And 2 more matches
String.prototype.substr() - JavaScript
the substr() method returns a portion of the string, starting at the specified
index and extending for a given number of characters afterwards. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.substr(start[, length]) parameters start the
index of the first character to include in the returned substring. length optional. the number of characters to extract. return value a new string containing the specified part of the given string. ...
...its value is capped at -str.length. ...
...its value is capped at -str.length. note: in microsoft jscript, negative values of the start argument are not considered to refer to the end of the string. ...
...And 2 more matches
String.prototype.substring() - JavaScript
the substring() method returns the part of the string between the start and end
indexes, or to the end of the string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.substring(
indexstart[,
indexend]) parameters
indexstart the
index of the first character to include in the returned substring.
indexend optional the
index of the first character to exclude from the returned substring. return value a new string containing the specified part of the given string. ...
...es and send us a pull request. syntax str.substring(
indexstart[,
indexend]) parameters
indexstart the
index of the first character to include in the returned substring.
indexend optional the
index of the first character to exclude from the returned substring. return value a new string containing the specified part of the given string. description substring() extracts characters from
indexstart up to but not including
indexend. in particular: if
indexend is omitted, substring() extracts characters to the end of the string. if
indexstart is equal to
indexend, substring() returns an empty string. if
indexstart is greater than
indexend, then the effect of substring() is as if the two arguments were swapped; see example below. any argument value that is less than 0 or greater th...
...tring4) // displays 'zilla' the last 5 characters let anystring = 'mozilla' let anystring5 = anystring.substring(anystring.length - 5) console.log(anystring5) the difference between substring() and substr() there's a subtle difference between the substring() and substr() methods, so you should be careful not to get them confused. the arguments of substring() represent the starting and ending
indexes, while the arguments of substr() represent the starting
index and the number of characters to include in the returned string. furthermore, substr() is considered a legacy feature in ecmascript and could be removed from future versions, so it is best to avoid using it if possible. let text = 'mozilla' console.log(text.substring(2,5)) // => "zil" console.log(text.substr(2,3)) // => "zil" ...
...And 2 more matches
TypedArray.prototype.filter() - JavaScript
rray types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.filter(callback[, thisarg]) parameters callback function to test each element of the typed array. invoked with arguments (element,
index, typedarray). return true to keep the element, false otherwise. thisarg optional value to use as this when executing callback. return value a new typed array with the elements that pass the test. description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true valu...
...ep the element, false otherwise. thisarg optional value to use as this when executing callback. return value a new typed array with the elements that pass the test. description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value. ...
...executing callback. return value a new typed array with the elements that pass the test. description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value. callback is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values. ...
...And 2 more matches
TypedArray.prototype.find() - JavaScript
the find() method returns a value in the typed array, if an element satisfies the provided testing function. otherwise undefined is returned. typedarray is one of the typed array types here. see also the find
index() method, which returns the
index of a found element in the typed array instead of its value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.find(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three arguments: element the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the array find was called upon. thisarg optional. object to use as this when executing callback. return value a value in the array if an element passes the test; otherwise, undefined. description the find method executes the callback function once for each element present in the typed array until it finds ...
... return value a value in the array if an element passes the test; otherwise, undefined. description the find method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, find immediately returns the value of that element. otherwise, find returns undefined. callback is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the
index of the element, and the typed array object being traversed. if a thisarg parameter is provided to find, it will be used as the this for each invocation of the callback. if it...
...And 2 more matches
Caching compiled WebAssembly modules - WebAssembly
warning: experimental webassembly.module
indexeddb serialization support is being removed from browsers; see bug 1469395 and this spec issue. caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. caching via
indexeddb
indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side. it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. this includes compiled wasm modules (webassembly.module javascript objects). ...
...hing via
indexeddb
indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side. it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. this includes compiled wasm modules (webassembly.module javascript objects). setting up a caching library because
indexeddb is a somewhat old-fashioned api, we wanted to provide a library function to speed up writing caching code, and make it work better along with today's more modern apis. in our wasm-utils.js library script, you'll find instantiatecachedurl() — this function fetches the wasm module at url with a version of dbversion, instantiates it with the given importobject, and returns a promise resolving...
...= 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database. ...
...And 2 more matches
panel - Archive of obsolete content
an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/
index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.u...
... and the add-on script receives them using panel.port.on(). var myscript = "window.addeventlistener('click', function(event) {" + " var t = event.target;" + " if (t.nodename == 'a')" + " self.port.emit('click-link', t.tostring());" + "}, false);" var mypanel = require("sdk/panel").panel({ contenturl: "http://www.bbc.co.uk/mobile/
index.html", contentscript: myscript }); mypanel.port.on("click-link", function(url) { console.log(url); }); mypanel.show(); this example uses contentscript to supply the script as a string. it's usually better practice to use contentscriptfile, which is a url pointing to a script file saved under your add-on's data directory. warning: unless your content script is extremely simple and consist...
...k href="panel-style.css" type="text/css" rel="stylesheet"> </head> <body> my panel content </body> </html> from firefox 31 onwards, you can style panel content using the contentstyle or contentstylefile options. ...
... panel limitations although panels can host html documents, they are not implemented as browser tabs, ...
ui/sidebar - Archive of obsolete content
probably listen to detach, and in its handler, remove your reference to the worker. ...
...etach, and in its handler, remove your reference to the worker. ...
...ler, remove your reference to the worker. ...
...er. ...
Creating annotations - Archive of obsolete content
r for messages from this worker. if the message is show we will just log the content for the time being. if the message is detach we remove the worker from the selectors array. ...
...this worker. if the message is show we will just log the content for the time being. if the message is detach we remove the worker from the selectors array. ...
...ssage is show we will just log the content for the time being. if the message is detach we remove the worker from the selectors array. ...
...tent for the time being. if the message is detach we remove the worker from the selectors array. at the top of the file import the page-mod module and declare an array for the workers: var pagemod = require('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var
index = workerarray.
indexof(worker); if(
index != -1) { workerarray.splice(
index, 1); } } edit toggleactivation() to notify the workers of a change in activation state: function activateselectors() { selectors.foreach( function (selector) { selector.postmessage(annotatorison); }); } function toggleactivation() { annotatorison = !annotatorison; activateselectors(); return annotatorison; } we'll be using this url in all our screenshots. because cfx run...
Creating Reusable Modules - Archive of obsolete content
you can split your code into separate modules with clearly defined interfaces between them. you then import and use these modules from other parts of your add-on using the require() statement, in exactly that same way that you import core sdk modules like page-mod or panel. it can often make sense to structure a larger or more complex add-on as a collection of modules. ...
...as string. note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returned nsilocalfile... } return path; } require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5file(promptforfile())); } }); this works , but
index.js is now getting longer and its logic is harder to understand. let's factor the file picker and hashing code into separate modules. creating separate modules filepicker.js first create a new file in "lib" called "filepicker.js". copy the file picker code into this new file, and add the following line at the end: exports.promptforfile = promptforfile; this defines the public interface of th...
...; // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.finish(false); // convert the binary hash data to a hex string. ...
...omstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.finish(false); // convert the binary hash data to a hex string. ...
Display a Popup - Archive of obsolete content
is tutorial we'll create an add-on that adds an action button to the toolbar that displays a panel when clicked. the panel just contains a <textarea> element: when the user presses the return key, the contents of the <textarea> is sent to the main add-on code. the main add-on code logs the message to the console. ...
...ge to the console. the add-on consists of seven files: package.json: created when you run jpm init
index.js: the main add-on code, that creates the button and panel get-text.js: the content script that interacts with the panel content text-entry.html: the panel content itself, specified as html icon-16.png, icon-32.png, and icon-64.png: icons for the button in three different sizes the "
index.js" looks like this: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var text_entry = require("sdk/panel").panel({ contenturl: data.url("text-entry.html"), contentscriptfile: data.url("get-text.js") }); // create a button require("sdk/ui/button/action")...
...type some text and press "return" and you should see the output in the console. if you use a toggle bu...
...type some text and press "return" and you should see the output in the console. if you use a toggle button, you can attach the panel to the button. ...
Creating a Microsummary - Archive of obsolete content
ing the same tools and languages you already use to generate pages. for example, if you use php scripts to generate pages on your site, you could write php code to output a microsummary when the view=microsummary url parameter is present. then just link to the microsummaries from within the pages themselves using a <link rel="microsummary"> element, f.e.: <head> <link rel="microsummary" href="
index.php?view=microsummary"> </head> when firefox encounters a <link rel="microsummary"> element, it loads the url in the href attribute. if the url points to a generator, it uses the generator to generate the microsummary for the page. otherwise, if the url returns plain text content (or html content that can be converted to plain text), firefox uses the content as the microsummary for the page. b...
... making the generator available for download now that the generator applies to the spread firefox home page, the only thing left to do is to make it downloadable. to do so, we need to put it up on the web and then ...
...o, we need to put it up on the web and then create a javascript link on some web page that calls firefox's window.sidebar.addmicrosummarygenerator() method to download and install the generator. ...
...a javascript link on some web page that calls firefox's window.sidebar.addmicrosummarygenerator() method to download and install the generator. ...
insertItemAt - Archive of obsolete content
« xul reference home insertitemat(
index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. ...
... « xul reference home insertitemat(
index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. ...
... to insert an item at the end with element.getrowcount() + 1 example <!-- this example inserts at the selected item or appends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some labels and values var somedate = new date(); if(mylistbox.selected
index == -1){ // no item was selected in list so append to the end mylistbox.appenditem( somedate.tolocaletimestring(), somedate.gettime() ); var new
index = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var new
index = mylistbox.selected
index; mylistbox.insertitemat(new
index, somedate.tolocaletimestring(), some...
...tbox.appenditem( somedate.tolocaletimestring(), somedate.gettime() ); var new
index = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var new
index = mylistbox.selected
index; mylistbox.insertitemat(new
index, somedate.tolocaletimestring(), somedate.gettime()); } // select the newly created item mylistbox.selected
index = new
index; } </script> <button label="insert item at selected" oncommand="insertitemtolist()"/> <listbox id="mylistbox"> <listitem label="foo"/> </listbox> see also appenditem() removeitemat() ...
Template and Tree Listeners - Archive of obsolete content
is removed, and didrebuild method will be called when the content has been regenerated. this listener will also work for tree builders, and will call the appropriate methods before and after the tree has been generated. to assign a builder listener to a builder, use the addlistener method. var somelistener = { item: null, willrebuild : function(builder) { this.item = builder.getresourceat
index(builder.root.current
index); }, didrebuild : function(builder) { if (this.item) { var idx = builder.get
indexofresource(this.item) if (idx != -1) builder.root.view.selection.select(idx); } } }; tree.builder.addlistener(somelistener); this example is very simple and just saves and restores the selected
index after a rebuild. since the content goes away during a rebuild, t...
...t, so it is restored here during the didrebuild method. the firefox bookmarks window uses this technique. if you try an example using the code above, you will notice that the first tree will maintain the selection when the rebuild button is pressed, whereas in the second tree does not. this is because the listener is only attached to the first tree. ...
...estored here during the didrebuild method. the firefox bookmarks window uses this technique. if you try an example using the code above, you will notice that the first tree will maintain the selection when the rebuild button is pressed, whereas in the second tree does not. this is because the listener is only attached to the first tree. the example above makes use of the getresourceat
index and get
indexofresource methods. these two methods are available for tree builders and will convert between an
index in the tree and the associated member resource for the item at the
index. naturally, we can't store the
index as the item may have moved its position. or, the resource may no longer be part of the results, which is why we need to check the return value of the get
indexofresource method. (as this ...
...function checks the orientation and returns the opposite. this works as the 'on' value is 0 and the 'between' values are -1 and 1. obviously, this code is much simpler than what we would really want to use -- we should be checking what is being dragged to make sure that it is compatible with the tree. or, we might want to allow dropping on specific rows only; the drop methods are supplied with an
index argument so we can check for this. « previousnext » ...
Focus and Selection - Archive of obsolete content
ne element per window has the focus at a time. the user can change the focus by clicking an element with the mouse or by pressing the tab key. when the tab key is pressed, the next element is given the focus. to step backwards, the shift key and tab key can be pressed. rearranging the tab order you can change the order in which elements are focused when the user presses the tab key by adding a tab
index attribute to an element. this attribute should be set to a number. when the user presses tab, the focus will shift to the element with the next highest tab
index. that means that you can order the elements by setting indices on elements in sequence. usually, however, you would not set the tab
index attribute. if you do not, pressing tab will set the focus to the next displayed element. you only ne...
...the blur event is used to respond when the focus is removed from an element. you can respond to focus changes by adding an onfocus or onblur attribute on an element. ...
...the blur event is used to respond when the focus is removed from an element. ...
...the blur event is used to respond when the focus is removed from an element. you can respond to focus changes by adding an onfocus or onblur attribute on an element. they work just like their html counterparts. ...
Modifying a XUL Interface - Archive of obsolete content
.) example 6 : source view <button label="change" oncommand="this.nextsibling.checked = !this.nextsibling.checked;"/> <checkbox label="check for messages"/> radio buttons may be selected as well using properties, however since only one in a group may be selected at a time, the others must all be unchecked when one is checked. you don't have to do this manually of course. the radiogroup's selected
index property may be used to do this. the selected
index property may be used to retrieve the
index of the selected radio button in the group and well as change it. changing a element disabled or enabled it is common to disable particular fields that don't apply in a given situation. for example, in a preferences dialog, one might have the choice of several possibilities, but one choice allows addition...
...or enabled it is common to disable particular fields that don't apply in a given situation. for example, in a preferences dialog, one might have the choice of several possibilities, but one choice allows additional customization. here is an example of how to create this type of interface. ...
...lds that don't apply in a given situation. for example, in a preferences dialog, one might have the choice of several possibilities, but one choice allows additional customization. here is an example of how to create this type of interface. example 7 : source view <script> function updatestate(){ var name = document.getelementbyid("name"); var s
index = document.getelementbyid("group").selected
index; name.disabled = s
index == 0; } </script> <radiogroup id="group" onselect="updatestate();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a function updatestate() is called whenever a select event is fired on the radio group. this will happen whenever a r...
...el="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a function updatestate() is called whenever a select event is fired on the radio group. this will happen whenever a radio button is selected. this function will retrieve the currently selected radio element using the selected
index property. note that even though one of the radio buttons is inside an hbox, it is still part of the radio group. if the first radio button is selected (
index of 0), the textbox is enabled by setting its disabled property to true. if the second radio button is selected, the textbox is enabled. the next section will provide more details about manipulating radio groups as well as manipulating lists.
Stacks and Decks - Archive of obsolete content
ed in sequence. rather than create separate windows and add navigation buttons to each of them, you would create one window and use a deck where the content changes. like stacks, the direct children of the deck element form the pages of the deck. if there are three children of the deck element, the deck will have three children. ...
...te windows and add navigation buttons to each of them, you would create one window and use a deck where the content changes. like stacks, the direct children of the deck element form the pages of the deck. if there are three children of the deck element, the deck will have three children. the displayed page of the deck can be changed by setting an selected
index attribute on the deck element. ...
...here are three children of the deck element, the deck will have three children. the displayed page of the deck can be changed by setting an selected
index attribute on the deck element. the
index is a number that identifies which page to display. pages are numbered starting from zero. so, the first child of the deck is page 0, the second is page 1 and so on. example 3 : source view <deck selected
index="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> three pages exist here, the default being the third one. the third page is a box with two elements inside it. both the box and the elements inside it make up the page. the dec...
...e third page"/> <button label="this is also the third page"/> </box> </deck> three pages exist here, the default being the third one. the third page is a box with two elements inside it. both the box and the elements inside it make up the page. the deck will be as large as the largest child, which here should be the third page. you can switch pages by using a script to modify the selected
index attribute. more on this in the section on events and the dom. the next section describes how stacks can be used to position child elements. « previousnext » ...
colorpicker - Archive of obsolete content
if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
... do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: string if this attribute is not present, the colorpicker is displayed inside the window. if this is set to the text button, the colorpicker is displayed as a button. when the use...
...d when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. disabled type: boolean gets and sets the value of the disabled attribute. open type: boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. tab
index type: integer gets and sets the value of the tab
index attribute. value property gets and sets color attribute methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), ge...
listitem - Archive of obsolete content
the text of the listitem is specified either using listcell elements, or by placing a label attribute directly on the listitem element. by default it contains a single listcell element of type and class appropriate to that of the listitem. more information is available in the xul tutorial. ...
...lement. by default it contains a single listcell element of type and class appropriate to that of the listitem. more information is available in the xul tutorial. attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tab
index, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tab
index, value style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the lab...
... user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selected
index or selecteditem property of the containing element. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: string you can make an item in a listbox a checkbox by setting this attribute to the value checkbox. val...
... url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, c...
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
... it is rendered on a menu. more information is available in the xul tutorial. ...
...is attribute is copied to the menulist.value property upon user selection of the menuitem. name type: string name radio menuitems with the same name as put into a group. only one menuitem in each radio group can be checked at a time. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selected
index or selecteditem property of the containing element. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: one of the values below can be used to create checkable menuitems or for radio button menuitems. checkbo...
...trol. parentcontainer type: menu element read only property that returns the containing menu element, or null if there isn't a containing menu. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. inherited properties align, , allowevents, , boxobject, builder, , , , classn...
menuseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to create a separator between menu items. typically drawn as a thin line. more information is available in the xul tutorial. ...
...ods | related ] used to create a separator between menu items. typically drawn as a thin line. more information is available in the xul tutorial. attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tab
index, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tab
index, value examples <menu label="menu"> <menupopup> <menuitem label="item1"/> <menuseparator/> <menuitem label="item2"/> <menuitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command. if this value is set, it overri...
... label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selected
index or selecteditem property of the containing element. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any sp...
...l. parentcontainer type: menu element read only property that returns the containing menu element, or null if there isn't a containing menu. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
radio - Archive of obsolete content
e selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a label, specified with the label attribute may be added beside the radio button. more information is available in the xul tutorial. ...
...her radio buttons in the same group are turned off. a label, specified with the label attribute may be added beside the radio button. more information is available in the xul tutorial. attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tab
index, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tab
index, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears i...
... label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selected
index or selecteditem property of the containing element. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any sp...
... type: string gets and sets the value of the label attribute. radiogroup type: radiogroup element equivalent to the control property. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
richlistitem - Archive of obsolete content
if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
...: string text used for 'find-as-you-type' (fayt) searching. in situations where the search text is ambiguous or missing, searchlabel can be used to give context to fayt. if searchlabel is not present, fayt falls back to use the label property. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selected
index or selecteditem property of the containing element. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any sp...
...el values. use the child elements directly to set label text. searchlabel type: string gets and sets the value of the searchlabel attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
tab - Archive of obsolete content
roperties | methods | related ] a single tab which should be placed inside a tabs element. the user may click a tab to bring the associated page of the tabbox to the front. more information is available in the xul tutorial. attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tab
index, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image, label, linkedpanel, selected, tab
index, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. ...
...last-tab type: boolean this attribute will be set to true for the last tab. this attribute should not be set manually, but is useful in a theme if the last tab should be styled differently. linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected. if this attribute is not used, the tab will be connected to the panel at the corresponding
index in the tabpanels element that the tab is in its tabs container. however, if this attribute is used, this behavior is overridden, and the tab will always be linked to a specific panel. this might be used to avoid duplication by linking several tabs to one panel with slight differences to the content adjusted in the select event. oncommand type: script code this event handler is called whe...
...until selected" preference, the pending attribute is set on tabs until they get loaded. pinned type: boolean this attribute is set to true if the tab has been pinned (that is, if it's an app tab). the tabbrowser element's pintab and unpintab methods handle pinning and unpinning tabs. selected type: boolean this attribute is set to true if the tab is selected by default. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. unread type: boolean this attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was ...
... and sets the value of the label attribute. linkedpanel type: id of a tabpanel element gets and sets the value of the linkedpanel attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
toolbarbutton - Archive of obsolete content
where possible, provide keyboard alternatives. where possible, duplicate functionality in a menu item or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...usable by -moz-user-focus: normal. ...
...ontally or vertically. the default value depends on the element. you can also use the -moz-box-orient style property. horizontal child elements of the element are placed next to each other in a row in the order that they appear in the xul source. vertical child elements of the element are placed under each other in a column in the order that they appear in the xul source. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. title type: string this functionality only applies when toolbarbutton is used in the customize toolbar dialog. the text that is displayed as a button's label when it's in the customize toolbar...
... the group attribute. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. open type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tab
index type: integer gets and sets the value of the tab
index attribute. type type: string gets and sets the value of the type attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), get...
HTML: A good basis for accessibility - Learn web development
used <button> elements, plus you don't get any of the default css styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). ...
...s styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). ...
...h advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tab
index="0": <div data-message="this is from the first button" tab
index="0">click me!</div> <div data-message="this is from the second button" tab
index="0">click me too!</div> <div data-message="this is from the third button" tab
index="0">and me!</div> basically, the tab
index attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), instead of just being tabbed through in their default source order. this is nearly always a bad idea, as it can cause major confusion. use it only...
...m tab order (specified in positive numerical order), instead of just being tabbed through in their default source order. this is nearly always a bad idea, as it can cause major confusion. use it only if you really need to, for example, if the layout shows things in a very different visual order to the source code, and you want to make things work more logically. there are two other options for tab
index: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable. this is the most useful value of tab
index. tab
index="-1" — this allows not normally tabbable elements to receive focus programmatically, e.g., via javascript, or as the target of links. whilst the above addition allows us to tab to the buttons, it does not allow us to activ...
HTML: A good basis for accessibility - Learn web development
used <button> elements, plus you don't get any of the default css styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). ...
...s styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). ...
...h advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tab
index="0": <div data-message="this is from the first button" tab
index="0">click me!</div> <div data-message="this is from the second button" tab
index="0">click me too!</div> <div data-message="this is from the third button" tab
index="0">and me!</div> basically, the tab
index attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), instead of just being tabbed through in their default source order. this is nearly always a bad idea, as it can cause major confusion. use it only...
...m tab order (specified in positive numerical order), instead of just being tabbed through in their default source order. this is nearly always a bad idea, as it can cause major confusion. use it only if you really need to, for example, if the layout shows things in a very different visual order to the source code, and you want to make things work more logically. there are two other options for tab
index: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable. this is the most useful value of tab
index. tab
index="-1" — this allows not normally tabbable elements to receive focus programmatically, e.g., via javascript, or as the target of links. whilst the above addition allows us to tab to the buttons, it does not allow us to activ...
Dealing with files - Learn web development
t into the habit of writing your folder and file names lowercase with no spaces and with words separated by dashes, at least until you know what you're doing. that way you'll bump into fewer problems later down the road. what structure should your website have? next, let's look at what structure our test site should have. the most common things we'll have on any website project we create are an
index html file and folders to contain images, style files, and script files. let's create these now:
index.html: this file will generally contain your homepage content, that is, the text and images that people see when they first go to your site. using your text editor, create a new file called
index.html and save it just inside your test-site folder. images folder: this folder will contain all th...
...on, unchecking the hide extensions for known file types check box, then clicking ok. for more specific information covering your version of windows, you can search on the web. file paths to make files talk to one another, you have to provide a file path between them — basically a route, so one file knows where another one is. to demonstrate this, we will insert a little bit of html into our
index.html file, and make it display the image you chose in the article "what will your website look like?" copy the image you chose earlier into your images folder. open up your
index.html file, and insert the following code into the file exactly as shown. don't worry about what it all means for now — we'll look at the structures in more detail later in the series. <!doctype html> <html> <he...
...the series. <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my test image"> is the html code that inserts an image into the page. 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 sho...
...e 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 of the path, plus a forward slash, e.g. subdirectory/my-image.jpg. to link to a target file in the directory above the invoking html file, write two dots. so for example, if
index.html was inside a subfolder of test-site and my-image.jpg was inside test-site, you could reference my-image.jpg from
index.html using ../my-image.jpg. you can combine these as much as you like, for example ../subdirectory/another-subdirectory/my-image.jpg. for now, this is about all you need to know. note: the windows file system tends to use backslashes, not forward slashes, e.g. c:\window...
JavaScript basics - Learn web development
our page for creating a hello world! example. (hello world! is the standard for introductory programming examples.) important: if you haven't been following along with the rest of our course, download this example code and use it as a starting point. go to your test site and create a new folder named scripts. within the scripts folder, create a new file called main.js, and save it. in your
index.html file, enter this code on a new line, just before the closing </body> tag: <script src="scripts/main.js"></script> this is doing the same job as the <link> element for css. it applies the javascript to the page, so it can have an effect on the html (along with the css, and anything else on the page). add this code to the main.js file: const myheading = document.queryselector('h1'); my...
.../main.js"></script> this is doing the same job as the <link> element for css. it applies the javascript to the page, so it can have an effect on the html (along with the css, and anything else on the page). add this code to the main.js file: const myheading = document.queryselector('h1'); myheading.textcontent = 'hello world!'; make sure the html and javascript files are saved. then load
index.html in your browser. you should see something like this: note: the reason the instructions (above) place the <script> element near the bottom of the html file is that the browser reads code in the order it appears in the file. if the javascript loads first and it is supposed to affect the html that hasn't loaded yet, there could be problems. placing javascript near the bottom of an html page...
...now when you click the image, it should change to the other one. this is what happened. you stored a reference to your <img> element in the myimage variable. next, you made this variable's onclick event handler property equal to a function with no name (an "anonymous" function). so every time this element is clicked: the code retrieves the value of the image's src attrib...
...the original state. adding a personalized welcome message next, let's change the page title to a personalized welcome message when the user first visits the site. this welcome message will persist. should the user leave the site and return later, we will save the message using the web storage api. we will also include an option to change the user, and therefore, the welcome message. in
index.html, add the following line just before the <script> element: <button>change user</button> in main.js, place the following code at the bottom of the file, exactly as it is written. this takes references to the new button and the heading, storing each inside variables: let mybutton = document.queryselector('button'); let myheading = document.queryselector('h1'); add the function below ...
Video and Audio APIs - Learn web development
ing: getting started to get started with this example, download our media-player-start.zip and unzip it into a new directory on your hard drive. if you downloaded our examples repo, you'll find it in javascript/apis/video-audio/start/ at this point, if you load the html you should see a perfectly normal html5 video player, with the native controls rendered. exploring the html open the html
index file. you'll see a number of features; the html is dominated by the video player and its controls: <div class="player"> <video controls> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <!-- fallback content here --> </video> <div class="controls"> <button class="play" data-icon="p" aria-label="play pause toggle...
...es to style them — like color and text-shadow. last but not least, let's look at the css for the timer: .timer { line-height: 38px; font-size: 10px; font-family: monospace; text-shadow: 1px 1px 0px black; color: white; flex: 5; position: relative; } .timer div { position: absolute; background-color: rgba(255,255,255,0.2); left: 0; top: 0; width: 0; height: 38px; z-
index: 2; } .timer span { position: absolute; z-
index: 3; left: 19px; } we set the outer .timer <div> to have flex: 5, so it takes up most of the width of the controls bar. we also give it position: relative, so that we can position elements inside it conveniently according to it's boundaries, and not the boundaries of the <body> element. the inner <div> is absolutely positioned to sit direc...
...lement. the inner <div> is absolutely positioned to sit directly on top of the outer <div>. it is also given an initial width of 0, so you can't see it at all. as the video plays, the width will be increased via javascript as the video elapses. the <span> is also absolutely positioned to sit near the left hand side of the timer bar. we also give our inner <div> and <span> the right amount of z-
index so that the timer will be displayed on top, and the inner <div> below that. this way, we make sure we can see all the information — one box is not obscuring another. implementing the javascript we've got a fairly complete html and css interface already; now we just need to wire up all the buttons to get the controls working. create a new javascript file in the same directory level as y...
...that the timer will be displayed on top, and the inner <div> below that. this way, we make sure we can see all the information — one box is not obscuring another. implementing the javascript we've got a fairly complete html and css interface already; now we just need to wire up all the buttons to get the controls working. create a new javascript file in the same directory level as your
index.html file. call it custom-player.js. at the top of this file, insert the following code: const media = document.queryselector('video'); const controls = document.queryselector('.controls'); const play = document.queryselector('.play'); const stop = document.queryselector('.stop'); const rwd = document.queryselector('.rwd'); const fwd = document.queryselector('.fwd'); const timerwrapper...
Server-side web frameworks - Learn web development
ode rather than lower level networking primitives. the example below shows how this works in the django (python) web framework. every "view" function (a request handler) receives an httprequest object containing request information, and is required to return an httpresponse object with the formatted output (in this case a string). # django view function from django.http import httpresponse def
index(request): # get an httprequest (request) # perform operations using information from the request. # return httpresponse return httpresponse('output string to return') route requests to the appropriate handler most sites will provide a number of different resources, accessible through distinct urls. handling these all in one function would be hard to maintain, so web frameworks ...
...having to change the underlying code. different frameworks use different mechanisms for the mapping. for example, the flask (python) web framework adds routes to view functions using a decorator. @app.route("/") def hello(): return "hello world!" while django expects developers to define a list of url mappings between a url pattern and a view function. urlpatterns = [ url(r'^$', views.
index), # example: /best/myteamname/5/ url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways. an http get request to get files or data from the server may encode what data is required in url parameters or within the url structure. an http post request to update a resour...
...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 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 s...
...is works. continuing the "youngest team" example from the previous section, the html template is passed a list variable called youngest_teams by the view. inside the html skeleton we have an expression that first checks if the youngest_teams variable exists, and then iterates it in a for loop. on each iteration the template displays the team's team_name value in a list item. ...
Getting started with Svelte - Learn web development
or you when changes are made to the source files. your browser will display something like this: application structure the starter template comes with the following structure: moz-todo-svelte ├── readme.md ├── package.json ├── package-lock.json ├── rollup.config.js ├── .gitignore ├── node_modules ├── public │ ├── favicon.ico │ ├──
index.html │ ├── global.css │ └── build │ ├── bundle.css │ ├── bundle.css.map │ ├── bundle.js │ └── bundle.js.map └── src ├── app.svelte └── main.js the contents are as follows: package.json and package-lock.json: contains information about the project that node.js/npm uses to keep it organized. yo...
...is the top-level component of your app. so far it just renders the 'hello world!' message. main.js: the entry point to our application. it just instantiates the app component and binds it to the body of our html page. public: this directory contains all the files that will be published in production. favicon.png: this is the favicon for your app. currently, it's the svelte logo.
index.html: this is the main page of your app. initially it's just an empty html5 page that loads the css files and js bundles generated by svelte. global.css: this file contains unscoped styles. it's a regular css file that will be applied to the whole application. build: this folder contains the generated css and javascript source code. bundle.css: the css file that svelte generated f...
...e to make all these files work together nicely? the svelte compiler processes the <style> section of every component and compiles them into the public/build/bundle.css file. it also compiles the markup and <script> section of every component and stores the result in public/build/bundle.js. it also adds the code in src/main.js to reference the features of each component. ...
...' href='/global.css'> <link rel='stylesheet' href='/build/bundle.css'> <script defer src='/build/bundle.js'></script> </head> <body> </body> </html> the minified version of bundle.js weighs a little more than 3kb, which includes the "svelte runtime" (just 300 lines of javascript code) and the app.svelte compiled component. as you can see, bundle.js is the only javascript file referenced by
index.html. there are no other libraries loaded into the web page. this is a much smaller footprint than compiled bundles from other frameworks. take into account that, in the case of code bundles, it's not just the size of the files you have to download that matter. this is executable code that needs to be parsed, executed, and kept in memory. so this really makes a difference, especially in low-powe...
Introduction to automated testing - Learn web development
questions have been asked, it will ask you if the information entered is ok. type yes and press enter/return and npm will generate a package.json file in your directory. this file is basically a config file for the project. you can customize it later, but for now it'll look something like this: { "name": "node-test", "version": "1.0.0", "description": "test for npm projects", "main": "
index.js", "scripts": { "test": "test" }, "author": "chris mills", "license": "mit" } with this, you are ready to move on. setting up gulp automation let's look at setting up gulp and using it to automate some testing tools. to begin with, create a test npm project using the procedure detailed at the bottom of the previous section. next, you'll need some sample html, css and javascri...
...mills", "license": "mit" } with this, you are ready to move on. setting up gulp automation let's look at setting up gulp and using it to automate some testing tools. to begin with, create a test npm project using the procedure detailed at the bottom of the previous section. next, you'll need some sample html, css and javascript content to test your system on — make copies of our sample
index.html, main.js, and style.css files in a subfolder with the name src inside your project folder. you can try your own test content if you like, but bear in mind that such tools won't work on internal js/css — you need external files. first, install gulp globally (meaning, it will be available across all projects) using the following command: npm install --global gulp-cli next, run the foll...
...e-dev gulp-htmltidy note: --save-dev adds the package as a dependency to your project. if you look in your project's package.json file, you'll see an entry for it in the devdependencies property. add the following dependency to gulpfile.js: const htmltidy = require('gulp-htmltidy'); add the following test to the bottom of gulpfile.js: function html(cb) { return gulp.src('src/
index.html') .pipe(htmltidy()) .pipe(gulp.dest('build')); cb(); } here we are grabbing our development
index.html file with gulp.src(), which allows us to grab a source file to do something with. we next use the pipe() function to pass that source to another command to do something else with. we can chain as many of these together as we want. we first run htmltidy() on the sou...
... if you get errors, check that you've added all the dependencies and the tests as shown above; also try commenting out the html/css/javascript code sections and then rerunning gulp to see if you can isolate what the problem is. gulp comes with a watch() function that you can use to watch your files and run tests whenever you save a file. for example, try adding the foll...
Accessibility API cross-reference
a n/a a dialog or message box. dialog dialog dialog dialog <dialog> a list of references to members of a group, such as a static table of contents. directory see <nav> if it really is a table of contents, use <toc> containing <toci> elements (which are wrappers for internal hyperlinks in such a table). for an
index, use <
index> with a <l>(list) inside. no default semantics in html, but semantics and other accessibility features may be provided with aria. see also span n/a n/a n/a <div> <div> but if you need custom semantic structure, use <nonstruct> instead window that corresponds to an mdi document. in aria, used to nest browsable rich text content inside in...
...e.g., tooltips may be drawn on the glass pane layer. glass_pane glass_pane n/a multiple adjacent panes that can be sized relative to each other by dragging a grippy on their border split_pane split_pane n/a an object that can be drawn into and is used to trap events. n/a n/a ...
...sy busy busy aria-busy indicates the current "checked" state of checkboxes, radio buttons, and other widgets. checked checked checked aria-checked checked (boolean attribute) defines the total number of columns in a table, grid, or treegrid. n/a n/a aria-colcount defines an element's column
index or position with respect to the total number of columns within a table, grid, or treegrid. n/a n/a aria-col
index defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. n/a n/a aria-colspan identifies the element (or elements) whose contents or presence are controlled by the current ...
...niques available n/a n/a aria-flowto indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. supported for anything that's not a menu is poor n/a n/a aria-haspopup the item can get the keyboard focus focusable focusable focusable tab
index attribute with value of 0 or more the item has focus for text input. for other kinds of keyboard operation, e.g. ui controls, see armed focused focused focused available to javascript as document.activeelement appearance has changed for mouseover hottracked n/a n/a especially used for sliders, scrollbars, ...
PR_EnumerateHostEnt
to begin an enumeration, this argument is set to zero. to continue an enumeration (thereby getting successive addresses from the host entry structure), the value should be set to the function's last returned value. ...
...to begin an enumeration, this argument is set to zero. to continue an enumeration (thereby getting successive addresses from the host entry structure), the value should be set to the function's last returned value. ...
...to begin an enumeration, this argument is set to zero. to continue an enumeration (thereby getting successive addresses from the host entry structure), the value should be set to the function's last returned value. ...
...rt number to be assigned as part of the prnetaddr structure. this parameter is not checked for validity. address on input, a pointer to a prnetaddr structure. on output, this structure is filled in by the runtime if the result of the call is greater than 0. returns the function returns one of the following values: if successful, the function returns the value you should specify in the enum
index parameter for the next call of the enumerator. if the function returns 0, the enumeration is ended. if unsuccessful, the function returns -1. you can retrieve the reason for the failure by calling pr_geterror. description pr_enumeratehostent is a stateless enumerator. the principle input, the prhostent structure, is not modified. ...
Python binding for NSS
ble via the numerous python documentation extraction tools. also see the generated html documentation provided with each release. nss/nspr structs are exposed as python objects. nss/nspr functions which operate on a nss/nspr object (i.e. struct) become methods of that object. nss/nspr objects which are collections support the python iteration protocol. in other words they can be iterated over,
indexed by position, or used as slices. nss/nspr objects whose collection elements can be referenced by name support associative
indexing. nss/nspr objects which have "get" and "set" api function calls are exposed as python properties. all nss/nspr python objects can print their current value by evaluting the python object in a string context or by using the python str() function. support threading...
...ckets if a port is appended to it, the bracketed hex address with appended with a port is unappropriate in some circumstances, hence the new address property to permit either the address string with a port or without a port. fix the implementation of the networkaddress.family property, it was returning bogus data due to wrong native data size. hostentry objects now support iteration and
indexing of their networkaddress members. add io.addr_family_name() function to return string representation of pr_af_* constants. modify example and test code to utilize addrinfo instead of deprecated networkaddress functionality. add address family command argument to ssl_example. fix pty import statement in test/setup_certs.py deprecated functionality networkaddre...
...ess objects can support both ipv4 and ipv6, but a hostentry object can only support ipv4. plus the implementation depdended on being able to perform a reverse dns lookup which is not always possible. hostentry.get_network_addresses() and hostentry.get_network_address() are now deprecated. in addition their port parameter is now no longer respected. hostentry objects now support iteration and
indexing of their networkaddress and that should be used to access their networkaddress objects instead. internal changes utilize pr_netaddrfamily() access macro instead of explict access. add prnetaddr_port() utility to hide host vs. network byte order requirements when accessing the port inside a prnetaddr and simplify accessing the ipv4 vs. ipv6 port variants. replace ...
...() nss.nss.sec_oid_tag_name() nss.nss.sec_oid_tag_str() the following files were added: doc/examples/cert_dump.py test/test_cert_components.py release 0.8.0 release date 2009-09-21 scm tag pynss_release_0_8_0 source download change log general modifications: secitem's now support
indexing and slicing on their data clean up parsing and parameter validation of variable arg functions the following were added: secitem.type secitem.len secitem.data pk11symkey.key_data pk11symkey.key_length pk11symkey.slot create_context_by_sym_key param_from_iv generate_new_param get_iv_length get_block_size get_pad_mechanis...
Property cache
has a setter and not a getter; or vice versa. lookups for jof_name instructions are quite different from ordinary property lookups: name lookups follow the scope chain and the prototype chain, whereas the others only follow the prototype chain. there are two different types of property cache entry. non-adding cache entries {.kpc=pc, .kshape=kshape, .vshape()=vshape, .scope
index()=scope
index, .proto
index()=proto
index, .vword=vword} this type of entry is created for all instructions that use the property cache. when the operand to the instruction at pc is an object obj with shape kshape, let pobj = the object found by walking scope
index steps up the parent chain and then proto
index steps up the prototype chain. if pobj exists (that is, both the parent chain an...
...dowed. the two shadowing guarantees ensure that if this happens, the shape of pobj changes, invalidating the entry. setting. for jof_set instructions, this makes two additional guarantees: first, vword.issprop(); second, the correct behavior is to set the property described by vword.tosprop(), rather than to shadow it with a new own property. teleportation. the jit handles situations where scope
index ≠ 0 or proto
index > 1 specially. it walks the scope chain and prototype chain as described above only once, at compile time, and emits code containing the pointer to the object that contains the property. the emitted code guards on the identity of the object to search. then it guards on the shape of the object containing the property. if both guards pass, there is no need to walk the chain. the...
...ing the pointer to the object that contains the property. the emitted code guards on the identity of the object to search. then it guards on the shape of the object containing the property. if both guards pass, there is no need to walk the chain. the jit code "teleports" directly to the appropriate object. adding cache entries {.kpc=pc, .kshape=kshape, .vshape()=vshape, .scope
index()=0, .proto
index()=0, .vword=vword} where kshape != vshape this type of entry is only created for jsop_setprop and jsop_setname instructions that create a new property. when the operand to the instruction at pc is an object obj with shape kshape, and rt->protohazardshape == vshape, the lookup can be skipped. it is guaranteed that obj does not have an own property with the desired...
...applies. a cache hit of this type saves a property lookup, but the interpreter still has to examine vword.toshape() to determine what to do next. vword.isslot() the property has a slot which the interpreter can read directly. this special kind of entry is used only for jof_get instructions and only when the property has a stub getter and has a slot (i.e. it is not jsprop_shared). the slot
index is vword.toslot(). vword.isobject() the property has a stub getter and its value is vword.toobject(). this special kind of entry is used only for jof_call instructions and only when the result is a function. it helps the jit avoid extra loads and guards when calling methods. branded scopes exist to support this case. when a property cache entry of this type is created, the scope of the ...
JS_ExecuteRegExp
execute a new regexp object to given input string. syntax bool js_executeregexp(jscontext *cx, js::handleobject obj, js::handleobject reobj, char16_t *chars, size_t length, size_t *
indexp, bool test, js::mutablehandlevalue rval); bool js_executeregexpnostatics(jscontext *cx, js::handleobject reobj, char16_t *chars, size_t length, size_t *
indexp, bool test, js::mutablehandlevalue rval); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. reobj js::handleobject ...
...uires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. reobj js::handleobject a pointer to a regexp object. chars const char16_t * a pointer to the string contains a input string. length size_t the length of bytes or chars, in characters.
indexp size_t * in/out parameter. a pointer to the last
index for the execution, and received the updated last
index. test bool pass true to avoid creating match result array and store boolean value to rval. rval js::mutablehandlevalue out parameter. receives the result match result array or boolean value. description js_executeregexp and js_newregexpobjectnostat...
... if test is false, js_executeregexp and js_newregexpobjectnostatics store the match result array to *rval if matches, otherwise stores null to *rval. if test is true, js_executeregexp and js_newregexpobjectnostatics store the boolean value true to *rval if matches, otherwise stores null to *rval. js_executeregexp updates the built-in regexp object's properties. ...
... if test is false, js_executeregexp and js_newregexpobjectnostatics store the match result array to *rval if matches, otherwise stores null to *rval. if test is true, js_executeregexp and js_newregexpobjectnostatics store the boolean value true to *rval if matches, otherwise stores null to *rval. js_executeregexp updates the built-in regexp object's properties. ...
Parser API
functions interface function <: node { id: identifier | null; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blocksta...
... functions interface function <: node { id: identifier | null; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blockstatement | expression; generat...
...k | comprehensionif ]; filter: expression | null; } a generator expression. as with array comprehensions, the blocks array corresponds to the sequence of for and for each blocks, and the optional filter expression corresponds to the final if clause, if present. note: generator expressions are spidermonkey-specific. interface graphexpression <: expression { type: "graphexpression";
index: uint32; expression: literal; } a graph expression, aka "sharp literal," such as #1={ self: #1# }. note: graph expressions are spidermonkey-specific. interface graph
indexexpression <: expression { type: "graph
indexexpression";
index: uint32; } a graph
index expression, aka "sharp variable," such as #1#. note: graph
index expressions are spidermonkey-specific. interface letexpr...
...celocation returns: customexpression callback to produce a custom array expression node. objectexpression(props[, loc]) props: [ customobjectproperty ] loc: sourcelocation returns: customexpression callback to produce a custom object expression node. thisexpression([loc]) loc: sourcelocation returns: customexpression callback to produce a custom this expression node. graphexpression(
index, expr[, loc])
index: uint32 >= 1 expr: customexpression loc: sourcelocation returns: customexpression callback to produce a custom graph expression node. graph
indexexpression(
index[, loc])
index: uint32 >= 1 loc: sourcelocation returns: customexpression callback to produce a custom graph
index expression node. comprehensionexpression(body, blocks, filter[, loc]) body: customexpression ...
imgIContainer
flags); native code only! void frameupdated(in unsigned long framenum, in nsintrect anewrect); native code only! obsolete since gecko 2.0 void getcurrentframerect(in nsintrect aframerect); native code only! obsolete since gecko 2.0 gfxasurface getframe(in pruint32 awhichframe, in pruint32 aflags); native code only! gfxiimageframe getframeat(in unsigned long
index); obsolete since gecko 1.9.2 void getframecolormap(in unsigned long framenumber, [array, size_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); obsolete since gecko 2.0 unsigned long getframeimagedatalength(in unsigned long framenumber); obsolete since gecko 2.0 imagecontainer getimagecontainer(); native code only! nsiframe getro...
...ons thrown ns_error_not_available if the animated state cannot be determined. animationmode unsigned short currentframe gfxasurface get a surface for the current frame. this may be a platform-native, optimized frame, so you cannot inspect its pixel data. read only. native code only! obsolete since gecko 2.0 currentframe
index unsigned long the
index of the current frame that would be drawn if the image was to be drawn now. read only. obsolete since gecko 2.0 currentframeisopaque boolean whether the current frame is opaque; that is, needs the background painted behind it. read only. height print32 the height of the container rectangle. in the case of any error, zero is returned, an...
...s framenumber missing description exceptions thrown missing exception missing description native code only!ensurecleanframe obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. create or reuse a frame at
index aframenum. it is an error to call this with aframenum not in the range [0, numframes]. void ensurecleanframe( in unsigned long aframenum, in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength ); parameters aframenum missing description ax m...
..., in pruint32 aflags ); parameters awhichframe frame specifier of the frame_* variety. aflags flags of the flag_* variety. return value missing description exceptions thrown missing exception missing description getframeat() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) gfxiimageframe getframeat( in unsigned long
index ); parameters
index missing description return value missing description exceptions thrown missing exception missing description getframecolormap() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. vo...
nsICommandLine
linehandler interface to add custom command line handling behavior. definitions arguments any values found on the command line. switches flags. in normalized form, these are preceded by a single dash. some flags may take parameters; for example: "-url <param>" or "-install-xpi <param>". method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long a
index); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line. the applicati...
...command line. long findflag( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to locate. do not include the initial hyphen. acasesensitive whether to do case-sensitive comparisons. ...
...) gets the value an argument from the array of command-line arguments, given the
index into the argument list. on windows, flags of the form /flag are normalized to -flag. /flag:param are normalized to -flag param. on unix/linux and mac os x, flags of the form --flag are normalized to -flag, and flags of the form --flag=param are normalized to the form -flag param. astring getargument( in long a
index ); parameters a
index the argument to retrieve. this
index is 0-based, and does not include the application name. return value the value of the specified argument. this is the full text of that argument, so if the argument is a flag, the returned value is "-flag [<flagvalue>]". exceptions thrown ns_error_invalid_arg the specified
index is out of bounds. handleflag() finds the specified flag, ...
...lag, an empty string if the flag's value is the empty string, or null if the specified parameter wasn't found. exceptions thrown ns_error_invalid_arg the specified flag has no value. removearguments() removes a range of arguments from the command line; this is typically done once those arguments have been handled. void removearguments( in long astart, in long aend ); parameters astart the
index to the first argument to remove from the command line; this is 0-based, and the name of the application is not included. aend the
index to the last argument to remove from the command line. resolvefile() resolves a file-path argument into an nsifile object. this method gracefully handles relative or absolute file paths, according to the working directory of this command line. nsifile resolvefile...
nsIDOMHTMLTimeRanges
the nsidomhtmltimeranges interface represents a set of time ranges in media; it's primarily used by the nsidomhtmlmediaelement interface, and implements the dom timeranges interface. each time range represented by an nsidomhtmltimeranges object has an
index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the
index number of the range to look up. dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article. ...
...x number; you call the start() and end() methods to obtain the start and end times of each range, specifying the
index number of the range to look up. dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article. last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long
index); float end(in unsigned long
index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object. read only. methods end() returns the time offset to the end of the specified time range. float end( in unsigned long
index ); parameters
index the
index to the time range whose end time is to be returned. return ...
...sidomhtmltimeranges object. read only. methods end() returns the time offset to the end of the specified time range. float end( in unsigned long
index ); parameters
index the
index to the time range whose end time is to be returned. return value the time at which the specified range ends, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown
index_size_err the specified
index is not valid. start() returns the time offset to the start of the specified time range. float start( in unsigned long
index ); parameters
index the
index to the time range whose start time is to be returned. return value the time at which the specified range starts, in seconds measured from the beginning of the timeline represented by the object. exceptions thro...
...e_err the specified
index is not valid. start() returns the time offset to the start of the specified time range. float start( in unsigned long
index ); parameters
index the
index to the time range whose start time is to be returned. return value the time at which the specified range starts, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown
index_size_err the specified
index is not valid. ...
nsINavHistoryResultViewObserver
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface is used by clients of the history results to define domain-specific handling of specific nsitreeview methods that the history result doesn't implement. ...
...his interface is used by clients of the history results to define domain-specific handling of specific nsitreeview methods that the history result doesn't implement. ...
... candrop() implement this method to report whether or not a drop is permitted onto the specified location. to provide behavior similar to the folder pane in thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't drop_on. warning: do not change the content of the observer list. boolean candrop( in long
index, in long orientation ); parameters
index the item over which the drag is currently located. orientation whether the drag target is before, after, or on the indicated row. return value return true if the drop is permitted or false if it isn't. ondrop() called when the user drops something onto the view being observed. void ondrop( in long row, in long orientation ); ...
... drops something onto the view being observed. void ondrop( in long row, in long orientation ); parameters row the row at which the drop occurred. orientation drop_before, drop_on, or drop_after, indicating whether the drop destination is before, on, or after the target row. ontoggleopenstate() called when an item is opened or closed. void ontoggleopenstate( in long
index ); parameters
index the item being toggled. oncycleheader() called when a header is clicked. void oncycleheader( in nsitreecolumn column ); parameters column the column whose header was clicked. oncyclecell() called when a cell in a non-selectable cycling column (such as unread or flagged in thunderbird) is clicked. void oncyclecell( in long row, in nsitreecolum...
nsIPromptService
sg text to appear with the checkbox. null if no checkbox is displayed. acheckstate contains the initial checked state of the checkbox when this method is called and the final checked state after this method returns. if you call this method from javascript you need to wrap this argument in an object with its 'value' property set to a boolean (or use an empty object). return value
index of the button pressed prompt() shows a dialog with an edit field and an optional, labeled checkbox. see also the prompt_example. boolean prompt( in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheckstate ); parameters aparent the parent window for the dialog. if set to null the parent window will...
...utselection ); aparent the parent window for the dialog. if set to null the parent window will be nsiwindowwatcher.activewindow. adialogtitle text to appear in the title of the dialog. atext text to appear in the body of the dialog. acount length of the aselectlist array parameter. aselectlist list of strings to display. aoutselection contains the
index of the selected item in the list when this method returns true. if you call this method from javascript, this argument is wrapped in an object with an attribute named 'value' which holds the selected
index. return value true for ok, false for cancel example code alert example alert displays a simple dialog. var prompts = components.classes["@mozilla.org/embedcomp/prompt-service;1"] ...
...pts.button_title_cancel; // this value of flags will create 3 buttons. the first will be "save", the // second will be the value of abuttontitle1, and the third will be "cancel" var button = prompts.confirmex(null, "title of this dialog", "what do you want to do?", flags, "", "button 1", "", null, check); // the checkbox will be hidden, and button will contain the
index of the button pressed, // 0, 1, or 2. prompt example prompt displays a dialog with an edit field. var prompts = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); var check = {value: false}; // default the checkbox to false var input = {value: "bob"}; // default the edit fi...
...get the item using items[selected.value]. see also nsiprompt working with out parameters ...
Xptcall Porting Guide
ee to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... ...
...se md directory for their given platforms and to integrate into the build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokeby
index(nsisupports* that, pruint32 method
index, pruint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs. these are discriminated unions describing the type and value of each parameter of the target function. the platform specific code then builds a call frame and invokes the method indicated by the
index method
index on the xpcom interface that. here are examples of ...
... this class.. #include "xptcstubsdecl.inc" // the following methods must be provided by inheritor of this class. ...
...nt than speed optimizations. this code is primarily used to connect xpcom components with javascript; function call overhead is a tiny part of the time involved. i put together xptcall/src/md/test as a place to evolve the basic functionality as a port is coming together. not all of the functionality is exercised, but it is a place to get started. xptcall/tests has an api level test for ns_invokeby
index, but no tests for the stubs functionality. such a test ought to be written, but this has not yet been done. a full 'test' at this point requires building the client and running the xpconnect test called testxpc in mozilla/js/src/xpconnect/tests. getting these ports done is very important. please let me know if you are interested in doing one. i'll answer any questions as i get them. porting statu...
Gloda examples
age query for more examples. ...
...t assuming that you have a message (glodamessage) in the conversation already, this is straight forward using glodamessage.conversation.getmessagescollection() alistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(conversation_coll) { try { for (var conv...
...{}); query.tags(...tagarray); let collection = query.getcollection(mylistener); search messages by daterange searches for all messages within a date range id_q=gloda.newquery(gloda.noun_message); // define a date range form yesterday to now id_q.daterange([new date() - 86400000, new date()]); var mylistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* call...
... id = id_coll.items[0]; //now we use the identity to find all messages that person was involved with msg_q=gloda.newquery(gloda.noun_message) msg_q.involves(id) msg_q.getcollection({ /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items...
DataTransfer - Web APIs
ame position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer.mozcleardataat() removes the data associated with the given format for an item at the specified
index. the
index is in the range from zero to the number of items minus one. removed in firefox 71. datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the specified
index, or null if it does not exist. the
index should be in the range from zero to the number of items minus one. removed in firefox 71. datatransfer.mozsetdataat() a data transfer may sto...
...umber of items minus one. removed in firefox 71. datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the specified
index, or null if it does not exist. the
index should be in the range from zero to the number of items minus one. removed in firefox 71. datatransfer.mozsetdataat() a data transfer may store multiple items, each at a given zero-based
index. mozsetdataat() may only be called with an
index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. ...
...removed in firefox 71. examples every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example. ...
...removed in firefox 71. examples every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example. ...
Introduction to the DOM - Web APIs
an html document, elements are further enhanced by the html dom api's htmlelement interface as well as other interfaces describing capabilities of specific kinds of elements (for instance, htmltableelement for <table> elements). nodelist a nodelist is an array of elements, like the kind that is returned by the method document.getelementsbytagname(). items in a nodelist are accessed by
index in either of two ways: list.item(1) list[1] these two are equivalent. in the first, item() is the single method on the nodelist object. the latter uses the typical array syntax to fetch the second item in the list. attribute when an attribute is returned by a member (e.g., by the createattribute() method), it is an object reference that exposes a special (albei...
...in the list. attribute when an attribute is returned by a member (e.g., by the createattribute() method), it is an object reference that exposes a special (albeit small) interface for attributes. attributes are nodes in the dom just like elements are, though you may rarely use them as such. namednodemap a namednodemap is like an array, but the items are accessed by name or
index, though this latter case is merely a convenience for enumeration, as they are in no particular order in the list. a namednodemap has an item() method for this purpose, and you can also add and remove items from a namednodemap. there are also some common terminology considerations to keep in mind. it's common to refer to any attribute node as simply an attribute, for example, and to refer t...
... necessary. ...
...div style="margin: .5in; height: 400px;"> <p><b><tt>text</tt></b></p> <form> <select onchange="setbodyattr('text', this.options[this.selected
index].value);"> <option value="black">black</option> <option value="red">red</option> </select> <p><b><tt>bgcolor</tt></b></p> <select onchange="setbodyattr('bgcolor', this.options[this.selected
index].value);"> <option value="white">white</option> <option value="lightgrey">gray</option> </select> <p><b><tt>link</tt></b></p> <select onchange="setbodyattr('link', this.options[this.selected
index].value);"> <option value="blue">blue</option> <option value="green">green</option> </select> <small> <a href="http://some.web...
FileHandle API - Web APIs
api overview this api is based on the following interfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces. ...
...erfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces. basic operations create a filehandle because the intent is to allow the storage of files through
indexeddb, creating a filehandle instance requires an
indexeddb database. var idbreq =
indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an optional type. both...
...formation (as well as the date of its last modification) can be retrieved through the lockedfile.getmetadata() method. ...
...function () { console.log('oups :( unable to read a 1gb file') } file storage when a file handle is created, the associated file only exists as a "temporary file" as long as you hold the filehandle instance. if you want a file to survive a page refresh/app relaunch, you need to store the handle in a database (not necessarily the one used to create the filehandle object). ...
HTMLTableElement - Web APIs
the element. if none is found, a new one is created and inserted in the tree as the first child of the <table> element. htmltableelement.deletecaption() removes the first <caption> that is a child of the element. htmltableelement.insertrow() returns an htmltablerowelement representing a new row of the table. ...
...serted in the tree as the first child of the <table> element. htmltableelement.deletecaption() removes the first <caption> that is a child of the element. htmltableelement.insertrow() returns an htmltablerowelement representing a new row of the table. it inserts it in the rows collection immediately before the <tr> element at the given
index position. if necessary a <tbody> is created. if the
index is -1, the new row is appended to the collection. ...
...htmltableelement.deletecaption() removes the first <caption> that is a child of the element. htmltableelement.insertrow() returns an htmltablerowelement representing a new row of the table. it inserts it in the rows collection immediately before the <tr> element at the given
index position. if necessary a <tbody> is created. if the
index is -1, the new row is appended to the collection. ...
...nt.insertrow() returns an htmltablerowelement representing a new row of the table. it inserts it in the rows collection immediately before the <tr> element at the given
index position. if necessary a <tbody> is created. if the
index is -1, the new row is appended to the collection. if the
index is smaller than -1 or greater than the number of rows in the collection, a domexception with the value
indexsizeerror is raised. htmltableelement.deleterow() removes the row corresponding to the
index given in parameter. if the
index value is -1 the last row is removed; if it smaller than -1 or greater than the amount of rows in the collection, a domexception with the value
indexsizeerror is raised. specifications specification status comment html living standardthe defi...
HTMLTextAreaElement - Web APIs
the number of visible text lines for the control. selectiondirection string: returns / sets the direction in which selection occurred. this is "forward" if selection was performed in the start-to-end direction of the current locale, or "backward" for the opposite direction. this can also be "none" if the direction is unknown. selectionend unsigned long: returns / sets the
index of the end of selected text. if no text is selected, contains the
index of the character that follows the input cursor. on being set, the control behaves as if setselectionrange() had been called with this as the second argument, and selectionstart as the first argument. selectionstart unsigned long: returns / sets the
index of the beginning of selected text. if no text is selected, c...
...of selected text. if no text is selected, contains the
index of the character that follows the input cursor. on being set, the control behaves as if setselectionrange() had been called with this as the second argument, and selectionstart as the first argument. selectionstart unsigned long: returns / sets the
index of the beginning of selected text. if no text is selected, contains the
index of the character that follows the input cursor. on being set, the control behaves as if setselectionrange() had been called with this as the first argument, and selectionend as the second argument. tab
index long: returns / sets the position of the element in the tabbing navigation order for the current document. textlength read only long: returns the codepoint length of t...
... for constraint validation. false if any conditions bar it from constraint validation, including its readonly or disabled property is true. wrap string: returns / sets the wrap html attribute, indicating how the control wraps text. htmltextareaelement.labelsread only nodelist: returns a list of label elements associated with this element. the two properties tab
index and accesskey are inherited from htmlelement from html5 on, but were defined on htmltextareaelement in dom level 2 html and earlier specifications. methods blur() removes focus from the control; keystrokes will subsequently go nowhere. focus() gives focus to the control; keystrokes will subsequently go to this element. select() selects the contents of the con...
...ss="return checkrows(this, event);" onpaste="return false;"></textarea> </p> </form> specifications specification status comment html living standardthe definition of 'htmltextareaelement' in that specification. living standard html5the definition of 'htmltextareaelement' in that specification. recommendation the attributes tab
index and accesskey, as well as the methods blur() and focus() are now defined on htmlelement. the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(), and se...
IDBCursor.delete() - Web APIs
the delete() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. once the record is deleted, the cursor's value is set to null. be aware that you can't call delete() (or idbcursor.update()) on cursors obtained from idb
index.openkeycursor(). for such needs, you have to use idb
index.opencursor() instead. note: this feature is available in web workers. syntax myidbcursor.delete(); returns an idbrequest object on which subsequent events related to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror t...
...elated to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read-only. invalidstateerror the cursor was created using idb
index.openkeycursor, is currently being iterated, or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "grace under pressure", we delete that entire record using var request = cursor.delete();. the cursor does not requi...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compa...
...nnerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); } cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'delete()' in that specification. recommendation
indexed database api draftthe definition of 'delete()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
IDBCursor.update() - Web APIs
the update() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. if the cursor points to a record that has just been deleted, a new record is created. be aware that you can't call update() (or idbcursor.delete()) on cursors obtained from idb
index.openkeycursor(). for such needs, you have to use idb
index.opencursor() instead. note: this feature is available in web workers. syntax var anidbrequest = myidbcursor.update(value); parameters value the new value to be stored at the current position. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: ...
...equest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idb
index.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the object store's key path does not match the key in this cursor's position. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. example in thi...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-com...
...listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'update()' in that specification. recommendation
indexed database api draftthe definition of 'update()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
IDBDatabase: close event - Web APIs
database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
...nd listens for the close event: // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('close...
...th', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('close', () => { console.log('database connection closed'); }); }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...pgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onclose = () => { console.log('database connection closed'); }; }; ...
IDBDatabase.deleteObjectStore() - Web APIs
as with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction. note: this feature is available in web workers. syntax dbinstance.deleteobjectstore(name); parameters name the name of the object store you want to delete. ...
...se that doesn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror you are trying to delete an object store that does not exist. names are case sensitive. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
...esult; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specification specification status comment
indexed database api 2.0the definition of 'deleteobjectstore()' in that specification. recommendation
indexed database api draftthe definition of 'deleteobjectstore()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafarian...
IDBDatabase: error event - Web APIs
ction object. ...
...iven tasktitle already exists): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10...
...em.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...pgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.onerror = () => { console.log(`error adding ...
IDBDatabase.transaction() - Web APIs
n't be specified here. if you don't provide the parameter, the default access mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40,
indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other
indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potent...
... note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.
indexeddb.experimental pref is set to true in about:config. details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase ins...
...e for the mode parameter is invalid. invalidaccesserror the function was called with an empty list of store names. example in this example we open a database connection, then use transaction() to open a transaction on the database. for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // open a r...
...d: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // you would then go on to do something to this database // via an object store var objectstore = transaction.objectstore("todolist"); // etc. specification specification status comment
indexed database api 2.0the definition of 'transaction()' in that specification. recommendation
indexed database api draftthe definition of 'transaction()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/brow...
IDBDatabase: versionchange event - Web APIs
red when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. ...
...ds a listener to versionchange: // open the database const dbopenrequest = window.
indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event => { const db = event.target.result; db.addeventlis...
... }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event => { const db = event.target.result; db.addeventlistener('versionchange', event => { console.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.
indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = event.target.result; db.onversionchange = event => { console.log('the version of this database has changed'); }; }; ...
IDBFactory - Web APIs
you open — that is, create and access — and delete a database with this object, and not directly with idbfactory. note: this feature is available in web workers. methods idbfactory.open the current method to request opening a connection to a database. idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. idbfactory.databases a method that returns a list of all available databases, including their names and versions. ...
...at returns a list of all available databases, including their names and versions. example in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. for a full working example, see our to-do notifications app (view example live.) // in the following line, you should include the prefixes of implementations you want to test. window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange |...
...this is used a lot later on, for opening tra...
...ror = function(event) { console.error("error loading database."); }; dbopenrequest.onsuccess = function(event) { console.info("database initialised."); // store the result of opening the database in the db variable. this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment
indexed database api 2.0the definition of 'idbfactory' in that specification. recommendation
indexed database api draftthe definition of 'idbfactory' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-co...
IDBObjectStore.clear() - Web APIs
the clear() method of the idbobjectstore interface creates and immediately returns an idbrequest object, and clears this object store in a separate thread. this is for deleting all the current data out of an object store. clearing an object store consists of removing all records from the object store and removing all records in
indexes that reference the object store. to remove only some of the records in a store, use idbobjectstore.delete passing a key or idbkeyrange. note: this feature is available in web workers. syntax var request = objectstore.clear(); returns an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description readonlyer...
... mode. transactioninactiveerror this idbobjectstore's transaction is inactive. example in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // clear all the data form the object store cleardata(); }; function cleardata() { // open a read/write db transaction, ready for clearing th...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
... of the object store var objectstorerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'clear()' in that specification. recommendation
indexed database api draftthe definition of 'clear()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
IDBObjectStore.name - Web APIs
s. syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a domstring containing the object store's name. exceptions there are a several exceptions which can occur when you attempt to change an object store's name. invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename
indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an object store is already using the specified name. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log...
...ore is already using the specified name. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.name to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data ...
...he object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'name' in that specification. recommendation
indexed database api draftthe definition of 'name' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBOpenDBRequest: upgradeneeded event - Web APIs
n attempt was made to open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
...nrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }); this is the same example, but uses the onupgradeneeded event handler property. // open the database c...
... false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }); this is the same example, but uses the onupgradeneeded event handler property. ...
...base const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; ...
IDBRequest: error event - Web APIs
uest to fail. ...
...dexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', event => { const db = dbopenrequest.result; // open a r...
...asktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); }); the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hou...
...gradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.tran...
IDBRequest: success event - Web APIs
the success event is fired when an idbrequest succeeds. ...
...uest = window.
indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) => { console.log('database opened successfully!'); })...
....create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) => { console.log('database opened successfully!'); }); the same example, but using the onsuccess event handler property: // open the database const openrequest = window.
indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hou...
...adeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; openrequest.onsuccess = (event) => { console.log('database opened successfully!'); }; ...
IDBRequest.transaction - Web APIs
in transactions, such as for requests returned from idbfactory.open — in this case you're just connecting to a database, so there is no transaction to return. if a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an idbtransaction with mode equal to "versionchange", and can be used to access existing object stores and
indexes, or abort the the upgrade. following the upgrade, the transaction ​property will again be null. note: this feature is available in web workers. syntax var mytransaction = request.transaction; value an idbtransaction. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.resul...
... openrequest.onupgradeneeded = function(event) { console.log(openrequest.transaction.mode); // will log "versionchange". var db = openrequest.result; if (event.oldversion < 1) { // new database, create "books" object store. db.createobjectstore('books'); } if (event.oldversion < 2) { // upgrading fr...
...console.log(openrequest.transaction); // will log "null". openrequest.onupgradeneeded = function(event) { console.log(openrequest.transaction.mode); // will log "versionchange". var db = openrequest.result; if (event.oldversion < 1) { // new database, create "books" object store. ...
...openrequest.transaction.mode); // will log "versionchange". var db = openrequest.result; if (event.oldversion < 1) { // new database, create "books" object store. db.createobjectstore('books'); } if (event.oldversion < 2) { // upgrading from v1 database: add
index on "title" to "books" store. var bookstore = openrequest.transaction.objectstore('books'); bookstore.create
index('by_title', 'title'); } }; openrequest.onsuccess = function() { console.log(openrequest.transaction); // will log "null". }; specifications specification status comment
indexed database api 2.0the definition of 'transaction' in that specification. recommendation
indexed database api draftthe definition of 'transaction' in that specification. rec...
IDBTransaction: complete event - Web APIs
the complete handler is executed when a transaction successfully completed. ...
...uest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db tran...
...ddeventlistener('complete', event => { console.log('transaction was competed'); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectstorerequest = objectstore.add(newitem); }; using the oncomplete property: // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hou...
...gradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.tran...
IDBTransaction: error event - Web APIs
ction object. ...
...iven tasktitle already exists): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db tr...
...ding new item: ${newitem.tasktitle}`); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...pgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.onerror = () =>...
IDBTransaction.mode - Web APIs
ode object defining the mode for isolating access to data in the current object stores: value explanation readonly allows data to be read but not changed. readwrite allows reading and writing of data in existing data stores to be changed. versionchange allows any operation to be performed, including ones that delete and create object stores and
indexes. this mode is for updating the version number of transactions that were started using idbdatabase.setversion(). transactions of this mode cannot run concurrently with other transactions. transactions in this mode are known as "upgrade transactions." example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the...
...and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply log the mode of the current transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data ...
...the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the mode this transaction has been opened in (should be "readwrite" in this case) transaction.mode; }; specification specification status comment
indexed database api 2.0the definition of 'mode' in that specification. recommendation
indexed database api draftthe definition of 'mode' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBVersionChangeEvent - Web APIs
note: this feature is available in web workers. properties also inherits properties from its parent, method. idbversionchangeevent.oldversion read only returns the old version of the database. idbversionchangeevent.newversion read only returns the new version of the database. deprecated properties idbversionchangeevent.version read only the new version of the database in a versionchange transaction. ...
...nclude handlers for the success and error cases. upon a version change (after an upgradedneeded event), the success event will implement the idbversionchangeevent interface. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of implementations you want to test. window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange |...
...this is used a lot ...
... note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment
indexed database api 2.0the definition of 'idbversionchangeevent' in that specification. recommendation initial definition.
indexed database api draftthe definition of 'idbversionchangeevent' in that specification. recommendation ...
WebGL2RenderingContext.bindBufferBase() - Web APIs
buffer a webglbuffer which to bind to the binding point (target). return value none. ...
... buffer a webglbuffer which to bind to the binding point (target). return value none. ...
... buffer a webglbuffer which to bind to the binding point (target). return value none. ...
... buffer a webglbuffer which to bind to the binding point (target). return value none. ...
WebGL2RenderingContext.bindBufferRange() - Web APIs
buffer a webglbuffer which to bind to the binding point (target). offset a glintptr specifying the starting offset. ...
... buffer a webglbuffer which to bind to the binding point (target). offset a glintptr specifying the starting offset. ...
... buffer a webglbuffer which to bind to the binding point (target). offset a glintptr specifying the starting offset. ...
... buffer a webglbuffer which to bind to the binding point (target). offset a glintptr specifying the starting offset. size a glsizeiptr specifying the amount of data that can be read from the buffer. return value none. ...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
return value a domstring indicating the active uniform block name. ...
... return value a domstring indicating the active uniform block name. ...
... return value a domstring indicating the active uniform block name. ...
... return value a domstring indicating the active uniform block name. ...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
pname a glenum specifying which information to query. ...
... pname a glenum specifying which information to query. ...
... pname a glenum specifying which information to query. ...
...ferenced by the vertex shader. gl.uniform_block_referenced_by_fragment_shader: returns a glboolean indicating whether the uniform block is referenced by the fragment shader. return value depends on which information is requested using the pname parameter. if an error occurs, null is returned. examples var blocksize = gl.getactiveuniformblockparameter(program, block
index, gl.uniform_block_data_size); specifications specification status comment webgl 2.0the definition of 'getactiveuniformblockparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuniformblockiv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
some vertex attribute indices may have predefined purposes, depending on the platform and/or the gpu. ...
...some vertex attribute indices may have predefined purposes, depending on the platform and/or the gpu. others are assigned by the webgl layer when you create the attributes. ...
...eate the attributes. either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enablevertexattribarray() to enable individual attributes so that they can be used. once that's been done, other methods can be used to access the attribute, including vertexattribpointer(), vertexattrib*(), and getvertexattrib(). syntax void gl.enablevertexattribarray(
index); parameters
index a gluint specifying the
index number that uniquely identifies the vertex attribute to enable. if you know the name of the attribute but not its
index, you can get the
index by calling getattriblocation(). return value undefined. errors to check for errors after calling enablevertexattribarray(), call geterror(). webglrenderingcontext.invalid_value the specified i...
... false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); this code snippet is taken from the function animatescene() in "a basic 2d webgl animation example." see that article for the full sample and to see the resulting animation in action. this code sets the buffer of vertexes that will be used to draw the triangles of the shape by calling bindbuffer(). then the vertex position attribute's
index is obtained from the shader program by calling getattriblocation(). with the
index of the vertex position attribute now available in avertexposition, we call enablevertexattribarray() to enable the position attribute so it can be used by the shader program (in particular, by the vertex shader). then the vertex buffer is bound to the avertexposition attribute by calling vertexattribpointer(). th...
WebGL constants - Web APIs
t 0x8df3 medium_int 0x8df4 high_int 0x8df5 framebuffers and renderbuffers constant name value description framebuffer 0x8d40 renderbuffer 0x8d41 rgba4 0x8056 rgb5_a1 0x8057 rgb565 0x8d62 depth_component16 0x81a5 stencil_
index8 0x8d48 depth_stencil 0x84f9 renderbuffer_width 0x8d42 renderbuffer_height 0x8d43 renderbuffer_internal_format 0x8d44 renderbuffer_red_size 0x8d50 renderbuffer_green_size 0x8d51 renderbuffer_blue_size 0x8d52 renderbuffer_alpha_size 0x8d53 renderb...
... constant name value description red 0x1903 rgb8 0x8051 rgba8 0x8058 rgb10_a2 0x8059 tex...
..._bindings 0x8a2f max_uniform_block_size 0x8a30 max_combined_vertex_uniform_components 0x8a31 max_combined_fragment_uniform_components 0x8a33 uniform_buffer_offset_alignment 0x8a34 active_uniform_blocks 0x8a36 uniform_type 0x8a37 uniform_size 0x8a38 uniform_block_
index 0x8a3a uniform_offset 0x8a3b uniform_array_stride 0x8a3c uniform_matrix_stride 0x8a3d uniform_is_row_major 0x8a3e uniform_block_binding 0x8a3f uniform_block_data_size 0x8a40 uniform_block_active_uniforms 0x8a42 uniform_block_active_uniform_indices 0x8a43 ...
... webgl_debug_renderer_info constant...
Creating 3D objects using WebGL - Web APIs
rawarrays() method to using the vertex array as a table, and referencing individual vertices in that table to define the positions of each face's vertices, by calling gl.drawelements(). consider: each face requires four vertices to define it, but each vertex is shared by three faces. we can pass a lot fewer data around by building an array of all 24 vertices, then referring to each vertex by its
index into that array instead of moving entire sets of coordinates around. if you wonder why we need 24 vertices, and not just 8, it is because each corner belongs to three faces of different colors, and a single vertex needs to have a single specific color; therefore we will create three copies of each vertex in three different colors, one for each face. this example uses the glmatrix library to per...
...lors[j]; // repeat each color four times for the four vertices of the face colors = colors.concat(c, c, c, c); } const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.static_draw); define the element array once the vertex arrays are generated, we need to build the element array. const
indexbuffer = gl.createbuffer(); gl.bindbuffer(gl.element_array_buffer,
indexbuffer); // this array defines each face as two triangles, using the // indices into the vertex array to specify each triangle's // position. const indices = [ 0, 1, 2, 0, 2, 3, // front 4, 5, 6, 4, 6, 7, // back 8, 9, 10, 8, 10, 11, // top 12, 13, 14, 12, 14, 15...
... 7, // back 8, 9, 10, 8, 10, 11, // top 12, 13, 14, 12, 14, 15, // bottom 16, 17, 18, 16, 18, 19, // right 20, 21, 22, 20, 22, 23, // left ]; // now send the element array to gl gl.bufferdata(gl.element_array_buffer, new uint16array(indices), gl.static_draw); return { position: positionbuffer, color: colorbuffer, indices:
indexbuffer, }; } the indices array defines each face like a pair of triangles, specifying each triangle's vertices as an
index into the cube's vertex arrays. thus the cube is described as a collection of 12 triangles. drawing the cube next we need to add code to our drawscene() function to draw using the cube's
index buffer, adding new gl.bindbuffer() and gl.drawelements() calls: // tell we...
...s array defines each face like a pair of triangles, specifying each triangle's vertices as an
index into the cube's vertex arrays. thus the cube is described as a collection of 12 triangles. drawing the cube next we need to add code to our drawscene() function to draw using the cube's
index buffer, adding new gl.bindbuffer() and gl.drawelements() calls: // tell webgl which indices to use to
index the vertices gl.bindbuffer(gl.element_array_buffer, buffers.indices); ... { const vertexcount = 36; const type = gl.unsigned_short; const offset = 0; gl.drawelements(gl.triangles, vertexcount, type, offset); } since each face of our cube is comprised of two triangles, there are 6 vertices per side, or 36 total vertices in the cube, even though many of them are duplicate...
ARIA: document role - Accessibility
generally used in complex composite widgets or applications, the document role can inform assistive technologies to switch context to a reading mode: the document role tells assistive technologies with reading or browse modes to use the document mode to read the content contained within this element. <div role="dialog"> ... <div id="infotext" role="document" tab
index="0"> <p>some informational text goes here.</p> </div> ... <button>close</button> </div> this example shows a dialog widget with some controls and a section with some informational text that the assistive technology user can read when tabbing to it. description by default, web pages are treated as documents; assistive technologies (at) enter browse or read mode when entering a new web page. this mode can be altered thro...
...ex composit widget that an assistive technology user should read using its browse or virtual reading mode, if available. because ats with reading mode default to that mode for all elements except for those with a widget or application role set, document role is only useful for focusable elements within a widget or application that should be read as static rich text. adding role="document" and tab
index="0" to the element containing the text within a widget enables the screen reader user to press the tab key to place focus on the document element and read the text with the screen reader's reading cursor. assistive technologies should switch context back to document mode, possibly intercepting from controls rewired for the parent's dynamic context, re-enabling the standard input events, such as ...
...as a relationship to the containing composit widget. an article can have associated articles. associated wai-aria roles, states, and properties aria-expanded include with a value of true or false if the document element is collapsible, to indicate if the document is currently expanded or collapsed. other values include the default undefined which means the document is not collapsible. tab
index="0" used to make it focusable so the assistive technology user can tab to it and start reading right away. keyboard interactions the element should be made focusable by setting the tab
index="0" attribute / value pair on it. this way, the user can tab to it, reading mode is invoked automatically, and the content can be read right away. required javascript features none, except as required ...
...ssages, expand or collapse them, and manipulate them. once focus returns to the message list either by activating the back button or pressing an asociated keystroke, direct application interaction mode is invoked again, and the user can move to a different conversation in the list with the arrow keys. best practices always make sure an item with the document role is focusable, by setting the tab
index attribute with a value of 0. that will also include it in the tab order. added benefits the document role is an easy way to indirectly control assistive technology behavior by unambiguously stating that this is content the user should read with standard screen reader commands. specifications specification status accessible rich internet applications (wai-aria) 1.1the defi...
ARIA: rowgroup role - Accessibility
_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span ro...
...e of 81 rows present in the dom: one within a table header and four rows within the table body. the header row, alone in a header rowgroup, has two column headers. the columns are sortable, but not currently sorted, as indicated by the aria-sort property. the table body is a separate rowgroup, with four rows currently in the dom. because not all the rows are in the dom, we've included the aria-row
index property on every row. best practices only use table, tbody, thead, tr, th, td, and so on for data table structure. you can add these aria roles to ensure accessibility should the native semantics of the table be removed, such as with css. a relevant use case for the aria table role is when the css's display property overrides the native semantics of a table, such as by display: grid. in this c...
...the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such...
...the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such as by setting the display property to flex or grid. added benefits none specifications specification status...
ARIA: checkbox role - Accessibility
the checkbox role is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology. <span role="checkbox" aria-checked="false" tab
index="0" aria-labelledby="chk1-label"> </span> <label id="chk1-label">remember my preferences</label> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have tw...
...rol can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript. similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. since a checkbox is an interactive control, it must be focusable and keyboard accessible. if the role is applied to a non-focusable element, use the tab
index attribute to change this. the expected keyboard shortcut for activating a checkbox is the space key. the developer is required to change the value of the aria-checked attribute dynamically when the checkbox is activated. associated wai-aria roles, states, and properties aria-checked the value of aria-checked defines the state of a checkbox. this attribute has one of three possible valu...
... aria-checked attribute dynamically when the checkbox is activated. associated wai-aria roles, states, and properties aria-checked the value of aria-checked defines the state of a checkbox. this attribute has one of three possible values: true the checkbox is checked false the checkbox is not checked mixed the checkbox is partially checked, or indeterminate tab
index="0" used to make it focusable so the assistive technology user can tab to it and start reading right away. keyboard interactions key function space activates the checkbox required javascript required event handlers onclick handle mouse clicks that will change the state of the checkbox by changing the value of the aria-checked attribute and the appearance of...
...of the aria-checked attribute and the appearance of the checkbox so it appears checked or unchecked to the sighted user examples the following example creates a simple checkbox element using css and javascript to handle the checked or unchecked status of the element. ...
CSS reference - CSS: Cascading Style Sheets
the syntax for each specified value depends on the data type defined for each specified property. ...
...browse key css concepts and a list of selectors organized by type. also included is a brief dom-css / cssom reference. basic rule syntax style rule syntax style-rule ::= selectors-list { properties-list } ... where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list] properties-list ::= [property : value] [; properties-list] see the
index of selectors, pseudo-classes, and pseudo-elements below. the syntax for each specified value depends on the data type defined for each specified property. style rule examples strong { color: red; } div.menu-bar li:hover > ul { display: block; } for a beginner-level introduction to the syntax of selectors, see our guide on css selectors. be aware that any syntax error in a rule definition...
...ors. be aware that any syntax error in a rule definition invalidates the entire rule. invalid rules are ignored by the browser. note that css rule definitions are entirely (ascii) text-based, whereas dom-css / cssom (the rule management system) is object-based. at-rule syntax as the structure of at-rules varies widely, please see at-rule to find the syntax of the specific one you want. keyword
index note: the property names in this
index do not include the javascript names where they differ from the css standard names. --webkit-line-clampa:activeadditive-symbols (@counter-style)::after (:after)align-contentalign-itemsalign-selfall<an-plus-b><angle><angle-percentage>animationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-name...
... basic selectors basic selectors are fundamental selectors; these are the most basic selectors that are frequently combined to create other, more complex selectors. universal selector *, ns|*, *|*, |* type selector elementna...
animation - CSS: Cascading Style Sheets
sslist.contains('pause')) { anim.style.animationplaystate = 'paused'; togglebutton(btn, 'play'); } else { anim.classlist.remove('a' + (i + 1)); settimeout(function () { togglebutton(btn, i === 0 ? ...
... constitue...
... constituent properties this property is a shorthand for the following css properties: animation-delay anim...
... anim.style.animationplaystate = ''; anim.classlist.add('a' + (i + 1)); }, 100) } } animation.foreach(function (node,
index) { node.addeventlistener('animationstart', function () { togglebutton(button[
index], 'pause'); }); node.addeventlistener('animationend', function () { togglebutton(button[
index], 'restart'); }); }); button.foreach(function (btn,
index) { btn.addeventlistener('click', function () { playpause(
index); }); }); }) a description of which properties are animatable is available; it's worth noting that this description is also valid for css transitions. constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode anima...
Setting up adaptive streaming media sources - Developer guides
ondemand profile this profile will allow switching between streams 'on demand' - that is to say that you only need provide a set of contiguous files and specify the bandwidth for each one and the appropriate file will be chosen automatically.
...s. apple provides tools to convert media files to the appropriate format. hls encoding tools ther are a number of useful tools available for hls encoding for hls live stream encoding adobe provide a media encoder for mac. ...
...s available for hls encoding for hls live stream encoding adobe provide a media encoder for mac. the stream segmenter — provided by apple for mac platforms — takes a media stream from a local network and splits media into equally sized media files together with an
index file. apple also provides a file segmenter for mac — which takes a suitably encoded file, splits it up and produces a
index file, in a similar fashion to the stream segmenter. note: you can find more details about these tools at using http live streaming.
index files (playlists) the hls
index file (much like mpeg-dash's .mpd file) contains the information on where all the media segments reside, as well as other meta data such as bandwidth application. apple uses the .m3u8 format (an extension of its .m3u playlis...
...milar fashion to the stream segmenter. note: you can find more details about these tools at using http live streaming.
index files (playlists) the hls
index file (much like mpeg-dash's .mpd file) contains the information on where all the media segments reside, as well as other meta data such as bandwidth application. apple uses the .m3u8 format (an extension of its .m3u playlist format) for
index files — see below for an example: #ext-x-version:3 #extm3u #ext-x-targetduration:10 #ext-x-media-sequence:1 # old-style integer duration; avoid for newer clients. #extinf:10, http://media.example.com/segment0.ts # new-style floating-point duration; use for modern clients. #extinf:10.0, http://media.example.com/segment1.ts #extinf:9.5, http://media.example.com/segment2.ts #ext-x-endlist not...
Global attributes - HTML: Hypertext Markup Language
ked for spelling errors; false, which indicates that the element should not be checked for spelling errors. style contains css styling declarations to be applied to the element. note that it is recommended for styles to be defined in a separate file or files. this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. tab
index an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. it can take several values: a negative value means that the element should be focusable, but should not be reachable via sequential keyboard navigation; 0 means that the element should be focusable and reachable via seq...
...t be reachable via sequential keyboard navigation; 0 means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention; a positive value means that the element should be focusable and reachable via sequential keyboard navigation; the order in which the elements are focused is the increasing value of the tab
index. if several elements share the same tab
index, their relative order follows their relative positions in the document. title contains a text representing advisory information related to the element it belongs to. such information can typically, but not necessarily, be presented to the user as a tooltip. translate an enumerated attribute that is used to specify whether an element's attribu...
...that specification. recommendation snapshot of html living standard. from html5, contextmenu, draggable, dropzone, and spellcheck have been added. html5the definition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, the concept of global attributes is introduced and the dir, lang, style, id, class, tab
index, accesskey, and title are now true global attributes. xml:lang which was initially part of xhtml, is now also part of html. hidden, data-*, contenteditable, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. several attributes that will become global attributes in subsequent specifications are defined on a subset of...
...yle>, and <title>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. tab
index is only supported on <a>, <area>, <button>, <object>, <select>, and <textarea>. accesskey is only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>. title is supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
SameSite cookies - HTTP
rather specify it explicitly to clearly communicate your intent which samesite policy applies to your cookie. this will also improve the experience across browsers as not all of them default to lax yet. ...
...ent which samesite policy applies to your cookie. this will also improve the experience across browsers as not all of them default to lax yet. ...
...t to lax yet. ...
... "^example\.org$" [nc] rewriterule "^(.*)" "https://www.example.org/
index.html" [r=301,l,qsa] rewriterule "^(.*)\.ht$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;01;https://www.example.org;30/;samesite=none;secure] rewriterule "^(.*)\.htm$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;02;https://www.example.org;30/;samesite=none;secure] rewriterule "^(.*)\.html$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;03;https://www.example.org;30/;samesite=none;secure] [...] rewriterule "^admin/(.*)\.html$" "admin/
index.php?nav=$1 [nc,l,qsa,co=rewriterule;09;https://www.example.org:30/;samesite=strict;secure] specifications specification title rfc 6265, section 4.1: set-cookie http state management mechanism draft-ietf-httpbis-rfc6265...
A re-introduction to JavaScript (JS tutorial) - JavaScript
notation upon being created. {[phonetype]: 12345} is possible instead of just var userphone = {}; userphone[phonetype] = 12345. arrays arrays in javascript are actually a special type of object. they work very much like regular objects (numerical properties can naturally be accessed only using [] syntax) but they have one magic property called 'length'. this is always one more than the highest
index in the array. one way of creating arrays is as follows: var a = new array(); a[0] = 'dog'; a[1] = 'cat'; a[2] = 'hen'; a.length; // 3 a more convenient notation is to use an array literal: var a = ['dog', 'cat', 'hen']; a.length; // 3 note that array.length isn't necessarily the number of items in the array. consider the following: var a = ['dog', 'cat', 'hen']; a[100] = 'fox'; a.length; ...
...y(); a[0] = 'dog'; a[1] = 'cat'; a[2] = 'hen'; a.length; // 3 a more convenient notation is to use an array literal: var a = ['dog', 'cat', 'hen']; a.length; // 3 note that array.length isn't necessarily the number of items in the array. consider the following: var a = ['dog', 'cat', 'hen']; a[100] = 'fox'; a.length; // 101 remember — the length of the array is one more than the highest
index. ...
...en'; a.length; // 3 a more convenient notation is to use an array literal: var a = ['dog', 'cat', 'hen']; a.length; // 3 note that array.length isn't necessarily the number of items in the array. consider the following: var a = ['dog', 'cat', 'hen']; a[100] = 'fox'; a.length; // 101 remember — the length of the array is one more than the highest
index. ...
.....in loop, however this does not iterate over the array elements, but the array indices. furthermore, if someone added new properties to array.prototype, they would also be iterated over by such a loop. therefore this loop type is not recommended for arrays. another way of iterating over an array that was added with ecmascript 5 is foreach(): ['dog', 'cat', 'hen'].foreach(function(currentvalue,
index, array) { // do something with currentvalue or array[
index] }); if you want to append an item to an array simply do it like this: a.push(item); arrays come with a number of methods. see also the full documentation for array methods. method name description a.tostring() returns a string with the tostring() of each element separated by commas. a.tolocales...
Expressions and operators - JavaScript
returns false (cannot delete non-configurable properties) delete myobj.h; // returns true (can delete user-defined properties) deleting array elements since arrays are just objects, it's technically possible to delete elements from them. this is however regarded as a bad practice, try to avoid it. when you delete an array property, the array length is not affected and other elements are no re-
indexed. to achieve that behavior, it is much better to just overwrite the element with the value undefined. to actually manipulate the array, use the various array methods such as splice. typeof the typeof operator is used in either of the following ways: typeof operand typeof (operand) the typeof operator returns a string indicating the type of the unevaluated operand. operand is the string, var...
...ood style to use them. relational operators a relational operator compares its operands and returns a boolean value based on whether the comparison is true. in the in operator returns true if the specified property is in the specified object. ...
..., or symbol expression representing a property name or array
index, and objectname is the name of an object. the following examples show some uses of the in operator. ...
...ay
index, and objectname is the name of an object. the following examples show some uses of the in operator. ...
Iterators and generators - JavaScript
egers between 0 and infinity. here is an example which can do just that. it allows creation of a simple range iterator which defines a sequence of integers from start (inclusive) to end (exclusive) spaced step apart. its final return value is the size of the sequence it created, tracked by the variable iterationcount. ...
...ence of integers from start (inclusive) to end (exclusive) spaced step apart. its final return value is the size of the sequence it created, tracked by the variable iterationcount. ...
...usive) spaced step apart. its final return value is the size of the sequence it created, tracked by the variable iterationcount. ...
...rn value is the size of the sequence it created, tracked by the variable iterationcount. ...
Text formatting - JavaScript
the length of a string is the number of elements in it. ...
...the length of a string is the number of elements in it. ...
...tat(). a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase. the following table summarizes the methods of string objects. methods of string method description charat, charcodeat, codepointat return the character or character code at the specified position in string.
indexof, last
indexof return the position of specified substring in the string or last position of specified substring, respectively. startswith, endswith, includes returns whether or not the string starts, ends or contains a specified string. concat combines the text of two strings and returns a new string. fromcharcode, fromcodepoint constructs a string from the ...
...m the specified sequence of unicode values. this is a method of the string class, not a string instance. split splits a string object into an array of strings by separating the string into substrings. slice extracts a section of a string and returns a new string. substring, substr return the specified subset of the string, either by specifying the start and end
indexes or the start
index and a length. match, matchall, replace, replaceall, search work with regular expressions. tolowercase, touppercase return the string in all lowercase or all uppercase, respectively. normalize returns the unicode normalization form of the calling string value. repeat returns a string consisting of the elements of the obj...
Array.prototype.forEach() - JavaScript
the foreach() method executes a provided function once for each array element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.foreach(callback(currentvalue [,
index [, array]])[, thisarg]) parameters callback function to execute on each element. it accepts between one and three arguments: currentvalue the current element being processed in the array.
index optional the
index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined. description foreach() calls a provi...
...alue the current element being processed in the array.
index optional the
index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined. description foreach() calls a provided callback function once for each element in an array in ascending order. it is not invoked for
index properties that have been deleted or are uninitialized. (for sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the
index of the element the array object being traversed if a thisarg parameter is provided to foreach(), it will be used as callback's this value. the thisarg value ultimately observable by callback is determined according to ...
...y on which it is called. (however, callback may do so) there is no way to stop or break a foreach() loop other than by throwing an exception. if you need such behavior, the foreach() method is the wrong tool. early termination may be accomplished with: a simple for loop a for...of / for...in loops array.prototype.every() array.prototype.some() array.prototype.find() array.prototype.find
index() array methods: every(), some(), find(), and find
index() test the array elements with a predicate returning a truthy value to determine if further iteration is required. foreach expects a synchronous function foreach does not wait for promises. kindly make sure you are aware of the implications while using promises(or async functions) as foreach callback. example code let ratings = [5, 4,...
...h(function(item){ copyitems.push(item) }) printing the contents of an array note: in order to display the content of an array in the console, you can use console.table(), which prints a formatted version of the array. the following example illustrates an alternative approach, using foreach(). the following code logs a line for each element in an array: function logarrayelements(element,
index, array) { console.log('a[' +
index + '] = ' + element) } // notice that
index 2 is skipped, since there is no item at // that position in the array... [2, 5, , 9].foreach(logarrayelements) // logs: // a[0] = 2 // a[1] = 5 // a[3] = 9 using thisarg the following (contrived) example updates an object's properties from each entry in the array: function counter() { this.sum = 0 this.count ...
Array.prototype.some() - JavaScript
thod tests whether at least one element in the array passes the test implemented by the provided function. it returns a boolean value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.some(callback(element[,
index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three arguments: element the current element being processed in the array.
indexoptional the
index of the current element being processed in the array. arrayoptional the array some() was called upon. thisargoptional a value to use as this when executing callback. return value true...
...t least one element in the array. otherwise, false. description the some() method executes the callback function once for each element present in the array until it finds the one where callback returns a truthy value (a value that becomes true when converted to a boolean). if such an element is found, some() immediately returns true. otherwise, some() returns false. callback is invoked only for
indexes of the array with assigned values. it is not invoked for
indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed. if a thisarg parameter is provided to some(), it will be used as the callback's this value. otherwise, the value undefined will be u...
...te the array on which it is called. the range of elements processed by some() is set before the first invocation of callback. elements appended to the array after the call to some() begins will not be visited by callback. if an existing, unvisited element of the array is changed by callback, its value passed to the visiting callback will be the value at the time that some() visits that element's
index. elements that are deleted are not visited. caution: calling this method on an empty array returns false for any condition! polyfill some() was added to the ecma-262 standard in the 5th edition, and it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of some() in implementations ...
... throw new typeerror(); } var t = object(this); var len = t.length >>> 0; for (var i = 0; i < len; i++) { if (i in t && fun.call(thisarg, t[i], i, t)) { return true; } } return false; }; } examples testing value of array elements the following example tests whether any element in the array is bigger than 10. function isbiggerthan10(element,
index, array) { return element > 10; } [2, 5, 8, 1, 4].some(isbiggerthan10); // false [12, 5, 8, 1, 4].some(isbiggerthan10); // true testing array elements using arrow functions arrow functions provide a shorter syntax for the same test. [2, 5, 8, 1, 4].some(x => x > 10); // false [12, 5, 8, 1, 4].some(x => x > 10); // true checking whether a value exists in an array to mimic the function of ...
Array.prototype.sort() - JavaScript
pair \ud655\ude55 will be sorted before the character \uff3a. if comparefunction is supplied, all non-undefined array elements are sorted according to the return value of the compare function (all undefined elements are sorted to the end of the array, with no call to comparefunction). ...
...b comes first). comparefunction(a, b) must always return the same value when given a specific pair of elements a and b as its two arguments. if inconsistent results are returned, then the sort order is undefined. ...
...rting. the idea is to traverse the array once to extract the actual values used for sorting into a temporary array, sort the temporary array, and then traverse the temporary array to achieve the right order. ...
...ition and sort-value var mapped = list.map(function(el, i) { return {
index: i, value: el.tolowercase() }; }) // sorting the mapped array containing the reduced values mapped.sort(function(a, b) { if (a.value > b.value) { return 1; } if (a.value < b.value) { return -1; } return 0; }); // container for the resulting order var result = mapped.map(function(el){ return list[el.
index]; }); there is an open source library available called mapsort which applies this approach. specifications specification ecmascript (ecma-262)the definition of 'array.prototype.sort' in that specification. ...
ArrayBuffer.prototype.slice() - JavaScript
contents are a copy of this arraybuffer's bytes from begin, inclusive, up to end, exclusive. 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. ...
...gin, inclusive, up to end, exclusive. 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 arraybuffer.slice(begin[, end]) parameters begin zero-based byte
index at which to begin slicing. end optional byte
index before which to end slicing. ...
...if the computed length of the new arraybuffer would be negative, it is clamped to zero. ...
...s all bytes from begin to the end of this arraybuffer. return value a new arraybuffer object. description the slice() method copies up to, but not including, the byte indicated by the end parameter. if either begin or end is negative, it refers to an
index from the end of the array, as opposed to from the beginning. the range specified by the begin and end parameters is clamped to the valid
index range for the current array. if the computed length of the new arraybuffer would be negative, it is clamped to zero. examples copying an arraybuffer const buf1 = new arraybuffer(8); const buf2 = buf1.slice(0); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.prototype.slice' in that specification. ...
RegExp.prototype.test() - JavaScript
request. syntax regexobj.test(str) parameters str the string against which to match the regular expression. returns true if there is a match between the regular expression and the string str. otherwise, false. description use test() whenever you want to know whether a pattern is found in a string. test() returns a boolean, unlike the string.prototype.search() method (which returns the
index of a match, or -1 if not found). to get more information (but with slower execution), use the exec() method. (this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called multiple times on the same global regular expression instance will advance past the previous match. examples using test() simple example that tests if "hello" is contain...
... when test() returns false, the calling regex's lastind...
...s of the test: function testinput(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the last
index of the regex. (regexp.prototype.exec() also advances the last
index property.) further calls to test(str) will resume searching str starting from last
index. the last
index property will continue to increase each time test() returns true. note: as long as test() returns true, last
index will not reset—even when testing a different string! when test() returns false, the calling regex's last
index property will reset to 0. the following example demonstrates th...
... last
index. the last
index property will continue to increase each time test() returns true. note: as long as test() returns true, last
index will not reset—even when testing a different string! when test() returns false, the calling regex's last
index property will reset to 0. the following example demonstrates this behaviour: const regex = /foo/g; // the "global" flag is set // regex.last
index is at 0 regex.test('foo') // true // regex.last
index is now at 3 regex.test('foo') // false // regex.last
index is at 0 regex.test('barfoo') // true // regex.last
index is at 6 regex.test('foobar') //false // regex.last
index is at 0 // (...and so on) specifications specification ecmascript (ecma-262)the definition of 'regexp.test' in that specification. ...
SharedArrayBuffer.prototype.slice() - JavaScript
the sharedarraybuffer.prototype.slice() method returns a new sharedarraybuffer whose contents are a copy of this sharedarraybuffer's bytes from begin, inclusive, up to end, exclusive. if either begin or end is negative, it refers to an
index from the end of the array, as opposed to from the beginning. this method has the same algorithm as array.prototype.slice(). the source for this interactive example is stored in a github repository. ...
...inning. this method has the same algorithm as array.prototype.slice(). 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 sab.slice() sab.slice(begin) sab.slice(begin, end) parameters begin optional zero-based
index at which to begin extraction. a negative
index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. if begin is undefined, slice begins from
index 0. end optional zero-based
index before which to end extraction. slice extracts up to but not including end. for example, slice(1,4) extracts the second element through the fourt...
...slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts through the end of the sequence (sab.bytelength). return value a new sharedarraybuffer containing the extracted elements. ...
...slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts through the end of the sequence (sab.bytelength). ...
String.fromCodePoint() - JavaScript
her than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. ...
...object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. ...
...d. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. ...
...thod has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. ...
TypedArray.prototype.forEach() - JavaScript
executes a provided function once per array element. this method has the same algorithm as array.prototype.foreach(). typedarray is one of the typed array types here. syntax typedarray.foreach(callback[, thisarg]) parameters callback function that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array. ...
...rovided function once per array element. this method has the same algorithm as array.prototype.foreach(). typedarray is one of the typed array types here. syntax typedarray.foreach(callback[, thisarg]) parameters callback function that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array.
index the
index of the current element being processed in the array. array the array foreach() was called upon. thisarg optional. value to use as this when executing callback. return value undefined. description the foreach() method executes the provided callback once for each element present in the typed array in ascending order. it is not invoked for
indexes that have been deleted or elided. how...
...ng callback. return value undefined. description the foreach() method executes the provided callback once for each element present in the typed array in ascending order. it is not invoked for
indexes that have been deleted or elided. however, it is executed for elements that are present and have the value undefined. callback is invoked with three arguments: the element value the element
index the typed array being traversed if a thisarg parameter is provided to foreach(), it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. the range of elements processed ...
...value at the time foreach() visits them; elements that are deleted before being visited are not visited. foreach() executes the callback function once for each typed array element; unlike every() and some() it, always returns the value undefined. examples logging the contents of a typed array the following code logs a line for each element in a typed array: function logarrayelements(element,
index, array) { console.log('a[' +
index + '] = ' + element); } new uint8array([0, 1, 2, 3]).foreach(logarrayelements); // logs: // a[0] = 0 // a[1] = 1 // a[2] = 2 // a[3] = 3 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.foreach' in that specification. ...
in operator - JavaScript
specified property is in the specified object or its prototype chain. 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 prop in object parameters prop a string or symbol representing a property name or array
index (non-symbols will be coerced to strings). object object to check if it (or its prototype chain) contains the property with specified name (prop). examples basic usage the following examples show some uses of the in operator. // arrays let trees = ['redwood', 'bay', 'cedar', 'oak', 'maple'] 0 in trees // returns true 3 in trees // returns true 6 in trees // returns f...
...to check if it (or its prototype chain) contains the property with specified name (prop). examples basic usage the following examples show some uses of the in operator. ...
...in) contains the property with specified name (prop). examples basic usage the following examples show some uses of the in operator. ...
...es = new array('redwood', 'bay', 'cedar', 'oak', 'maple') trees[3] = undefined 3 in trees // returns true the in operator will return false for empty array slots. even if accessing it directly returns undefined. let empties = new array(3) empties[2] // returns undefined 2 in empties // returns false to avoid this, make sure a new array is always filled with non-empty values or not write to
indexes past the end of array. let empties = new array(3).fill(undefined) 2 in empties // returns true inherited properties the in operator returns true for properties in the prototype chain. (if you want to check for only non-inherited properties, use object.prototype.hasownproperty() instead.) 'tostring' in {} // returns true specifications specification ecmascript (ecma-2...
import.meta - JavaScript
it returns an object with a url property indicating the base url of the module. this will either be the url from which the script was obtained, for external scripts, or the document base url of the containing document, for inline scripts. note that this will include query parameters and/or hash (i.e., following the ? or #). ...
...om which the script was obtained, for external scripts, or the document base url of the containing document, for inline scripts. note that this will include query parameters and/or hash (i.e., following the ? or #). ...
...pts. note that this will include query parameters and/or hash (i.e., following the ? or #). ...
... will include query parameters and/or hash (i.e., following the ? or #). for example, with the following html: <script type="module"> import './
index.mjs?someurlinfo=5'; </script> ..the following javascript file will log the `someurlinfo parameter: //
index.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 the same applies when a file imports another: //
index.mjs import './
index2.mjs?someurlinfo=5'; //
index2.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 note that while node.js will pass on query parameters (or the hash) as in the latter example, as of node 14.1.0, a url with query parameters will err when loading in the form node --experimental-modules
index.mjs?someurlinfo=5 (it is treated as a file rather than a url in this context). such file-...
Add to Home screen - Progressive web apps (PWAs)
ent places. name provides the full app name, and short_name provides a shortened name to be used when there is insufficient space to display the full name. you are advised to provide both if your app's name is particularly long. start_url: provides a path to the asset that should be loaded when the added-to-home screen app is launched. note that this has to be a relative url pointing to the site
index, relative to the url of the manifest. also, be aware that chrome requires this before it will display the install banner, whereas firefox doesn't require it for showing the home-with-a-plus icon. the manifest for our sample app looks like this: { "background_color": "purple", "description": "shows random fox pictures. hey, at least it isn't cats.", "display": "fullscreen", "icons": [ ...
... the manifest for our sample app looks like this: { "background_color": "purple", "description": "shows random fox pictures. hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/
index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app. you can include more sizes if you want; android will choose the most appropriate size for each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp format). not...
...lace. what does a2hs not give you? bear in mind that when you add an app to your home screen, it just makes the app easily accessible — it doesn't download the app's assets and data to your device and make the app available offline, or anything like that. to make your app work offline, you have to use the service worker api to handle storing the assets offline, and if required, web storage or
indexeddb to store its data. in our example app, we've just used a service worker to store all necessary files. the service worker is registered against the site with the final code block in the
index.js file. we then cache all the site's assets using the cache api, and serve them from the cache instead of the network using the code in the sw.js file. a2hs on desktop while originally intended to imp...
...first of all, we declare a deferredprompt variable (which we'll explain later on), get a reference to our install button, and set it to display: none initially: let deferredprompt; const addbtn = document.queryselector('.add-button'); addbtn.style.display = 'none'; we hide the button initially because the pwa will not be available fo...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
used to remind the user about something, or let them know about new content being available in the app. push example push needs the server part to work, so we're not able to include it in the js13kpwa example hosted on github pages, as it offers hosting of static files only. it is all explained in the service worker cookbook — see the push payload demo. ...
...ted on github pages, as it offers hosting of static files only. it is all explained in the service worker cookbook — see the push payload demo. this demo consists of three files:
index.js, which contains the source code of our app server.js, which contains the server part (written in node.js) service-worker.js, which contains the service worker-specific code. ...
...pages, as it offers hosting of static files only. it is all explained in the service worker cookbook — see the push payload demo. this demo consists of three files:
index.js, which contains the source code of our app server.js, which contains the server part (written in node.js) service-worker.js, which contains the service worker-specific code. ...
...you can use the following ones:"); console.log(webpush.generatevapidkeys()); return; } webpush.setvapiddetails( 'https://serviceworke.rs/', process.env.vapid_public_key, process.env.vapid_private_key ); next, a module defines and exports all the routes an app needs to handle: getting the vapid public key, registering, and then sending notifications. you can see the variables from the
index.js file being used: payload, delay and ttl. module.exports = function(app, route) { app.get(route + 'vapidpublickey', function(req, res) { res.send(process.env.vapid_public_key); }); app.post(route + 'register', function(req, res) { res.sendstatus(201); }); app.post(route + 'sendnotification', function(req, res) { const subscription = req.body.subscription; const pay...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svg 2 is the next major version of the svg standard, which is a complete rework of the svg 1.2 draft. version 2 contains a lot of changes regarding the last stable version svg 1.1. those changes are listed below including their support status within mozilla applications. ...
...ver implemented svgelement.viewportelement and svgelement.ownersvgelement nullable implementation status unknown svgelement.getpresentationattribute() removed never implemented (prototype removed in bug 921456) svgcolor and svgicccolor removed never implemented svgelement.focus(), svgelement.blur() not implemented (bug 778654) svgelement.tab
index implemented (bug 778654) document.activeelement implementation status unknown globaleventhandlers on svgelement implementation status unknown options dictionary attribute for svggraphicselement.getbbox() implemented behind the preference svg.new-getbbox.enabled (bug 999964, bug 1019326) allow leading and trailing whitespace in <length>, <angle>, <nu...
...upported (bug 528332 (firefox 15 / thunderbird 15 / seamonkey 2.12), bug 1318208) arcs value for stroke-linejoin not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute implemented (bug 879659) svgpaint removed implementation status unknown fill and stroke taking multiple paints implementation status unknown z-
index not implemented (bug 360148 child(<integer>) paint value implementation status unknown display of zero-length subpaths depends on stroke-linecap attribute implementation status unknown markers on all shapes implementation status unknown <marker> element display defined in ua style sheet implementation status unknown only single paints fo...
...<hatchpath> (renamed hatchpath) not implemented (bug 1239147) display behavior of paint server elements defined by ua style sheet not implemented clipping, masking, and compositing change notes overflow respected on outermost <svg> elements inline in html implementation status unknown interactivity change notes tab
index attribute implemented (bug 778654) bounding-box on pointer-events not implemented (bug 945187) load, abort, error, and unload instead of svgload, svgabort, svgerror, and svgunload not implemented (bug 620002) only structurally external elements and outermost <svg> element fire load events implementation status unknown resize and scroll instead of sv...
Compiling from Rust to WebAssembly - WebAssembly
{ "hello-wasm": "^0.1.0" }, "devdependencies": { "webpack": "^4.25.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.10" } } note that you need to fill in your own username, after the @, in the dependencies section. next, we need to configure webpack. ...
...", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.10" } } note that you need to fill in your own username, after the @, in the dependencies section. next, we need to configure webpack. ...
...note that you need to fill in your own username, after the @, in the dependencies section. next, we need to configure webpack. ...
...const path = require('path'); module.exports = { entry: "./
index.js", output: { path: path.resolve(__dirname, "dist"), filename: "
index.js", }, mode: "development" }; now we need an html file; create
index.html and give it the following contents: <!doctype html> <html> <head> <meta charset="utf-8"> <title>hello-wasm example</title> </head> <body> <script src="./
index.js"></script> </body> </html> finally, create the
index.js referenced in the html file and give it these contents: const js = import("./node_modules/hello-wasm/hello_wasm.js"); js.then(js => { js.greet("webassembly"); }); note that you need to fill in your npm username again. this imports the new module from the node_modules folder. this isn't considered a best practice, but this is a dem...
SDK API Lifecycle - Archive of obsolete content
can trust that a given api will not change in future releases. at the same time, developers maintaining and extending the sdk's apis need to be able to introduce new apis that aren't yet fully proven, and to retire old apis when they're no longer optimal or supported by the underlying platform. the api lifecycle aims to balance these competing demands. it has two main components: a stability
index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while giving developers enough time to update their code. stability
index the stability
index is adopted from node.js. the sdk uses only four of the six values defined by node.js: experimental the module is not yet stabil...
... sdk. we will avoid breaking backwards compatibility unless absolutely necessary. if we do have to make backwards-incompatible changes, we will go through the formal deprecation process. deprecated we plan to change this module, and backwards compatibility should not be expected. don’t start using it, and plan to migrate away from this module to its replacement. ...
...the deprecation notice should point developers at a migration guide. ...
Getting Started (jpm) - Archive of obsolete content
default for each property. for more information on jpm init, see the jpm command reference. once you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to accept it. implementing the add-on now you can write the add-on's code. unless you've changed the value of "entry point" ("main" in package.json), this goes in "
index.js" file in the root of your add-on. this file was created for you in the previous step. open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: han...
... in cfx, the entry point defaults to "main.js", and is located in the "lib" directory under the add-on's root. save the file. next, create a directory called "data" in your add-on's root, mkdir data and save these three icon files to the "data" directory: icon-16.png ...
... in cfx, the entry point defaults to "main.js", and is located in the "lib" directory under the add-on's root. save the file. next, create a directory called "data" in your add-on's root, mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png b...
Unit Testing - Archive of obsolete content
create a new directory, navigate to it, and run jpm init. now create a new file called "base64.js", and give it the following contents: const { atob, btoa } = require("resource://gre/modules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions. ...
...on/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory. you could download this icon: . now "
index.js" imports the base64 module and calls its two exported functions. if we run the add-on and click the button, we should see the following logging output: info: agvsbg8= info: hello testing the base64 module navigate to the add-on's test directory and delete the test-
index.js file. in its place create a file called test-base64.js with the following contents: var base64 = require("../base64")...
...l atob() and btoa() and use assert.ok() to check that the output is as expected. the second function tests the module's error-handling code by passing an empty string into atob() and using assert.throws() to check that the expected exception is raised. at this point your add-on ought to look like this: /base64 /data icon-16.png package.json readme.md
index.js base64.js /test test-base64.js now execute jpm --verbose test from the add-on's root directory. you should see something like this: console.info: jpm-utest: executing './test/test-base64.test atob' console.info: jpm-utest: pass: atob works console.info: jpm-utest: executing './test/test-base64.test btoa' console.info: jpm-utest: pass: btoa works console.info: jpm-utest...
Tree - Archive of obsolete content
(var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && treeview.iscontaineropen(i)) treeview.toggleopenstate(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cell
index = 0; var celltext = tree.view.getcelltext(tree.current
index, tree.columns.getcolumnat(cell
index)); alert(celltext); } getting the tree item from the focused row assuming <tree id="my-tree">, you can use the following to get the tree item: var view = document.getelementbyid("my-tree").view; var sel = view.selection.current
index; //returns -1 if the tree is not focused var treeitem = vie...
... getting the cell from a mouse click your first choice is likely to try <treecell onclick="yourfunc();"/> or something similar. but this will not work. you can't add event handlers to <treecell>. instead, you can add the event handler to the <tree> element. ...
... getting the cell from a mouse click your first choice is likely to try <treecell onclick="yourfunc();"/> or something similar. but this will not work. you can't add event handlers to <treecell>. instead, you can add the event handler to the <tree> element. you can then use the event and some utility methods to find the <treecell>. ...
xml:base support in old browsers - Archive of obsolete content
; } else if (xmlbase.match(/\/$/) && xlink.match(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.
indexof('/') === 0 ) { // if link is an absolute url, it should be from the host only link = loc.protocol + '//' + loc.host + link; } else { // if link is relative, it should be from full path, minus the file var dirpath = loc.pathname.substring(0, loc.pathname.last
indexof('/')-1); if (link.last
indexof('/') !== link.length-1) { link += '/'; } link = loc.protocol + '//' + loc.host...
... !thisitem.nodename) { return xmlbase; } // check present element and higher up for xml:base // now check for the next matching local name up in the hierarchy (until the document root) while (thisitem.nodename !== '#document' && thisitem.nodename !== '#document-fragment') { att = thisitem.getattribute('xml:base'); // xml: namespaces must use 'xml' prefix if (att) { protocolpos = att.
indexof('//'); var protocolmatch = att.match(scheme); if (protocolmatch) { // if has protocol, can stop if (abs) { var skipfile = (att.
indexof('///') === protocolpos) ? 3 : 2; // if the file protocol has an extra slashe, prepare to also skip it in the separator search var att2 = att.
indexof('/', protocolpos+skipfile); // find first path separator ('/') after protocol if (att2 !
...null : xmlbase; return xmlbase...
CSS3 - Archive of obsolete content
k: due to insufficient browser support, standardization of the padding-box value may be postponed to the next iteration of this module. allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-
index pseudo-elements. at risk: due to insufficient browser support, standardization of the pseudo-elements ::value, ::choices, ::repeat-item, and ::repeat-
index may be postponed to the next iteration of this module . support for icons, defined by the css icon property simultaneously with the new icon value of the css content property. at risk: due to insufficient browser support, sta...
...the next iteration of this module. the ability to define the hotspot of a cursor as well as the new none, context-menu, cell, vertical-text, alias, copy, no-drop, not-allowed, nesw-resize, nwse-resize, col-resize, row-resize, all-scroll, zoom-in, zoom-out, extending the cursor property. the ability to specify the sequential navigation order (that is the tabbing order ) using the css nav-
index, nav-up, nav-right, nav-left, nav-down properties. at risk: due to insufficient browser support, standardization of the navigation properties may be postponed to the next iteration of this module. the ability to control the usage of an ime editor, using the css ime-mode property. at risk: due to insufficient browser support, standardization of the ime-mode property may be postpon...
...m to define exclusion regions in any positioning scheme. adds the notion of shapes, in which content must flows. filter effects module level 1 working draft css generated content for paged media module working draft adds the ability to tailor printed version of a document by allowing to control header, footer but also references tables like
indexes or tables of content. css page floats working draft css grid layout unknown css line grid module level 1 working draft css positioned layout module level 3 working draft css regions module level 1 working draft defines a new mechanism allowing content t...
Running Tamarin performance tests - Archive of obsolete content
ersion of avm2 --vmargs2 args to pass to avm2, if not specified --vmargs will be used --nooptimize do not optimize files when compiling --perfm parse the perfm results from avm --csv= also output to csv file, filename required --csvappend append to csv file instead of overwriting --score compute and print geometric mean of scores --
index=
index file to use (must end with .py) --save
index= save results to given
index file name option details
indexing: there are two command line flags that control
indexing: --
index and —save
index both require an
index filename to be specified after the flag. "--
index index.py" will load
index.py and run all of the tests in that
index and report results normalized to the
index val...
...d with .py) --save
index= save results to given
index file name option details
indexing: there are two command line flags that control
indexing: --
index and —save
index both require an
index filename to be specified after the flag. "--
index index.py" will load
index.py and run all of the tests in that
index and report results normalized to the
index values. a subset of the tests in the
index can be run by passing what tests you want to run after specifying the
index file. "--save
index indexname.py" will run the specified tests and save the values to the give
index file. specifying both --
index and --save
index will merge the values specified in --
index to the new saved
indexfile. cumulative score: new option of --score will display a cumulative score for every metric. really mos...
...ssing what tests you want to run after specifying the
index file. "--save
index indexname.py" will run the specified tests and save the values to the give
index file. specifying both --
index and --save
index will merge the values specified in --
index to the new saved
indexfile. cumulative score: new option of --score will display a cumulative score for every metric. really most useful with an
index file (or v8 tests), since running with raw time values will skew the results towards longer running tests csv output: "--csv filename" will save run results to a csv file that can be analyzed using excel pivottables. use --csvappend if you want to append the results to the csv file support files testconfig.txt this file contains instructions for how the harness should handle performance test...
enumValueNames - Archive of obsolete content
returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist. description enumvaluenames can be used to iterate through the values for a given key. ...
... returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist. description enumvaluenames can be used to iterate through the values for a given key. ...
... returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist. description enumvaluenames can be used to iterate through the values for a given key. ...
Attribute (XUL) - Archive of obsolete content
naccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefault
index container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset custom
index customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype dragging editable editort...
...pr firstdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltiptext group handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightnonmatches homepage href icon id ignoreblurwhilesearching ignorecase ignoreincolumnpicker ignorekeys image inactivetitlebarcolor increment
index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noa...
...dnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selected
index seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tab
index tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri ...
Introduction to XUL - Archive of obsolete content
taining main toolbar (and its contents) application-specific content area below toolbar area structure of a xul file our language of choice is xml, flavoured with css stylistic information. having said that, the details of a particular application of xml; say, the syntax for specifying a toolbar, are left to separate documents describing those particular applications. check the xptoolkit
index for the most recent list. since xul is a language for describing window layout, there is some overlap in the topics covered by this document and a separate document describing xul windows. the task of writing a xul window description is basically the same as the task of writing an html content description, with these exceptions: the syntax is xml (not that different from html 4), and there are s...
... element in the html namespace. <html:script type="application/javascript"> // dialog initialization code function initwindow() { var checkbox = document.getelementbyid("remember"); if (checkbox) checkbox.checked = true; } </html:script> javascript can be referenced as in html documents: as onclick handlers and the like. see individual widget documentation referenced at the
index for a list of attributes accepting javascript values. javascript is most safely kept in a separate file and included in the xul file <html:script language="javascript" src="our.js"/> or relegated to the contents of a cdata section, to prevent the xml parser from choking on javascript which may look like xml content (a < character, for instance.) <html:script type="application/javascript"> ...
...es, tree controls and the like. a window can just as easily contain html form elements (using the html namespace) like any html content (though there is no need to put them within a form element). in fact, xul largely uses extant widgets from html, with a few extensions and additions. each widget will define a unique xml syntax for describing itself; see the widget documentation referenced at the
index for details. other infrastructure widgets may have javascript event handlers just as in html, and are tied together using javascript and broadcaster nodes. broadcaster nodes are declared as <broadcaster> elements in the xul description, and are involved with the communication of changes of state between widgets. a widget or several widgets can arrange to have the value of one of their attribute...
removeItemAt - Archive of obsolete content
« xul reference home removeitemat(
index ) return type: element removes the child item in the element at the specified
index. the method returns the removed item. ...
... « xul reference home removeitemat(
index ) return type: element removes the child item in the element at the specified
index. the method returns the removed item. ...
... return type: element removes the child item in the element at the specified
index. the method returns the removed item. ...
Methods - Archive of obsolete content
ane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensure
indexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowserat
index getbrowserfordocument getbrowserfortab getbrowser
indexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor get
indexoffirstvisiblerow get
indexofitem getitemat
index getnextitem getnotificat...
...tnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto goto
index goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadw...
...referenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollby
index scrollbypixels scrollto
index select selectall selectitem selectitemrange selecttabat
index setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.d...
Property - Archive of obsolete content
tifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefault
index container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current current
index currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimal...
... locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement page
index pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel sear...
...pupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selected
index selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tab
index tabs tabscrolling tabpanels tag textlength tex...
button - Archive of obsolete content
used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the label of the button using the label attribute or by placing content inside the button. more information is available in the xul tutorial. attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tab
index, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tab
index, type examples <button label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the ...
...ntally or vertically. the default value depends on the element. you can also use the -moz-box-orient style property. horizontal child elements of the element are placed next to each other in a row in the order that they appear in the xul source. vertical child elements of the element are placed under each other in a column in the order that they appear in the xul source. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: one of the values below the type of button. if this attribute is not present, a normal button is created. leave the attribute out for a normal button. checkbox this type ...
...group attribute. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. open type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tab
index type: integer gets and sets the value of the tab
index attribute. type type: string gets and sets the value of the type attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), ...
caption - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a groupbox. it may contain either a text label, using the label attribute, or child elements for a more complex caption. more information is available in the xul tutorial. attributes accesskey, crop, image, label, tab
index properties accesskey, crop, image, label, tab
index examples <groupbox> <caption label="my groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox label="a checked groupbox"/> </caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. ...
...ent. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. crop type: string gets and sets the value of the crop attri...
...roperties accesskey type: character gets and sets the value of the accesskey attribute. crop type: string gets and sets the value of the crop attribute. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. tab
index type: integer gets and sets the value of the tab
index attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens,...
checkbox - Archive of obsolete content
ost commonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a label, specified with the label attribute, may be added beside the check box. more information is available in the xul tutorial. attributes accesskey, checked, command, crop, disabled, src, label, preference, tab
index properties accesskey, accessibletype, checked, command, crop, disabled, src, label, tab
index examples <checkbox label="enable javascript" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attrib...
...f this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type...
...ets the value of the command attribute. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. src type: url gets and sets the value of the src attribute. label type: string gets and sets the value of the label attribute. tab
index type: integer gets and sets the value of the tab
index attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributen...
datepicker - Archive of obsolete content
the mouse. to avoid this, you can use the workaround described here, i.e., use window.settimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. a monthchange event is fired for the grid and popup datepickers whenever a new month is navigated to or displayed. attributes disabled, firstdayofweek, readonly, type, tab
index, value properties date, dateleadingzero, datevalue, disabled, month, monthleadingzero, open, readonly, tab
index, value, year, yearleadingzero examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed...
... which day of the week to display as the first day in the grid. the values range from 0 to 6, where 0 is sunday and 6 is saturday. the default value is determined by the locale, so only use this attribute if you want to override it. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: one of the values below you can set the type attribute to one of the values below to specify the type of datepicker to use normal ...
...ld be displayed before the month when it is less than 10. open type: boolean for popup type datepickers, specifies whether the popup is open. set this property to open or close the popup. for non-popup datepickers, this property is always false. readonly type: boolean if set to true, then the user cannot modify the value of the element. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string the currently selected date in the form yyyy-mm-dd. unlike the month property, months in this value range from 01 to 12. set this property to change the selected date. year type: integer the currently selected year from 1 to 9999. set this property to c...
deck - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that displays only one of its children at a time. the selected
index attribute determines which child is displayed. more information is available in the xul tutorial. attributes selected
index properties selected
index, selectedpanel examples <deck selected
index="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selected
index type: integer gets and sets the
index of the currently selected panel. the first item is at
index 0. inherited from xul element align, allowevents, allownega...
...by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected do not hide panels; the deck element only understands visible panels. selectedpanel type: element holds a reference to the current...
..., insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties selected
index type: integer returns the
index of the currently selected item. you may select an item by assigning its
index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected do not hide panels; the deck element only understands visible panels. selectedpanel type: element holds a reference to the currently selected panel within a deck element. assig...
description - Archive of obsolete content
set either with the value attribute or by placing text inside the open and close description tags. the value attribute is used to set text that appears in a single line. if text appears as a child of the description, it will wrap to multiple lines. it may contain arbitrary markup, which can be styled as needed. more information is available in the xul tutorial. attributes crop, disabled, tab
index value properties accessibletype, crop, disabled, tab
index, value style classes header, indent, monospace, plain, small-margin examples this is a long section of text that will word wrap when displayed <description> this is a long section of text that will word wrap when displayed. </description> this is a long section of text that will not word wrap <description value="this is a l...
...llowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. ...
...not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
param - Archive of obsolete content
name type: string the name of a parameter within the sql statement. ...
... name type: string the name of a parameter within the sql statement. ...
... name type: string the name of a parameter within the sql statement. ...
preference - Archive of obsolete content
ences element. each preference element corresponds to a preference which is stored in the user's preferences file. you can connect a user interface element such as a checkbox to a preference element using the user interface element's preference attribute. more information is available in the preferences system article. attributes disabled, instantapply, inverted, name, onchange, readonly, tab
index, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tab
index, type, value, valuefrompreferences methods reset examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences> see preferences system for a complete example. attributes disabled type: boolean indicates whether the element is disab...
...ype="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected...
...ead-only. name type: string the name of the preference to change. for example, the browser's home page is set with the preference browser.startup.homepage. preferences type: element reference to the containing preferences element. readonly type: boolean if set to true, then the user cannot modify the value of the element. tab
index type: integer gets and sets the value of the tab
index attribute. type type: string gets and sets the value of the type attribute. value gets and sets the value of the user preference specified in name. in pref dialogs with instantapply == true (default on mac os x) this value is kept in sync with the actual value stored in the preferences (see valuefrom...
scale - Archive of obsolete content
the value by one unit, or the page up and page down keys to increment and decrement the value by one page, as specified by the pageincrement attribute. the home and end keys set the scale's value to the minimum and maximum values, respectively. a scale will fire a change event whenever the scale's value is modified. attributes dir, disabled, increment, max, min, movetoclick, pageincrement, tab
index, value properties disabled, max, min, increment, pageincrement, tab
index, value, methods decrease, decreasepage, increase, increasepage, examples horizontal scale: <scale min="1" max="10"/> vertical scale: <scale min="1" max="10" orient="vertical"/> attributes dir type: one of the values below the direction in which the child elements of the element are placed. n...
...only one increment in that direction. if not specified, the default value is used, which varies for each platform. pageincrement type: integer the amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. ...
.... increment type: integer gets and sets the value of the increment attribute. min type: integer gets and sets the value of the min attribute. max type: integer gets and sets the value of the max attribute. pageincrement type: integer gets and sets the value of the pageincrement attribute. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. methods inherited methods addeventlistener(), appendchild(), blur, click, ...
tabbox - Archive of obsolete content
ed to switch between each page. the tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. more information is available in the xul tutorial. ...
...nt which contains the tabs and the second a tabpanels element which contains the contents of the pages. more information is available in the xul tutorial. ...
...ode type: eventtarget indicates the node where keyboard navigation events listener is set up. the initial value for this property is determined by the value of the eventnode attribute. handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute. handlectrltab type: boolean gets and sets the value of the handlectrltab attibute. selected
index type: integer returns the
index of the currently selected item. you may select an item by assigning its
index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element. assigning a value to this property will modif...
timepicker - Archive of obsolete content
9, a change event handler may encounter erratic behavior when the time is changed using the keyboard instead of the mouse. to avoid this, you can use the workaround described here, i.e., use window.settimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. attributes disabled, hideseconds, increment, readonly, tab
index, value properties amindicator, datevalue, disabled, hideseconds, hour, hourleadingzero, increment, is24hourclock, ispm, minute, minuteleadingzero, pmindicator, readonly, second, secondleadingzero, tab
index, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
...cates whether to show the seconds field. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. increment type: integer indicates the number of minutes to skip each time the arrows are pressed. this should be used in combination with setting hideseconds to true. tab
index type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tab
index are later in the tab sequence. value type: string the initial value of the timepicker in either the form hh:mm:ss or hh:mm. properties amindicator type: string the string valu...
... if set to true, then the user cannot modify the value of the element. second type: integer the currently selected second from 0 to 59. set this property to change the selected second. secondleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the second when it is less than 10. tab
index type: integer gets and sets the value of the tab
index attribute. value type: string the currently entered time of the form hh:mm:ss. set this property to change the time. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), ...
Browser Detection and Cross Browser Support - Archive of obsolete content
o which was built on november 8, 2000. if you must detect gecko using the user agent string, gecko/ccyymmdd is the most appropriate string to search for. the third vendor/version (netscape6/6.0) identifies this particular instance of a gecko browser as netscape 6.0. many sites keyed off of the existence of the string netscape6 in the user agent and used tests similar to: if (navigator.useragent.
indexof('netscape6') != -1) { // netscape 6 code } note how this type of detection misses any other gecko based browser. unfortunately, the netscape 6 user agent string was not sufficiently generalizable due to it's use of the string netscape6 as a description of the vendor. netscape 7 corrects this error and introduces another chance for user agent string based detection to fail. mozilla/5.0 (...
...ach portion of // the rv value delimited by . // will be treated as value out of 100. // e.g. ...
...alue delimited by . // will be treated as value out of 100. // e.g. ...
Array.observe() - Archive of obsolete content
s an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed array after the change was made. type: a string indicating the type of change taking place. one of "add", "update", "delete", or "splice". oldvalue: only for "update" and "delete" types. the value before the change.
index: only for the "splice" type. the
index at which the change occurred. removed: only for the "splice" type. an array of the removed elements. addedcount: only for the "splice" type. the number of elements added. description the callback function is called each time a change is made to arr, with an array of all changes in the order in which they occurred. changes done via array ...
...ved: only for the "splice" type. an array of the removed elements. addedcount: only for the "splice" type. the number of elements added. description the callback function is called each time a change is made to arr, with an array of all changes in the order in which they occurred. changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes. ...
...rted as "splice" changes.
index assignment changes which do not change the length of the array may be reported as "update" changes. examples logging different change types var arr = ['a', 'b', 'c']; array.observe(arr, function(changes) { console.log(changes); }); arr[1] = 'b'; // [{type: 'update', object: <arr>, name: '1', oldvalue: 'b'}] arr[3] = 'd'; // [{type: 'splice', object: <arr>,
index: 3, removed: [], addedcount: 1}] arr.splice(1, 2, 'beta', 'gamma', 'delta'); // [{type: 'splice', object: <arr>,
index: 1, removed: ['b', 'c'], addedcount: 3}] specifications strawman proposal specification. ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
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 the heading was drawn over the floated image, in contradiction to the css specification. ...
... heading turned out to be a matter of relatively positioning the floated image, and then giving it a z-
index value. in order to create visual appeal, i decided 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 t...
...ns on card paragraphs, and then changed the left margin to be 160px, which makes sure the text in the paragraphs won't wrap under the floated images. this is desirable 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 r...
The Business Benefits of Web Standards - Archive of obsolete content
d. the payload might be slightly higher for the first page. but for accessing multiple pages of a site over many visits the savings in bandwidth are huge. improve search engine optimization without costs being well-placed in search engines is one of the hardest challenges faced by webmasters. in this case, every bit helps. by using semantic markup we greatly assist the search engines in their
indexing process. these things come naturally to standards developers without additional effort, time or thought. all their documents are properly marked up at the outset. the number of sites which do not include proper titles and descriptions in the meta is surprising. a lot of other sites would greatly increase their seo by simply using proper tags for the content. adding h1, h2, and h3, tags and so ...
...t, time or thought. all their documents are properly marked up at the outset. the number of sites which do not include proper titles and descriptions in the meta is surprising. a lot of other sites would greatly increase their seo by simply using proper tags for the content. adding h1, h2, and h3, tags and so on gives proper structure to hypertext documents. search engine agents crawl the web to
index it, but for ranking and
indexing purposes they can only process text. dynamic effects such as those created by javascript are not taken into account, and text rendered with graphics cannot be read and parsed either. separating presentation from content increases the information/markup ratio, making css-based documents more pertinent with regard to the search terms, which makes them rank higher in...
...tion/markup ratio, making css-based documents more pertinent with regard to the search terms, which makes them rank higher in search results. using css to render titles instead of graphics also helps in this regard. there are very significant differences in how search engines operate. instead of worrying about each engine and attempting to artificially manipulate the results, web standards pages
index and rank properly (where they deserve to) across all search engines. in the same way that standards hugely reduce the concern we need to have for browser differences, they also reduce the differences between the way search engines rank pages. there should be little need to plunge into the increasing costs and uncertain quality and integrity of proprietary pay per click campaigns. increase websi...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
/> <param name="backgroundcolor" value="0xc0c0c0" /> <param name="endimage" value="10" /> <param name="soundsource" value="audio"> <param name="soundtrack" value="spacemusic.au" /> <param name="sounds" value="1.au|2.au|3.au|4.au|5.au|6.au|7.au|8.au|9.au|0.au" /> <param name="pause" value="200" /> <p>you need the java plugin. get it from <a href="http://java.sun.com/products/plugin/
index.html">here.</a></p> </object> the above code mentions a version specific mime type, and if the mozilla-based browser such as netscape 7 doesn't have jre 1.4.1_01 installed, the alternate text is displayed. it isn't always necessary to give such a version specific mime type. if you aren't taking advantage of any version specific features, a more generic mime type such as application/x-java-vm wi...
...s such as netscape 7 also allow for a special classid attribute that can also be used. this is the special "java:" classid. here is an example using this invocation method: <object classid="java:nervoustext.class" width="534" height="50"> <param name="text" value="java 2 sdk, standard edition v1.4" /> <p>you need the java plugin. get it from <a href="http://java.sun.com/products/plugin/
index.html">here. </a> </p> </object> the "java:" classid allows you to reference the class that provides the primary entry point. the rest of the configuration parameters work via the param elements. applet -- the popular choice the applet element is still very much supported, and is the most popular way currently to invoke java applets. in netscape 7 and compuserve 7, the applet element dire...
...pe. if the preference is unchecked, the plugin finder service will be consulted only if the web page authordoes not specify either of these attributes. original document information author(s): arun k. ranganathan, netscape communications last updated date: 14. nov 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. ...
Implementing controls using the Gamepad API - Game development
te gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object. gamepad object there's lots of useful information contained in the gamepad object, with the states of buttons and axes being the most important: id: a string containing information about the controller.
index: a unique indentifier for the connected device. connected: a boolean variable, true if the device is connected. mapping: the layout type of the buttons; standard is the only available option for now. axes: the state of each axis, represented by an array of floating-point values. buttons : the state of each button, represented by an array of gamepadbutton objects containing pressed and value p...
...ifier for the connected device. connected: a boolean variable, true if the device is connected. mapping: the layout type of the buttons; standard is the only available option for now. axes: the state of each axis, represented by an array of floating-point values. buttons : the state of each button, represented by an array of gamepadbutton objects containing pressed and value properties. the
index variable is useful if we're connecting more than one controller and want to identify them to act accordingly — for example when we have a two-player game requiring two devices to be connected. querying the gamepad object beside connect() and disconnect(), there are two more methods in the gamepadapi object: update() and buttonpressed(). update() is executed on every frame inside the game loop...
...updated (see the latest.) it hasn't changed much, but it's good to know whats going on — the updates are as follows. getting the gamepads the navigator.getgamepads() method has been updated with a longer explanation and an example piece of code. now the length of the array of gamepads has to be n+1 where n is the number of connected devices — when there's one device connected and it has the
index of 1, the array's length is 2 and it will look like this: [null, [object gamepad]]. if the device is disconnected or unavailable, the value for it is set to null. mapping standard the mapping type is now an enumerable object instead of a string: enum gamepadmappingtype { "", "standard" }; this enum defines the set of known mappings for a gamepad. for now, there's only the standard lay...
Square tilemaps implementation: Static maps - Game development
re that map data, we can use a plain object or a custom class. for the sake of simplicity, in the example code a plain object has been used. it contains the basic map properties: cols: the width of the map, in columns. rows: the height of the map, in rows. tsize: the tile size, in pixels. tiles: a 1-dimensional array containing the visual grid. gettile(): a helper method that gets the tile
index in a certain position. tiles contains the actual visual map data. we are representing the tiles with indices, assigned to the tiles dependant on their position in the atlas (e.g. 0 for the left-most tile.) however, we must account for empty tiles, since they are crucial for implementing layers — empty tiles are usually assigned a negative
index value, 0, or a null value. in these examples, em...
...ontains the actual visual map data. we are representing the tiles with indices, assigned to the tiles dependant on their position in the atlas (e.g. 0 for the left-most tile.) however, we must account for empty tiles, since they are crucial for implementing layers — empty tiles are usually assigned a negative
index value, 0, or a null value. in these examples, empty tiles will be represented by
index 0, so we will shift the indices of the atlases by one (and thus the first tile of the atlas will be assigned
index 1, the second
index 2, etc.) the gettile() helper method returns the tile contained at the specified column and row. if tiles were a 2d matrix, then the returned value would just be tiles[column][row]. however, it's usually more common to represent the grid with a 1-dimensional arra...
...s the first tile of the atlas will be assigned
index 1, the second
index 2, etc.) the gettile() helper method returns the tile contained at the specified column and row. if tiles were a 2d matrix, then the returned value would just be tiles[column][row]. however, it's usually more common to represent the grid with a 1-dimensional array. in this case, we need to map the column and row to an array
index: var
index = row * map.cols + column; wrapping up, an example of a tilemap object could look like the following. this features an 8 x 8 map with tiles 64 x 64 pixels in size: var map = { cols: 8, rows: 8, tsize: 64, tiles: [ 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1...
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
crawlers follow rules. if you follow those rules closely when doing seo for a website, you give the site the best chances of showing up among the first results, increasing traffic and possibly revenue (for ecommerce and ads). ...
...crawlers follow rules. if you follow those rules closely when doing seo for a website, you give the site the best chances of showing up among the first results, increasing traffic and possibly revenue (for ecommerce and ads). ...
...ch engines give some guidelines for seo, but big search engines keep result ranking as a trade secret. seo combines official search engine guidelines, empirical knowledge, and theoretical knowledge from science papers or patents. seo methods fall into three broad classes: technical tag the content using semantic html. when exploring the website, crawlers should only find the content you want
indexed. copywriting write content using your visitors' vocabulary. use text as well as images so that crawlers can understand the subject. popularity you get most traffic when other established sites link to your site. learn more general knowledge seo on wikipedia learn seo google webmasters learning resources ...
Example 1 - Learn web development
em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
... /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0, 0, 0, .45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #...
Example 3 - Learn web development
this is the third example that explain how to build custom form widgets. ...
... this is the third example that explain how to build custom form widgets. ...
... background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
Using data attributes - Learn web development
andard attributes, extra properties on dom, or node.setuserdata(). html syntax the syntax is simple. any attribute on any element whose attribute name starts with data- is a data attribute. say you have an article and you want to store some extra information that doesn’t have any visual representation. just use data attributes for that: <article id="electric-cars" data-columns="3" data-
index-number="12314" data-parent="cars"> ... </article> javascript access reading the values of these attributes out in javascript is also very simple. you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property. to get a data attribute through the dataset object, get the property by the part of...
...heir full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property. to get a data attribute through the dataset object, get the property by the part of the attribute name after data- (note that dashes are converted to camelcase). const article = document.queryselector('#electric-cars'); article.dataset.columns // "3" article.dataset.
indexnumber // "12314" article.dataset.parent // "cars" each property is a string and can be read and written. in the above case setting article.dataset.columns = 5 would change that attribute to "5". css access note that, as data attributes are plain html attributes, you can even access them from css. for example to show the parent data on the article you can use generated content in css with the a...
...our own display routines. see this screencast for an example using generated content and css transitions (jsbin example). data values are strings. number values must be quoted in the selector for the styling to take effect. issues do not store content that should be visible and accessible in data attributes, because assistive technology may not access them. in addition, search crawlers may not
index data attributes' values. the main issues to consider are internet explorer support and performance. internet explorer 11+ provides support for the standard, but all earlier versions do not support dataset. to support ie 10 and under you need to access data attributes with getattribute() instead. also, the performance of reading data-attributes compared to storing this data in a regular js object...
Client-Server Overview - Learn web development
rate. it also has benefits in terms of maintenance, because you can change the url used to deliver a particular feature in one place, without having to change the handler function. for example, consider the following django (python) code that maps two url patterns to two view functions. ...
...r'^junior/$') because they use a pattern matching technique called "regular expressions" (regex, or re). ...
...ch 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_teams} return render(request, 'best/
index.html', context) after the junior() function gets the list of junior teams, it calls the render() function, passing the original httprequest, an html template, and a "context" object defining the information to be included in the template. the render() function is a convenience function that generates html using a context and an html template, and returns it in an httpresponse object. obviousl...
Beginning our React todo list - Learn web development
this way, it will match the <h1> at the top of our app. <title>todomatic</title> when your browser refreshes, you should see something like this: it's ugly, and doesn’t function yet, but that's okay — we'll style it in a moment. first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> eleme...
...se them in curly braces. if you write defaultchecked="true", the value of defaultchecked will be "true" — a string literal. remember — this is actually javascript, not html! the aria-pressed attribute used in our earlier code snippet has a value of true because aria-pressed is not a true boolean attribute in the way checked is. ...
... font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-
index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focu...
TypeScript support in Svelte - Learn web development
'completed' : 'active'}` todos[i] = { ...todos[i], ...todo } } let filter: filter = filter.all const filtertodos = (filter: filter, todo...
...f the <script> section with the following: import type { todotype } from '../types/todo.type' export let todos: todotype[] we will also specify the headingel, which we used to bind to the heading tag, as an htmlelement. update the let headingel line with the following: let headingel: htmlelement finally, you'll notice the following error reported, related to where we set the tab
index attribute. that's because typescript is type-checking the <h2> element and expects tab
index to be of type number. to fix it, replace tab
index="-1" with tab
index={-1}, like this: <h2 id="list-heading" bind:this={headingel} tab
index={-1}>{completedtodos} out of {totaltodos} items completed</h2> this way typescript can prevent us from incorrectly assigning it to a string variable. n...
...iagnostics... ==================================== ./svelte-todo-typescript/src/app.svelte:8:12 error: argument of type '{ handler: () => void; }' is not assignable to parameter of type 'jsonvalue'. types of property 'handler' are incompatible. type '() => void' is not assignable to type 'jsonvalue'. type '() => void' is not assignable to type '{ [key: string]: jsonvalue; }'.
index signature is missing in type '() => void'. (ts) $todos = { handler: () => {} } this is another example of how specifying types can make our code more robust, and help us catch more bugs before they get into production. and that's it. we've converted our whole application to use typescript. bulletproofing our stores with generics our stores have already been ported to typescript but we can do...
Focus management with Vue refs - Learn web development
ed a way to provide assistive technology users with information that confirms that an element was deleted. we're already tracking the number of elements in our list heading — the <h2> in app.vue — and it's associated with our list of to-do items. this makes it a reasonable place to move focus to when we delete a node. first, we need to add a ref to our list heading. we also need to add a tab
index="-1" to it — this makes the element programmatically focusable (i.e. it can be focused via javascript), when by default it is not. inside app.vue, update your <h2> as follows: <h2 id="list-summary" ref="listsummary" tab
index="-1">{{listsummary}}</h2> note: tab
index is a really powerful tool for handling certian accessibility problems. however, it should be used with caution. over-using tab...
...="-1" to it — this makes the element programmatically focusable (i.e. it can be focused via javascript), when by default it is not. inside app.vue, update your <h2> as follows: <h2 id="list-summary" ref="listsummary" tab
index="-1">{{listsummary}}</h2> note: tab
index is a really powerful tool for handling certian accessibility problems. however, it should be used with caution. over-using tab
index="-1" can cause problems for all sorts of users, so only use it exactly where you need to. you should also almost never use tab
index > = 0, as it can cause problems for users since it can make the dom flow and the tab-order mismatch, and/or add non-interactive elements to the tab order. this can be confusing to users, especially those using screen readers and other assistive technology. now that...
...r assistive technology. now that we have a ref and have let browsers know that we can programmatically focus the <h2>, we need to set focus on it. at the end of deletetodo(), use the listsummary ref to set focus on the <h2>. since the <h2> is always rendered in the app, you do not need to worry about using $nexttick of lifecycle methods to handle focusing it. deletetodo(todoid) { const item
index = this.todoitems.find
index(item => item.id === todoid); this.todoitems.splice(item
index, 1); this.$refs.listsummary.focus(); } now, when you delete an item from your list, focus should be moved up to the list heading. this should provide a reasonable focus experience for all of our users. summary so that's it for focus management, and for our app! congratulations for working your way ...
Handling common JavaScript problems - Learn web development
browsers (see strict mode in browsers). typed arrays allow javascript code to access and manipulate raw binary data, which is necessary as browser apis for example start to manipulate streams of raw video and audio data. these are available in ie10 and above, and all modern browsers. there are also many new apis appearing in recent browsers, which don't work in older browsers, for example:
indexeddb api, web storage api, and others for storing website data on the client-side. web workers api for running javascript in a separate thread, helping to improve performance. webgl api for real 3d graphics. web audio api for advanced audio manipulation. webrtc api for multi-person, real-time video/audio connectivity (e.g. video conferencing). there are a few strategies for handling incompat...
...ry about cross browser differences. the library will manipulate appropriate apis in the background so the functionality will work whatever the browser (in theory). for example, localforage is a library for client-side data storage, which provides a simple syntax for storing and retrieving data. in the background, it uses the best api the browser has available for storing the data, whether that is
indexeddb, web storage, or even websql (which is now deprecated, but is still supported in some older versions of safari/ie). as another example, jquery when choosing a library to use, make sure that it works across the set of browsers you want to support, and test your implementation thoroughly. also make sure that the library is popular and well-supported, and isn't likely to just become obsolete n...
...he browser is (version, name, os, etc.) in the bad only days when pretty much everyone used netscape or internet explorer, developers used to use so-called browser sniffing code to detect which browser the user was using, and give them appropriate code to work on that browser. the code used to look something like this (although this is a simplified example): let ua = navigator.useragent; if(ua.
indexof('firefox') !== -1) { // run firefox-specific code } else if(ua.
indexof('chrome') !== -1) { // run chrome-specific code } the idea was fairly good — detect what browser is viewing the site, and run code as appropriate to make sure the browser will be able to use your site ok. note: try opening up your javascript console now and running navigator.useragent, to see what you get returned. ...
Command line crash course - Learn web development
age information, even if it is long. it'll help you to understand better how the tool is intended to be used. playing with prettier let’s have a quick play with prettier, so you can see how it works. first of all, create a new directory somewhere on your file system that is easy to find. maybe a directory called prettier-test on your desktop. ...
...forgot to run prettier? so there's some code styles that can be fixed. no problem. ...
...the following code in a new file called
index.js, inside your test directory: const myobj = { a:1,b:{c:2}} function printme(obj){console.log(obj.b.c)} printme(myobj) we can run prettier against a codebase to just check if our code wants adjusting. cd into your directory, and try running this command: prettier --check
index.js you should get on output along the lines of checking formatting...
index.js code style issues found in the above file(s). forgot to run prettier? so there's some code styles that can be fixed. no problem. adding the --write option to the prettier command will fix those up, leaving us to focus on actually writing useful code. now try running this version of the command: prettier --write
index.js you’ll get an output like this checking formatting...
index.js code...
Introducing a complete toolchain - Learn web development
, you'll get a version number returned like 2.0.2; if not, it'll return something along the lines of "command not found". if this is the case, install it using the following command: npm install prettier -g now that prettier is installed, running and tidying your code can be done on the command line on an individual file basis from anywhere on your computer, for example: prettier --write ./src/
index.html note: in the command above, i use prettier with the --write flag. prettier understands this to mean "if there's problems in my code format, go ahead and fix them, then save my file". this is fine for our development process, but we can also use prettier without the flag and it will only check the file. checking the file (and not saving it) is useful for purposes like checks that run before...
...wever, bear in mind that if you want to refine and enforce a rule about how your code looks (or validates), it's very likely that it can be done with the right eslint configuration. a little later in this chapter, we'll provide the eslint config. once a working configuration is in place, running the command can generate some useful information. here is an example eslint output: ./my-project/src/
index.js 2:8 error 'react' is defined but never used no-unused-vars 22:20 error 'body' is defined but never used no-unused-vars 96:19 error 'b' is defined but never used no-unused-vars ✖ 3 problems (3 errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now. as with other tools, code editor integration support is typically good for eslint, a...
...o start working with our project, we’ll run the parcel server on the command line. in its default mode it will watch for changes in your code and automatically install your dependencies. this is nice because we don't have to flit back and forth between the code and the command line. to start parcel off in the background, go to your terminal and run the following command: npx parcel src/
index.html you should see an output like this (once the dependencies have been installed): server running at http://localhost:1234 ✨ built in 129ms. parcel also installs the dependencies that we will use in our code, including react, react-dom, react-async-hook, date-fns, and format-number. this first run will therefore be longer than a typical run of parcel. note: if you run parcel o...
Debugging on Mac OS X
e # attach to an already running app). the breakpoint runs some commands to # figure out the object directory path from the attached target and then # sources the .lldbinit from there. # # note: this scripts actions take a few seconds to complete, so the custom # formatters, commands etc. that are added may not be immediately available. # breakpoint set --name nsthread::processnextevent --thread-
index 1 --auto-continue true --one-shot true breakpoint command add -s python # this script that we run does not work if we try to use the global 'lldb' # object, since it is out of date at the time that the script runs (for # example, `lldb.target.executable.fullpath` is empty). therefore we must # get the following objects from the 'frame' object. target = frame.getthread().getpr...
...lete our breakpoint (not actually necessary with `--one-shot true`): target.breakpointdelete(bp_loc.getbreakpoint().getid()) # for completeness, find and delete the dummy breakpoint (the breakpoint # lldb creates when it can't initially find the method to set the # breakpoint on): # bug workaround! ...
... set the # breakpoint on): # bug workaround! getid() on the *dummy* breakpoint appears to be returning # the breakpoint
index instead of its id. we have to add 1 to correct for # that! :-( dummy_bp_list = lldb.sbbreakpointlist(target) debugger.getdummytarget().findbreakpointsbyname("nsthread::processnextevent", dummy_bp_list) dummy_bp_id = dummy_bp_list.getbreakpointat
index(0).getid() + 1 debugger.getdummytarget().breakpointdelete(dummy_bp_id) # "source" the mozilla project .lldbinit: os.chdir(target.executable.fullpath.split("/dist/")[0]) debugger.handlecommand("command source -s true " + os.path.join(os.getcwd(), ".lldbinit")) done see debugging mozilla with lldb for more information. having a profile for debugging purposes it is recommended...
Message manager overview
n tab: three times, in the diagram above. similarly, if you send a message using the global frame message manager, it's received by all content tabs, and is then delivered to any frame scripts that are listening for it. ...
...frame script using the window message manager it gets loaded separately into each tab open in that particular window. if you send a message using the window message manager, it gets sent to all content tabs in that window. ...
...is global to the parent process. messages sent using the gppmm get sent to all cpmms in all child processes. process scripts loaded using the gppmm get loaded in all child processes. ...
PR_GetThreadPrivate
returns null if the data has not been set. description pr_getthreadprivate may be called at any time during a thread's execution. ...
... returns null if the data has not been set. description pr_getthreadprivate may be called at any time during a thread's execution. ...
... returns null if the data has not been set. description pr_getthreadprivate may be called at any time during a thread's execution. ...
PR_SetThreadPrivate
sets per-thread private data. syntax #include <prthread.h> prstatus pr_setthreadprivate(pruintn
index, void *priv); parameters pr_setthreadprivate has the following parameters:
index an
index into the per-thread private data table. priv the per-thread private data, or more likely, a pointer to the data. returns the function returns one of the following values: if successful, pr_success. if the
index is invalid, pr_failure. description if the thread already has non-null private data associated with it, and if the destructor function for the
index is known (not null), nspr calls the destructor function associated with the
index before setting the new data value. the pointer at the
index is swapped with null. if the swapped out value is not null, the destructor function is c...
... if the thread already has non-null private data associated with it, and if the destructor function for the
index is known (not null), nspr calls the destructor function associated with the
index before setting the new data value. the pointer at the
index is swapped with null. if the swapped out value is not null, the destructor function is called. on return, the private data associated with the
index is reassigned the new private data's value, even if it is null. the runtime provides no protection for the private data. the destructor is called with the runtime holding no locks. synchronization is the client's responsibility. ...
...apped out value is not null, the destructor function is called. on return, the private data associated with the
index is reassigned the new private data's value, even if it is null. the runtime provides no protection for the private data. the destructor is called with the runtime holding no locks. synchronization is the client's responsibility. the only way to eliminate thread private data at an
index prior to the thread's termination is to call pr_setthreadprivate with a null argument. this causes the
index's destructor function to be called, and afterwards assigns a null in the table. a client must not delete the referant object of a non-null private data without first eliminating it from the table. ...
64-bit Compatibility
nctions in lirwriter: ins_i2p() - on 32-bit platforms, does nothing. on 64-bit platforms, performs a lir_i2q. ins_u2p() - on 32-bit platforms, does nothing. on 64-bit platforms, performs a lir_u2q. ins_p2i() - on 32-bit platforms, does nothing. on 64-bit platforms, performs a lir_qlo. a common use for extending values is to perform advanced addressing. for example, this code tries to load an
index from an integer array, but it is not portable: lir->insload(lir_ldp, lir->ins2(lir_piadd, arrayins, lir->ins2i(lir_mul,
indexins, sizeof(int)) ), 0); the sanityfilter will assert on a 64-bit platform because lir_piadd (which will be lir_qiadd) needs both operands to be 64-bit. the correct code is, assu...
...integer array, but it is not portable: lir->insload(lir_ldp, lir->ins2(lir_piadd, arrayins, lir->ins2i(lir_mul,
indexins, sizeof(int)) ), 0); the sanityfilter will assert on a 64-bit platform because lir_piadd (which will be lir_qiadd) needs both operands to be 64-bit. ...
...r_mul,
indexins, sizeof(int)) ), 0); the sanityfilter will assert on a 64-bit platform because lir_piadd (which will be lir_qiadd) needs both operands to be 64-bit. ...
JS_AliasElement
syntax jsbool js_aliaselement(jscontext *cx, jsobject *obj, const char *name, jsint alias); name type description cx jscontext * the context in which to create the alias. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...ion cx jscontext * the context in which to create the alias. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object for which to create the alias. name const char * name of the element for which to create an alias. this name corresponds to a string representation of the element's current
index number. alias jsint alias number to assign to the element. description js_aliaselement assigns an alternate
index number for an element or numeric property associated with a native object. obj is the object to which the element belongs. name is the element's current
index in the object, and alias is the alternate
index to assign to the element. this feature is deprecated, mea...
...if the alias is successfully created and associated with the property, js_aliaselement returns js_true. adding an alias element does not change the element array length. ...
JS_LookupElement
obsolete since jsapi 37this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine if a specified numeric property exists. syntax bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to look up the property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search.
index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of...
... cx jscontext * the context in which to look up the property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search.
index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of obj[
index], or undefined if the element does not exist. description js_lookupelement examines a specified javascript object, obj, for a numeric property numbered
index. note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the ecmascript standard also sp...
...language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the ecmascript standard also specifies this behavior: see ecma 262-3 §11.2.1, step 6. so any call to js_lookupelement is equivalent to a call to js_lookupproperty passing a numeric string for the name. if the property obj[
index] exists, js_lookupelement sets *vp to the property's stored value and returns true. if no such property exists, js_lookupelement sets *vp to undefined and returns true (to indicate that no error occurred). on error or exception, js_lookupelement returns false, and the value left in *vp is undefined. js_lookupelement does not distinguish between a property with a value of undefined and a property...
JS_SET_TRACING_DETAILS
callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type description trc jstracer * the tracer. ...
... callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type description trc jstracer * the tracer. buf char * out parameter. ...
...iption trc jstracer * the tracer. buf char * out parameter. the callback stores a string describing the reference traced in buf. bufsize size_t the size of buf, in chars. description set debugging information about a reference to a traceable thing to prepare for the following call to js_calltracer. when printer is null, arg must be const char * or char * c string naming the reference and
index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an
index into some array vector that stores the reference. when printer is not null, the arg and
index arguments are available to the callback as the debugprinterarg and debugprint
index fields of trc. the storage for name or callback's arguments needs to live only until the following call to js_calltrac...
Property attributes
otype, creates a new own data property on obj; the prototype's .x is not shared with its children. if the inherited property is shared, the setter is called instead. if the property is also jsprop_permanent, then certain aspects of inheriting the property via the prototype chain are affected. do not depend on this. see bug 575997. ...
...some objects like function/object have self-hosted functions that can only be defined after the initialization is already finished. ...
...prop_ignore_value see also bug 575997 - for jsprop_shared bug 1088002 - added jsprop_propop_accessors bug 825199 - added jsprop_define_late bug 365851 - added jsfun_stub_gsops bug 581263 - added jsfun_constructor bug 1101123 - added jsprop_redefine_nonconfigurable bug 1037770 - added jsop_ignore_* bug 1105518 - for jsprop_redefine_nonconfigurable bug 1138489 - removed jsprop_
index bug 1140482 - added jsprop_resolving ...
JSAPI reference
ed in spidermonkey 1.8 obsolete since jsapi 31 jsval_trace_kind added in spidermonkey 1.8 obsolete since jsapi 31 js_tracer_init added in spidermonkey 1.8 obsolete since jsapi 12 js_tracerinit added in spidermonkey 12 obsolete since jsapi 31 js_calltracer added in spidermonkey 1.8 obsolete since jsapi 22 js_set_tracing_details added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_
index added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_name added in spidermonkey 1.8 obsolete since jsapi 26 js_call_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_value_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_object_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_string_tracer added in spidermonkey 1.8 obsolete since jsa...
...tra settings and does not call setters. similarly, "lookup" is a lower-level version of "get" that offers extra options and does not call getters. ...
...olete since jsapi 23 a spidermonkey extension allows a native function to return an lvalue—that is, a reference to a property of an object: js_setcallreturnvalue2 obsolete since javascript 1.8.5 id a jsid is an identifier for a property or method of an object. ...
History Service Design
the old long searches through tree views. this is possible through a relevance algorithm that assigns a param called frecency to every page in history, see the places frecency algorithm for major informations. history service provides the basics to create such adaptive search paths, allowing for a better browsing experience through a common interface. long term objectives include the ability to
index more informations from the visited pages, through fulltext
indexes, and the possibility to generalize the frecency algorithm to allow for its use in user's queries. might be also nice to provide a hook for third-party products so they can provide text searching capabilities to the places system. places core history service (nsinavhistoryservice.idl) is the core of places, every other places ser...
...rdingly (maybe restoring a backup). once the database connection has been set-up the schema version of the database is checked. schema version is upgraded every time a change is made to the database schema, history service will eventually upgrade the database, moving and fixing its datas accordingly. in case the database has been created for the first time history service will create all tables,
indexes and triggers, calling related inittables static methods of other dependant services. finally temporary tables,
indexes and triggers are created, this happens at every run since those entities are removed when closing the connection. temporary storage is used to avoid too frequent writes to the disk, since those are most likely to cause fsyncs (to ensure data integrity) on the target filesystem...
... up locking the ui till the database i/o to save data is complete. for this reason visits and favicons are added lazily on a timer. in future this will probably change in favour of storage asynchronous statements, so that the inserts will be queued-up by mozstorage itself in a separate thread. sql queries are built with performance in mind, and constantly tested against large databases. database
indexes are quite important, and a good query can make the difference between minutes or seconds. many queries are especially optimized, for example limited history queries, often used to build menus, allowing for good performances even in presence of a really large history. storing pages and visits pages (intended as uris) are stored into a table shared by both history and bookmarks, every url is un...
Places utilities for JavaScript
nodeiscontainer(nsinavhistoryresultnode anode); boolean nodeisdynamiccontainer(nsinavhistoryresultnode anode); boolean nodeislivemarkcontainer(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean nodeislivemarkitem(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean isreadonlyfolder(nsinavhistoryresultnode anode); int get
indexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int
index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, bo...
...vice. boolean nodeislivemarkitem(anode) determines whether a result node is a live-bookmark item parameters anode the node to check. return type returns a boolean. isreadonlyfolder() determines whether or not a node is a readonly folder. boolean isreadonlyfolder(anode) parameters anode the node to check. return type return true if the node is a folder, false otherwise. get
indexofnode() gets the
index of a node within its parent container int get
indexofnode(anode) parameters anode the node to look up return type returns the
index of the node within its parent container, or -1 if the node was not found or the node specified has no parent. wrapnode() string-wraps a result node according to the rules of the specified content type. string wrapnode(anode, ...
...b a blob (string) of data, in some format we potentially know how to parse. type the content type of the blob. return type returns an array of objects representing each item contained by the source. maketransaction() constructs a transaction for the drop or paste of a blob of data into a container. maketransaction(data, type, container,
index, copy) parameters data the unwrapped data blob of dropped or pasted data. type the content type of the data container the container the data was dropped or pasted into
index the
index within the container the item was dropped or pasted at copy the drag action was copy, so don't move folders or links. return type returns an object implementing nsitransaction that ...
NS_ConvertASCIItoUTF16
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
NS_ConvertUTF16toUTF8
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
NS_ConvertUTF8toUTF16
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
NS_LossyConvertUTF16toASCII
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsAdoptingCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsAdoptingString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsAutoString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsCAutoString
@param aset -- characters to b...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void...
...g&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, c...
nsCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsDependentCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsDependentString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsFixedCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsFixedString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsPromiseFlatCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsPromiseFlatString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
nsXPIDLCString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...int32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swa...
nsXPIDLString
@param aset -- characters to be cut from th...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - so...
...ruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string. @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - so...
inIDOMUtils
ing apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselector
index); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselector
index); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname)...
... value state 1 :active 2 ...
...state ); parameters aelement the element to set the content state of. astate the content state to set. this must be one (and only one) of the values listed in content state flags. selectormatcheselement() checks if a given selector from a style rule matches an element. bool selectormatcheselement ( in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselector
index, in domstring apseudo optional ) parameters aelement the element to check the selector against. arule the style rule containing the selector. aselector
index the
index of the selector. apseudo optional a string specifying the pseudo-element to match. may be omitted when checking the regular elements. addpseudoclasslock() makes the element take on style properties that would apply...
nsIAccessibleEvent
event_hyperlink_number_of_anchors_changed 0x0052 0x004e the number of anchors associated with this hyperlink object has changed. event_hyperlink_selected_link_changed 0x0053 0x004f the hyperlink selected state changed from selected to unselected or from unselected to selected. event_hypertext...
... event_hyperlink_number_of_anchors_changed 0x0052 0x004e the number of anchors associated with this hyperlink object has changed. event_hyperlink_selected_link_changed 0x0053 0x004f the hyperlink selected state changed from selected to unselected or from unselected to selected. event_hypertext_link_activated 0x0054 0x0050 one of th...
...ected_link_changed 0x0053 0x004f the hyperlink selected state changed from selected to unselected or from unselected to selected. event_hypertext_link_activated 0x0054 0x0050 one of the links associated with the hypertext object has been activated. event_hypertext_link_selected 0x0055 0x0051 one of the links associated with the hypertext object has been selected. event_hyperlink_start_
index_changed 0x0056 0x0052 the starting
index of this link within the containing string has changed. event_hypertext_changed 0x0057 0x0053 focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object. event_hypertext_nlinks_changed 0x0058 0x0054 the number of hyperlin...
nsIHttpServer
unction callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.
indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1'] ...
...t match the production, such as for cgi functionality. * @note * implementations may treat type as a trusted argument; users who fail to * generate this string from trusted data risk security vulnerabilities. */ void registercontenttype(in string extension, in string type); /** * sets the handler used to display the contents of a directory if * the directory contains no
index page. * * @param handler * an object which will handle any requests for directories which * do not contain
index pages, or null to reset to the default *
index handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 * response will be returned. an nsifile corresponding to the * directory is available...
...*/ readonly attribute nsihttpserveridentity identity; /** * retrieves the string associated with the given key in this, for the given * path's saved state. all keys are initially associated with the empty * string. ...
nsITreeContentView
the nsitreecontentview interface is implemented by tree views that are backed by dom content. it is typically reached by calling queryinterface on a nsitreeview. layout/xul/base/src/tree/public/nsitreecontentview.idlscriptable please add a summary to this article. ...
...iew interface is implemented by tree views that are backed by dom content. it is typically reached by calling queryinterface on a nsitreeview. layout/xul/base/src/tree/public/nsitreecontentview.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview long get
indexofitem(in nsidomelement item); nsidomelement getitemat
index(in long
index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods get
indexofitem() retrieve the
index associated with the specified content item. long get
indexofitem( in nsidomelement item ); parameters item a tree row for which to find the row
index. return value a non-...
...ttributes attribute type description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods get
indexofitem() retrieve the
index associated with the specified content item. long get
indexofitem( in nsidomelement item ); parameters item a tree row for which to find the row
index. return value a non-negative integer row
index if the row was found within the tree. returns -1 if the item was not found. getitemat
index() retrieve the content item associated with the specified
index. nsidomelement getitemat
index( in long
index ); parameters
index the row
index for which to get the item return value the nsidomelement item. remarks the nsitreecontentview interface only applies to trees with dom element children, and doe...
nsIUpdateManager
t/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that maintains a list of previously installed updates, as well as the currently in use update. ...
...saveupdates() saves all updates to disk. void saveupdates(); parameters none. ...
...pe description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the specified
index into the history list. nsiupdate getupdateat( in long
index ); parameters
index an
index into the history list for the nsiupdate to retrieve. return value the nsiupdate at the specified
index into the history list. saveupdates() saves all updates to disk. void saveupdates(); parameters none. see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiupdatepatch nsiapplicationupdateservice nsiupdateprompt nsiupdatetimermanager ...
nsIWebNavigation
s: * @mozilla.org/browser/shistory-internal;1 * @mozilla.org/browser/shistory;1 * @mozilla.org/embedding/browser/nswebbrowser;1 * @mozilla.org/docshell;1 gecko 1.9.2 note in gecko 1.9.2 (firefox 3.6), the @mozilla.org/webshell;1 component no longer exists; you need to use @mozilla.org/docshell;1 instead. ...
....org/browser/shistory-internal;1 * @mozilla.org/browser/shistory;1 * @mozilla.org/embedding/browser/nswebbrowser;1 * @mozilla.org/docshell;1 gecko 1.9.2 note in gecko 1.9.2 (firefox 3.6), the @mozilla.org/webshell;1 component no longer exists; you need to use @mozilla.org/docshell;1 instead. ...
...nt is loaded from the cache (if available) and page state (such as form values and scroll position) is restored. void goback( ); goforward() tells the object to navigate to the next session history item. when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is restored. void goforward( ); goto
index() tells the object to navigate to the session history item at a given
index. void goto
index( in long
index ); parameters
index the
index of the session history item to go to. loaduri() loads a given uri. this will give priority to loading the requested uri in the object implementing this interface. if it can't be loaded here however, the uri dispatcher will go through its normal proc...
nsIWindowsRegKey
efox 1.5 / thunderbird 1.5 / seamonkey 1.0) the interface represents a single key in the registry. this interface is highly win32 specific. ...
...ace represents a single key in the registry. this interface is highly win32 specific. ...
...alues defined above. createchild() this method opens or creates a subkey relative to this key. nsiwindowsregkey createchild( in astring relpath, in unsigned long mode ); parameters relpath mode return value nsiwindowsregkey for the newly opened or created subkey. getchildname() this method returns the name of the n'th child key. astring getchildname( in unsigned long
index ); parameters
index the
index of the requested child key. return value the name of the n'th child key. getvaluename() this method returns the name of the n'th value under this key. astring getvaluename( in unsigned long
index ); parameters
index the
index of the requested value. return value the name of the n'th value under this key. getvaluetype() this method returns the ...
Performance
, explain select * from moz_history; the results are hard to understand, but you should be able to see whether it is using indices. a command that will give you a higher level overview is "explain query plan". for example sqlite> explain query plan select * from moz_historyvisit v join moz_history h on v.page_id = h.id where v.visit_date > 1000000000; 0|0|table moz_historyvisit as v with
index moz_historyvisit_date
index 1|1|table moz_history as h using primary key this tells us that it will first look up in moz_historyvisit using an
index, and will then look up in moz_history using the primary key. both of these are "good" because they use indices and primary keys, which are fast. sqlite> explain query plan select * from moz_historyvisit where session = 12; 0|0|table moz_historyvisit ...
...you can download the command line tool from the sqlite download page. be sure you have a version of the command line tool that is at least as recent as what mozilla uses. ...
... a percentage of memory in nsnavhistory::initdb in toolkit/components/places/src/nsnavhistory.cpp. sharding the cache between connections by default, storage enables the sqlite shared-cache mode which makes multiple connections to the same database share the same cache. the cache is threadsafe. all you need to do is use services.storage.opendatabase(file). some features (virtual tables, full text
indexes) are not compatible with shared cache - then you need to use services.storage.openunshareddatabase(file), which doesn't share the cache. see mozistorageservice.opendatabase(). disk writes sqlite provides the basic acid rules of database theory: atomicity: each transaction is atomic and cannot be "partially" committed. consistency: the database won't get corrupted. isolation: multiple tra...
Warnings
storage sometimes warns about things to stderr. this page is designed to help explain the cause and possible solutions for these warnings. sort operations this warning message will say something about the number of sort operations that have occurred for a sql statement. this happens when you have an order by clause that does not use an
index. ...
... storage sometimes warns about things to stderr. this page is designed to help explain the cause and possible solutions for these warnings. sort operations this warning message will say something about the number of sort operations that have occurred for a sql statement. this happens when you have an order by clause that does not use an
index. ...
...e cause and possible solutions for these warnings. sort operations this warning message will say something about the number of sort operations that have occurred for a sql statement. this happens when you have an order by clause that does not use an
index. when you do not use an
index, all the results from the query have to first be fetched, and then those results are sorted. however, when the
index is used, the data can be obtained row by row from the database, which will be much faster. if, for some reason you cannot use an
index in your order by clause, you can suppress this warning by including a sql comment in your query that contains this text: /* do not warn (bug [everything in these brackets does not matter] */ the bug mentioned should explain why the query cannot use an
index. ...
Creating a gloda message query
ns/demo_addon, demo3, it seems that the attributename given in these files is the constraintname to be used (e.g. query.subjectmatches(searchstring) for message subject (compare fundattr.js line 145 ). create a collection from the query your listener is notified as messages are added to the collection as the database query completes. ...
...atches(searchstring) for message subject (compare fundattr.js line 145 ). create a collection from the query your listener is notified as messages are added to the collection as the database query completes. you may also see new messages show up if new messages are
indexed that meet the constraints. ...
...are added to the collection as the database query completes. you may also see new messages show up if new messages are
indexed that meet the constraints. ...
Using js-ctypes
it os x carbon is not available in 64bit versions of os x, therefore core foundation must be used. the below will do the same as standardalert from above, it will use the core foundation function of cfusernotificationdisplaynotice. ...
...tor.ptr; var unichar = ctypes.jschar; // uint16 with automatic conversion // define constants var kcfusernotificationstopalertlevel = 0; var kcfusernotificationnotealertlevel = 1; var kcfusernotificationcautionalertlevel = 2; var kcfusernotificationplainalertlevel = 3; // declare functions /* https://developer.apple.com/library/mac/documentation/corefoundation/reference/cfusernotificationref/
index.html#//apple_ref/c/func/cfusernotificationdisplaynotice * sint32 cfusernotificationdisplaynotice ( * cftimeinterval timeout, * cfoptionflags flags, * cfurlref iconurl, * cfurlref soundurl, * cfurlref localizationurl, * cfstringref alertheader, * cfstringref alertmessage, * cfstringref defaultbuttontitle * ); */ var cfusernotificationdisplaynotice = libcf.declare("cfuser...
... * void cfrelease ( * cftyperef cf * ); */ var cfrelease = libcf.declare('cfrelease', ctypes.default_abi, void, // return cftyperef // cf ); /* https://developer.apple.com/library/mac/documentation/corefoundation/reference/cfstringref/#//apple_ref/c/func/cfstringcreatewithcharacters * cfstringref cfstringcreatewithcharacters ( * cfallocatorref alloc, * const unichar *chars, * cf
index numchars * ); */ var cfstringcreatewithcharacters = libcf.declare('cfstringcreatewithcharacters', ctypes.default_abi, cfstringref, // return cfallocatorref, // alloc unichar.ptr, // *chars cf
index // numchars ); // helper functions function makecfstr(jsstr) { // js str is just a string // returns a cfstr that must be released with cfrelease when done return cfstringcreatewithchara...
Intensive JavaScript - Firefox Developer Tools
wser to run the given function in each frame, just before it performs a repaint. as long as each function is reasonably small, the browser should be able to keep inside its frame budget. ...
..., just before it performs a repaint. as long as each function is reasonably small, the browser should be able to keep inside its frame budget. ...
...split up calculateprimes(): we will just calculate primality for each number in a separate function: function dopointlesscomputationswithrequestanimationframe() { function testcandidate(
index) { // finishing condition if (
index == iterations) { console.log(primes); pointlesscomputationsbutton.disabled = false; return; } // test this number var candidate =
index * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } // schedule the next var testfunction = testcandidate.bind(this,
index + 1); window.requestanimationframe(t...
AudioNode.connect() - Web APIs
the connect() method of the audionode interface lets you connect one of the node's outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's output data is automatically used to change the value of that parameter over time. syntax var destinationnode = audionode.connect(destination, output
index, input
index); audionode.connect(destination, output
index); parameters destination the audionode or audioparam to which to connect. output
index optional an
index specifying which output of the current audionode to connect to the destination. the
index numbers are defined according to the number of output channels (see audio channels). while you can only connect a given output to a given input once ...
...g which output of the current audionode to connect to the destination. the
index numbers are defined according to the number of output channels (see audio channels). while you can only connect a given output to a given input once (repeated attempts are ignored), you can connect an output to multiple inputs by calling connect() repeatedly. this makes fan-out possible. the default value is 0. input
index optional an
index describing which input of the destination you want to connect the current audionode to; the default is 0. the
index numbers are defined according to the number of input channels (see audio channels). it is possible to connect an audionode to another audionode, which in turn connects back to the first audionode, creating a cycle. this is allowed only if there is at least one del...
...on is thrown. this parameter is not allowed if the destination is an audioparam. return value if the destination is a node, connect() returns a reference to the destination audionode object, allowing you to chain multiple connect() calls. in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefined. exceptions
indexsizeerror the value specified as output
index or input
index doesn't correspond to an existing input or output. invalidaccesserror the destination node is not part of the same audio context as the source node. notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the r...
AudioNode.disconnect() - Web APIs
l, parameters (output and/or input) further limiting which inputs and/or outputs should be disconnected. if this value is an audioparam, then the connection to that audioparam is terminated, and the node's contributions to that computed parameter become 0 going forward once the change takes effect. if no matching connection is found, an invalidaccesserror exception is thrown. ...
...uld be disconnected. if this value is an audioparam, then the connection to that audioparam is terminated, and the node's contributions to that computed parameter become 0 going forward once the change takes effect. if no matching connection is found, an invalidaccesserror exception is thrown. output optional an
index describing which output from the current audionode is to be disconnected. the
index numbers are defined according to the number of output channels (see audio channels). if this parameter is out-of-bound, an
indexsizeerror exception is thrown. input optional an
index describing which input into the specified destination audionode is to be disconnected. the
index numbers are defined according to the number of input channels (see audio channels). if this parameter is out-of-boun...
...rs are defined according to the number of output channels (see audio channels). if this parameter is out-of-bound, an
indexsizeerror exception is thrown. input optional an
index describing which input into the specified destination audionode is to be disconnected. the
index numbers are defined according to the number of input channels (see audio channels). if this parameter is out-of-bound, an
indexsizeerror exception is thrown. exceptions
indexsizeerror a value specified for input or output is invalid, referring to a node which doesn't exist or outside the permitted range. invalidaccesserror the node on which disconnect() was called isn't connected to the specified destination node. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new a...
CSSRuleList - Web APIs
the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet. ...
...the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet. ...
...the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet. ...
CSSStyleSheet.deleteRule() - Web APIs
return value undefined example this example removes the first rule from the stylesheet mystyles. ...
... return value undefined example this example removes the first rule from the stylesheet mystyles. ...
... return value undefined example this example removes the first rule from the stylesheet mystyles. ...
CSSStyleSheet.insertRule() - Web APIs
the cssstylesheet.insertrule() method inserts a new css rule into the current style sheet, with some restrictions. note: although insertrule() is exclusively a method of cssstylesheet, it actually inserts the rule into cssstylesheet.cssrules — its internal cssrulelist. syntax stylesheet.insertrule(rule [,
index]) parameters rule a domstring containing the rule to be inserted. what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration. for at-rules, both an at-identifier and the rule content.
index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules. the default is 0. (in older implementations, this was required. see ...
...tor and a style declaration. for at-rules, both an at-identifier and the rule content.
index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules. the default is 0. (in older implementations, this was required. see browser compatibility for details.) return value the newly inserted rule's
index within the stylesheet's rule-list. restrictions css has some intuitive and not-so-intuitive restrictions affecting where rules can be inserted. violating them will likely raise a domexception. if
index > cssrulelist.length, the method aborts with an
indexsizeerror. if rule cannot be inserted at
index 0 due to some css constraint, the method aborts with a hierarchyrequesterror. if more than...
... // 92 = "\\".charcodeat(0) } if (closebracketpos === -1) break a; // no closing bracket was found! ...
CSSUnparsedValue.forEach() - Web APIs
arrayoptional the cssunparsedvalue that foreach() is being called on. ...
... arrayoptional the cssunparsedvalue that foreach() is being called on. ...
... arrayoptional the cssunparsedvalue that foreach() is being called on. thisarg optional value to use as this (i.e the reference object) when executing callback. ...
Pixel manipulation with canvas - Web APIs
in the rgba order, with integer values between 0 and 255 (included). the data property returns a uint8clampedarray which can be accessed to look at the raw pixel data; each pixel is represented by four one-byte values (red, green, blue, and alpha, in that order; that is, "rgba" format). each color component is represented by an integer between 0 and 255. each component is assigned a consecutive
index within the array, with the top left pixel's red component being at
index 0 within the array. pixels then proceed from left to right, then downward, throughout the array. the uint8clampedarray contains height × width × 4 bytes of data, with
index values ranging from 0 to (height×width×4)-1. for example, to read the blue component's value from the pixel at column 200, row 50 in the image, you...
... (imagedata.width * 4)) + (200 * 4)) + 2]; if given a set of coordinates (x and y), you may end up doing something like this: var xcoord = 50; var ycoord = 100; var canvaswidth = 1024; function getcolorindicesforcoord(x, y, width) { var red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; } var colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); var red
index = colorindices[0]; var green
index = colorindices[1]; var blue
index = colorindices[2]; var alpha
index = colorindices[3]; var redforcoord = imagedata.data[red
index]; var greenforcoord = imagedata.data[green
index]; var blueforcoord = imagedata.data[blue
index]; var alphaforcoord = imagedata.data[alpha
index]; or, if es2015 is appropriate: const xcoord = 50; const ycoord = 100; const canvaswidth = ...
... = imagedata.data[blue
index]; var alphaforcoord = imagedata.data[alpha
index]; or, if es2015 is appropriate: const xcoord = 50; const ycoord = 100; const canvaswidth = 1024; const getcolorindicesforcoord = (x, y, width) => { const red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; }; const colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); const [red
index, green
index, blue
index, alpha
index] = colorindices; you may also access the size of the pixel array in bytes by reading the uint8clampedarray.length attribute: var numbytes = imagedata.data.length; creating an imagedata object to create a new, blank imagedata object, you should use the createimagedata() method. there are two versions of the createimagedata() method: var myimagedata = ctx.c...
DataTransfer.mozClearDataAt() - Web APIs
the datatransfer.mozcleardataat() method removes the data associated with the given format for an item at the specified
index. the
index must be in the range from zero to the number of items minus one. if the format argument is not provided, then the data associated with all formats is removed. if the format is not found, then this method has no effect. if the last format for the item is removed, the entire item is removed, reducing mozitemcount by one. removing the last format for a particular
index removes that item entirely, shifting the remaining items down and changing their indices. note: this method is gecko-specific. syntax void datatransfer.mozcleardataat([type],
index); arguments type a string representing the type of the drag data to remove from the drag data object. ...
... return value void example this example shows the use of the mozcleardataat() method in a dragend event handler. ...
... return value void example this example shows the use of the mozcleardataat() method in a dragend event handler. ...
DataTransfer.mozSetDataAt() - Web APIs
data should be added in order of preference, with the most specific format added first and the least specific format added last. if data of the given format already exists, it is replaced in the same position as the old data. ...
... data should be added in order of preference, with the most specific format added first and the least specific format added last. if data of the given format already exists, it is replaced in the same position as the old data. ...
...ence, with the most specific format added first and the least specific format added last. if data of the given format already exists, it is replaced in the same position as the old data. the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports. note: this method is gecko-specific. syntax void datatransfer.mozsetdataat([type], data,
index); arguments type a string representing the type of the drag data to add to the drag data object. data a nsivariant representing the data to add to the drag data object.
index a unsigned long representing the
index of the data to add. return value void example this example shows the use of the mozsetdataat() method in a dragstart handler. function dragstart_handler(event) { ...
GamepadEvent - Web APIs
e to. constructor gamepadevent() returns a new gamepadevent object. properties gamepadevent.gamepad read only returns a gamepad object, providing access to the associated gamepad data for the event fired. examples the gamepad property being called on a fired window.gamepadconnected event. ...
...ew gamepadevent object. properties gamepadevent.gamepad read only returns a gamepad object, providing access to the associated gamepad data for the event fired. examples the gamepad property being called on a fired window.gamepadconnected event. window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s. ...
... window.gamepadconnected event. window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s. %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from
index %d: %s", e.gamepad.
index, e.gamepad.id); }); specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification. working draft initial definition browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung in...
HTMLFormElement.elements - Web APIs
prior to html 5, the returned object was an htmlcollection, on which htmlformcontrolscollection is based. ...
...any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms. ...
...en processing forms. example quick syntax example in this example, we see how to obtain the list of form controls as well as how to access its members by
index and by name or id. <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" name="password"> </form> var inputs = document.getelementbyid("my-form").elements; var inputby
index = inputs[0]; var inputbyname = inputs["username"]; accessing form controls this example gets the form's element list, then iterates over the list, looking for <input> elements of type "text" so that some form of processing can be performed on them. var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { if (inputs[i]...
HTMLTableElement.insertRow() - Web APIs
the htmltableelement.insertrow() method inserts a new row (<tr>) in a given <table>, and returns a reference to the new row. if a table has multiple <tbody> elements, by default, the new row is inserted into the last <tbody>. to insert the row into a specific <tbody>: let specific_tbody = document.getelementbyid(tbody_id); let row = specific_tbody.insertrow(
index) note: insertrow() inserts the row directly into the table. ...
.... to insert the row into a specific <tbody>: let specific_tbody = document.getelementbyid(tbody_id); let row = specific_tbody.insertrow(
index) note: insertrow() inserts the row directly into the table. the row does not need to be appended separately as would be the case if document.createelement() had been used to create the new <tr> element. syntax var newrow = htmltableelement.insertrow(
index); htmltableelement is a reference to an html <table> element. parameters
index optional the row
index of the new row. if
index is -1 or equal to the number of rows, the row is appended as the last row. if
index is greater than the number of rows, an
indexsizeerror exception will result. if
index is omitted it defaults to -1. return value newrow is an htmltablerowelement that references t...
...t.createtextnode() and node.appendchild(). ...
HTMLTableRowElement - Web APIs
or french. this property was optional and was not very well supported. htmltablerowelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well supported. htmltablerowelement.row
index read only returns a long value which gives the logical position of the row within the entire table. if the row is not part of a table, returns -1. htmltablerowelement.sectionrow
index read only returns a long value which gives the logical position of the row within the table section it belongs to. if the row is not part of a section, returns -1. htmltablerowelement.valign is a domstring r...
...n attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablerowelement.deletecell() removes the cell at the given position in the row. if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the
indexsizeerror value. htmltablerowelement.insertcell() inserts a new cell just before the given position in the row. if the given position is not given or is -1, it appends the cell to the row. if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than -1, it raises a domexception with the
indexsizeerror value. returns a reference to a htm...
... definition of 'htmltablerowelement' in that specification. living standard html5the definition of 'htmltablerowelement' in that specification. recommendation the parameter of insertcell is now optional and default to -1. document object model (dom) level 2 html specificationthe definition of 'htmltablerowelement' in that specification. obsolete the cells, row
index, and selectionrow
index properties are now read-only. the methods insertcell and deletecell can raise exceptions. document object model (dom) level 1 specificationthe definition of 'htmltablerowelement' in that specification. obsolete initial definition. ...
IDBCursor.continuePrimaryKey() - Web APIs
rsor has been closed, without having to compare the keys one by one. calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalidstateerror being thrown on the second call because the cursor’s got value flag has been unset. this method is only valid for cursors coming from an
index. using it for cursors coming from an object store will throw an error. note: this feature is available in web workers. syntax cursor.continueprimarykey(key, primarykey); parameters key the key to position the cursor at. primarykey the primary key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception descriptio...
...ursor's position and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. invalidaccesserror the cursor's direction is not prev or next. ...
... recommendation ...
IDBCursorWithValue - Web APIs
the idbcursorwithvalue interface of the
indexeddb api represents a cursor for traversing or iterating over multiple records in a database. it is the same as the idbcursor, except that it includes the value property. the cursor has a source that indicates which
index or object store it is iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursorwithvalue object representing a given cursor. operations are performed on the underlying
index or object store. note: this feature is available in web workers. <div id="inter...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.co...
...; listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'idbcursorwithvalue' in that specification. recommendation
indexed database api draftthe definition of 'idbcursorwithvalue' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandr...
IDBDatabase.onabort - Web APIs
result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
IDBDatabase.onerror - Web APIs
db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
IDBDatabase.onversionchange - Web APIs
db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/md...
...ase change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment
indexed database api 2.0the definition of 'onversionchange' in that specification. recommendation
indexed database api draftthe definition of 'onversionchange' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroi...
IDBDatabaseSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the
indexeddb api represents a synchronous connection to a database. method overview idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in dom...
...he object store. returns idbobjectstoresync an object to access the opened object store. exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if an object store with the given name (based on case-sensitive comparison) already exists in the connected database. removeobjectstore() destroys an object store with the given name, as well as all
indexes that reference that object store. void removeobjectstore ( in domstring storename ) raises (idbdatabaseexception); parameters storename the name of an existing object store to remove. returns void exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if the object store with the given name (based on case-sensitive comparison) does n...
... version the version to store in the database. transaction() creates and returns a transaction, acquiring locks on the given database objects, within the specified timeout duration, if possible. idbtransactionsync transaction ( in optional domstringlist storenames, in optional unsigned int timeout ) raises (idbdatabaseexception); parameters storenames the names of object stores and
indexes in the scope of the new transaction. timeout the interval that this operation is allowed to take to acquire locks on all the objects stores and
indexes identified in storenames. returns idbtransactionsync an object to access the newly created transaction. exceptions this method can raise an idbdatabaseexception with the following code: timeout_err if reserving all the database ob...
IDBFactorySync - Web APIs
method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. ...
... method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. ...
... method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. ...
IDBKeyRange.bound() - Web APIs
rieve records with keys inside that range. this range includes the values "a" and "f", as we haven't declared that they should be open bounds. if we used idbkeyrange.bound("a", "f", true, true);, then the range would not include "a" and "f", only the values between them. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compa...
...l = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'bound()' in that specification. recommendation
indexed database api draftthe definition of 'bound()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
IDBKeyRange.includes() - Web APIs
eption of the following type: attribute description dataerror the supplied key was not a valid key. ...
...s('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the
indexed db specification. for browsers that do not support it, the following polyfill can be used. ...
...exed db specification. for browsers that do not support it, the following polyfill can be used. idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c =
indexeddb.cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c =
indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status comment
indexed database api draftthe definition of 'includes()' in that specification. recommendation
indexed database api draftthe definition of 'includes()' in that specification. ...
IDBKeyRange - Web APIs
you can limit the range using lower and upper bounds. for example, you can iterate over all values of a key in the value range a–z. a key range can be a single value or a range with upper and lower bounds or endpoints. if the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. a bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). ...
... recommendation adds includes(). browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check ...
... recommendation adds includes(). ...
IDBObjectStore.add() - Web APIs
ode snippet, we open a read/write transaction on our database and add some data to an object store using add(). note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dat...
...bject store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'add()' in that specification. recommendation
indexed database api draftthe definition of 'add()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBObjectStore.autoIncrement - Web APIs
not auto increment. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.autoincrement to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/br...
... store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'autoincrement' in that specification. recommendation
indexed database api draftthe definition of 'autoincrement' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid ...
IDBObjectStore.delete() - Web APIs
the key is not a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the deletedata() function to delete a record from the database deletedata(); }; function deletedata() { // open a read/write db transaction...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-comp...
...ct store var objectstorerequest = objectstore.delete("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'delete()' in that specification. recommendation
indexed database api draftthe definition of 'delete()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
IDBObjectStore.get() - Web APIs
and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the getdata() function to get the data from the database getdata(); }; function getdata() { // open a read/write db transaction, ready...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dat...
...tore.get("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status comment
indexed database api 2.0the definition of 'get()' in that specification. recommendation
indexed database api draftthe definition of 'get()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBObjectStore.keyPath - Web APIs
store.keypath; value any value type. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.keypath to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
...object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'keypath' in that specification. recommendation
indexed database api draftthe definition of 'keypath' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
IDBObjectStore.openCursor() - Web APIs
e cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idb
index has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var ob...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/brow...
....result; if(cursor) { // cursor.value contains the current record being iterated through // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification specification status comment
indexed database api 2.0the definition of 'opencursor()' in that specification. recommendation
indexed database api draftthe definition of 'opencursor()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
IDBObjectStore.openKeyCursor() - Web APIs
e cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idb
index has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var ob...
... recommendation ...
... recommendation ...
IDBObjectStore.transaction - Web APIs
value an idbtransaction object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.transaction to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browse...
...ct store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'transaction' in that specification. recommendation
indexed database api draftthe definition of 'transaction' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
IDBOpenDBRequest.onblocked - Web APIs
r the blocked event. this event is triggered when the upgradeneeded should be triggered because of a version change but the database is still in use (that is, not closed) somewhere, even after the versionchange event was sent. note: this feature is available in web workers. syntax idbopendbrequest.onblocked = function(event) { ... }; example var db; // let us open our database var request =
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below d...
...b variable. // this is used a lot below db = request.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.
indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ... }; request.onblocked = funct...
... note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ... }; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment
indexed database api 2.0the definition of 'onblocked' in that specification. recommendation
indexed database api draftthe definition of 'onblocked' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-c...
IDBRequest.error - Web APIs
n because domerror has been removed from the dom standard. the following error codes are returned under certain conditions: error explanation aborterror if you abort the transaction, then all requests still in progress receive this error. constrainterror if you insert data that doesn't conform to a constraint. it's an exception type for creating stores and
indexes. you get this error, for example, if you try to add a new key that already exists in the record. quotaexceedederror if you run out of disk quota and the user declined to grant you more space. unknownerror if the operation failed for reasons unrelated to the database itself. a failure due to disk io errors is such an example. noerror if the request succeeds. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dat...
...ata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); }; specifications specification status comment
indexed database api 2.0the definition of 'error' in that specification. recommendation
indexed database api draftthe definition of 'error' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBRequest.source - Web APIs
the source read-only property of the idbrequest interface returns the source of the request, such as an
index or an object store. if no source exists (such as when calling
indexeddb.open), it returns null. note: this feature is available in web workers. syntax var idb
index = request.source; var idbcursor = request.source; var idbobjectstore = request.source; value an object representing the source of the request, such as an idb
index, idbobjectstore or idbcursor. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logg...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-d...
...ce of this request is " + updatetitlerequest.source); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'source' in that specification. recommendation
indexed database api draftthe definition of 'source' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
IDBTransaction.abort() - Web APIs
to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted i...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-da...
...ean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // abort the transaction we just did transaction.abort(); }; specification specification status comment
indexed database api 2.0the definition of 'abort()' in that specification. recommendation
indexed database api draftthe definition of 'abort()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBTransaction.db - Web APIs
tabase and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we return the associated database connection using db. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and ...
...ly in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the database (idbdatabase) connection with which this transaction is associated transaction.db; }; specification specification status comment
indexed database api 2.0the definition of 'db' in that specification. recommendation
indexed database api draftthe definition of 'db' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
IDBTransaction.error - Web APIs
andlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data ...
...nt) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'error' in that specification. recommendation
indexed database api draftthe definition of 'error' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBTransaction.objectStore() - Web APIs
following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/bro...
...// report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; specification specification status comment
indexed database api 2.0the definition of 'objectstore()' in that specification. recommendation
indexed database api draftthe definition of 'objectstore()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
IDBTransaction.onabort - Web APIs
re. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
....</li>'; }; transaction.onabort = function() { // report when the transaction was successfully aborted console.log("transaction aborted!"); }; // abort the transaction we just did transaction.abort(); }; specification specification status comment
indexed database api 2.0the definition of 'onabort' in that specification. recommendation
indexed database api draftthe definition of 'onabort' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
IDBTransaction.onerror - Web APIs
andlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inser...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-d...
...) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'onerror' in that specification. recommendation
indexed database api draftthe definition of 'onerror' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
IDBVersionChangeEvent.newVersion - Web APIs
nippet, we make a request to open a database, and include handlers for the success and error cases. these events are fired via the custom idbversionchangeevent interface. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of // implementations you want to test. window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange |...
... // this is used a lot later on, for op...
....innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment
indexed database api 2.0the definition of 'newversion' in that specification. recommendation
indexed database api draftthe definition of 'newversion' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-...
IDBVersionChangeEvent.oldVersion - Web APIs
the oldversion read-only property of the idbversionchangeevent interface returns the old version number of the database. when the opened database doesn't exist yet, the value of oldversion is 0. note: this feature is available in web workers. syntax var oldversion = idbversionchangeevent.oldversion value a 64-bit integer. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
...equest.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specifications specification status comment
indexed database api 2.0the definition of 'oldversion' in that specification. recommendation
indexed database api draftthe definition of 'oldversion' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web...
Browser storage limits and eviction criteria - Web APIs
sers, but browser specifics are called out where known. opera and chrome should behave the same in all cases. opera mini (still presto-based, server-side rendering) doesn't store any data on the client. what technologies use browser data storage? in firefox, the following technologies make use of browser data storage to store data when required. we term them "quota clients" in this context:
indexeddb asm.js caching cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document. note: in private browsing mode, most data storage is not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last acces...
... not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last access time" of origins is updated when any of these are activated/deactivated — origin eviction will delete data for all these quota clients. in chrome/opera, the quota management api handles quota management for appcache,
indexeddb, websql, and file system api. different types of data storage even in the same browser, using the same storage method, there are different classes of data storage to understand. this section discusses the different ones you might find in different browsers. storage comes in two types: persistent: this is data that is intended to be kept around for a long time. this will only be evicted ...
...it doesn't matter if box mode is "best-effort" or "persistent" — data is stored under <profile>/storage/default. note: in firefox, you can find your profile folder by entering about:support in the url bar, and pressing the show in... button (e.g., show in finder on mac os x) next to the profile folder title. note: if you are looking around in your profile a...
KeyboardLayoutMap.forEach() - Web APIs
array optional the keyboardlayoutmap that foreach() is being called on. ...
... array optional the keyboardlayoutmap that foreach() is being called on. ...
... array optional the keyboardlayoutmap that foreach() is being called on. thisarg optional value to use as this (i.e the reference object) when executing callback. ...
NodeList.prototype.forEach() - Web APIs
the foreach() method of the nodelist interface calls the callback given in parameter once for each value pair in the list, in insertion order. syntax somenodelist.foreach(callback[, thisarg]); parameters callback a function to execute on each element of somenodelist. it accepts 3 parameters: currentvalue the current element being processed in somenodelist. current
index optional the
index of the currentvalue being processed in somenodelist. listobj optional the somenodelist that foreach() is being applied to. thisarg optional value to use as this when executing callback. return value undefined. example let node = document.createelement("div"); let kid1 = document.createelement("p"); let kid2 = document.createtextnode("hey"); let kid3 = document.createelement(...
...value to use as this when executing callback. return value undefined. ...
...ndefined. ...
OVR_multiview2 - Web APIs
alse. however, the oculus browser (6+) also supports multisampling using the oculus_multiview extension. see also this webgl issue. constants this extension exposes 4 constants that can be used in getparameter() or getframebufferattachmentparameter(). framebuffer_attachment_texture_num_views_ovr number of views of the framebuffer object attachment. ...
...ulus browser (6+) also supports multisampling using the oculus_multiview extension. see also this webgl issue. constants this extension exposes 4 constants that can be used in getparameter() or getframebufferattachmentparameter(). framebuffer_attachment_texture_num_views_ovr number of views of the framebuffer object attachment. ...
...calling checkframebufferstatus for a framebuffer in this state returns framebuffer_incomplete_view_targets_ovr. ...
Selection.getRangeAt() - Web APIs
a negative number or a number greater than or equal to selection.rangecount will result in an error. return value the specified range object. ...
...a negative number or a number greater than or equal to selection.rangecount will result in an error. return value the specified range object. ...
...a negative number or a number greater than or equal to selection.rangecount will result in an error. return value the specified range object. ...
ServiceWorkerContainer.register() - Web APIs
more information on how it works. return value a promise that resolves with a serviceworkerregistration object. examples the examples described here should be taken together to get a better understanding of how service workers scope applies to a page. the following example uses the default value of scope (by omitting it). the service worker code in this case, if included in example.com/
index.html, will control example.com/
index.html, as well as pages underneath it, like example.com/product/description.html. if ('serviceworker' in navigator) { // register a service worker hosted at the root of the // site using the default scope. navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); },...
...he // site using the default scope. navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/
index.html, at the root of a site, would apply to exactly the same pages as the example above. remember the scope, when included, uses the page's location as its base. alternatively, if this code were included in a page at example.com/product/description.html, with the javascript file residing at example.com/product/sw.js, then the service worker would only apply to resources under example.com/product...
...le.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. the following code, if included in example.com/
index.html, at the root of a site, would only apply to resources under example.com/product. if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: '/product/'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registratio...
SpeechSynthesisEvent - Web APIs
the speechsynthesisevent interface of the web speech api contains information about the current state of speechsynthesisutterance objects that have been processed in the speech service. properties the speechsynthesisevent interface also inherits properties from its parent interface, event. speechsynthesisevent.char
index read only returns the
index position of the character in the speechsynthesisutterance.text that was being spoken when the event was triggered. speechsynthesisevent.elapsedtime read only returns the elapsed time in milliseconds after the speechsynthesisutterance.text started being spoken that the event was triggered at. speechsynthesisevent.name read only returns the name associated with certain types of events occuring as the speechsynthesisutterance.text is bein...
...rk event, or the type of boundary reached in the case of a boundary event. speechsynthesisevent.utterance read only returns the speechsynthesisutterance instance that the event was triggered on. methods the speechsynthesisevent interface also inherits methods from its parent interface, event. ...
...ary event. speechsynthesisevent.utterance read only returns the speechsynthesisutterance instance that the event was triggered on. methods the speechsynthesisevent interface also inherits methods from its parent interface, event. examples utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speechsynthesisevent' in that specification. draft ...
StylePropertyMapReadOnly.forEach() - Web APIs
arrayoptional the stylepropertymapreadonly thatforeach() is being called on. ...
... arrayoptional the stylepropertymapreadonly thatforeach() is being called on. ...
... arrayoptional the stylepropertymapreadonly thatforeach() is being called on. thisarg optional value to use as this (i.e the reference object) when executing callback. ...
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
uniformblockbinding a gluint specifying the binding point to which to bind the uniform block. return value none. ...
... uniformblockbinding a gluint specifying the binding point to which to bind the uniform block. return value none. ...
... uniformblockbinding a gluint specifying the binding point to which to bind the uniform block. return value none. ...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. type a glenum specifying the data type of each component in the array. ...
... size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. type a glenum specifying the data type of each component in the array. ...
... size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. type a glenum specifying the data type of each component in the array. ...
WebGL2RenderingContext - Web APIs
l members of the webglrenderingcontext interface. some methods of the webgl 1 context can accept additional values when used in a webgl 2 context. you will find this info noted on the webgl 1 reference pages. the webgl tutorial has more information, examples, and resources on how to get started with webgl. constants see the webgl constants page. state information webgl2renderingcontext.get
indexedparameter() returns the
indexed value for the given target. buffers webgl2renderingcontext.bufferdata() initializes and creates the buffer object's data store. webgl2renderingcontext.buffersubdata() updates a subset of a buffer object's data store. webgl2renderingcontext.copybuffersubdata() copies part of the data of a buffer to another buffer. webgl2renderingcontext.getbuffersubdata...
...eturns information about varying variables from webgltransformfeedback buffers. webgl2renderingcontext.pausetransformfeedback() pauses a transform feedback operation. webgl2renderingcontext.resumetransformfeedback() resumes a transform feedback operation. uniform buffer objects webgl2renderingcontext.bindbufferbase() binds a given webglbuffer to a given binding point (target) at a given
index. webgl2renderingcontext.bindbufferrange() binds a range of a given webglbuffer to a given binding point (target) at a given
index. webgl2renderingcontext.getuniformindices() retrieves the indices of a number of uniforms within a webglprogram. webgl2renderingcontext.getactiveuniforms() retrieves information about active uniforms within a webglprogram. webgl2renderingcontext.getuniformbl...
...webgl2renderingcontext.bindbufferrange() binds a range of a given webglbuffer to a given binding point (target) at a given
index. webgl2renderingcontext.getuniformindices() retrieves the indices of a number of uniforms within a webglprogram. webgl2renderingcontext.getactiveuniforms() retrieves information about active uniforms within a webglprogram. webgl2renderingcontext.getuniformblock
index() retrieves the
index of a uniform block within a webglprogram. webgl2renderingcontext.getactiveuniformblockparameter() retrieves information about an active uniform block within a webglprogram. webgl2renderingcontext.getactiveuniformblockname() retrieves the name of the active uniform block at a given
index within a webglprogram. webgl2renderingcontext.uniformblockbinding() assigns bindin...
Using the Web Speech API - Web APIs
b service for recognition processing, so it won't work offline. demo to show simple usage of web speech recognition, we've written a demo called speech color changer. when the screen is tapped/clicked, you can say an html color keyword, and the app's background color will change to that color. to run the demo, you can clone (or directly download) the github repo it is part of, open the html
index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome. browser support support for web speech api speech recognition is curently limited to chrome for desktop and android — chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g. webkitspeechrecognition. htm...
...eb speech synthesis, we've provided a demo called speak easy synthesis. this includes a set of form controls for entering text to be synthesised, and setting the pitch, rate, and voice to use when the text is uttered. after you have entered your text, you can press enter/return to hear it spoken. to run the demo, you can clone (or directly download) the github repo it is part of, open the html
index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome, or firefox os. browser support support for web speech api speech synthesis is still getting there across mainstream browsers, and is currently limited to the following: firefox desktop and mobile support it in gecko 42+ (windows)/44+, without prefixes, and it can be turned on...
...eak(utterthis); in the final part of the handler, we include an speechsynthesisutterance.onpause handler to demonstrate how speechsynthesisevent can be put to good use. when speechsynthesis.pause() is invoked, this returns a message reporting the character number and name that the speech was paused at. utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } finally, we call blur() on the text input. this is mainly to hide the keyboard on firefox os. inputtxt.blur(); } updating the displayed pitch and rate values the last part of the code simply updates the pitch/rate values displayed in the ui, each time ...
XRInputSourceArray.keys() - Web APIs
od in the xrinputsourcearray interface returns a javascript iterator which can then be used to iterate over the keys used to reference each item in the array of input sources. syntax xrinputsourcearray.keys(); parameters none. return value a javascript iterator that can be used to walk through the keys for each entry in the list of input sources. ...
...d to iterate over the keys used to reference each item in the array of input sources. syntax xrinputsourcearray.keys(); parameters none. return value a javascript iterator that can be used to walk through the keys for each entry in the list of input sources. the values returned by the iterator are the
indexes of each entry in the list; that is, the numbers 0, 1, 2, and so forth through the
index of the last item in the list. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. for (const inputidx of xrsession.inputsources.keys()) { /* the keys are the
indexes into the list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys. for each ke...
...ples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. for (const inputidx of xrsession.inputsources.keys()) { /* the keys are the
indexes into the list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys. for each key, the input is retrieved using the
index with array notation: xrsession.inputsources[inputidx]. specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface ...
XRInputSourceArray - Web APIs
the interface xrinputsourcearray represents a live list of webxr input sources, and is used as the return value of the xrsession property inputsources. each entry is an xrinputsource representing one input device connected to the webxr system. in addition to being able to access the input sources in the list using standard array notation (that is, with
index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available. properties the following properties are available on xrinputsourcearray objects. length read only the number of xrinputsource objects in the list. methods the following methods are available on xrinputsourcearray objects. you may also use the features of the symbol type. entries() returns an iter...
...ties are available on xrinputsourcearray objects. length read only the number of xrinputsource objects in the list. methods the following methods are available on xrinputsourcearray objects. you may also use the features of the symbol type. entries() returns an iterator you can use to walk the list of key/value pairs in the list. each item returned is an array whose first value is the
index and whose second value is the xrinputsource at that
index. foreach() iterates over each item in the list, in order from first to last. keys() a list of the keys corresponding to the entries in the input source list. values() returns an iterator you can use to go through all the values in the list. each item is a single xrinputsource object. in addition to these methods, you may use array ...
...urce at that
index. foreach() iterates over each item in the list, in order from first to last. keys() a list of the keys corresponding to the entries in the input source list. values() returns an iterator you can use to go through all the values in the list. each item is a single xrinputsource object. in addition to these methods, you may use array notation to access items in the list by
index for example, the snippet of code below calls a function handleinput(), passing into it the first item in the input source list, if the list isn't empty. let sources = xrsession.inputsources; if (sources.length > 0) { handleinput(sources[0]); } examples specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that spec...
Using the link role - Accessibility
can be used to change focus to the link, and enter used to execute the link. note: where possible, it is recommended that you use a native <a> element rather than the link role, as native elements are more widely supported by older user agents and assistive technology. native <a> elements also support keyboard and focus requirements by default, without need for additional customization. the tab
index attribute may optionally be used with this role to directly specify the position of the element in the tab order. possible effects on user agents and assistive technology when the link role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a link role in the operating system's accessibility api. fire an accessib...
...chnology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples this example shows how to implement a fake link using a <span> element. this includes javascript to grab the location and handle navigating to the new location using window.open() via clicking, and using keyboard, css to give the desired visuals of a link, the tab
index="0" attribute to make it keyboard-focussable, and role="link" to make it recognised as a link by assistive technology. this is a huge amount of work just to recreate something you've get for free using the <a> element, so you should really use that if possible. but this shows that it can be done. you should however note that there are still problems with this approach: it is very difficult t...
...s been visited before, and therefore use :visited styles (e.g. the default purple color for visited links). opening a page using the open() method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form the domain it exists on. ...
Using the radio role - Accessibility
and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
...d above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
...d="rg1_label">lunch options</h3> <ul class="radiogroup" id="rg1" role="radiogroup" aria-labelledby="rg1_label"> <li id="r1" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tab
index="0" role="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> working examples: notes aria attributes used related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources ...
ARIA: table role - Accessibility
mantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span role="c...
...need to be added via associated roles, such as rowgroup, row, columnheader, and cell. if the table contains sortable columns or rows, the aria-sort attribute should be added on the header cell element (not the table itself). if any rows or columns are hidden, the aria-colcount or aria-rowcount should be included indicating the total number of columns or rows, respectively, along with the aria-col
index or aria-row
index on each cell. the aria-col
index or aria-row
index is set to the position of a cell within the row or column, respectively. if the table includes cells that span multiple rows or multiple columns, then aria-rowspan or aria-colspan should be included as well. realize, it is much simpler to simply use the <table> element, along with all the related semantic elements and attributes th...
..._elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span ro...
::after (:after) - CSS: Cascading Style Sheets
bc8f7; } .ribbon::after { content: "this is a fancy orange box."; background-color: #ffba10; border-color: black; border-style: dotted; } result tooltips this example uses ::after, in conjunction with the attr() css expression and a data-descr custom data attribute, to create tooltips. ...
...keyboard users with this technique, by adding a tab
index of 0 to make each span keyboard focusable, and using a css :focus selector. this shows how flexible ::before and ::after can be, though for the most accessible experience a semantic disclosure widget created in some other way (such as with details and summary elements) is likely to be more appropriate. html <p>here we have some <span tab
index="0" data-descr="collection of words and punctuation">text</span> with a few <span tab
index="0" data-descr="small popups that appear when hovering">tooltips</span>. </p> css span[data-descr] { position: relative; text-decoration: underline; color: #00f; cursor: help; } span[data-descr]:hover::after, span[data-descr]:focus::after { content: attr(data-descr); position: absolute; ...
... working draft no significant changes to the previous specification. css animationsthe definition of 'animations on pseudo-element properties' in that specification. working draft allows animations on properties...
position - CSS: Cascading Style Sheets
ithub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the position property is specified as a single keyword chosen from the list of values below. values static the element is positioned according to the normal flow of the document. the top, right, bottom, left, and z-
index properties have no effect. this is the default value. relative the element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static. this value cr...
...alue. relative the element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static. this value creates a new stacking context when the value of z-
index is not auto. its effect on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined. absolute the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. its final position...
...olute the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. its final position is determined by the values of top, right, bottom, and left. this value creates a new stacking context when the value of z-
index is not auto. the margins of absolutely positioned boxes do not collapse with other margins. fixed the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something...
Rich-Text Editing in Mozilla - Developer guides
; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selected
index].value);this.selected
index=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <option value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title 5 <h5></option> <option value="h6">subtitle <h6></option> <option value="p">paragraph <p></opti...
...ion value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title 5 <h5></option> <option value="h6">subtitle <h6></option> <option value="p">paragraph <p></option> <option value="pre">preformatted <pre></option> </select> <select onchange="formatdoc('fontname',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- font -</option> <option>arial</option> <option>arial black</option> <option>courier new</option> <option>times new roman</option> </select> <select onchange="formatdoc('fontsize',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option ...
...ue);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option value="2">a bit small</option> <option value="3">normal</option> <option value="4">medium-large</option> <option value="5">big</option> <option value="6">very big</option> <option value="7">maximum</option> </select> <select onchange="formatdoc('forecolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- color -</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- background -</option> <option va...
Making content editable - Developer guides
; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selected
index].value);this.selected
index=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <option value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title 5 <h5></option> <option value="h6">subtitle <h6></option> <option value="p">paragraph <p></opti...
...ion value="h2">title 2 <h2></option> <option value="h3">title 3 <h3></option> <option value="h4">title 4 <h4></option> <option value="h5">title 5 <h5></option> <option value="h6">subtitle <h6></option> <option value="p">paragraph <p></option> <option value="pre">preformatted <pre></option> </select> <select onchange="formatdoc('fontname',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- font -</option> <option>arial</option> <option>arial black</option> <option>courier new</option> <option>times new roman</option> </select> <select onchange="formatdoc('fontsize',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option ...
...ue);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option value="2">a bit small</option> <option value="3">normal</option> <option value="4">medium-large</option> <option value="5">big</option> <option value="6">very big</option> <option value="7">maximum</option> </select> <select onchange="formatdoc('forecolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- color -</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- background -</option> <option va...
<button>: The Button element - HTML: Hypertext Markup Language
iterion 1.4.3 | w3c understanding wcag 2.0 clicking and focus whether clicking on a <button> causes it to (by default) become focused varies by browser and os. the results for <input> of type="button" and type="submit" are the same. ...
...ult) become focused varies by browser and os. the results for <input> of type="button" and type="submit" are the same. ...
...3 chrome yes - chrome 35 yes - chrome 65 safari n/a no (even with a tab
index) safari 12 (bug 22261) internet explorer yes - internet explorer 11 n/a presto yes - opera 12 yes - opera 12 does tapping on a <button> give it focus? mobile browsers ios 7.1.2 android 4.4.4 safari mobile no (even with a tab
index) n/a chrome 35 no (even with a tab
index) yes specifications specification status comment html living standardthe definition of '<button>' in that specification. living standard html5the definition of '<button>' in that specification. recommendation html 4.01 specificationthe definition of '<button>' in that spec...
Link types - HTML: Hypertext Markup Language
if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one. for example, a blog entry could link to a monthly
index page this way. note: although recognized, the singular archive is incorrect and must be avoided. <a>, <area>, <link> <form> author defines a hyperlink to a page describing the author or providing a way to contact the author. note: this may be a mailto: hyperlink, but this is not recommended on public pages as robot harvesters will quickly lead to a lot of spam ...
...bpage icon for web clip or a start-up placeholder. instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. the shortcut link type is often seen before icon, but this link type is non-conforming, ignored and web authors must not use it anymore. <link> <a>, <area>, <form> import html imports <link> <a>, <area>, <form>
index obsolete since html5 indicates that the page is part of a hierarchical structure and that the hyperlink leads to the top level resource of that structure. if one or several up link types are also present, the number of these up indicates the depth of the current page in the hierarchy. <a>, <area>, <link> <form> last indicates that the hyperlink leads to the last re...
...hapter, section, subsection, and appendix html 4.01 specificationthe definition of 'link types' in that specification. recommendation added alternate, stylesheet, start, chapter, section, subsection, appendix, and bookmark. renamed previous to prev. removed top, and search. unknownthe definition of '<link>' in that specification. obsolete added top, contents,
index, glossary, copyright, next, previous, help, and search. rfc 1866: html 2.0 obsolete initial definition. ...
Using the application cache - HTML: Hypertext Markup Language
rowser should cache for offline access. resources are identified by uri. entries listed in the cache manifest must have the same scheme, host, and port as the manifest. example 1: a simple cache manifest file the following is a simple cache manifest file, example.appcache, for an imaginary web site at www.example.com. cache manifest # v1 - 2011-08-13 # this is a comment. http://www.example.com/
index.html http://www.example.com/header.png http://www.example.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the application cache. resources can be sp...
...mple.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the application cache. resources can be specified using either absolute or relative urls (e.g.,
index.html). the "v1" comment in the example above is there for a good reason. browsers only update an application cache when the manifest file changes, byte for byte. if you change a cached resource (for example, you update the header.png image with new content), you must also change the content of the manifest file in order to let browsers know that they need to refresh the cache. you can make any c...
...t file. wildcards may be used. the cache, network, and fallback sections can be listed in any order in a cache manifest file, and each section can appear more than once in a single manifest. example 2: a more complete cache manifest file the following is a more complete cache manifest file for the imaginary web site at www.example.com: cache manifest # v1 2011-08-14 # this is another comment
index.html cache.html style.css image1.png # use from network if available network: network.html # fallback content fallback: . fallback.html this example uses network and fallback sections to specify that the network.html page must always be retrieved from the network, and that the fallback.html page should be served as a fallback resource (e.g., in case a connection to the server cannot be establ...
JavaScript data types and data structures - JavaScript
like a number in cases where it is converted to boolean: if, ||, &&, boolean, !. bigints cannot be operated on interchangeably with numbers. instead a typeerror will be thrown. string type javascript's string type is used to represent textual data. it is a set of "elements" of 16-bit unsigned integer values. each element in the string occupies a position in the string. the first element is at
index 0, the next at
index 1, and so on. the length of a string is the number of elements in it. unlike some programming languages (such as c), javascript strings are immutable. this means that once a string is created, it is not possible to modify it. however, it is still possible to create another string based on an operation on the original string. for example: a substring of the original by pi...
...rty. false "normal" objects, and functions a javascript object is a mapping between keys and values. keys are strings (or symbols), and values can be anything. this makes objects a natural fit for hashmaps. functions are regular objects with the additional capability of being callable. dates when representing dates, the best choice is to use the built-in date utility in javascript. ...
...this makes arrays a perfect candidate to represent lists or sets. typed arrays are new to javascript with ecmascript 2015, and present an array-like view of an underlying binary data buffer. ...
Loops and iteration - JavaScript
th a label, it terminates the specified labeled statement. the syntax of the break statement looks like this: break; break [label]; the first form of the syntax terminates the innermost enclosing loop or switch. the second form of the syntax terminates the specified enclosing labeled statement. ...
... for...of statement the for...of statement creates a loop iterating over iterable objects (including array, m...
...; return result; } for an object car with properties make and model, result would be: car.make = ford car.model = mustang arrays although it may be tempting to use this as a way to iterate over array elements, the for...in statement will return the name of your user-defined properties in addition to the numeric
indexes. therefore, it is better to use a traditional for loop with a numeric
index when iterating over arrays, because the for...in statement iterates over user-defined properties in addition to the array elements, if you modify the array object (such as adding custom properties or methods). for...of statement the for...of statement creates a loop iterating over iterable objects (including array, map, set, arguments object and so on), invoking a custom iteration hook with sta...
The legacy Iterator protocol - JavaScript
next a zero arguments function that returns an value. difference between legacy and es2015 iterator protocols the value was returned directly as a return value of calls to next, instead of the value property of a placeholder object iteration termination was expressed by throwing a stopiteration object. ...
...erence between legacy and es2015 iterator protocols the value was returned directly as a return value of calls to next, instead of the value property of a placeholder object iteration termination was expressed by throwing a stopiteration object. ...
...the value was returned directly as a return value of calls to next, instead of the value property of a placeholder object iteration termination was expressed by throwing a stopiteration object. ...
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
to check if a property is in an object. you can't search in strings, or in numbers, or other primitive types. examples searching in strings unlike in other programming languages (e.g. python), you can't search in strings using the in operator. "hello" in "hello world"; // typeerror: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.
indexof(), for example. "hello world".
indexof("hello") !== -1; // true the operand can't be null or undefined make sure the object you are inspecting isn't actually null or undefined. var foo = null; "bar" in foo; // typeerror: cannot use 'in' operator to search for 'bar' in 'foo' (chrome) // typeerror: right-hand side of 'in' should be an object, got null (firefox) the in operator always expects...
... var trees = ['redwood', 'bay', 'cedar', 'oak', 'maple']; 3 in trees; // true "oak" in trees; // false ...
... var trees = ['redwood', 'bay', 'cedar', 'oak', 'maple']; 3 in trees; // true "oak" in trees; // false ...
Array.prototype.entries() - JavaScript
the entries() method returns a new array iterator object that contains the key/value pairs for each
index in the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax array.entries() return value a new array iterator object. ...
...terator object that contains the key/value pairs for each
index in the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax array.entries() return value a new array iterator object. ...
...ndex in the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax array.entries() return value a new array iterator object. examples iterating with
index and element const a = ['a', 'b', 'c']; for (const [
index, element] of a.entries()) console.log(
index, element); // 0 'a' // 1 'b' // 2 'c' using a for…of loop var a = ['a', 'b', 'c']; var iterator = a.entries(); for (let e of iterator) { console.log(e); } // [0, 'a'] // [1, 'b'] // [2, 'c'] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.entries' in that specification. ...
Array.prototype.fill() - JavaScript
return value the modified array, filled with value. ...
... return value the modified array, filled with value. ...
...the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.fill(value[, start[, end]]) parameters value value to fill the array with. (note all elements in the array will be this exact value.) start optional start
index, default 0. end optional end
index, default arr.length. return value the modified array, filled with value. description if start is negative, it is treated as array.length + start. if end is negative, it is treated as array.length + end. fill is intentionally generic: it does not require that its this value be an array object. fill is a mutator method: it will change the array itself ...
Date() constructor - JavaScript
nt format. date objects contain a number that represents milliseconds since 1 january 1970 utc. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new date() new date(value) new date(datestring) new date(year, month
index [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator. if you simply call the date object directly, such as now = date(), the returned value is a string rather than a date object. parameters there are four basic forms for the date() constructor: no parameters when no parameters are provid...
... component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. any missing fields are given the lowest possible value (1 for day and 0 for every other component). year integer value representing the year. values from 0 to 99 map to the years 1900 to 1999. all other values are the actual year. see the example below. month
index integer value representing the month, beginning with 0 for january to 11 for december. day optional integer value representing the day of the month. the default is 1. hours optional integer value representing the hour of the day. the default is 0 (midnight). minutes optional integer value representing the minute segment of a time. the default is 0 minutes past the hour. se...
... ...
TypedArray.prototype.every() - JavaScript
example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.every(callback[, thisarg]) parameters callback function to test for each element, taking three arguments: currentvalue the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array every was called upon. thisarg optional. value to use as this when executing callback. return value true if the callback function returns a truthy value for every array element; otherwise, false. description the every method executes the provided callback function once for each element pres...
...ion once for each element present in the typed array until it finds one where callback returns a falsy value (a value that becomes false when converted to a boolean). if such an element is found, the every method immediately returns false. otherwise, if callback returned a true value for all elements, every will return true. callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed. if a thisarg parameter is provided to every, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. every does not m...
... for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. every does not mutate the typed array on which it is called. examples testing size of all typed array elements the following example tests whether all elements in the typed array are bigger than 10. function isbigenough(element,
index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test. new uint8array([12, 5, 8, 130, 44]).every(elem => elem >= 10); // false new uint8array([12, 54, 18, 130, 44]).every(...
TypedArray.prototype.fill() - JavaScript
defaults to this.length. return value the modified array. ...
...defaults to this.length. return value the modified array. ...
... typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.fill(value[, start = 0[, end = this.length]]) parameters value value to fill the typed array with. start optional. start
index. defaults to 0. end optional. end
index (not included). defaults to this.length. return value the modified array. description the elements interval to fill is [start, end). the fill method takes up to three arguments value, start and end. the start and end arguments are optional with default values of 0 and the length of the this object. if start is negative, it is treated as length+star...
TypedArray.prototype.slice() - JavaScript
e algorithm as array.prototype.slice(). typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.slice([begin[, end]]) parameters begin optional zero-based
index at which to begin extraction. a negative
index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. if begin is undefined, slice begins from
index 0. end optional zero-based
index before which to end extraction. slice extracts up to but not including end. for example, slice(1,4) extracts the second element through the fourt...
...slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts through the end of the sequence (typedarray.length). return value a new typed array containing the extracted elements. ...
...slice(2,-1) extracts the third element through the second-to-last element in the sequence. ...
TypedArray.prototype.some() - JavaScript
example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.some(callback[, thisarg]) parameters callback function to test for each element, taking three arguments: currentvalue the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array some was called upon. thisarg optional. value to use as this when executing callback. return value true if the callback function returns a truthy value for any array element; otherwise, false. description the some method executes the callback function once for each element present in the ty...
...ction returns a truthy value for any array element; otherwise, false. description the some method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, some immediately returns true. otherwise, some returns false. callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed. if a thisarg parameter is provided to some, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. some does not mut...
...rray.prototype.some }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples testing size of all typed array elements the following example tests whether any element in the typed array is bigger than 10. function isbiggerthan10(element,
index, array) { return element > 10; } new uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test. new uint8array([2, 5, 8, 1, 4]).some(elem => elem > 10); // false new uint8array([12, 5, 8, 1, 4]).some(elem => elem > 10);...
for...in - JavaScript
a different property name is assigned to variable on each iteration. object object whose non-symbol enumerable properties are iterated over. description a for...in loop only iterates over enumerable, non-symbol properties. objects created from built–in constructors like array and object have inherited non–enumerable properties from object.prototype and string.prototype, such as string's
indexof() method or object's tostring() method. the loop will iterate over all enumerable properties of the object itself and those the object inherits from its prototype chain (properties of nearer prototypes take precedence over those of prototypes further away from the object in its prototype chain). deleted, added, or modified properties a for...in loop iterates over the properties of an object i...
... iteration, other than the property currently being visited. there is no guarantee whether an added property will be visited, whether a modified property (other than the current one) will be visited before or after it is modified, or whether a deleted property will be visited before it is deleted. array iteration and for...in note: for...in should not be used to iterate over an array where the
index order is important. array
indexes are just enumerable properties with integer names and are otherwise identical to general object properties. there is no guarantee that for...in will return the
indexes in any particular order. the for...in loop statement will return all enumerable properties, including those with non–integer names and those that are inherited. because the order of iteration ...
... iterating over own properties only if you only want to consider properties attached to the object itself, and not its prototypes, use getownpropertynames() or perform a hasownproperty() check (propertyisenumerable() can also be used). ...
How to make PWAs installable - Progressive web apps (PWAs)
art menu, or an icon on the desktop), and a background color to use in loading or splash screens. this information is needed for the browser to present the web app properly during the installation process, as well as within the device's app-launching interface, such as the home screen of a mobile device. the js13kpwa.webmanifest file of the js13kpwa web app is included in the <head> block of the
index.html file using the following line of code: <link rel="manifest" href="js13kpwa.webmanifest"> there are a few common kinds of manifest file that have been used in the past: manifest.webapp was popular in firefox os app manifests, and many use manifest.json for web manifests as the contents are organized in a json structure. however, the .webmanifest file format is explicitly mentioned in the w...
...13kpwa", "description": "progressive web app that lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/
index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app. short_name: short name to be shown on the home screen. description: a sentence or two explaining what your app does. icons: a bunch of icon information — source urls, sizes,...
...xplanatory, but to be certain we're on the same page: name: the full name of your web app. short_name: short name to be shown on the home screen. description: a sentence or two explaining what your app does. icons: a bunch of icon information — source urls, sizes, and types. be sure to include at least a few, so that one that fits best will be chosen for the user's device. start_url: the
index document to launch when starting the app. display: how the app is displayed; can be fullscreen, standalone, minimal-ui, or browser. theme_color: a primary color for the ui, used by operating system. background_color: a color used as the app's default background, used during install and on the splash screen. a minimal web manifest must have at least a name and an icons field with at least one...
The building blocks of responsive design - Progressive web apps (PWAs)
ing live. note that getusermedia() is an experimental technology, which currently only works in google chrome and firefox desktop. more functionality and a clean up of the styling of snapshot are planned for a future date. our desktop layout for snapshot is three columns, containing the camera viewer, image capture view, and gallery, respectively. the markup is very simple: <x-deck selected-
index="0"> <x-card> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps. we have used brick to create the mobile layout for snapshot, which you will read more about below. to get these sitting side-by-side we have used the following rule...
...n any card a button's width higher up the card. when you click on an image in the gallery it brings up options to delete or cancel deletion of the card, and you don't want two buttons on top of one another. x-card:nth-child(3) img { width: 50%; } this rule simply changes the width of the gallery images so now there are two per line. ...
... next up, the font-size of the buttons is set to 6.8vw. why? because the top-margin of the x-cards was set to 17vw earlier on. all buttons in the app have been set to have a line-height of 2.5, in the default css at the top of the stylesheet (check if you don...
<a> - SVG: Scalable Vector Graphics
elf; animatable: yes type a mime type for the linked url. value type: <string> ; default value: none; animatable: yes xlink:href deprecated since svg 2 the url or url fragment that the hyperlink points to. may be required for backwards compatibility for older browsers. ...
...y, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <fo...
<circle> - SVG: Scalable Vector Graphics
lue type: <length> ; default value: 0; animatable: yes pathlength the total length for the circle's circumference, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<ellipse> - SVG: Scalable Vector Graphics
e> ; default value: auto; animatable: yes pathlength this attribute lets specify the total length for the path, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2 cx, cy, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<foreignObject> - SVG: Scalable Vector Graphics
alue type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the foreignobject. value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
... candidate recommendation ...
<g> - SVG: Scalable Vector Graphics
vg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- using g to inherit presentation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <...
<line> - SVG: Scalable Vector Graphics
value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y2 defines the y-axis coordinate of the line ending point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes pathlength defines the total path length in user units. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<marker> - SVG: Scalable Vector Graphics
able: yes refy this attribute defines the y coordinate for the reference point of the marker. value type: top|center|bottom|<coordinate> ; default value: 0; animatable: yes viewbox this attribute defines the bound of the svg viewport for the current svg fragment. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <fo...
<path> - SVG: Scalable Vector Graphics
q 90,60 50,90 q 10,60 10,30 z"/> </svg> attributes d this attribute defines the shape of the path. value type: <string> ; default value: ''; animatable: yes pathlength this attribute lets authors specify the total length for the path, in user units. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsthe definition of '<path>' in th...
<polygon> - SVG: Scalable Vector Graphics
attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon. value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<polyline> - SVG: Scalable Vector Graphics
attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polyline value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<rect> - SVG: Scalable Vector Graphics
; default value: auto; animatable: yes pathlength the total length of the rectangle's perimeter, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector grap...
<svg> - SVG: Scalable Vector Graphics
e> ; default value: 0; animatable: yes y the displayed y coordinate of the svg container. no effect on outermost svg elements. value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning these attributes can also be used as css properties. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <...
<text> - SVG: Scalable Vector Graphics
animatable: yes lengthadjust how the text is stretched or compressed to fit the width defined by the textlength attribute. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes textlength a width that the text should be scaled to fit. ...
...nant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment ...
<textPath> - SVG: Scalable Vector Graphics
able: yes startoffset how far the beginning of the text should be offset from the beginning of the path. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes textlength the width of the space into which the text will render. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> ...
<tspan> - SVG: Scalable Vector Graphics
animatable: yes lengthadjust how the text is stretched or compressed to fit the width defined by the textlength attribute. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes textlength a width that the text should be scaled to fit. ...
...nant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications speci...
<use> - SVG: Scalable Vector Graphics
es note: width, and height have no effect on use elements, unless the element referenced has a viewbox - i.e. they only have an effect when use refers to a svg or symbol element. note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element. ...
...rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:href, xlink:title usage notes categoriesgraphics element, graphics referencing element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specificat...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
logies, many of which become the de-facto standard. articles hands-on xsl author: don r. day location: http://www-106.ibm.com/developerwork...-hands-on-xsl/ understanding xslt author: jay greenspan location: http://hotwired.lycos.com/webmonkey/...l?tw=authoring what is xslt? author: g. ...
....ibm.com/developerwork...-hands-on-xsl/ understanding xslt author: jay greenspan location: http://hotwired.lycos.com/webmonkey/...l?tw=authoring what is xslt? author: g. ...
... what is xslt? author: g. ...
clipboard - Archive of obsolete content
pboard = require("sdk/clipboard"); clipboard.set("lorem ipsum dolor sit amet"); var contents = clipboard.get(); set the clipboard contents to some html. var clipboard = require("sdk/clipboard"); clipboard.set("<blink>lorem ipsum dolor sit amet</blink>", "html"); if the clipboard contains html content, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.
indexof("html") != -1) require("sdk/tabs").open("data:text/html;charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaah...
....set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.
indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images. if the intention is set the clipboard to a data url as string and not as image, it can be done by specifying a different flavor, like text. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + ...
tabs - Archive of obsolete content
myopentabs.push(tab); }); // listen for tab content loads. tabs.on('ready', function(tab) { console.log('tab is loaded', tab.title, tab.url); }); access tabs the module itself can be used as a list of all opened tabs across all windows. ...
...tion instead. contenttype this is currently an experimental api, so we might change it in future releases. returns the mime type that the document currently loaded in the tab is being rendered as. this may come from http headers or other sources of mime information, and might be affected by automatic type conversions performed by either the browser or extensions. this property is read-only.
index the
index of the tab relative to other tabs in the application window. this property can be set to change its relative position. ispinned whether or not this tab is pinned as an app tab. this property is read-only. window the window object for this tab. readystate new in firefox 33. a string telling you the load state of the document hosted by this tab. this corresponds directly to docu...
Using third-party modules (jpm) - Archive of obsolete content
current directory, under a directory called "node_modules". the --save argument instructs npm to add this package to the dependencies key in the add-on's package.json file. you'll now see a new directory in "my-menuitem" called "node_modules". ...
...ee a new directory in "my-menuitem" called "node_modules". it will contain a single directory "addon-pathfinder", and the modules included in this package will be somewhere in that directory: my-menuitem
index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem". open "
index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menuitem({ id: "clickme", menuid: "menu_toolspopup", label: "click me!", oncommand: function() { console.log("clicked"); }, insertbefore: "menu_pageinfo" }); now run the add-on: jpm run -b nightly you should see a new menu item in the tools menu labeled "click me!". click the button, a...
Miscellaneous - Archive of obsolete content
rg/appshell/window-mediator;1"].getservice(ci.nsiwindowmediator); var mainwindow = wm.getmostrecentwindow("navigator:browser"); //get sessionhistory from the current selected tab var history = mainwindow.gbrowser.selectedbrowser.webnavigation.sessionhistory; and then get the page you want, and it's postdata. this example obtains the post data of the last page. var postdata = history.getentryat
index(history.
index-1,false).queryinterface(ci.nsishentry).postdata; if you got here all by yourself, your problem must be at reading the postdata, because it's a nsiinputstream object, whose available function always returns 0. and if you read it directly, you always got nothing. and here's how it's done postdata.queryinterface(ci.nsiseekablestream).seek(ci.nsiseekablestream.ns_seek_set, 0); var st...
...nt/certs" + certname, null, null); var input=channel.open(); scriptablestream.init(input); var certfile=scriptablestream.read(input.available()); scriptablestream.close(); input.close(); var begincert = "-----begin certificate-----"; var endcert = "-----end certificate-----"; certfile = certfile.replace(/[\r\n]/g, ""); var begin = certfile.
indexof(begincert); var end = certfile.
indexof(endcert); var cert = certfile.substring(begin + begincert.length, end); certdb.addcertfrombase64(cert, certtrust, ""); }, classdescription: "certificate service", contractid: "@mozilla.org/certs-service;2", classid: components.id("{e9d2d37c-bf25-4e37-82a1-16b8fa089939}"), queryinterface: xpcomutils.generateqi([ci.nsio...
Windows - Archive of obsolete content
ditionally, if the window is in the background, it may not be brought to the front. this code will check for a window of the provided name. if it finds one, it focuses it. if it doesn't, it opens one. ...
...t doesn't, it opens one. var wenum = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher) .getwindowenumerator(); var
index = 1; var windowname = "yourwindowname"; while (wenum.hasmoreelements()) { var win = wenum.getnext(); if (win.name == windowname) { win.focus(); return; }
index++ } window.open("chrome://to/your/window.xul", windowname, "features"); uniquely identifying dom windows requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko, each dom window has a unique 64-bit id number. you can get a dom window's id using the nsidomwindowutils attribute outerwindowid. each time a new window is created, it gets assigned an id one greater than the las...
Adding sidebars - Archive of obsolete content
you'll need finer grained control than the one provided by a tabbox. in these cases the « xul reference « and « xul reference « elements are probably what you're looking for. they are extremely useful, and you'll find yourself using them in many situations besides sidebars. a deck is like a tabbbox without the tabs. it only displays one of its child nodes at a time, depending on its selected
index value. in the following example, the second child will be displayed, not the first which would be the default. <deck selected
index="2"> <hbox> <!-- content for the first child. --> </hbox> <hbox> <!-- content for the second child. --> </hbox> </deck> note how this is one of the few cases where an attribute of an element is named using camel case instead of all small caps. ...
...o different purposes, and the only difference between the two cases is a label that has a value in one case and something else in another. using a .properties file and a string bundle is a viable option, but it involves a lot of code for something so simple, specially if that's the only case where you need dynamic text. the alternative is to use a deck with the two labels, and change the selected
index depending on the purpose of the window. this way you can still use dtd, and the code remains simple. a stack is like a deck, except that all of its children are always on display, one of top of the other. it allows you to decompose complex ui into individual layers, broadening the layout possibilities. one common use for a stack is to have an image background that stretches horizontally and vert...
XPCOM Objects - Archive of obsolete content
need to be publicized are exposed through xpcom components and interfaces. you can think of xpcom as a reference to all the capabilities available on the lower layers of firefox. using xpcom components is relatively simple, as you've seen in previous examples. this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an
index to static objects and class definitions available through xpcom. the string between the brackets is just an identifier, in this case corresponding to the observer service. you'll usually know what string to use by reading examples and documentation. there is no comprehensive list of these (that we know of), and that's understandable since it would be a very long list, and it can be extended by ad...
...classes, just like the objects we handle in js. the method you call on cc["some-string"] should either be getservice or createinstance, depending on what you're asking for. in most cases it is very clear which one to call, but in case of doubt, look for documentation on it. those two methods always receive the interface identifier as an argument. similarly to cc, ci (components.interfaces) is an
index of available interfaces. a modified version of the last code snippet produces an even longer list of available interfaces. just like in component identifiers, the nsi prefix is just a way of keeping things in order. the ns stands for netscape, mozilla's predecessor. the "i" stands for interface. our interfaces should begin with something like xsihello. an interface is just a definition of a set ...
Promises - Archive of obsolete content
f files) { let data = yield os.file.read(file); processor.add(data); } // now write the processed files back out, as a binary blob. yield os.file.writeatomic(config.processedpath, processor.process(), { tmppath: config.processedpath + "." + math.random() }); // and write out a new config file. config.
indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api. while this api does not have direct su...
...row: row => { runtask(row.getresultbyname("task"), row.getresultbyname("group")); } }); // and quickly grab a single row value. let [row] = yield db.execute( "select value from nodes where key = 'timestamp' \ order by value desc limit 1"); latesttimestamp = row.getresultby
index(0); } finally { // make sure to close the database when finished. // failure to do this will prevent firefox from shutting down // cleanly. yield db.close(); } }); promise wrappers and helpers the following are some example promise-based wrappers for common callback-based asynchronous apis. addonmanager var aom = { __proto__: addonmanager, ...
Creating regular expressions for a microsummary generator - Archive of obsolete content
m/.*qqitemz.*qqcmdzviewitem in this expression, we use .* twice, since there are two places where there may be some characters that vary between auction item urls. handling https urls note: although ebay doesn't do this, occasionally a site will make pages available at both insecure and secure urls. ...
...s expression, we use .* twice, since there are two places where there may be some characters that vary between auction item urls. handling https urls note: although ebay doesn't do this, occasionally a site will make pages available at both insecure and secure urls. for example, both of the following urls might point to the same page: http://www.example.com/
index.html https://www.example.com/
index.html to make a regular expression that matches both pages, we just need to start the expression with "https" and then add a question mark (?) after that string, for example: ^https?://www\.example\.com/
index\.html the question mark makes the previous character optional, so the regular expression matches strings that include the "s" in "https" as well as ones that don't. conclusion if we i...
Monitoring downloads - Archive of obsolete content
tatement("select * from items"); // get all items in table try { while (statement.executestep()) { var row = document.createelement('listitem'); // add the cells to the row var cell = document.createelement('listcell'); var sourcestr = statement.getstring(0); row.setattribute("tooltiptext", sourcestr); sourcestr = sourcestr.slice(sourcestr.last
indexof("/")+1); cell.setattribute("label", sourcestr); // source row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute("label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); ...
...ow 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 cells' style attribute to text-align:right. exercises for the reader there...
How to implement a custom XUL query processor component - Archive of obsolete content
e string value getbindingobjectfor: function(avar) { return null; }, // called when a rule matches this item. ...
...ved and the result is no longer being used by the builder hasbeenremoved: function() { } }; // basic wrapper for nsisimpleenumerator function templateresultset(aarrayofdata) { this._
index = 0; this._array = aarrayofdata; } templateresultset.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsisimpleenumerator]), hasmoreelements: function() { return this._
index < this._array.length; }, getnext: function() { return new templateresult(this._array[this._
index++]); } }; // the query processor class - implements nsixultemplatequeryprocessor function templatequeryprocessor() { // our basic list of data this._data = [ {name: "mark", age: 36, hair: "brown", eye: "brown"}, {name: "bill", age: 25, hair: "red", eye:...
setSelectionRange - Archive of obsolete content
set both arguments to the same value to move the cursor to the corresponding position without selecting text. ...
...set both arguments to the same value to move the cursor to the corresponding position without selecting text. ...
MenuModification - Archive of obsolete content
be appended to this existing one. while the appenditem method always adds the new item to the end of the menu, the insertitemat method may be used in a similar fashion to insert an item into the menu elsewhere. menu.insertitemat(0, "delete", "delete"); in this example, the insertitemat method is used to insert a new 'delete' item at the beginning of the menu's popup. the first argument is the
index where the new item should be inserted. in this case, 0 is supplied as the
index, which means before the first item. indicies are counted starting at 0, so to insert an item before the fourth item pass 3 as the argument. the second and third arguments to insertitemat are the label and value for the new item, as with appenditem. both the appenditem and insertitemat methods return the new menuitem,...
...); } </script> the haschildnodes method may be used to check if a node has any children. the first time the function is called, the haschildnodes method will return false, however the second time, the method will return true as the items have already been added to the menu. removing items from a menu to remove an item from the menu, use the removeitemat method. it takes a single argument, the
index of the item to remove. in this example, an item is appended to a menu, and then immediately removed again. menu.appenditem("open", ""); menu.removeitemat(menu.itemcount - 1); the itemcount property holds the number of items within the menu. to remove all of the items from a menu, you may wish to simply remove the menupopup directly, instead of removing each item individually. ...
Menus - Archive of obsolete content
th the up or down arrow on the keyboard, then pressing the return key or right arrow key will open the menu. if it were a menuitem, then pressing the return key would have launched the command associated with it. there may be occasion to access or set this programatically with a script. if the menu has been created using a menulist, this is easily accomplished using the selecteditem or selected
index properties. however, it is not possible to use these properties for menus whose popup is the child of menu, button, or toolbarbutton. however, there is a way to access the active item using the nsimenuboxobject interface: activeitem = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject).activechild; where xulmenu is the menu, button, or toolbarbutton object. you can set ...
...l will deactivate all items, and keyboard navigation will start from the top of the menu. it should be noted that setting the active item in this way will not affect the selected property or selected attribute of the previously and newly activated item. you must unset/set those explicity for each item affected, if you want them to be. for menulists, however, setting the selecteditem or selected
index properties on the menu will automatically take care of that for you. ...
Commands - Archive of obsolete content
the supportscommand method returns true for the '...
...e, the following example will disable pasting into a textbox. var tboxcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_paste"); }, iscommandenabled : function(cmd){ return false; }, docommand : function(cmd){ }, onevent : function(evt){ } }; document.getelementbyid("tbox").controllers.insertcontrollerat(0,tboxcontroller); in this example, we insert the controller at
index 0, which means before any others. the new controller supports the 'cmd_paste' command and always indicates that the command is disabled. the default textbox controller never gets called because the command dispatcher found the controller above to handle the command first. next, we'll find out how to update commands. « previousnext » ...
Content Panels - Archive of obsolete content
layed is created by using an iframe. when the user enters a url or clicks on a link in a document, the source of the frame is changed. ...
...this example isn't functionally complete. next, we would want to add script which changes the src attribute at the desired time, for example when the user presses the enter key. browsers there is a second type of content panel, using the browser tag. you would use this when you want to create a frame that displays content like a browser. ...
Tree Box Objects - Archive of obsolete content
functions which may be used to get the parts of the tree at specific coordinates and vice versa. the getcellat() function may be used to get the cell at specific pixel location the getrowat() function may be used to get a row at a specific location. the getrowat() function takes two arguments, the x and y coordinates to use. tree.boxobject.getrowat( 50, 100 ); this example will return the
index of the row with a horizontal position of 50 and a vertical position of 100. naturally, it doesn't really matter what the value of the x coordinate is since rows always take up the entire horizontal space of the tree. one important thing to note is that the coordinates are measured from the upper left corner of the containing document, not the edge of the tree itself. this makes it easy to pass ...
...u will see a number of interfaces that use out parameters in the xulplanet object reference (fixme: deadlink). these are indicated by the word 'out' before the argument. for these, you will need to supply an empty object and the function will fill in the 'value' property with the necessary value. the three out parameters will be filled in with the row, the column and a child type. the row is the
index of the row the mouse is over, since we call it with the event coordinates of a mousemove event. if the coordinate is not over a row, the row value will be set to -1. the column is a column object in mozilla 1.8 and later. in earlier versions, columns are identified with a string, the id of the column. in later versions, a separate column object exists, which can be queried for column data. the f...
XUL Changes for Firefox 1.5 - Archive of obsolete content
tion, see preferences system. bfcache mozilla now caches the page's dom, so that navigating back and forward does not reload the page, making navigation much more efficient. the pageshow and pagehide events are used when switching from a page in the cache, while the load and unload events are used only when the page is loaded or unloaded. for more information see using firefox 1.5 caching. tab
index the tab
index property is now applied to most elements. <radiogroup> setting the value property on the <radiogroup> element selects the <radio> element in the group with the corresponding value. dialog: defaultbutton property the <dialog> binding now supports the defaultbutton property. setting this property changes the default button of the dialog. it can be set either to one of the buttons ...
...is has been fixed in firefox 1.5 and all code depending on this non zero-based behaviour should be changed. <stringbundle> the <stringbundle> element has a strings property which may be used to retrieve an enumeration of all of the strings in the bundle. draggable tabs the tabbrowser now allows the user to rearrange tabs by dragging them. <tabbox> the <tabbox> element now supports a selected
index attribute to specify the tab to be selected by default. loading overlays dynamically xul now supports loading overlays dynamically with the document.loadoverlay function. original document information author(s): neil deakin ...
XUL Questions and Answers - Archive of obsolete content
describing the attributes of the items in the menu and you generate the xul on client by applying an xslt transform.) can i change a xul tree cell/row/item background color with javascript? to set the background color you need to set the property for the cell/row and not for the item. ...
...tributes of the items in the menu and you generate the xul on client by applying an xslt transform.) can i change a xul tree cell/row/item background color with javascript? to set the background color you need to set the property for the cell/row and not for the item. ...
browser - Archive of obsolete content
properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, goto
index, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
...progress listener to the browser which will monitor loaded documents. the progress listener should implement the nsiwebprogresslistener interface. goback() return type: no return value go back one page in the history. goforward() return type: no return value go forward one page in the history. gohome() return type: no return value load the user's home page into the browser. goto
index(
index ) return type: no return value navigate to the page in the history with the given
index. use a positive number to go forward and a negative number to go back. note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. please check which one you're documenting! (this one has no post data parameter, see loaduriwithflags for a ...
tabpanels - Archive of obsolete content
me people like to use tabpanel elements. by clicking the first tab, the first panel will be displayed. by clicking the second tab, the second panel will be displayed and so on. there should be the same number of panels as there are tabs. panels should never be hidden; hiding the tab suffices to make the panel inaccessible. more information is available in the xul tutorial. attributes selected
index properties selected
index, selectedpanel examples (example needed) attributes selected
index type: integer gets and sets the
index of the currently selected panel. the first item is at
index 0. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, ...
...minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. selected
index type: integer returns the
index of the currently selected item. you may select an item by assigning its
index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element. assigning a value to this property will modif...
toolbar - Archive of obsolete content
n a toolbar is first displayed. in earlier versions, a copy of each item was created and placed on the toolbar. this means that the palette now only contains items not already in the toolbar. this introduces a potential compatibility problem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette. ...
...ubar" and a menubar element. currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar. this will be modified when the user customizes the toolbar. the value of this attribute should be a comma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer". custom
index not in seamonkey 1.x type: integer this value is the
index of the toolbar in the list of the custom toolbars. the value is updated automatically by the toolbar customization dialog. customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized. this causes the set of buttons to be persisted across sessions. defaultset not in seamo...
Browser Feature Detection - Archive of obsolete content
rue stress true false false tablelayout true true true textshadow true false true top true true true unicodebidi true true true visibility true true true voicefamily true false true volume true false true widows true false true z
index true true true test code // document properties that are used to determine // support levels var _features = { 'domcore1': [ {name: 'doctype', 'supported': false}, {name: 'implementation', 'supported': false}, {name: 'documentelement', 'supported': false}, {name: 'createelement', 'supported': false}, {name: 'createdocumentfragment', 'supported': false}, {name: 'creat...
... false}, {name: 'stress', 'supported': false}, {name: 'tablelayout', 'supported': false}, {name: 'textshadow', 'supported': false}, {name: 'top', 'supported': false}, {name: 'unicodebidi', 'supported': false}, {name: 'visibility', 'supported': false}, {name: 'voicefamily', 'supported': false}, {name: 'volume', 'supported': false}, {name: 'widows', 'supported': false}, {name: 'z
index', 'supported': false} ] }; function supports(object, featureset) { var i; var features = _features[featureset]; var level = 0; if (!features) return level; for (i = 0; i < features.length; i++) if (typeof(object[features[i].name]) != 'undefined') { features[i].supported = true; ++level; } return math.floor( (100 * level) / features.length ); } function generatereport...
Array.unobserve() - Archive of obsolete content
anonymous function, because this reference will be used to unset the previous observer. it's useless to call array.unobserve() with an anonymous function as callback, it will not remove any observer. ...
...array.observe(arr, observer); ​ arr.push(4); // [{type: "splice", object: <arr>,
index: 3, removed:[], addedcount: 1}] array.unobserve(arr, observer); arr.pop(); // the callback wasn't called using an anonymous function var persons = ['khalid', 'ahmed', 'mohammed']; array.observe(persons, function (changes) { console.log(changes); }); persons.shift(); // [{type: "splice", object: <arr>,
index: 0, removed: [ "khalid" ], addedcount: 0 }] array.unobserve(persons, function (changes) { console.log(changes); }); persons.push('abdullah'); // [{type: "splice", object: <arr>,
index: 2, removed: [], addedcount: 1 }] // the callback will always be called ...
VBArray.ubound - Archive of obsolete content
if omitted, ubound behaves as if a 1 was passed. remarks if the vbarray is empty, the ubound method returns undefined. if dim is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error. ...
...if omitted, ubound behaves as if a 1 was passed. remarks if the vbarray is empty, the ubound method returns undefined. if dim is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error. ...
JSObject - Archive of obsolete content
of javascript source code which will be evaluated in the context given by "this". declaration public object eval(string s) getmember method. retrieves the value of a property of a javascript object. equivalent to "this.name" in javascript. declaration public object getmember(string name) getslot method. retrieves the value of an array element of a javascript object. equivalent to "this[
index]" in javascript. declaration public object getslot(int
index) getwindow static method. returns a jsobject for the window containing the given applet. this method is useful in client-side javascript only. declaration public static jsobject getwindow(applet applet) removemember method. removes a property of a javascript object. declaration public void removemember(string name) setmemb...
...vemember method. removes a property of a javascript object. declaration public void removemember(string name) setmember method. sets the value of a property of a javascript object. equivalent to "this.name = value" in javascript. declaration public void setmember(string name, object value) setslot method. sets the value of an array element of a javascript object. equivalent to "this[
index] = value" in javascript. declaration public void setslot(int
index, object value) tostring method. converts a jsobject to a string. overrides: tostring in class java.lang.object declaration public string tostring() ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
to advertise through jaxer using the data from the database we captured from prior form submissions. ...
...jaxer using the data from the database we captured from prior form submissions. listing 10 - creating a simple xml service <script runat="server"> var rs_comments = jaxer.db.execute("select * from comments"); var doc = document.implementation.createdocument('', 'comments', null); var root = doc.documentelement; rs_comments.rows.foreach(function(row,
index) { if (true ||
index < 10) { var node = doc.createelement('comment'); node.setattribute('id', row.id); node.setattribute('name', row.name); node.setattribute('message', row.message); root.appendchild(node); } }); jaxer.response.exit(200, doc); </script> the data from the database is represented in xml format as follows: <comments> <comment message="”jaxer" name="”nigel" id="”1”"></comment> ... more comment...
Archive of obsolete content
ature or api, and how it worked. there are many reasons older documentation can be useful. so, we've established this area into which we can archive older documentation. material in this archived content zone should not be used for building new web sites or apps for modern browsers. it's here for historical reference only. see the complete
index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder. try to create subtrees for categories of material. also, only move pages here that are extremely obsolete. if anyone might realistically need the information in a living product, it may not be appropriate to move it here. ...
...book is to help you update websites to work with standards-based browsers and properly detect gecko. getting the page url in npapi plugin sometimes, you want to restrict an npapi plugin to be loadable only from a certain url or domain or scheme. or whenever you make network requests yourself, you almost always need to enforce same-origin policy.
index of archived content inner-browsing extending the browser navigation paradigm this article is the version from 2003 with slight modifications (no images and no links to samples). it's here for reference. install.js see also this article from xulplanet's main tutorial. jxon jxon (lossless javascript xml object notation) is a generic...
Introduction to game development for the Web - Game development
let's look at how the web can help you. the reach of the web is enormous; it's everywhere. games built with html5 work on smartphones, tablets,...
... game, you'll need this api. html and css together, these two technologies let you build, style, and lay out your game's user interface. part of html is the <canvas> element, which provides one way to do 2d graphics. html audio the <audio> element lets you easily play simple sound effects and music. if your needs are more involved, check out the web audio api for real audio processing power!
indexeddb a powerful data storage api for maintaining user data on their own computer or device. a great way to save game state and other information locally so it doesn't have to be downloaded every time it's needed. also useful to help make your game playable even when the user isn't connected to the web (such as when they're stuck on an airplane for hours on end). javascript javascript, the progr...
GLSL Shaders - Game development
ement in the <head> includes the three.js library in the page; we will write our code into three script tags in the <body> tag: the first one will contain the vertex shader. the second one will contain the fragment shader. the third one will contain the actual javascript code generating the scene. before reading on, copy this code to a new text file and save it in your working directory as
index.html. we'll create a scene featuring a simple cube in this file to explain how the shaders work. the cube's source code instead of creating everything from scratch we can reuse the building up a basic demo with three.js source code of the cube. most of the components like the renderer, camera, and lights will stay the same, but instead of the basic material we will set the cube's color and posi...
...ith three.js source code of the cube. most of the components like the renderer, camera, and lights will stay the same, but instead of the basic material we will set the cube's color and position using shaders. go to the cube.html file on github, copy all the javascript code from inside the second <script> element, and paste it into the third <script> element of the current example. save and load
index.html in your browser — you should see a blue cube. the vertex shader code let's continue by writing a simple vertex shader — add the code below inside the body's first <script> tag: void main() { gl_position = projectionmatrix * modelviewmatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } the resulting gl_position is calculated by multiplying the model-view and the projec...
Create the Canvas and draw on it - Game development
nvas-workshop/lesson1.html. before we can start writing the game's functionality, we need to create a basic structure to render the game inside. this can be done using html and the <canvas> element. the game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element. ...
...byid("mycanvas"); var ctx = canvas.getcontext("2d"); here we're storing a reference to the <canvas> element to the canvas variable. then we're creating the ctx variable to store the 2d rendering context — the actual tool we can use to paint on the canvas. let's see an example piece of code that prints a red square on the canvas. add this below your previous lines of javascript, then load your
index.html in a browser to try it out. ctx.beginpath(); ctx.rect(20, 40, 50, 50); ctx.fillstyle = "#ff0000"; ctx.fill(); ctx.closepath(); all the instructions are between the beginpath() and closepath() methods. we are defining a rectangle using rect(): the first two values specify the coordinates of the top left corner of the rectangle on the canvas, while the second two specify the width and height...
Initialize the framework - Game development
nctionality, we need to create a basic structure to render the game inside. this can be done using html — the phaser framework will generate the required <canvas> element. the game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element generated by the framework. ...
...haser (v3). the v2 library is still available on the phaser download page, below the links for the v3 download. go to the phaser download page. choose an option that suits you best — i would recommend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway. save the phaser code inside a /js directory in the same location as your
index.html file. update the src value of the first <script> element as shown above. walking through what we have so far at this point we have a charset defined, <title> and some basic css in the header to reset the default margin and padding. we also have a <script> element to apply the phaser source code to the page. the body contains a second <script> element, where we will write the javascript c...
Load the assets and print them on screen - Game development
parameter is the relative path to the graphic asset. in our case, we will load the image for our ball. (note that the file name does not also have to be the same, but we'd recommend it, as it makes everything easier to follow.) of course, to load the image, it must be available in our code directory. grab the ball image from github, and save it inside an /img directory in the same place as your
index.html file. now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen. the first two parameters are the x and y coordinates of the canvas where you want it added, and t...
...prite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen. the first two parameters are the x and y coordinates of the canvas where you want it added, and the third one is the name of the asset we defined earlier. that's it — if you load your
index.html file you will see the image already loaded and rendered on the canvas! compare your code you can check the finished code for this lesson for yourself in the live demo below, and play with it to better understand how it works: next steps printing out the ball was easy; next, we'll try moving the ball on screen. « previousnext » ...
Player paddle and controls - Game development
we can use the world.width and world.height values to position the paddle exactly where we want it: game.world.width*0.5 will be right in the middle of the screen. in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects. as you'll notice if you reload your
index.html at this point, the paddle is currently not exactly in the middle. why? because the anchor from which the position is calculated always starts from the top left edge of the object. we can change that to have the anchor in the middle of the paddle's width and at the bottom of it's height, so it's easier to position it against the bottom edge. add the following line below the previous new one: ...
...t's x position, however when we start the game, the position of the paddle is not in the middle. it's because the input position is not yet defined. to fix that we can set the default position (if an input position is not yet defined) to be the middle of the screen. update the previous line as follows: paddle.x = game.input.x || game.world.width*0.5; if you haven't already done so, reload your
index.html and try it out! position the ball we have the paddle working as expected, so let's position the ball on it. it's very similar to positioning the paddle — we need to have it placed in the middle of the screen horizontally and at the bottom vertically with a little offset from the bottom. to place it exactly as we want it we will set the anchor to the exact middle of the ball. find the exi...
2D maze game with device orientation - Game development
online documentation and go through the big collection of examples. the phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. starting with the project you can see cyber orb source code on github. the folder structure is quite straightforward: the starting point is the
index.html file where we initialize the framework and set up an <canvas> to render the game on. you can open the
index file in your favourite browser to launch the game and try it. there are also three folders in the directory: img: all the images that we will use in the game. src: the javascript files with all the source code of the game defined inside. audio: the sound files used in the game.
...also three folders in the directory: img: all the images that we will use in the game. src: the javascript files with all the source code of the game defined inside. audio: the sound files used in the game. setting up the canvas we will be rendering our game on canvas, but we won't do it manually — this will be taken care of by the framework. let’s set it up: our starting point is the
index.html file with the following content. you can create this yourself if you want to follow along: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>cyber orb demo</title> <style> body { margin: 0; background: #333; } </style> <script src="src/phaser-arcade-physics.2.2.2.min.js"></script> <script src="src/boot.js"></script> <script src="src/preloader.js"></script...
Origin - MDN Web Docs Glossary: Definitions of Web-related terms
web content's origin is defined by the scheme (protocol), host (domain), and port of the url used to access it. two objects have the same origin only when the scheme, host, and port all match. some operations are restricted to same-origin content, and this restriction can be lifted using cors. ...
... web content's origin is defined by the scheme (protocol), host (domain), and port of the url used to access it. two objects have the same origin only when the scheme, host, and port all match. some operations are restricted to same-origin content, and this restriction can be lifted using cors. ...
MDN Web Docs Glossary: Definitions of Web-related terms
houdini hpkp hsts html html5 http http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ietf iife imap immutable
index indexeddb information architecture inheritance input method editor instance internationalization internet intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery j...
...simd simple header simple response header sisd site site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed
index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error ...
CSS and JavaScript accessibility best practices - Learn web development
; the first two lines run the functions when the mouse pointer hovers over and stops hovering over the thumbnail, respectively. this won't allow us to access the zoomed view by keyboard though — to allow that, we've included the last two lines, which run the functions when the image is focused and blurred (when focus stops). ...
...e, because we've included tab
index="0" on it. the click event is interesting — it sounds mouse-dependent, but most browsers will activate onclick event handlers after enter/return is pressed on a link or form element that has focus, or when such an element is tapped on a touchscreen device. this doesn't work by default however when you allow a non-default-focusable event to have focus using tab
index — in such cases you need to detect specifically when that exact key is pressed (see building keyboard accessibility back in). test your skills! you've reached the end of this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: css and javascript accessibility.
Advanced styling effects - Learn web development
we will cover these in detail i...
...we will cover these in detail in our css layout module. css shapes while it is true that everything in css is a rectangular box, and images are a physical rectangular box, we can make it look as if our content flows around non-rectangular things by using css shapes. ...
Organizing your CSS - Learn web development
tials) these can then all be compiled together into one, or a small number of stylesheets to actually link into your website. ...
...ink into your website. so for example, with partials, you could have several style files inside a directory, say foundation/_code.scss, foundation/_lists.scss, foundation/_footer.scss, foundation/_links.scss, etc., then use the sass @use role to load them into other stylesheets: // foundation/_
index.sass @use 'code' @use 'lists' @use 'footer' @use 'links' if the partials are all loaded into an
index file, as implied above, you can then load that entire directory into another stylesheet in one go: // style.sass @use 'foundation' note: a simple way to try out sass is to use codepen — you can enable sass for your css in the settings for a pen, and codepen will then run the sass parser for you, in order that you can see the resulting webpage with regular css applied. sometimes you will find...
Getting started with CSS - Learn web development
d, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of linking a css document to an html file, and be able to do simple text formatting with css. starting with some html our starting point is an html document. you can copy the code from below if you want to work on your own computer. save the code below as
index.html in a folder on your machine. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <p>this is a paragraph of text. in the text is a <span>span element</span> and also a <a href="http://example.com">link</a>.</p> <p>this is the second paragraph. it contains an <em>emphasi...
...es we want it to use. there are three different ways to apply css to an html document that you'll commonly come across, however, for now, we will look at the most usual and useful way of doing so — linking css from the head of your document. create a file in the same folder as your html document and save it as styles.css. the .css extension shows that this is a css file. to link styles.css to
index.html add the following line somewhere inside the <head> of the html document: <link rel="stylesheet" href="styles.css"> this <link> element tells the browser that we have a stylesheet, using the rel attribute, and the location of that stylesheet as the value of the href attribute. you can test that the css works by adding a rule to styles.css. using your code editor add the following to your cs...
CSS FAQ - Learn web development
ed. for example: -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); note: for more information on dealing with prefixed properties, see handling common html and css problems — handling css prefixes from our cross-browser testing module. note: see the mozilla css extensions page for more information on the mozilla-prefixed css properties. how does z-
index relate to positioning? the z-
index property specifies the stack order of elements. an element with a higher z-
index/stack order is always rendered in front of an element with a lower z-
index/stack order on the screen. z-
index will only work on elements that have a specified position (position:absolute, position:relative, or position:fixed). note: for more information, see our positioning lear...
...ifies the stack order of elements. an element with a higher z-
index/stack order is always rendered in front of an element with a lower z-
index/stack order on the screen. z-
index will only work on elements that have a specified position (position:absolute, position:relative, or position:fixed). note: for more information, see our positioning learning article, and in particular the introducing z-
index section. ...
create fancy boxes - Learn web development
cy::after { /* this is required to be allowed to display the pseudo-elements, event if the value is an empty string */ content: ''; /* we positionnate our pseudo-elements on the left and right sides of the box, but always at the bottom */ position: absolute; bottom : 0; /* this makes sure our pseudo-elements will be below the box content whatever happens. */ z-
index : -1; background-color: #a4c9cf; border-radius: 100%; } .fancy::before { /* this is the size of the clouds left ear */ width : 125px; height : 125px; /* we sligthly move it to the left */ left : -80px; /* to make sure that the bottom of the cloud remains flat, we must make the bottom right corner of the left ear square. */ border-bottom-right-radius: 0; } .fa...
...box-shadow property allow us to create inner light and a flat drop shadow effect, but with some little extra work it becomes possible to create a more natural geometry by using pseudo-element and the transform property. .fancy { position: relative; background-color: #ffc; padding: 2rem; text-align: center; max-width: 200px; } .fancy::before { content: ""; position : absolute; z-
index : -1; bottom : 15px; right : 5px; width : 50%; top : 80%; max-width: 200px; box-shadow: 0px 13px 10px black; transform: rotate(4deg); } what's next in many ways, making a fancy box is mostly about adding color and images within the background, so it could worth digging into managing colors and images. also, fancy boxes themselves are quite useless if they are not...
What is the difference between webpage, website, web server, and search engine? - Learn web development
pages, such as google, bing, yahoo, or duckduckgo. search engines are normally accessed through a web browser (e.g. you can perform search engine searches directly in the address bar of firefox, chrome, etc.) or through a web page (e.g. bing.com or duckduckgo.com). let's look at a simple analogy — a public library. this is what you would generally do when visiting a library: find a search
index and look for the title of the book you want. make a note of the catalog number of the book. go to the particular section containing the book, find the right catalog number, and get the book. let's compare the library with a web server: the library is like a web server. it has several sections, which is similar to a web server hosting multiple websites. the different sections (science, mat...
... history, etc.) in the library are like websites. each section is like a unique website (two sections do not contain same books). the books in each section are like webpages. one website may have several webpages, e.g., the science section (the website) will have books on heat, sound, thermodynamics, statics, etc. (the webpages). webpages can each be found at a unique location (url). the search
index is like the search engine. each book has its own unique location in the library (two books cannot be kept at the same place) which is specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document d...
How do I use GitHub Pages? - Learn web development
top of. next, sign up for a github account. it's simple and easy. once you've signed up, log in to github.com with your username and password. preparing your code for upload you can store any code you like in a github repository, but to use the github pages feature to full effect, your code should be structured as a typical website, e.g. with the primary entry point being an html file called
index.html. the other thing you need to do before moving on is to initialise your code directory as a git repository. to do this: point the command line to your test-site directory (or whatever you called the directory containing your website). for this, use the cd command (i.e. "change directory"). here's what you'd type if you've put your website in a directory called test-site on your desktop: ...
...ur repository choose settings, then scroll down until you get to the github pages section. underneath source, choose master branch. the page should refresh. go to the github pages section again, and you should see a line of the form "your site is ready to be published at https://xxxxxx." if you click on this url, you should go to a live version of your example, provided the home page is called
index.html — it goes to this entry point by default. if your site's entry point is called something else, for example mypage.html, you'll need to go to https://xxxxxx/mypage.html. further github knowledge if you want to make more changes to your test site and upload those to github, you simply need to make the change to your files just like you did before. then, you need to enter the following com...
CSS basics - Learn web development
out! using a text editor, paste the three lines of css (above) into a new file. save the file as style.css in a directory named styles. to make the code work, we still need to apply this css (above) to your html document. otherwise, the styling won't change the appearance of the html. (if you haven't been following our project, pause here to read dealing with files and html basics.) open your
index.html file. paste the following line in the head (between the <head> and </head> tags): <link href="styles/style.css" rel="stylesheet"> save
index.html and load it in your browser. you should see something like this: if your paragraph text is red, congratulations! your css is working. anatomy of a css ruleset let's dissect the css code for red paragraph text to understand how it works : ...
...y more selectors to discover. to learn more, see the mdn selectors guide. fonts and text now that we've explored some css fundamentals, let's improve the appearance of the example by adding more rules and information to the style.css file. first, find the output from google fonts that you previously saved from what will your website look like?. add the <link> element somewhere inside your
index.html's head (anywhere between the <head> and </head> tags). it looks something like this: <link href="https://fonts.googleapis.com/css?family=open+sans" rel="stylesheet"> this code links your page to a style sheet that loads the open sans font family with your webpage. next, delete the existing rule you have in your style.css file. it was a good test, but let's not continue with lots of red...
What’s in the head? Metadata in HTML - Learn web development
sts in browsers). the humble favicon has been around for many years. it is the first icon of this type: a 16-pixel square icon used in multiple places. you may see (depending on the browser) favicons displayed in the browser tab containing each open page, and next to bookmarked pages in the bookmarks panel. ...
...pply, try checking out our css-and-js.html example page. setting the primary language of the document finally, it's worth mentioning that you can (and really should) set the language of your page. this can be done by adding the lang attribute to the opening html tag (as seen in the meta-example.html and shown below.) <html lang="en-us"> this is useful in many ways. your html document will be
indexed more effectively by search engines if its language is set (allowing it to appear correctly in language-specific results, for example), and it is useful to people with visual impairments using screen readers (for example, the word "six" exists in both french and english, but is pronounced differently.) you can also set subsections of your document to be recognised as different languages. for ex...
Mozilla splash page - Learn web development
u should have already worked through the rest of the multimedia and embedding module. objective: to test knowledge around embedding images and video in web pages, frames, and html responsive image techniques. starting point to start off this assessment, you need to grab the html and all the images available in the mdn-splash-page-start directory on github. save the contents of
index.html in a file called
index.html on your local drive, in a new directory. then save pattern.png in the same directory (right click on the image to get an option to save it.) access the different images in the originals directory and save them in the same way; you'll want to save them in a different directory for now, as you'll need to manipulate (some of) them using a graphics editor before they...
...x wide versions of: firefox_logo-only_rgb.png firefox-addons.jpg mozilla-dinosaur-head.png call them something sensible, e.g. firefoxlogo400.png and firefoxlogo120.png. along with mdn.svg, these images will be your icons to link to further resources, inside the further-info area. you'll also link to the firefox logo in the site header. save copies of all these inside the same directory as
index.html. next, create a 1200px wide landscape version of red-panda.jpg, and a 600px wide portrait version that shows the panda in more of a close up shot. again, call them something sensible so you can easily identify them. save a copy of both of these inside the same directory as
index.html. note: you should optimise your jpg and png images to make them as small as possible, while still looking ...
Drawing graphics - Learn web development
e of these means learning another new api (a third party one, in this case), but they are a lot simpler than coding raw webgl. recreating our cube let's look at a simple example of how to create something with a webgl library. we'll choose three.js, as it is one of the most popular ones. in this tutorial we'll create the 3d spinning cube we saw earlier. ...
...s it is one of the most popular ones. in this tutorial we'll create the 3d spinning cube we saw earlier. to start with, make a local copy of
index.html in a new folder, then save a copy of metal003.png in the same folder. this is the image we'll use as a surface texture for the cube later on. next, create a new file called main.js, again in the same folder as before. if you open
index.html in your code editor, you'll see that it has two <script> elements — the first one attaching three.min.js to the page, and the second one attaching our main.js file to the page. you need to download the three.min.js library and save it in the same directory as before. now we've got three.js attached to our page, we can start to write javascript that makes use of it into main.js. let's...
Introduction to web APIs - Learn web development
library and a framework is “inversion of control”. when calling a method from a library, the developer is in control. with a framework, the control is inverted: the framework calls the developer's code. what can apis do? there are a huge number of apis available in modern browsers that allow you to do a wide variety of things in your code. you can see this by taking a look at the mdn apis
index page. common browser apis in particular, the most common categories of browser apis you'll use (and which we'll cover in this module in greater detail) are: apis for manipulating documents loaded into the browser. the most obvious example is the dom (document object model) api, which allows you to manipulate html and css — creating, removing and changing html, dynamically applying new styl...
...de storage apis are becoming a lot more widespread in web browsers — the ability to store data on the client-side is very useful if you want to create an app that will save its state between page loads, and perhaps even work when the device is offline. there are a number of options available, e.g. simple name/value storage with the web storage api, and more complex tabular data storage with the
indexeddb api. common third-party apis third-party apis come in a large variety; some of the more popular ones that you are likely to make use of sooner or later are: the twitter api, which allows you to do things like displaying your latest tweets on your website. map apis like mapquest and the google maps api allows you to do all sorts of things with maps on your web pages. the facebook suite...
Silly story generator - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module. objective: to test comprehension of javascript fundamentals, such as variables, numbers, operators, strings, and arrays. starting point to get this assessment started, you should: go and grab the html file for the example, save a local copy of it as
index.html in a new directory somewhere on your computer, and do the assessment locally to begin with. this also has the css to style the example contained within it. go to the page containing the raw text and keep this open in a separate browser tab somewhere. you'll need it later. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html, css and java...
...silly story if you press the button again (and again...) the following screenshot shows an example of what the finished program should output: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do. basic setup: create a new file called main.js, in the same directory as your
index.html file. apply the external javascript file to your html by inserting a <script> element into your html referencing main.js. put it just before the closing </body> tag. initial variables and functions: in the raw text file, copy all of the code underneath the heading "1. complete variable and function definitions" and paste it into the top of the main.js file. this gives you three variabl...
Working with JSON - Learn web development
if we loaded this object into a javascript program, parsed in a variable called superheroes for example, we could then access the data inside it using the same dot/bracket notation we looked at in the javascript object basics article. for example: superheroes.hometown superheroes['active'] to access data further down the hierarchy, you simply have to chain the required property names and array
indexes together. for example, to access the third superpower of the second hero listed in the members list, you'd do this: superheroes['members'][1]['powers'][2] first we have the variable name — superheroes. inside that we want to access the members property, so we use ["members"]. members contains an array populated by objects. we want to access the second object inside the array, so we use...
...iation resistance", "turning tiny", "radiation blast" ] }, { "name": "madame uppercut", "age": 39, "secretidentity": "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 comput...
Perceived performance - Learn web development
er, but you can make it feel faster even if the metrics discussed in the othser sections can't be improved. there is no unicorn metric that can measure what the user feels, but metrics are useful in guaging improvements (and regressions). relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed
index. first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable. it doesn’t indicate completeness and may report a time when nothing visible is painted. first contentful paint (fcp) reports the time when the browser first rendered anything of signifigance, be that te...
...t the user has content to consume. the first meaningful paint, or fmp, is the when content appears on the screen that is actually meaningful; which is a better metric for user-perceived loading experience, but still not ideal. largest contentful paint (lcp) metric, definited in the largest contentful paint api, reports the render time of the largest content element visible in the viewport. speed
index is also used to approximate perceived performance: it measures the average time for pixels on the visible screen to be painted. it doesn't account for jitter, nor does it weight which content important to a user more highly, so it's not a perfect metric. these metrics have to do with initial load and render. it is also important to ensure the site feels fast once the user begins interacting with...
Componentizing our React app - Learn web development
r code with one of javascript's core abilities: iteration. to use iteration, we should first re-think our tasks. tasks as data each of our tasks currently contains three pieces of information: its name, whether it has been checked, and its unique id. this data translates nicely to an object. since we have more than one task, an array of objects would work well in representing this data. ...
...you can console.log() it to check, if you’d like. ...
Starting our Svelte Todo list app - Learn web development
r list of todos. create a new folder — src/components. note: you can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily. ...
... font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-
index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focu...
Deployment and next steps - Learn web development
ld to build our application. we are also telling gitlab to deploy the contents of the public folder. on the last line, we are configuring gitlab to redeploy our app only when there's a push to our master branch. since our app will be published at a subdirectory (like https://your-user.gitlab.io/mdn-svelte-todo), we'll have to make the references to the javascript and css files in our public/
index.html file relative. to do this, we just remove the leading slashes (/) from the /global.css, /build/bundle.css, and /build/bundle.js urls, like this: <title>svelte to-do list</title> <link rel='icon' type='image/png' href='favicon.png'> <link rel='stylesheet' href='global.css'> <link rel='stylesheet' href='build/bundle.css'> <script defer src='build/bundle.js'></script> do this now. ...
.../bundle.js urls, like this: <title>svelte to-do list</title> <link rel='icon' type='image/png' href='favicon.png'> <link rel='stylesheet' href='global.css'> <link rel='stylesheet' href='build/bundle.css'> <script defer src='build/bundle.js'></script> do this now. now we just have to commit and push our changes to gitlab. do this by running the following commands: > git add public/
index.html > git add .gitlab-ci.yml > git commit -m "added .gitlab-ci.yml file and fixed
index.html absolute paths" > git push counting objects: 5, done. delta compression using up to 8 threads. compressing objects: 100% (5/5), done. writing objects: 100% (5/5), 541 bytes | 541.00 kib/s, done. total 5 (delta 3), reused 0 (delta 0) to gitlab.com:opensas/mdn-svelte-todo.git 7dac9f3..5725f46 master ->...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
t checkalltodos = (completed) => { todos.foreach(t => t.completed = completed) todos = todos } this will solve the problem. internally svelte will flag todos as changed and remove the apparently redundant self-assignment. apart from the fact that it looks weird, it's perfectly ok to use this technique, and sometimes it's the most concise way to do it. we could also access the todos array by
index, like this: const checkalltodos = (completed) => { todos.foreach( (t,i) => todos[i].completed = completed) } assignments to properties of arrays and objects — e.g. obj.foo += 1 or array[i] = x — work the same way as assignments to the values themselves. when svelte analyzes this code, if can detect that the todos array is being modified. another solution is to assign a new array to todos...
...adingel.focus(). update the contents of todosstatus.svelte like so: <script> export let todos $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length let headingel export function focus() { // shorter version: export const focus = () => headingel.focus() headingel.focus() } </script> <h2 id="list-heading" bind:this={headingel} tab
index="-1">{completedtodos} out of {totaltodos} items completed</h2> note that we've added a tab
index attribute to the <h2> to allow the element to receive focus programmatically. as we saw earlier, using the bind:this={headingel} directive gives us a reference to the dom node in the variable headingel. then we use export function focus() to expose a function that gives focus to the <h2> heading.
Working with Svelte stores - Learn web development
at the beginning we import the alert store. next we import the ondestroy() lifecycle function, which lets us execute a callback after the component has been unmounted. we then create a local...
...'completed' : 'active'}` todos[i] = { ...todos[i], ...todo } } add the following reactive block beneath the block that starts with let filter =...
Dynamic behavior in Svelte: working with variables and props - Learn web development
the data at the moment, our displayed todo items are all static. we want to iterate over each item in our todos array and render the markup for each task, so let's do that now. html doesn't have a way of expressing logic — like conditionals and loops. svelte does. in this case we use the {#each...} directive to iterate over the todos array. the second parameter, if provided, will contain the
index of the current item. also, a key expression can be provided, which will uniquely identify each item. svelte will use it to diff the list when data changes, rather than adding or removing items at the end, and it's a good practice to always specify one. finally, an :else block can be provided, which will be rendered when the list is empty. let's give it a try. replace the existing <ul> elem...
...elte will use it to diff the list when data changes, rather than adding or removing items at the end, and it's a good practice to always specify one. finally, an :else block can be provided, which will be rendered when the list is empty. let's give it a try. replace the existing <ul> element with the following simplified version to get an idea of how it works: <ul> {#each todos as todo,
index (todo.id)} <li> <input type="checkbox" checked={todo.completed}/> {
index}. {todo.name} (id: {todo.id}) </li> {:else} nothing to do here! {/each} </ul> go back to the app; you'll see something like this: now we've seen that this is working, let's generate a complete todo item with each loop of the {#each} directive, and inside embed the information from the todos array: i...
Getting started with Vue - Learn web development
elopment code into older syntax that is more cross-browser compatible in production code. you can register additional babel plugins in this file. .browserslistrc: this is a config for browserslist. you can use this to control which browsers your tooling optimizes for. public: this directory contains static assets that are published, but not processed by webpack during build (with one exception;
index.html gets some processing). favicon.ico: this is the favicon for your app. currently, it's the vue logo.
index.html: this is the template for your app. your vue app is run from this html page, and you can use lodash template syntax to interpolate values into it. note: this is not the template for managing the layout of your application — this template is for managing static html th...
...aging the layout of your application — this template is for managing static html that sits outside of your vue app. editing this file typically only occurs in advanced use cases. src: this directory contains the core of your vue app. main.js: this is the entry point to your application. currently, this file initializes your vue application and signifies which html element in the
index.html file your app should be attached to. this file is often where you register global components or additional vue libraries. app.vue: this is the top-level component in your vue app. see below for more explanation of vue components. components: this directory is where you keep your components. currently it just has one example component. assets: this directory is for storing static ass...
Accessibility/LiveRegionDevGuide
e, the root event string is object:text-changed with ":delete" and ":insert" being appended to complete the event type. in iaccessible2, there are two distinct event types - ia2_event_text_removed and ia2_event_text_inserted. the text associated with an at-spi text changed event is directly in the event object. the event.any_data field holds the entire text string while event.detail1 is the start
index while event.detail2 is the text string length. 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 resul...
...hole while atomic="false" (default) indicates that the region can stand on it's own. the text offsets associated with a text changed event are used when supporting this property. the offsets can be acquired directly in a text changed event object in at-spi and through the use of iaccessibletext::get_oldtext and iaccessibletext::get_newtext in iaccessible2. when atomic is set to "false", the start
index and end
index/run length are used as given. the result being that only the change will be presented. when atomic is set to "true", the entire region should be presented. in this case the start
index is 0 and the end
index/run length is the length of the text - 1. container-channel the channel property defines two channels - 'main' and 'alert'. it was originally intended to give web developers ...
Android-specific test suites
public class testpermissions { @ignore @test public void testsuccessrunnableisexecutedifpermissionsaregranted() { ... contact information android-test is currently owned by :sebastian and :nalexander. file tickets in the firefox for android product in bugzilla. android-checkstyle verifies that the java coding style is consistent throughout. see http://checkstyle.sourceforge.net/
index.html and https://docs.gradle.org/2.14/userguide/checkstyle_plugin.html for more details. running android-checkstyle to run android-checkstyle, first build firefox for android with your changes; then run ./mach android checkstyle this will run the tests and report the results to stdout, as well as produce an html report. disabling one failing test in general, it's not sensible to allow java ...
.... android-findbugs ensures that the code avoids common java coding errors. using this suite will allow the code to be analyzed to spot any design flaws or potential bugs. if an issue is found within the code, a warning will be identified and put into the correct category that the suite controls — this could be malicious, correctness, or just bad practice. see http://findbugs.sourceforge.net/
index.html and https://docs.gradle.org/2.14/userguide/findbugs_plugin.html for more details. running android-findbugs to run android-findbugs, first build firefox for android with your changes; then run ./mach android findbugs this will run the tests and report the results to stdout, as well as produce an html report. disabling one failing test in general, it's not sensible to allow new java code...
HTMLIFrameElement.executeScript()
, or an onerror handler if not. parameters script the script to be executed. options optional optionally, you can provide an origin or url for the script to be executed against. it's recommended that you include an origin or url, in order to ensure that the script is being executed in the expected context: origin: an origin, e.g. http://example.com url: a url, e.g. ...
...re that the script is being executed in the expected context: origin: an origin, e.g. http://example.com url: a url, e.g. http://example.com/
index.html note: the options parameter does not currently seem to have much effect. the script seems to execute even if a url/origin is specified. ...
HTML parser threading
ing in a speculating state and sets the newly created speculation object as the tree op sink (instead of the tree op stage described earlier) of the tree builder. the speculation object has a queue of tree ops (into which the tree builder will now flush ops to instead of the tree op stage), an owning reference to the nshtml5owningutf16buffer that contains the starting point of the speculation, an
index into the nshtml5owningutf16buffer defining the exact starting point within the buffer, the line number of the tokenizer at that point and a snapshot of the tree op state. the line number and the snapshot are also added to the tree op that attempts to execute scripts (before flushing it). the tree builder snapshot contains a copy of the tree builder stack, a copy of the list of open formatting ele...
...e mtokenizermutex. if the single speculation is successful, the tree ops from the parser-thread tree builder are flushed straight to the tree op executor and the tree op stage is set as the tree op sink for the tree builder. the executor is told that it's reading from the stage again. if the speculation failed, the first buffer corresponding to the starting point of the speculation gets its start
index restored to the
index stored on the speculation object. subsequent buffers get their start
index reset back to zero. the tokenizer gets its line number restored from the speculation object. this is equivalent to rewinding the input to where it was when speculation started. all the speculations in the speculation queue are destroyed. pending tree ops in the tree builder are cleared. the tree op st...
HTTP Cache
the eviction preparation operation - i.e. clearing of the internal io state - is then put to the end of the open_prio...
...the eviction preparation operation - i.e. clearing of the internal io state - is then put to the end of the open_priority le...
PBackground
t side of a pbackground actor pair is always on the designated background thread, while the child side is on the thread that chooses to use pbackground. the background thread is designed to be responsive (nobody is allowed to do long running computation or file i/o on it) to guarantee better latency than going through the main threads (which can run arbitrary js, gc, etc.) can provide. examples
indexeddb was rebuilt on top of pbackground last year. this allows the dom code to generally not worry about what thread (main vs. worker) or process (single vs. multiple) it is running in. instead, it simply turns all of its operations into ipdl calls on a set of pbackground-based actors and the processing, file i/o, etc, can be controlled from the pbackground thread regardless of where the dom calls ...
... about what thread (main vs. worker) or process (single vs. multiple) it is running in. instead, it simply turns all of its operations into ipdl calls on a set of pbackground-based actors and the processing, file i/o, etc, can be controlled from the pbackground thread regardless of where the dom calls are being made. the logic is all implemented in actorsparent.cpp and actorschild.cpp in the dom/
indexeddb directory. these are not small files (actorsparent.cpp was over 27k lines of code as of this publication) but the logic that needs to run in the parent is very clearly separated from the dom code no matter what thread it's running on. note: this article was original published as what is pbackground?, by kyle huey. ...
JNI.jsm
g a cdata object that is a java string. return value a javascript string. unloadclasses() blah blah void unloadclasses(); parameters this function takes no arguments. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. working with arrays creating/preallocating a typed array methods cdata .get(number a
index); cdata .getelements(number astart, number alength); void .set(number a
index, cdata avalue); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given a
index. cdata get(number a
index); parameters a
index the position in the array to obtain. return ...
...ied by astart and ending at position astart + alength. void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in. alength the number of elements to copy from astart. if 0 is supplied, an empty cdata array is returned. return value a new cdata array object based on the array. .set() sets an element in the array at given a
index to the given aval. void set(number a
index, cdata aval); parameters a
index the position in the array to change. aval a value to set it to. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. .setelements() sets a section of a typed array to specified values. this function starts on the position of astart in the arr...
Mozilla DOM Hacking Guide
that the initialization has been performed. the implementation is described in section 1.5. static nsresult registerclassname(print32 adomclassinfoid): help me! static nsresult registerclassprotos(print32 adomclassinfoid): help me! static nsresult registerexternalclasses();: help me! nsresult resolveconstructor(jscontext *cx, jsobject *obj, jsobject **objp);: help me! static print32 getarray
indexfromid(jscontext *cx, jsval id, prbool *aisnumber = nsnull): if the js value is an integer, then *aisnumber is true, and the integer is returned. else, *aisnumber is false and -1 is returned. static inline prbool isreadonlyreplaceable(jsval id) { ... }: help me! static inline prbool iswritablereplaceable(jsval id) { ... }: help me! nsresult docheckpropertyaccess(...): help me! (bug 90757) ...
... add a new js external constructor, like "new image()" to bypass the default behavior of xpconnect to implement a "replaceable" property to mess with the prototypes of dom objects example of functionality implemented using domclassinfo: constructors of dom objects in the global scope (e.g. node) setting up custom prototypes for those dom objects new image(), new option() window.history[
index] document.<formname> how to add a new interface to an existing dom object for this section, we will use the simple example of the domimplementation dom object. this is a real-world case that was used to solve bug 33871 (the patch is not checked in yet, as of writing this document). the problem is the following: we have to add a new htmldomimplementation interface to the domimplementation dom...
Mozilla Web Developer FAQ
origin resource sharing http headers. downloadable fonts in the eot format are not supported. if you use downloadable fonts, please make sure the fonts have the right unicode mappings and the content uses the right unicode characters. the past practice of displaying non-latin text by assigning non-latin glyphs to latin code points breaks copying and pasting, breaks searching on the page, breaks
indexing by search engines and breaks readability in browsers that do not support downloadable fonts (e.g. legacy browsers or mobile browsers that opt not to download fonts due to file size). why aren’t symbol/dingbat fonts working? they are working. characters in html 4 and xml documents are unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font ...
... search engines and breaks readability in browsers that do not support downloadable fonts (e.g. legacy browsers or mobile browsers that opt not to download fonts due to file size). why aren’t symbol/dingbat fonts working? they are working. characters in html 4 and xml documents are unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph
indexes. <font face="symbol">a</font> means the character latin small letter a (u+0061) preferably displayed using the symbol font. since the symbol font does not have glyph for that character, another font is used. if you mean α, you should use greek small letter alpha (u+03b1). if you are using a legacy encoding that cannot represent that character, you can use a numeric character reference: α...
NSS 3.12.9 release notes
new and revised documents available since the release of nss 3.11 include the following:</for> build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.9 shared libraries are backward compatible with all older nss 3.x ...
...ngecerttrust and cert_savesmimeprofile bug 585518: addtrust qualified ca root serial wrong in certdata.txt trust entry bug 337433: need cert_findcertbynicknameoremailaddrbyusage bug 592939: expired cas in certdata.txt documentation <for a="" class="new " documentation="" href="/en/
index.html#documentation" list="" nss="" of="" pages="" primary="" rel="internal" see="" the="" title="en/
index.html#documentation">nss documentation. new and revised documents available since the release of nss 3.11 include the following:</for> build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.9 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.9 shared li...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
s rv; prfiledesc *headerfile = null; prfiledesc *encfile = null; prfiledesc *infile = null; certcertificate *cert = null; secitem data; unsigned char ptext[modblocksize]; unsigned char encbuf[modblocksize]; unsigned int ptextlen; int
index; unsigned int nwritten; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0; seckeypublickey *pubkey = null; /* if the intermediate encrypted file already exists, delete it*/ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* r...
...headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* read input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { if (ptextlen != modblocksize) { paddinglength = modblocksize - ptextlen; for (
index=0;
index < paddinglength;
index++) { ptext[ptextlen+
index] = (unsigned char)paddinglength; } ptextlen = modblocksize; } rv = pk11_pubencryptraw(pubkey, encbuf, ptext, ptextlen, null); nwritten = pr_write(encfile, encbuf, ptextlen); } /* write the padding to header file */ pad[0] = paddinglength; paditem.t...
sample2
. ...
...to write padding */ headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_append, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* read input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { if (ptextlen != modblocksize) { paddinglength = modblocksize - ptextlen; for (
index=0;
index < paddinglength;
index++) { ptext[ptextlen+
index] = (unsigned char)paddinglength; } ptextlen = modblocksize; } rv = pk11_pubencryptraw(pubkey, encbuf, ptext, ptextlen, null); nwritten = pr_write(encfile, encbuf, ptextlen); } /* write the padding to header file */ pad[0] = paddinglength; paditem.type = sibuffer; paditem.data = (unsigned char *)pad; paditem.len = sizeof(pad[0]); writetohea...
JIT Optimization Strategies
on that the type inference engine has failed to collect enough information to guide the optimization process. getelement getelem_typedobject attempts to optimized element accesses on array typed objects. getelem_dense attempts to optimize element accesses on densely packed array objects. dense arrays are arrays which do not have any 'holes'. this means that the array has valid values for all
indexes from 0 to length-1. getelem_typedstatic attempts to optimize element accesses on a typed array that can be determined to always refer to the same array object. if this optimization succeeds, the 'array' object is treated as a constant, and is not looked up or retrieved from a variable. getelem_typedarray attempts to optimize element accesses on a typed array. getelem_string attempts to op...
...bject. if this optimization succeeds, the 'array' object is treated as a constant, and is not looked up or retrieved from a variable. setelem_typedarray attempts to optimize element writes on a typed array. setelem_dense attempts to optimize element writes on densely packed array objects. dense arrays are arrays which do not have any 'holes'. this means that the array has valid values for all
indexes from 0 to length-1. setelem_arguments attempts to optimize element writes to the arguments special object available in functions. this optimization only works if the arguments object is used in well-understood ways within the function. the function containing the arguments.length is allowed to use the arguments object in the following ways without disabling this optimization: access argume...
JS::HandleValueArray
values js::autovaluevector & elements of newly created array. values js::autovaluearray & elements of newly created array. args js::callargs & elements of newly created ar...
...allargs & elements of newly created array. len size_t (frommarkedlocation only) length of elements array or (subarray only) length of sub array of values. elements js::value * (frommarkedlocation only) a pointer to the first element of an array of js::value. values js::handlevaluearray (subarray only) an array to get sub array. start
index size_t (subarray only) an
index of the first element of subarray of values. methods method description size_t length() const returns the length of the array. const value *begin() const returns the pointer to the first element of the array. js::handlevalue operator[](size_t i) const returns i-th element of the array. description ...
JSObjectOps.getRequiredSlot
. syntax typedef jsval (*jsgetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot); typedef jsbool (*jssetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsval v); name type description cx jscontext * the js context in which we access the slot. obj jsobject * the object whose slot we access. slot uint32 the
index of the slot to access. see note below. v jsval the value to store in the slot, for jssetrequiredslotop. description get and set a required slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. the native ops (js_objectops, see js/src/jsobj.cpp) acces...
...quired slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. the native ops (js_objectops, see js/src/jsobj.cpp) access slots reserved by including a call to the jsclass_has_reserved_slots(n) macro in the jsclass.flags initializer. note: the slot parameter is a zero-based
index into obj slots, unlike the
index parameter to the js_getreservedslot and js_setreservedslot api entry points, which is a zero-based
index into the jsclass_reserved_slots(clasp) reserved slots that come after the initial well-known slots: proto, parent, class, and optionally, the private data slot. ...
JS_AlreadyHasOwnProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object to be searched. name or id const char * or const char16_t *or js::handleid (in js_alreadyhasownproperty, alreadyhas...
... searched. name or id const char * or const char16_t *or js::handleid (in js_alreadyhasownproperty, alreadyhasownucproperty, and js_alreadyhasownpropertybyid) the name of the property to search for. namelen size_t (in js_alreadyhasownucproperty only) the length of name, in characters; or the special value (size_t) -1 to indicate that name is null-terminated.
index uint32_t (in js_alreadyhasownelement only) the
index of the element to search for. foundp bool * out parameter. *foundp receives true if the property is found or false if it is not found. if an error occurs, the value left in *foundp is undefined. description these functions attempt to determine whether a property already exists on a specific jsobject without modifying ...
JS_DeleteElement
removes a specified element or numeric property from an object. syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t
index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element.
index uint32_t
index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation. description js_del...
...if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. ...
JS_DeleteElement2
obsolete since jsapi 39this 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. removes a specified element or numeric property from an object. renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t
index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element.
index uint32_t
index number of the element to delete. succeede...
...if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. ...
JS_GetElement
vp js::mutablehandlevalue out parameter. ...
...ement(jscontext *cx, js::handleobject obj, uint32_t
index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element.
index uint32_t
index of the element to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the element, if it exists, and undefined otherwise. description js_getelement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered
index. if the element exists, js_getelement sets *vp to the...
JS_GetStringCharAt
this article covers features introduced in spidermonkey 38 return a specified character from a string. syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t
index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t
index); name type description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * or jsflatstring * the string to get character.
index size_t an integer between 0 and 1-less-than the length of the string. res char16_t * (js_getstringcharat only) out parameter. on successful, receives the character code. description js_getstringcharat...
...ar16_t * (js_getstringcharat only) out parameter. on successful, receives the character code. description js_getstringcharat and js_getflatstringcharat get the specified character from the string str. on successful, js_getstringcharat returns true and stores the character code into *res, otherwise returns false. js_getflatstringcharat always succeeds, and returns the character code.
index should not be greater than or equal to the length of str. see also mxr id search for js_getstringcharat mxr id search for js_getflatstringcharat bug 1034627 ...
Redis Tips
s hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc. ...
... yet redis is so easy to learn and use that you'll seldom feel you need to consult it. there are three reasons to look at the docs for every command you use. time complexity - each command's complexity is given in big-o notation. ...
Gecko events
ion_changed a table's column description changed. event_table_column_header_changed a table's column header changed. event_table_column_insert event_table_column_delete event_table_column_reorder event_window_activate event_window_deactivate event_window_destroy event_window_maximize event_window_minimize event_window_resize event_window_restore event_hyperlink_end_
index_changed the ending
index of this link within the containing string has changed. event_hyperlink_number_of_anchors_changed the number of anchors assoicated with this hyperlink object has changed. event_hyperlink_selected_link_changed the hyperlink selected state changed from selected to unselected or from unselected to selected. event_hypertext_link_activated one of the links associated with t...
...s hyperlink object has changed. event_hyperlink_selected_link_changed the hyperlink selected state changed from selected to unselected or from unselected to selected. event_hypertext_link_activated one of the links associated with the hypertext object has been activated. event_hypertext_link_selected one of the links associated with the hypertext object has been selected. event_hyperlink_start_
index_changed the starting
index of this link within the containing string has changed. event_hypertext_changed focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object. event_hypertext_nlinks_changed the number of hyperlinks associated with a hypertext object changed. ev...
XForms Accessibility
so, yes we d...
...there are set of tests at beaufour.dk w3c's xforms test at w3.org keyboard navigation issues navigation sequence though xforms spec declares nav
index attribute to define the navigation sequence (see 1.0 specs or 1.1 specs) but rich schwerdtfeger (distinguished engineer, swg accessibility architect/strategist chair, ibm accessibility architecture review board) gave some clarification about nav
index. he wrote: nav
index was in xforms - it was stripped out as it was believed the focus model was dependent on the content which used it. so, yes we don't care about nav
index in xforms. if you use xhtml1.x use tab
index. if you use xhtml2 use nextfocus. therefore since mozilla xforms works in xhtml (1.x) or xul documents only then we use tab
index instead. note, we support -moz-user-focus style neit...
Components.classes
all of the properties and methods of the nsijscid and its ancestor interface nsijsid are available for use on the objects contained in this object. ...
... all of the properties and methods of the nsijscid and its ancestor interface nsijsid are available for use on the objects contained in this object. ...
Components.classesByID
components.classesbyid is a read-only object whose properties are classes
indexed by cid. introduction components.classesbyid is a read-only object whose properties implement the nsijscid interface. each property represents one of the classes of xpcom components that can be constructed or accessed as an xpcom service. components.classesbyid is exactly like components.classes except that the elements are
indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid. ...
... xpcom service. components.classesbyid is exactly like components.classes except that the elements are
indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid. ...
Components.interfaces
introduction components.interfaces is a read-only object whose properties implement the nsijsiid interface. each object represents one of the xpcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which xpconnect is capable of reflecting into javascript. properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid. ...
...a parameter of type nsid. this includes nsisupports.queryinterface(), the optional parameter accepted by nsijscid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.getinterfaces(). the properties of the components.interfaces object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are
indexed by interface name. you can retrieve an interface object using: var iface = components.interfaces.nsisupportsarray; this will return you the interface object for the nsisupportsarray interface. accessing constants defined in an interface interface descriptions (cf. xpidl) may not only contain method declarations, but also constants. for example, assume we have the following interface declar...
Components.utils.importGlobalProperties
using this api you can import these objects into such a system scope. this function is not intended for sandboxes but for system-privileged scopes. to import these objects into a sandbox, use the wantglobalproperties option in the sandbox constructor. this function is passed an array of strings. each string is the name of an object to import, and will be defined on the importing scope's global. ...
...nstructor. this function is passed an array of strings. each string is the name of an object to import, and will be defined on the importing scope's global. ...
Language bindings
are currently available: components objectthe components object is the object through which xpconnect functionality is reflected into javascript. the components object is actually a native instance of the nsixpccomponents interface which is reflected into javascript as a top level object using xpconnect.components.classescomponents.classes is a read-only object whose properties are classes
indexed by contractid.components.classesbyidcomponents.classesbyid is a read-only object whose properties are classes
indexed by cid.components.constructorcreates a javascript function which can be used to create or construct new instances of xpcom components.components.exceptioncomponents.exception is a javascript constructor to create nsixpcexception objects. these exception objects may be thrown whe...
...objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces
indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only array of classes
indexed by iid.components.issuccesscodedetermines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.components.lastresultcomponents.managercomponents.manager is a convenience reflection of the global...
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer. void insert( const self_type& astring,
index_type aposition ); parameters astring [in] a nsacstring to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. void insert( const char_type* adata,
index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise...
...arameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar,
index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer. void replace(
index_type acutstart,
index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. astring [in] a nsacstring to append to this string. void replace(
index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. adata [in] a raw character array ...
...ex of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. adata [in] a raw character array to append to this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void replace(
index_type acutstart,
index_type acutlength, char_type achar ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. achar [in] a character to append to this string. remarks if insufficient memory is available to perform the assignment, then the string's internal buff...
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer. void insert( const self_type& astring,
index_type aposition ); parameters astring [in] a nsastring to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. void insert( const char_type* adata,
index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise,...
...arameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar,
index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer. void replace(
index_type acutstart,
index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. astring [in] a nsastring to append to this string. void replace(
index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. adata [in] a raw character array t...
...ex of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. adata [in] a raw character array to append to this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void replace(
index_type acutstart,
index_type acutlength, char_type achar ); parameter acutstart [in] the starting
index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. achar [in] a character to append to this string. remarks if insufficient memory is available to perform the assignment, then the string's internal buffe...
IAccessibleRelation
ess to an object's set of relations. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) method overview [propget] hresult localizedrelationtype([out] bstr localizedrelationtype ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relationtype([out] bstr relationtype ); [propget] hresult target([in] long target
index, [out] iunknown target ); [propget] hresult targets([in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); methods localizedrelationtype() returns a localized version of the relation type. [propget] hresult localizedrelationtype( [out] bstr localizedrelationtype ); parameters localizedrelationtype return value s_ok. ntargets() re...
...long ntargets ); parameters ntargets return value s_ok. relationtype() returns the type of the relation. [propget] hresult relationtype( [out] bstr relationtype ); parameters relationtype the strings returned are defined @ref grprelations "in this section of the documentation". return value s_ok. target() returns one accessible relation target. [propget] hresult target( [in] long target
index, [out] iunknown target ); parameters target
index 0 based
index. target return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. targets() returns multiple accessible relation targets. [propget] hresult targets( [in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ...
mozIStorageConnection
nt(in autf8string asqlstatement); void createtable(in string atablename, in string atableschema); mozistoragependingstatement executeasync([array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean
indexexists(in autf8string a
indexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 a...
...atements' execution. executesimplesql() executes an sql expression that has no bound parameters. warning: performing synchronous io on the main thread can cause serious performance problems. as a result, this method of modifying the database is strongly discouraged! void executesimplesql( in autf8string asqlstatement ); parameters asqlstatement the sql statement to execute.
indexexists() this method determines whether or not the given
index exists. boolean
indexexists( in autf8string a
indexname ); parameters a
indexname the
index to check. return value true if the
index exists, false otherwise. preload() obsolete since gecko 1.9 (firefox 3) this is used to preload the database cache. it loads pages from the start of the database ...
mozIStorageService
.opendatabase() method. warning: if you have more than one connection to a file, you must use the exact same name for the file each time, including case. the sqlite code uses a simple string comparison to see if there is already a connection. opening a connection to "foo.sqlite" and "foo.sqlite" will corrupt your database. if your database contains virtual tables (for example, for full-text
indexes), you must use mozistorageservice.openunshareddatabase() to open it, since those tables are not compatible with a shared cache. if you use this method to open a database containing virtual tables, it will think the database is corrupted and throw ns_error_file_corrupted. note: the connection object returned by this function is not threadsafe. you must use it only from the thread you created it ...
...nded that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet). each connection uses its own sqlite cache, which is inefficient, so you should use opendatabase() instead of this method unless you need a feature of sqlite that is incompatible with a shared cache, like virtual table and full text
indexing support. if cache contention is expected, for instance when operating on a database from multiple threads, using unshared connections may be a performance win. warning: if you have more than one connection to a file, you must use the exact same name for the file each time, including case. the sqlite code uses a simple string comparison to see if there is already a connection. opening a co...
nsIAbCard
prefermailformat unsigned long allowed values are stored in nsiabprefermailformat. ismaillist boolean maillisturi string if ismaillist is true then maillisturi will contain the uri of the associated mailing list. allowremotecontent boolean allow...
... prefermailformat unsigned long allowed values are stored in nsiabprefermailformat. ismaillist boolean maillisturi string if ismaillist is true then maillisturi will contain the uri of the associated mailing list. allowremotecontent boolean allow remote content to be displayed in h...
nsIAccessibleRelation
cessiblerelation.idlscriptable this interface gives access to an accessibles set of relations. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: be carefull, do not change constants until atk has a structure to map gecko constants into atk constants. method overview nsiaccessible gettarget(in unsigned long
index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation. read only. targetscount unsigned long returns the number of targets for this relation. read only. constants constant value descript...
...he name or description fields of an nsiaccessible. relation_description_for 0x0f this object is describes the target object. relation_default_button 0x4000 part of a form/dialog with a related default button. it is used for msaa only, no for ia2 nor atk/at-spi. methods gettarget() returns accessible relation target at the given
index. nsiaccessible gettarget( in unsigned long
index ); parameters
index zero-based
index of relation target. return value returns an nsiaccessible object. exceptions thrown ns_error_invalid_arg indicates the given
index is out of range. gettargets() returns an array of accessible relation targets. nsiarray gettargets(); parameters none. return value a...
nsIAccessibleTreeCache
viewinvalidated(in long astartrow, in long aendrow, in long astartcol, in long aendcol); methods getcachedtreeitemaccessible() returns the tree item from the cache for the cell in the specified row and column; the nsiaccessible is created if it doesn't already exist in the cache. nsiaccessible getcachedtreeitemaccessible( in long arow, in nsitreecolumn acolumn ); parameters arow the row
index. acolumn the column object. if is is null then the primary column is used. it makes sense for atk only. return value the nsiaccessible corresponding to the specified tree cell. invalidatecache() invalidates the number of cached treeitem accessibles. void invalidatecache( in long arow, in long acount ); parameters arow row
index the invalidation starts from. acount the number of treeitem ac...
...n specifies whether rows have been inserted (plus) or removed (minus) treeviewchanged() invalidates children created for the previous tree view. void treeviewchanged(); parameters none. treeviewinvalidated() fires name change events for invalidated area of tree. void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row
index invalidation starts from. aendrow row
index invalidation ends, -1 means the last row
index. astartcol column
index invalidation starts from. aendcol column
index invalidation ends, -1 means the last column
index. ...
nsIBrowserSearchService
may be null if there are no visible search engines. defaultengine nsisearchengine the default...
... init(). void init( [optional] in nsibrowsersearchinitobserver observer ); parameters observer if specified, a callback called once initialization is complete, or immediately, if the service has already been initialized. in javascript, this observer can be a regular function. moveengine() moves a visible search engine. void moveengine( in nsisearchengine engine, in long new
index ); parameters engine the engine to move. new
index the engine's new
index in the set of visible engines. exceptions thrown ns_error_failure if new
index is out of bounds, or if engine is hidden. removeengine() removes the search engine. if the search engine is installed in a global location, this will just hide the engine. if the engine is in the user'...
nsICRLManager
security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
...ing key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays ); parameters info autoupdatetype noofdays return value deletecrl() delete the crl. void deletecrl( in unsigned long crl
index ); parameters crl
index 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 long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey ); parameters data length uri type...
nsIDOMOfflineResourceList
e dynamically managed resource list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long
index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list...
...domstring uri ); parameters uri the uri of the resource to check. return value true if the resource is in the list, otherwise false. mozitem returns the uri of the item at the specific offset into the list of cached resources. note: this method is deprecated in firefox 3.5; you should instead access the list directly using the items attribute. domstring mozitem( in unsigned long
index ); parameters
index the
index of the cached item whose uri should be returned. return value an domstring containing the uri of the specified resource. mozremove() removes an item from the list of dynamically managed entries. if this was the last reference to the given uri in the application cache, the cache entry is removed. void mozremove( in domstring uri ); parameters ur...
nsIDOMStorage
only exist once within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed. method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long
index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to...
...meters none. getitem() returns from session storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value an nsidomstorageitem object describing the data corresponding to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified
index in the data store. domstring key( in unsigned long
index ); parameters
index the
index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown
index_size_err there is no key at the specified
index. removeitem() given a key, removes the corresponding entry from the session store. void removeitem( in domstring key ); parame...
nsIDOMStorage2
dom window's local storage object can be retrieved from the window's localstorage attribute. dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long
index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the da...
...n. void clear(); parameters none. getitem() returns from local storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value a string containing the data corresponding to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified
index in the data store. domstring key( in unsigned long
index ); parameters
index the
index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown
index_size_errthere is no key at the specified
index. removeitem() given a key, removes the corresponding entry from local storage. void removeitem( in domstring key ); parameters ke...
nsIDOMXPathResult
read only. ...
...ailable nodes of an unordered_node_iterator_type or ordered_node_iterator_type result. nsidomnode iteratenext(); parameters none. return value a dom node. snapshotitem() returns the specified node from what is essentially an array of resulting dom nodes. is only available if the result type is unordered_node_snapshot_type or ordered_node_snapshot_type. nsidomnode snapshotitem( in unsigned long
index ); parameters
index the
index of the dom node to return. return value a dom node. see also introduction to using xpath in javascript document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathexception ...
nsIDocShell
(after the onunload event has fired, but before the new document has been set up) read only. isoffscreenbrowser boolean if true, this docshell is not visible in the traditional sense, but is being actively rendered to the screen (such as by being painted to a canvas), and should be treated accordingly. layouthistorystate nsilayouthistorystate loadedtrans
index long keeps track of the previous shtransaction
index and the current shtransaction
index at the time that the doc shell begins to load. used for contentviewer eviction. read only. loadtype unsigned long load type for the document. valid states are defined in constants. note that nsidocshell may use other states internally so you should check for the specific state bit. ...
...assumed to be nulled out by the parent when the parent is going away. obsolete since gecko 1.8 prescontext nsprescontext presentation context for the currently loaded document. this may be null. read only. native code only! presshell nsipresshell presentation shell for the currently loaded document. this may be null. read only. native code only! previoustrans
index long keeps track of the previous shtransaction
index and the current shtransaction
index at the time that the doc shell begins to load. used for contentviewer eviction. read only. printpreview nsiwebbrowserprint if the current content viewer is not initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. read only. ...
nsIDragSession
widget/public/nsidragsession.idlscriptable provides support for interacting with an ongoing drag session during a drag and drop operation. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitem
index ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not. usually the target "frame" sets this so the native system can render the correct feedback. datatransfer nsidomdatatransfer the data transfer object for the current drag operation. dragaction u...
... targetsize nssize sets the current width and height of the drag target area. it will contain the current size of the frame that the drag is currently in. native code only! methods getdata() gets data from a drag and drop operation. can be called while the drag is in process or after the drop has completed. void getdata( in nsitransferable atransferable, in unsigned long aitem
index ); parameters atransferable the transferable for the data to be put into. aitem
index which of multiple drag items, zero-based. must be less than numdropitems. isdataflavorsupported() checks to see if any of the native data on the clipboard matches a given data flavor. if numdropitems is greater than one, there is no indication as to which of the items matches the data flavor. boolean ...
nsIDynamicContainer
firefox 3) the service can fill result nodes directly into the container when it is opened. it can use the property bag on every result node to store data associated with each item, such as a full path on disk. it can also create additional containers for each container, registered to its service. method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anew
index); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping. it i...
...nerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping. it is called after the container has been moved. void oncontainermoved( in long long aitemid, in long long anewparent, in long anew
index ); parameters aitemid the item-id of the container item. anewparent the item of the new parent folder for the container. anew
index the
index at which the container will be inserted, or "-1" to append to the end of the list. oncontainernodeclosed() this method is called when the given container has just been collapsed so that the service can do any necessary cleanup. this is not guaranteed to g...
nsIHttpHeaderVisitor
his is done by subscribing to the http-on-examine-response and http-on-examine-cached-response observers. when the observer fires, the visitor interface is used to walk through the response headers and evaluate the mime type. ...
...d http-on-examine-cached-response observers. when the observer fires, the visitor interface is used to walk through the response headers and evaluate the mime type. ...
nsIMessageBroadcaster
sage managers within its window. see message manager interfaces for more details on the distinction between message senders and message broadcasters. methods void broadcastasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long a
index); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. warning: broadcasting messages can be very expensive and leak sensitive data. use with extreme caution. throws ns_error_not_initialized if the sender is not...
...data property of the received message. objects object. an object each of whose properties is an object. this becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. getchildat() return a single subordinate message manager. parameters name type description a
index number the
index of the subordinate message manager to retrieve. returns nsimessagelistenermanager: the message manager at the given
index. attributes childcount number: the number of subordinate message managers. read only. ...
nsIMsgDBHdr
meters propertyname the name of the property to retrieve. return value the value of the property. getuint32property() get an integer property. usually you would use this to store your own properties. unsigned long getuint32property(in string propertyname); parameters propertyname the name of the property to retrieve. thunderbird stored uint32 properties (not a complete list):
indexed used for spotlight integration on osx. notaphishmessage indicates whether phisihing filters have been run on a message yet. return value the value of the property. setuint32property() void setuint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set. propertyval the value of the...
...); parameters flags flags to be retained on the current message flags. all other flags are cleared. setreferences() void setreferences(in string references); parameters references sets the list of references for a news message. getstringreference() returns one of the references in the list of references. acstring getstringreference(in long refnum); parameters refnum the
index of the reference to return. must be less than the total number of references. setrecipientsarray() uses the header parser to recreate the recipients header from an array of names and addresses. void setrecipientsarray(in string names, in string addresses, in unsigned long numaddresses); parameters names a null-delimited list of recipien...
nsIMsgFilter
eadonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in acstring arbitraryheader ) getterm() void nsimsgfilter::getterm ( in long term
index, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, out boolean booleanand, out acstring arbitraryheader ) appendterm() void nsimsgfilter::appendterm (in nsimsgsearchterm term) createterm() nsimsgsearchterm nsimsgfilter::createterm ( ) matchhdr() void nsimsgfilter::matchhdr ( in nsi...
...lder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, out boolean result ) logrulehit() void nsimsgfilter::logrulehit ( in nsimsgruleaction afilteraction, in nsimsgdbhdr aheader ) createaction() nsimsgruleaction nsimsgfilter::createaction ( ) getactionat() nsimsgruleaction nsimsgfilter::getactionat (in long a
index) appendaction() void nsimsgfilter::appendaction (in nsimsgruleaction action ) clearactionlist() void nsimsgfilter::clearactionlist() getsortedactionlist() void nsimsgfilter::getsortedactionlist (in nsisupportsarray actionlist) ...
nsIMsgFilterList
ribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filter
index ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filter
index, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filter
index)...
...terat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filter
index, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filter
index) movefilterat() void nsimsgfilterlist::movefilterat ( in unsigned long filter
index, in nsmsgfiltermotionvalue motion ) insertfilterat() void nsimsgfilterlist::insertfilterat ( in unsigned long filter
index, in nsimsgfilter filter ) movefilter() void nsimsgfilterlist::movefilter ( in nsimsgfilter filter, in nsmsgfiltermotionvalue motion ) createfilter() nsimsgfilter nsimsgfilterlist::createfilter ( in astring name ) sav...
nsINavHistoryResultNode
1) attributes attribute type description accesscount unsigned long total number of times the uri has been accessed. for hosts, this is the total number of the children under it, rather than the total number of times the host has been accessed (getting that information would require an additional query, so for performance reasons that information isn't given by default). read only. bookmark
index long when this item is in a bookmark folder (its parent is of type folder), this is the
index into that folder at which this node resides. these indices start at 0 and increase in the order at which the nodes appear in the bookmark folder. for items that are not in a bookmark folder, this value is -1. read only. dateadded prtime if the node is an item (bookmark, folder, or separator), this valu...
...e of node. you can use queryinterface to access the corresponding specialized result node interface. read only. uri autf8string the uri of the resource represented by the node. for visits and urls, this is the url of the page. for folders and queries, this is the place: uri of the corresponding folder or query. this may be empty for other types of objects, like host containers. read only. view
index long value with undefined meaning for use by the view. its initial value will be -1. the result implementation treats nodes with this property set to -1 as invisible! view-implementations may use this value to track the node
index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at. other views may choose not to use this, but should initita...
nsISHEntry
6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/browser/session-history-entry;1. ...
.... methods addchildshell() saved child docshells corresponding to contentviewer. the child shells are restored as children of the parent docshell, in this order, when the parent docshell restores a saved presentation. append a child shell to the end of our list. void addchildshell( in nsidocshelltreeitem shell ); parameters shell childshellat() nsidocshelltreeitem childshellat( in long
index ); parameters
index the child shell at
index; null if
index is out of bounds. return value clearchildshells() clear the child shell list. void clearchildshells(); parameters none. clone() nsishentry clone(); parameters none. return value native code only!create additional ways to create an entry. void create( in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilay...
nsISHistoryListener
ny action (except adding a new session history entry) from happening by returning false from the corresponding callback method. a session history listener can be registered on a particular nsishistory instance via the nsishistory.addshistorylistener() method. method overview boolean onhistorygoback(in nsiuri abackuri); boolean onhistorygoforward(in nsiuri aforwarduri); boolean onhistorygoto
index(in long a
index, in nsiuri agotouri); void onhistorynewentry(in nsiuri anewuri); boolean onhistorypurge(in long anumentries); boolean onhistoryreload(in nsiuri areloaduri, in unsigned long areloadflags); methods onhistorygoback() called when navigating to a previous session history entry, for example due to an nsiwebnavigation.goback() call. boolean onhistorygoback( in nsiuri abackuri )...
...oceed or false to cancel it. onhistorygoforward() called when navigating to a next session history entry, for example due to an nsiwebnavigation.goforward() call. boolean onhistorygoforward( in nsiuri aforwarduri ); parameters aforwarduri the uri of the session history entry being navigated to. return value true to allow the go forward operation to proceed or false to cancel it. onhistorygoto
index() called when navigating to a session history entry by
index, for example, when nsiwebnavigation.goto
index() is called. boolean onhistorygoto
index( in long a
index, in nsiuri agotouri ); parameters a
index the
index in session history of the entry to be loaded. agotouri the uri of the session history entry to be loaded. return value true to allow the operation to proceed or false to cancel i...
nsISelection
offset); native code only! void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only! ...
... in nsidomnode parentnode, in long offset ); parameters parentnode the node where the selection will be extended to. offset where in the node to place the offset in the new selection end. native code only!extendnative void extendnative( in nsinode parentnode, in long offset ); parameters parentnode offset getrangeat() returns the nsidomrange at the specified
index. nsidomrange getrangeat( in long
index ); parameters
index return value the nsidomrange requested modify() modifies the selection. note that the parameters are case-insensitive. void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend()" } "move" collapses the selection to the end of the se...
nsITaskbarWindowPreview
buttons may be accessed by calling getbutton(); each button is an nsitaskbarpreviewbutton object. you may customize these buttons using the attributes on that interface. user clicks on the toolbar buttons are reported to your nsitaskbarpreviewcontroller implementation's nsitaskbarpreviewcontroller.onclick() method. method overview nsitaskbarpreviewbutton getbutton(in unsigned long
index); attributes attribute type description enablecustomdrawing boolean if true, the nsitaskbarpreviewcontroller object's nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods will be called to draw the preview. if false, the operating system draws these for you. constants ...
...e description num_toolbar_buttons 7 the maximum number of toolbar buttons supported by the windows taskbar api. methods getbutton() returns the specified button from the preview's toolbar. note: by default, all buttons are hidden. you must fetch and configure each button that you want to make visible. nsitaskbarpreviewbutton getbutton( in unsigned long
index ); parameters
index the
index into the button array for the nsitaskbarpreviewbutton to retrieve. this value must be at least 0 (the leftmost button) and less than num_toolbar_buttons. return value an nsitaskbarpreviewbutton describing the requested button. see also nsitaskbarpreview nsitaskbarpreviewcontroller nsitaskbartabpreview nsitaskbarpreviewbutton nsiwintaskbar ...
nsITreeColumns
the nsitreecolumns interface represents the tree columns. layout/xul/base/src/tree/public/nsitreecolumns.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long
index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns. read only. length long an alias for count (for the benefit of scripts which treat this as an array)...
...olumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns. read only. length long an alias for count (for the benefit of scripts which treat this as an array). read only. tree nsitreeboxobject the tree widget for these columns. read only. methods getcolumnat() get the column for a given
index. nsitreecolumn getcolumnat( in long
index ); parameters
index index of the column return value a nsitreecolumn for this
index. getcolumnfor() get the column for a given element. nsitreecolumn getcolumnfor( in nsidomelement element ); parameters element a dom element return value a nsitreecolumn for this element. getfirstcolumn() get the first column. nsitreecolumn getfirstcolumn(); par...
nsIUpdate
a complete file-replace patch. this object also contains information about the update that the front end and other application services can use to learn more about what is going on. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long
index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update. billboardurl astring the url to a page that is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, down to the hour, minute, and second of it...
... statustext astring an optional message associated with the update. type astring the type of patch represented by the object: "major" a major new version of the application. "minor" a minor update, such as a security update. version astring the application version of the update.obsolete since gecko 2.0 methods getpatchat() retrieves a patch. nsiupdatepatch getpatchat( in unsigned long
index ); parameters
index the
index of the patch to retrieve. return value an nsiupdatepatch object describing the specified patch. serialize() serializes the update object into a dom element. nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the update. return value the patch object serialized into an nsidomelement. see also nsiu...
nsPIPromptService
embedding/components/windowwatcher/public/nspipromptservice.idlscriptable this interface is for the dialog implementers, not for other developers. inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: the contract id isn't defined. this interface defines the meaning of each
indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++. the
indexes for getstring() and setstring() are: emsg the value is 0. this is the message text of the dialog. echeckboxmsg the value is 1. this is the label text of a checkbox on the dialog. eiconclass the value is 2. this is the class attribute value of the icon image. etitlemessage the value is 3. this is the heading of...
...3text the value is 11. this is the label of the forth button on the dialog. edialogtitle the value is 12. this is the title of the dialog. eopeningsound obsolete since gecko 1.9.2 the value is 13. this is the system sound name which should be played when the dialog is shown. see also nsisound.playsystemsound(). this is obsolete on gecko 1.9.2 and later. you should use esoundeventid instead. the
indexes for getint() and setint() are: ebuttonpressed the value is 0. this is used for the result of the dialog. the pressed button number will be returned. echeckboxstate the value is 1. this is the default checkbox state and the result of it. enumberbuttons the value is 2. this is the number of the visible buttons on the dialog. enumbereditfields the value is 3. this is the number of the visible tex...
Storage
a named placeholder called "parameter" to be bound later (described in binding parameters). similarly, the c++ looks like this: nscomptr<mozistoragestatement> statement; rv = dbconn->createstatement(ns_literal_cstring("select * from table_name where column_name = ?1"), getter_addrefs(statement)); ns_ensure_success(rv, rv); this example uses the numbered placeholder
indexed by zero for a parameter to be bound later (described in binding parameters). note: numerical
indexes for parameters are always one less than the number you write in the sql. the use of numerical
indexes for parameters is strongly discouraged in javascript where named parameters are much easier to use. note: if you need to execute a statement multiple times, caching the result of createstateme...
...inding functions can be found with the mozistoragestatement documentation. c++ example: nscomptr<mozistoragestatement> statement; rv = mdbconn->createstatement(ns_literal_cstring("select * from table_name where id = ?1"), getter_addrefs(statement)); ns_ensure_success(rv, rv); rv = statement->bindint32parameter(0, 1234); ns_ensure_success(rv, rv); note: numerical
indexes for parameters are always one less than the number you write in the sql. the use of numerical
indexes for parameters is strongly discouraged in javascript where named parameters are much easier to use. binding multiple sets of parameters starting in gecko 1.9.2 (firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asy...
xptcall FAQ
tub code for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal footprint and is extendable to work with any valid xpcom interface without requiring additional per platform compiled code to be distributed. what does xptcall really do? the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokeby
index(nsisupports* that, pruint32 method
index, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types). given the correct set of parameters, this function can call any method on any xpcom in...
...criminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types). given the correct set of parameters, this function can call any method on any xpcom interface. xpconnect uses information from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript to xpcom using xptc_invokeby
index. the information in the typelibs allows xpconnect to convert function parameters and build the nsxptcvariant array required to make this call. the stubs (or impersonation) facility of xptcall allows for implementing a class which can, at runtime, pretend to be any xpcom interface. this is done by providing a vtbl full of generic function stubs in xptcall. these stubs forward calls to a shared fu...
Demo Addon
nsimsgdbhdr. we iterate over the first ten of them and extract author, subject and date for each one. demo 3- search messages by subject this demo shows how to find messages by a subject accross all folders using gloda. ...
... to find messages by a subject accross all folders using gloda. ...
Standard OS Libraries
find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". windows also has the "winapilists" and ".net framework" (i'm not sure if it can be accessed jsctypes but probably). a complete list of windows apis can be found at the msdn api
index. winapi this is the one that is most commonly used by js-ctypes. this comes shipped by default with all installations of windows operating systems since win98. it's also known as winapi32 or just winapi. a list of all the functions available through this api can be found at the msdn winapi
index. for finding out the values and types of arguments and returns of the functions you want to use from...
...i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is a full working example; just copy & paste it to try it out. ...
ArrayType
ly for unsized arraytype. return value a cdata representing the newly allocated array. exceptions thrown typeerror length is not provided for unsized array, or is provided for sized array. arraytype cdata properties property type description length number the length of the array. read only. in addition, each element in the array can be referenced by
index using standard bracket notation, such as myarray[
index]. properties inherited from cdata property type description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an unspecified length. value object the javascript equivalent of the cdata object's value. ...
...raytype cdata methods addressofelement() returns a new cdata object of the appropriate pointer type, whose value points to the specified array element on which the method was called. cdata addressofelement( idx ); parameters idx a numeric value indicating the offset into the array of the element just to return a pointer. if this value isn't a valid javascript number that's also a valid
index into the array, a typeerror exception is thrown. return value a new cdata object pointing to the specified element. the type of the returned object will be determined by ctypes.pointertype(thearraytype.constructor.elementtype)). see also ctype cdata type conversion ...
Plug-in Basics - Plugins
this nesting is quite commo...
...base="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0" width="749" height="68"> <param name="movie" value="foo.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#eeeeee"> <param name="salign" value="tl"> <param name="menu" value="0"> <embed src="foo.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/
index.cgi?p1_prod_version=shockwaveflash" type="application/x-shockwave-flash" width="749" height="68" bgcolor="#eeeeee" salign="tl" menu="0"> </embed> </object> using custom embed attributes in addition to these standard attributes, you can create private, plug-in-specific attributes and use them in the embed attribute to pass extra information between the html page and the plu...
Debugger.Script - Firefox Developer Tools
null if the source code was not retained. if the instance refers to webassembly code, the debugger.source instance representing the serialized text format of the webassembly code. sourcestart if the instance refers to a jsscript, the character within the debugger.source instance given by source at which this script’s code starts; zero-based. if this is a function’s script, this is the
index of the start of the function token in the source code. if the instance refers to webassembly code, throw a typeerror. sourcelength if the instance refers to a jsscript, the length, in characters, of this script’s code within the debugger.source instance given by source. if the instance refers to webassembly code, throw a typeerror. global if the instance refers to a jsscript, a ...
...ebugger.script prototype object the functions described below may only be called with a this value referring to a debugger.script instance; they may not be used as methods of other kinds of objects. getalloffsets() if the instance refers to a jsscript, return an arrayl describing the relationship between bytecode instruction offsets and source code positions in this script.l is sparse, and
indexed by source line number. if a source line numberline has no code, thenl has noline property. if there is code forline, then l[line] is an array of offsets of byte code instructions that are entry points to that line. for example, suppose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square. a[i] = i*i; calling getalloffsets() on that c...
CSSStyleDeclaration.item() - Web APIs
the cssstyledeclaration.item() method interface returns a css property name from a cssstyledeclaration by
index. this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the
index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname = style.item(
index); parameters
index is the
index of the node to be fetched. the
index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified
index. ...
...
index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname = style.item(
index); parameters
index is the
index of the node to be fetched. the
index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified
index. javascript has a special simpler syntax for obtaining an item from a nodelist by
index: var propertyname = style[
index]; example var style = document.getelementbyid('div1').style; var propertyname = style.item(1); // or simply style[1] - returns the second style listed specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.item()' in that specification. working draft document obje...
CSSStyleSheet - Web APIs
remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified
index into the stylesheet's rule list. insertrule() inserts a new rule at the specified position in the stylesheet, given the textual representation of the rule. legacy properties these properties are legacy properties first introduced by microsoft long ago; they shouldn't be used but are not likely to be removed anytime soon. rules read only the rules property is functionally identical to th...
... danger of being removed anytime soon. addrule() adds a new rule to the stylesheet given the selector to which the style applies and the style block to apply to the matching elements. this differs from insertrule(), which simply takes the textual representation of the entire rule as a single string. removerule() functionally identical to deleterule(); removes the rule at the specified
index from the stylesheet's rule list. notes in some browsers, if a stylesheet is loaded from a different domain, accessing cssrules results in securityerror. a stylesheet is associated with at most one document, which it applies to (unless disabled). a list of cssstylesheet objects for a given document can be obtained using the document.stylesheets property. a specific style sheet can also be acce...
CSSValueList - Web APIs
the cssvaluelist interface derives from the cssvalue interface and provides the abstraction of an ordered collection of css values. some properties allow an empty list in their syntax. in that case, these properties take the none identifier. so, an empty list means that the property has the value none. the items in the cssvaluelist are accessible via an integral
index, starting from 0. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" ...
...e53" text-anchor="middle" alignment-baseline="middle">cssvaluelist</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, cssvalue. cssvaluelist.lengthread only an unsigned long representing the number of cssvalues in the list. methods cssvaluelist.item() this method is used to retrieve a cssvalue by ordinal
index. the order in this collection represents the order of the values in the css style property. if
index is greater than or equal to the number of values in the list, this returns null. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalueslist' in that specification. obsolete initial definition ...
Basic animations - Web APIs
} function anim() { requestanimationframe(anim); c.fillstyle = "rgba(0,0,0,0.05)"; c.fillrect(0, 0, cn.width, cn.height); a.foreach(function(e, i) { e.dr(); }); } </script> <style> #cw { position: fixed; z-
index: -1; } body { margin: 0; padding: 0; background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html> output snake game <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" cont...
...-1, e = -1; if (t) { var i = { ...this.sn[0] }; if ("arrowup" == d && (i.y -= this.h), "arrowdown" == d && (i.y += this.h), "arrowleft" == d && (i.x -= this.w), "arrowright" == d && (i.x += this.w), i.x >= w ? i.x = 0 : i.x < 0 && (i.x = w - this.w), i.y > h ? ...
CustomElementRegistry.define() - Web APIs
htmlelement { constructor() { // always call super first in constructor super(); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create spans var wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); var icon = document.createelement('span'); icon.setattribute('class','icon'); icon.setattribute('tab
index', 0); var info = document.createelement('span'); info.setattribute('class','info'); // take attribute content and put it inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon var imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } var ...
... 'padding: 10px;' + 'background: white;' + 'border-radius: 10px;' + 'opacity: 0;' + 'transition: 0.6s all;' + 'position: absolute;' + 'bottom: 20px;' + 'left: 10px;' + 'z-
index: 3;' + '}' + 'img {' + 'width: 1.2rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow...
Examples of web and XML development using the DOM - Web APIs
ocument.createelement('table'); var thead = table.createthead(); var row = thead.insertrow(-1); var lablelist = ['#', 'property', 'value']; var len = lablelist.length; for (var i=0; i<len; i++) { addcell(row, lablelist[i]); } var tbody = document.createelement('tbody'); table.appendchild(tbody); for (var p in e) { row = tbody.insertrow(-1); row.classname = (row.row
index % 2)? 'odd':'even'; addcell(row, row.row
index); addcell(row, p); addcell(row, e[p]); } document.body.appendchild(table); } window.onload = function(event){ showeventproperties(event); } </script> </head> <body> <h1>properties of the dom <span id="eventtype"></span> event object</h1> </body> </html> example 8: using the dom table interface the dom htmltableelement inte...
... methods are htmltableelement.insertrow and tablerow.insertcell. to add a row and some cells to an existing table: <table id="table0"> <tr> <td>row 0 cell 0</td> <td>row 0 cell 1</td> </tr> </table> <script> var table = document.getelementbyid('table0'); var row = table.insertrow(-1); var cell, text; for (var i = 0; i < 2; i++) { cell = row.insertcell(-1); text = 'row ' + row.row
index + ' cell ' + i; cell.appendchild(document.createtextnode(text)); } </script> notes a table's innerhtml property should never be used to modify a table, although you can use it to write an entire table or the content of a cell. if dom core methods document.createelement and node.appendchild are used to create rows and cells, ie requires that they are appended to a tbody element, whereas ot...
EffectTiming.iterationStart - Web APIs
frameeffectreadonly, and keyframeeffect. syntax var timingproperties = { iterationstart = iterationnumber }; timingproperties.iterationstart = iterationnumber; value a floating-point value whose value is at least 0 and is not +infinity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating. ...
...meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. ...
Introduction to the File and Directory Entries API - Web APIs
dit a binary file that's in their local file directory. it provides a storage api that is already familiar to your users, who are used to working with file systems. for examples of features you can create with this app, see the sample use cases section. the file and directory entries api and other storage apis the file and directory entries api is an alternative to other storage apis like
indexeddb, websql (which has been deprecated since november18, 2010), and appcache. the api is a better choice for apps that deal with blobs for the following reasons: the file and directory entries api offers client-side storage for use cases that are not addressed by databases. if you want to have large mutable chunks of data, the file and directory entries api is a much more efficient storage sol...
... and appcache. the api is a better choice for apps that deal with blobs for the following reasons: the file and directory entries api offers client-side storage for use cases that are not addressed by databases. if you want to have large mutable chunks of data, the file and directory entries api is a much more efficient storage solution than a database. while firefox supports blob storage for
indexeddb, chrome currently does not (chrome is still implementing support for blob storage in
indexeddb). if you are targeting chrome for your app and you want to store blobs, the file and directory entries api and app cache are your only choices. however, appcache storage isn't locally mutable, and doesn't allow for fine-grained client-side management. in chrome, you can use the file and directory e...
Gamepad - Web APIs
senting the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. gamepad.connected read only a boolean indicating whether the gamepad is still connected to the system. gamepad.id read only a domstring containing identifying information about the controller. gamepad.
index read only an integer that is auto-incremented to be unique for each device currently connected to the system. gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated. experimental extensions to gamepad th...
...ation. gamepad.hand read only an enum defining what hand the controller is being held in, or is most likely to be held in. gamepad.hapticactuators read only an array containing gamepadhapticactuator objects, each of which represents haptic feedback hardware available on the controller. example window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s. %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); specifications specification status comment gamepadthe definition of 'gamepad' in that specification. working draft initial definition gamepad extensionsthe definition of 'gamepad extensions' in that specification. editor's draft de...
HTMLAnchorElement - Web APIs
that reflects the rel html attribute, specifying the relationship of the target object to the linked object. htmlanchorelement.rellist read only returns a domtokenlist that reflects the rel html attribute, as a list of tokens. htmlhyperlinkelementutils.search is a usvstring representing the search element, including leading question mark ('?'), if any, of the referenced url. htmlelement.tab
index is a long containing the position of the element in the tabbing navigation order for the current document. htmlanchorelement.target is a domstring that reflects the target html attribute, indicating where to display the linked resource. htmlanchorelement.text is a domstring being a synonym for the node.textcontent property. htmlanchorelement.type is a domstring that reflects the type html ...
...rty has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moved to the htmlhyperlinkelementutils mixin, and htmlanchorelement implements this mixin. html5the definition of 'htmlanchorelement' in that specification. recommendation the methods blur() and focus(), as well as the properties tab
index and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media, pathname, port, protocol, rellist, search, and text. document object model (dom) level 2 html specificationthe definition of 'htmlanchorelement' in that specification. obsolete ...
HTMLAreaElement - Web APIs
dicating relationships of the current document to the linked resource, as a list of tokens. htmlhyperlinkelementutils.search is a usvstring containing the search element (including leading question mark '?'), if any, of the referenced url. htmlareaelement.shape is a domstring that reflects the shape html attribute, indicating the shape of the hot-spot, limited to known values. htmlelement.tab
index is a long containing the element's position in the tabbing order. htmlareaelement.target is a domstring that reflects the target html attribute, indicating the browsing context in which to open the linked resource. htmlareaelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring con...
...g standard the following property has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moving to the htmlhyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definition of 'htmlareaelement' in that specification. recommendation technically, the properties tab
index and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties have been added: rel, rellist, media, hreflang, type, host, hostname, pathname, port, protocol, search, and hash. document object model (dom) level 2 html specificationthe definition of 'htmlareaelement' in that specification. obsolete no change from docume...
HTMLButtonElement - Web APIs
st that represents a list of <label> elements that are labels for this button. htmlbuttonelement.menu is a htmlmenuelement representing the menu element to be displayed if the button is clicked and is of type="menu". htmlbuttonelement.name is a domstring representing the name of the object when submitted with a form. html5 if specified, it must not be the empty string. htmlbuttonelement.tab
index is a long that represents this element's position in the tabbing order. htmlbuttonelement.type is a domstring indicating the behavior of the button. this is an enumerated attribute with the following possible values: submit: the button submits the form. this is the default value if the attribute is not specified, html5 or if it is dynamically changed to an empty or invalid value. reset: ...
...on. recommendation the menu attribute and type="menu" value have been removed. html 5.1the definition of 'htmlbuttonelement' in that specification. recommendation the following attribute has been added: menu. the type attribute can take one more value, "menu". html5the definition of 'htmlbuttonelement' in that specification. recommendation the attributes tab
index and accesskey, are now defined on htmlelement. the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget, labels, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). the type attribute is no more read-only. document object model (dom) level 2 html...
HTMLCollection.item - Web APIs
the htmlcollection method item() returns the node located at the specified offset into the collection. note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of individual nodes in the collection to change, so the
index value will not necessarily remain constant for a given node. syntax var element = htmlcollection.item(
index) parameters
index the position of the node to be returned. elements appear in an htmlcollection in the same order in which they appear in the document's source. return value the node at the specified
index, or null if
index is less than zero or greater than or equal to the length property. usage notes the item() method returns a numbered element from an htmlcollection. in javascript, it is eas...
...see the example below. ...
HTMLCollection - Web APIs
e the modern dom, collections implementing this interface could only have html elements as their items). an htmlcollection in the html dom is live; it is automatically updated when the underlying document is changed. properties htmlcollection.length read only returns the number of items in the collection. methods htmlcollection.item() returns the specific node at the given zero-based
index into the list. returns null if the
index is out of range. an alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. htmlcollection.nameditem() returns the specific node whose id or, as a fallback, name matches the string specified by name. matching by name is only done as a last resort, on...
... only in html, and only if the referenced element supports the name attribute. returns null if no node exists by the given name. an alternative to accessing collection[name] (which instead returns undefined when name does not exist). this is mostly useful for non-javascript dom implementations. usage in javascript htmlcollection also exposes its members directly as properties by both name and
index. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. for example, assuming there is one <form> element in the document and its id is myform: var elem1, elem2; // document.forms ...
HTMLElement - Web APIs
t, relative to the layout. htmlelement.properties read only returns a htmlpropertiescollection… htmlelement.spellcheck is a boolean that controls spell-checking. it is present on all html elements, though it doesn't have an effect on all of them. htmlelement.style is a cssstyledeclaration, an object representing the declarations of an element's style attributes. htmlorforeignelement.tab
index is a long representing the position of the element in the tabbing order. htmlelement.title is a domstring containing the text that appears in a popup box when mouse is over the element. htmlelement.translate is a boolean representing the translation. event handlers most event handler properties, of the form onxyz, are defined on the documentandelementeventhandlers, globaleventhandlers o...
...lowing properties: translate, itemscope, itemtype, itemid, itemref, itemprop, properties, and itemvalue. added the following method: forcespellcheck(). moved the onxyz attributes to the globaleventhandlers interface and added an inheritance from it. html5the definition of 'htmlelement' in that specification. recommendation added the following properties: dataset, hidden, tab
index, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties. moved the id and classname properties to the element interface. document object model (dom) level 2 html specificationthe definition of 'htmlelement' i...
HTMLImageElement.useMap - Web APIs
s in our learning article add a hitmap on top of an image. usage notes the string value of usemap must be a valid anchor for a <map> element. in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it. ...
...usemap must be a valid anchor for a <map> element. in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it. consider a <map> that looks like this: <map name="mainmenu-map"> <area shape="circle" coords="25, 25, 75, 75" href="/
index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/
index.html" alt="shop"> </map> given the image map named mainmenu-map, the image which uses it should look something like the following: <img src="menubox.png" usemap="#mainmenu-map"> for additional examples (including interactive ones), see the articles about the <map> and <area> elements, as well as the guide to using image maps. example the source for this interactive example is stored in a ...
HTMLInputElement - Web APIs
s text, search, tel, url or email; otherwise it is ignored. readonly boolean: returns / sets the element's readonly attribute, indicating that the user cannot modify the value of the control. html5this is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type. selectionstart unsigned long: returns / sets the beginning
index of the selected text. when nothing is selected, this returns the position of the text input cursor (caret) inside of the <input> element. selectionend unsigned long: returns / sets the end
index of the selected text. when there's no selection, this returns the offset of the character immediately following the current text input cursor position. selectiondirection string: r...
...arch is initiated on an <input> of type="search". also available via the onsearch event handler property. specifications specification status comment html living standardthe definition of 'htmlinputelement' in that specification. living standard html5the definition of 'htmlinputelement' in that specification. recommendation technically, the tab
index and accesskey properties, as well as the blur(), click(), and focus() methods, are now defined on htmlelement. the following properties are now obsolete: align and usemap. the following properties have been added: autocomplete, autofocus, dirname, files, formaction, formenctype, formmethod, formnovalidate, formtarget, height, indeterminate, labels, list, max, min, multiple, pattern, placeho...
HTMLObjectElement - Web APIs
s. htmlobjectelement.hspace is a long representing the horizontal space in pixels around the control. htmlobjectelement.name returns a domstring that reflects the name html attribute, specifying the name of the browsing context. htmlobjectelement.standby is a domstring that reflects the standby html attribute, specifying a message to display while the object loads. htmlobjectelement.tab
index is a long representing the position of the element in the tabbing navigation order for the current document. htmlobjectelement.type is a domstring that reflects the type html attribute, specifying the mime type of the resource. htmlobjectelement.typemustmatch is a boolean that reflects the typemustmatch html attribute, indicating if the resource specified by data must only be played if it ma...
... not validate. specifications specification status comment html living standardthe definition of 'htmlobjectelement' in that specification. living standard html5the definition of 'htmlobjectelement' in that specification. recommendation the w3c specification is a latest of a previous version of html living standard technically, the property tab
index is now defined on htmlelement. the following properties are now obsolete: align, archive, border, code, codebase, codetype, declare, hspace, standby, and vspace. the following properties have been added: typemustmatch, contentwindow, willvalidate, validity, and validationmessage. the following methods have been added: checkvalidity() and setcustomvalidity(). document object m...
HTMLOrForeignElement - Web APIs
the focused element is the element which will receive keyboard and similar events by default. specifica...
...the focused element is the element which will receive keyboard and similar events by default. specifications ...
HTMLTableCellElement - Web APIs
tive label for the header cell.. this alternate label can be used in other contexts, such as when describing the headers that apply to a data cell. this is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibility tool. usually the value of abbr is an abbreviation or acronym, but can be any text that's appropriate contextually. htmltablecellelement.cell
index read only a long integer representing the cell's position in the cells collection of the <tr> the cell is contained within. if the cell doesn't belong to a <tr>, it returns -1. htmltablecellelement.colspan an unsigned long integer indicating the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. it reflects the colspan attribute. html...
...en obsoleted: align, axis, bgcolor, height, width, ch, choff, nowrap, and valign. the headers property is now read-only and contains a domsettabletokenlist rather than a mere domstring. the colspan and rowspan properties are now unsigned long. document object model (dom) level 2 html specificationthe definition of 'htmltablecellelement' in that specification. obsolete the cell
index property is now read-only. document object model (dom) level 1 specificationthe definition of 'htmltablecellelement' in that specification. obsolete initial definition. ...
HTMLTableRowElement.insertCell() - Web APIs
row (<tr>) and returns a reference to the cell. note: insertcell() inserts the cell directly into the row. the cell does not need to be appended separately with node.appendchild() as would be the case if document.createelement() had been used to create the new <td> element. you can not use insertcell() to create a new <th> element though. syntax var newcell = htmltablerowelement.insertcell(
index); htmltablerowelement is a reference to an html <tr> element. parameters
index optional
index is the cell
index of the new cell. if
index is -1 or equal to the number of cells, the cell is appended as the last cell in the row. if
index is greater than the number of cells, an
indexsizeerror exception will result. if
index is omitted it defaults to -1. return value newcell is an htmltable...
...t.createtextnode() and node.appendchild(). ...
IDBCursor.advance() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-c...
...nerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log('every other entry displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'advance()' in that specification. recommendation
indexed database api draftthe definition of 'advance()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web...
IDBCursor.continue() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-com...
...li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'continue()' in that specification. recommendation
indexed database api draftthe definition of 'continue()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
IDBCursor.direction - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-comp...
...'</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.direction); cursor.continue(); } else { console.log('entries displayed backwards.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'direction' in that specification. recommendation
indexed database api draftthe definition of 'direction' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
IDBCursor.key - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data a...
...innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.key); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'key' in that specification. recommendation
indexed database api draftthe definition of 'key' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBCursor.primaryKey - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser...
...rsor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.primarykey); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'primarykey' in that specification. recommendation
indexed database api draftthe definition of 'primarykey' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
IDBCursorWithValue.value - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-com...
...html = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.value); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'source' in that specification. recommendation
indexed database api draftthe definition of 'idbdatabase' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
IDBDatabase.close() - Web APIs
t actually closed until all transactions created using this connection are complete. no new transactions can be created for this connection once this method is called. methods that create transactions throw an exception if a closing operation is pending. note: this feature is available in web workers. syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // opening a database. // create event handlers for both success and failure of dbopenrequest.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable. db = dbopenrequest.resul...
...unction(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable. db = dbopenrequest.result; // now let"s close the database again! db.close(); }; specification specification status comment
indexed database api 2.0the definition of 'close()' in that specification. recommendation
indexed database api draftthe definition of 'close()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
IDBDatabase.name - Web APIs
x var dbname = idbdatabase.name; value a domstring containing the name of the connected database. example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged. for a full example, see our to-do notifications app (view example live). // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot be...
...; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status comment
indexed database api 2.0the definition of 'name' in that specification. recommendation
indexed database api draftthe definition of 'name' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data...
IDBDatabase.objectStoreNames - Web APIs
e interface is a domstringlist containing a list of the names of the object stores currently in the connected database. note: this feature is available in web workers. syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database. example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below...
...+= '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment
indexed database api 2.0the definition of 'objectstorenames' in that specification. recommendation
indexed database api draftthe definition of 'objectstorenames' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/...
IDBDatabase.version - Web APIs
f the idbdatabase interface is a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. note: this feature is available in web workers. syntax var myinteger = idbdatabase.version; value an integer containing the version of the connected database. example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot be...
...penrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment
indexed database api 2.0the definition of 'version' in that specification. recommendation
indexed database api draftthe definition of 'version' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
IDBDatabaseException - Web APIs
attributes attribute type description code unsigned short the most appropriate error code for the condition. message domstring error message describing the exception raised. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. ...
...ange as the specifications continue to change. use the constant names instead. constant value description abort_err 8 a request was aborted, for example, through a call to idbtransaction.abort. constraint_err 4 a mutation operation in the transaction failed because a constraint was not satisfied. for example, an object, such as an object store or
index, already exists and a request attempted to create a new one. data_err 5 data provided to an operation does not meet requirements. non_transient_err 2 an operation was not allowed on an object. unless the cause of the error is corrected, retrying the same operation would result in failure. not_allowed_err 6 an operation was called on an object wher...
IDBEnvironment - Web APIs
important: the
indexeddb property that was previously defined in this mixin is instead now windoworworkerglobalscope.
indexeddb (that is, defined as a member of the windoworworkerglobalscope mixin). the idbenvironment helper of the
indexeddb api contains the
indexeddb property, which provides access to
indexeddb functionality. it is the top level
indexeddb interface implemented by the window and worker objects. note: this feature is available in web workers. properties idbenvironment.
indexeddb read only provides a mechanism for applications to asynchronously access capabilities of
indexed databases; contains an idbfactory object. example the following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
IDBFactory.cmp() - Web APIs
the cmp() method of the idbfactory interface compares two values as keys to determine equality and ordering for
indexeddb operations, such as storing and iterating. note: this feature is available in web workers. note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid
indexeddb keys (booleans and objects, for example) or are treated as equivalent
indexeddb keys (for example, since
indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent). this throws an exception if either of the values is not a valid key. syntax var result =
indexeddb.cmp(first, second); parameters first the first key to compare. second the second key to compare. ...
... description -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key. example var a = 1; var b = 2; var result = window.
indexeddb.cmp(a, b); console.log( "comparison results: " + result ); specifications specification status comment
indexed database api 2.0the definition of 'cmp()' in that specification. recommendation
indexed database api draftthe definition of 'cmp()' in that specification. recommendation browser compatibility the compatibility table on th...
databases - Web APIs
the databases method of the idbfactory interface returns a list represening all the available databases, including their names and versions. note: this feature is available in web workers. note: this method is introduced in a draft of a specifications and browser compatibility is limited. syntax const promise =
indexeddb.databases() parameters the method does not take in any parameters. return value a promise that resolves either to an error or a list of dictionaries, each with two elements, name and version. name the database name. version the database version. exceptions this method may raise a domexception of the following types: attribute description securityerror the method is called from an opaque origin. other error specificatio...
...ries, each with two elements, name and version. name the database name. version the database version. exceptions this method may raise a domexception of the following types: attribute description securityerror the method is called from an opaque origin. other error specification does not describe all possible errors. example const promise =
indexeddb.databases() promise.then(databases => { console.log(databases) }) specifications specification status comment
indexed database api draftthe definition of 'databases()' in that specification. recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute ...
IDBKeyRange.lower - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dat...
...l = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'lower' in that specification. recommendation
indexed database api draftthe definition of 'lower' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBKeyRange.lowerBound() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/brow...
...trong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'lowerbound()' in that specification. recommendation
indexed database api draftthe definition of 'lowerbound()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
IDBKeyRange.lowerOpen - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-co...
... = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'loweropen' in that specification. recommendation
indexed database api draftthe definition of 'loweropen' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
IDBKeyRange.only() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data ...
...rhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'only' in that specification. recommendation
indexed database api draftthe definition of 'only' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBKeyRange.upper - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dat...
...l = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upper' in that specification. recommendation
indexed database api draftthe definition of 'upper' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
IDBKeyRange.upperBound() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/brow...
...ng>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upperbound()' in that specification. recommendation
indexed database api draftthe definition of 'upperbound()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
IDBKeyRange.upperOpen - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-co...
...'<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upperopen' in that specification. recommendation
indexed database api draftthe definition of 'upperopen' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
IDBObjectStore.getKey() - Web APIs
ons this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. ...
... recommendation initial definition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasa...
IDBObjectStore.put() - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data ...
...iginated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() function again to update the display updatetitlerequest.onsuccess = () => { displaydata(); }; }; specification specification status comment
indexed database api 2.0the definition of 'put()' in that specification. recommendation
indexed database api draftthe definition of 'put()' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
IDBRequest.onerror - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat...
...h the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); // todo what about event parameter into onerror()? what will be inside of this event? }; specifications specification status comment
indexed database api 2.0the definition of 'onerror' in that specification. recommendation
indexed database api draftthe definition of 'onerror' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
IDBRequest.onsuccess - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-co...
...r updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'onsuccess' in that specification. recommendation
indexed database api draftthe definition of 'onsuccess' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
IDBRequest.readyState - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-...
...quest is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'readystate' in that specification. recommendation
indexed database api draftthe definition of 'readystate' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web...
IDBRequest.result - Web APIs
recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-d...
... var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'result' in that specification. recommendation
indexed database api draftthe definition of 'result' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
IDBTransactionSync - Web APIs
when an application creates an idbtransactionsync object, it blocks until the browser is able to reserve the require database objects. ...
...when an application creates an idbtransactionsync object, it blocks until the browser is able to reserve the require database objects. ...
Key Values - Web APIs
virtual keycode windows mac linux android "avrinput" [3] changes the input mode on an external audio/video receiver (avr) unit. keycode_avr_input (182) "avrpower" [3] toggles the power on an external avr unit. keycode_avr_power (181) "colorf0red" [3] general-purpose media function key, color-coded red. this has
index 0 among the colored keys. vk_colored_key_0 keycode_prog_red (183) "colorf1green" [3] general-purpose media funciton key, color-coded green. this has
index 1 among the colored keys. vk_colored_key_1 keycode_prog_green (184) "colorf2yellow" [3] general-purpose media funciton key, color-coded yellow. this has
index 2 among the colored keys. vk_c...
...key, color-coded green. this has
index 1 among the colored keys. vk_colored_key_1 keycode_prog_green (184) "colorf2yellow" [3] general-purpose media funciton key, color-coded yellow. this has
index 2 among the colored keys. vk_colored_key_2 keycode_prog_yellow (185) "colorf3blue" [3] general-purpose media funciton key, color-coded blue. this has
index 3 among the colored keys. vk_colored_key_3 keycode_prog_blue (186) "colorf4grey" general-purpose media funciton key, color-coded grey. this has
index 4 among the colored keys. vk_colored_key_4 keycode_prog_grey "colorf5brown" general-purpose media funciton key, color-coded brown. this has
index 5 among the colored keys. vk_colored_key_5 ...
Using the MediaStream Recording API - Web APIs
mented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
... information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
NamedNodeMap - Web APIs
a namednodemap object is live and will thus be auto-updated if changes are made to its contents internally or elsewhere. although called namednodemap, this interface doesn't deal with node objects but with attr objects, which were originally a specialized class of node, and still are in some implementations. properties this interface doesn't inherit any property. ...
... the amount of objects in the map. methods this interface doesn't inherit any method. namednodemap.getnameditem() returns a attr, corresponding to the given name. namednodemap.setnameditem() replaces, or adds, the attr identified in the map by the given name. namednodemap.removenameditem() removes the attr identified by the given map. namednodemap.item() returns the attr at the given
index, or null if the
index is higher or equal to the number of nodes. namednodemap.getnameditemns() returns a attr identified by a namespace and related local name. namednodemap.setnameditemns() replaces, or adds, the attr identified in the map by the given namespace and related local name. namednodemap.removenameditemns() removes the attr identified by the given namespace and related local name...
Node.childNodes - Web APIs
the node.childnodes read-only property returns a live nodelist of child nodes of the given element where the first child node is assigned
index 0. ...
...to get data from node objects, use their properties. (for example, to get the name of the first childnode: elementnodereference.childnodes[1].nodename.) the document object itself has 2 children: the doctype declaration and the root element, typically referred to as documentele...
NodeList.item() - Web APIs
returns a node from a nodelist by
index. this method doesn't throw exceptions as long as you provide arguments. a value of null is returned if the
index is out of range, and a typeerror is thrown if no argument is provided. syntax nodeitem = nodelist.item(
index) nodelist is a nodelist. this is usually obtained from another dom property or method, such as childnodes.
index is the
index of the node to be fetched. the
index is zero-based. nodeitem is the
indexth node in the nodelist returned by the item method. ...
...item = nodelist.item(
index) nodelist is a nodelist. this is usually obtained from another dom property or method, such as childnodes.
index is the
index of the node to be fetched. the
index is zero-based. nodeitem is the
indexth node in the nodelist returned by the item method. alternate syntax javascript also offers an array-like bracketed syntax for obtaining an item from a nodelist by
index: nodeitem = nodelist[
index] example var tables = document.getelementsbytagname("table"); var firsttable = tables.item(1); // or simply tables[1] - returns the second table in the dom specifications specification status comment domthe definition of 'nodelist: item' in that specification. living standard ...
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. used as a destination for drawing, rendering, clearing, and writing operations. ...
... ext.color_attachment13_webgl ext.color_attachment14_webgl ext.color_attachment15_webgl when using the webgl_depth_texture extension: ext.depth_stencil_attachment: depth and stencil buffer data storage. texture a webgltexture object whose image to attach. level a glint specifying the mipmap level of the texture image to be attached. must be 0. baseview
index a glint specifying the base view
index of the framebuffer object attachment. numviews a glsizei specifying the number of views of the framebuffer object attachment. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the accepted attachment points. a gl.invalid_value error is thrown if level is n...
RTCIceCandidate.RTCIceCandidate() - Web APIs
a newly-created rtcicecandidate object, optionally configured based on the specified object based on the rtcicecandidateinit dictionary. if candidateinfo is provided, the new rtcicecandidate is initialized as follows: each member of the rtcicecandidateinit object is initialized to the value of the property by the same name from rtcicecandidateinit. this includes the candidate, sdpmid, sdpmline
index, and usernamefragment properties. the candidate string (which is sdp text) is parsed; each property found is stored in the corresponding field in the rtcicecandidate. if any of the fields is invalid, parsing of the string silently aborts without throwing an exception. the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message. the fo...
...hey are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport. note: parsing of the candidate string is performed using the candidate-attribute grammar from the webrtc specification. exceptions typeerror the specified rtcicecandidateinit has values of null in both the sdpmid and sdpmline
index properties. usage notes this constructor does not do complete validation of the specified candidateinfo object or string. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate()' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.addIceCandidate() - Web APIs
peer's description by the ice agent. the promise does not receive any input parameters. exceptions when an error occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified domexception object passed to the rejection handler. ...
... the specified ufrag doesn't match the ufrag field in any of the remote descriptions being considered. one or more of the values in the candidate string are invalid or could not be parsed. attempting to add the candidate fails for any reason. ...
Storage API - Web APIs
api gives sites' code the ability to find out how much space they can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things. note: this feature is available in web workers. ...
...e site storage unit for each origin. in essence, every web site or web application has its own storage unit into which its data gets placed. the diagram below shows a site storage pool with three storage units within, showing how storage units can have different data types stored within and may have different quotas (maximum storage limits). origin 1 has some web storage data as well as some
indexeddb data, but also has some free space left; its current usage hasn't yet reached its quota. origin 2 has no data stored in it yet; it's just an empty box waiting for content. this origin, however, has a lower quota than the other two do. it may be a less-visited site, or one known to have lower data storage requirements. origin 3's storage unit is completely full; it's reached its quota and ca...
Text.splitText() - Web APIs
. the newly created node is returned to the caller. if the original node had a parent, the new node is inserted as the next sibling of the original node. if the offset is equal to the length of the original node, the newly created node has no data. separated text nodes can be concatenated using the node.normalize() method. ...
...the newly created node has no data. separated text nodes can be concatenated using the node.normalize() method. syntax newnode = textnode.splittext(offset) parameters offset the
index immediately before which to break the text node. return value returns a newly created text node that contains the text after the specified offset point. exceptions thrown a domexception with a value of
index_size_err is thrown if the specified offset is negative or is greater than the number of 16-bit units in the node's text; a domexception with a value of no_modification_allowed_err is thrown if the node is read-only. example in this example, the text of a <p> is split into two text nodes, and a <u> is inserted between them. html <p>foobar</p> javascript const p = document.queryselector('p');...
TextEncoder.prototype.encodeInto() - Web APIs
-8. this may be less than string.length if uint8array did not have enough space. written the number of bytes modified in the destination uint8array. the bytes written are guaranteed to form complete utf-8 byte sequences. encode into a specific position encoder.encodeinto always puts its output at the start of the array. however, it is sometimes useful to make the output start at a particular
index. the solution is typedarray.prototype.subarray(). observe. var encoder = new textencoder; function encodeintoatposition(string, u8array, position) { return encoder.encodeinto(string, position ? u8array.subarray(position|0) : u8array); } var u8array = new uint8array(8); encodeintoatposition("hello", u8array, 2); console.log( "" + u8array.join() ); // 0,0,104,101,108,108,111,0 buffer sizing...
...hold t such that if rounduptobucketsize(s.length) + t >= s.length * 3, you simply allocate for s.length * 3. otherwise, first allocate for rounduptobucketsize(s.length) and convert. if the read item it the return dictionary is s.length, the conversion is done. if not, reallocate the target buffer to written + (s.length - read) * 3 and then convert the rest by taking a substring of s starting from
index read and a subbuffer of the target buffer starting from
index written. above rounduptobucketsize() is a function that rounds up to the allocator bucket size. for example, if your wasm allocator is known to use power-of-two buckets, rounduptobucketsize() should return the argument if it is a power-of-two or the next power-of-two otherwise. if the behavior of the wasm allocator is unknown, roundup...
TimeRanges - Web APIs
timeranges interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements. a timeranges object includes one or more ranges of time, each specified by a starting and ending time offset. you reference each time range by using the start() and end() methods, passing the
index number of the time range you want to retrieve. the term "normalized timeranges object" indicates that ranges in such an object are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). properties timeranges.length read only returns an unsigned long representing the number of time ranges represented by the time range object. methods t...
...bject" indicates that ranges in such an object are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). properties timeranges.length read only returns an unsigned long representing the number of time ranges represented by the time range object. methods timeranges.start() returns the time for the start of the range with the specified
index. timeranges.end() returns the time for the end of the specified range. specifications specification status comment html living standardthe definition of 'timeranges' in that specification. living standard initial definition ...
WebGLRenderingContext.getActiveUniform() - Web APIs
the webglrenderingcontext.getactiveuniform() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uniform attribute. it is generally used when querying unknown uniforms either for debugging or generic library creation. syntax webglactiveinfo webglrenderingcontext.getactiveuniform(program,
index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uniform variable's information.
index a gluint specifying the
index of the uniform attribute to get. this value is an
index 0 to n - 1 as returned by gl.getprogramparameter(program, gl.active_uniforms). return value a webglactiveinfo object describing the uniform. the type attribute of the return value will be one of the following: gl.float gl.float_...
...o, and uniform block { float bar; } e; will result in block.bar. the size attribute of the return value corresponds to the length of the array for uniforms declared as arrays. otherwise, it is 1 (this includes interface blocks instanced with arrays). exceptions gl.invalid_value is generated if the program webglprogram is invalid (not linked, deleted, etc.). gl.invalid_value is generated if
index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1]. examples const numuniforms = gl.getprogramparameter(program, gl.active_uniforms); for (let i = 0; i < numuniforms; ++i) { const info = gl.getactiveuniform(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications specification status comment ...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
chment_depth_size gl.framebuffer_attachment_green_size gl.framebuffer_attachment_red_size gl.framebuffer_attachment_stencil_size gl.framebuffer_attachment_texture_layer when using the ovr_multiview2 extension: ext.framebuffer_attachment_texture_num_views_ovr: the number of views of the framebuffer object attachment. ext.framebuffer_attachment_texture_base_view_
index_ovr: the base view
index of the framebuffer object attachment. return value depends on the requested information (as specified with pname). either a glint, a glenum, a webglrenderbuffer, or a webgltexture. pname parameter return value gl.framebuffer_attachment_object_type a glenum indicating the type of the texture. either gl.renderbuffer, gl.texture, o...
...umber of the texture layer which contains the attached image. ext.framebuffer_attachment_color_encoding_ext a glenum indicating the framebuffer color encoding. either gl.linear or ext.srgb_ext. ext.framebuffer_attachment_texture_num_views_ovr a glsizei indicating the number of views of the framebuffer object attachment. ext.framebuffer_attachment_texture_base_view_
index_ovr a glint indicating the base view
index of the framebuffer object attachment. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, gl.read_framebuffer or if attachment is not one of the accepted attachment points. examples gl.getframebufferattachmentparameter(gl.framebuffer, gl.color_attachment0, ...
WebGLRenderingContext.getUniformLocation() - Web APIs
values correspond to the uniform names returned by getactiveuniform; see that function for specifics on how declared uniforms map to uniform location names. additionally, for uniforms declared as arrays, the following names are also valid: the uniform name without the [0] suffix. e.g. the location returned for arrayuniform is equivalent to the one for arrayuniform[0]. the uniform name
indexed with an integer. e.g. the location returned for arrayuniform[2] would point directly to the third entry of the arrayuniform uniform. return value a webgluniformlocation value indicating the location of the named variable, if it exists. if the specified variable doesn't exist, null is returned instead. the webgluniformlocation is an opaque value used to uniquely identify the location in ...
... the specified variable doesn't exist, null is returned instead. the webgluniformlocation is an opaque value used to uniquely identify the location in the gpu's memory at which the uniform variable is located. with this value in hand, you can call other webgl methods to access the value of the uniform variable. the webgluniformlocation type is compatible with the glint type when specifying the
index or location of a uniform attribute. errors the following errors may occur; to check for errors after getuniformlocation() returns, call geterror(). gl_invalid_value the program parameter is not a value or object generated by webgl. gl_invalid_operation the program parameter doesn't correspond to a glsl program generated by webgl, or the specified program hasn't been linked successfully. ...
WebGL best practices - Web APIs
apting to the case there they are not supported. likewise the limits of your system will be different than your clients' systems! don't assume you can use thirty texture samplers per shader just because it works on your machine! take advantage of universally supported webgl 1 extensions these webgl 1 extensions are universally supported: angle_instanced_arrays ext_blend_minmax oes_element_
index_uint oes_standard_derivatives oes_vertex_array_object webgl_debug_renderer_info webgl_lose_context (see also: https://jdashg.github.io/misc/webgl/webgl-feature-levels.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum requirements for webgl are quite low. in practice, e...
... compression that makes basis universal compressed texture files much smaller than regular compressed textures over-the-wire, more comparable to jpeg. https://github.com/binomialllc/basis_universal/blob/master/webgl/readme.md memory usage of depth and stencil formats depth and stencil attachments and formats are actually inseparable on many devices. you may ask for depth_component24 or stencil_
index8, but you're often getting d24x8 and x24s8 32bpp formats behind the scenes. assume that the memory usage of depth and stencil formats is rounded up to the nearest four bytes. teximage/texsubimage uploads (particularly with videos) can cause pipeline flushes most texture uploads from dom elements will incur a processing pass that will temporarily switch gl progams internally, causing a pipeline ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
ccurs, this handler executes. using destructuring, the rtctrackevent's track and streams properties are extracted. the former is either the video track or the audio track being received. the latter is an array of mediastream objects, each representing a stream containing this track (a track may in rare cases belong to multiple streams at once). in our case, this will always contain one stream, at
index 0, because we passed one stream into addtrack() earlier. we add an unmute event handler to the track, because the track will become unmuted once it starts receiving packets. we put the remainder of our reception code in there. if we already have video coming in from the remote peer (which we can see if the remote view's <video> element's srcobject property already has a value), we do nothing. o...
...ck() earlier. we add an unmute event handler to the track, because the track will become unmuted once it starts receiving packets. we put the remainder of our reception code in there. if we already have video coming in from the remote peer (which we can see if the remote view's <video> element's srcobject property already has a value), we do nothing. otherwise, we set srcobject to the stream at
index 0 in the streams array. the perfect negotiation logic now we get into the true perfect negotiation logic, which functions entirely independently from the rest of the application. handling the negotiationneeded event first, we implement the rtcpeerconnection event handler onnegotiationneeded to get a local description and send it using the signaling channel to the remote peer. let makingoffer...
The structured clone algorithm - Web APIs
the structured clone algorithm copies complex javascript objects. it is used internally to transfer data between workers via postmessage(), storing objects with
indexeddb, or copying objects for other apis. it clones by recursing through the input object while maintaining a map of previously visited references, to avoid infinitely traversing cycles. things that don't work with structured clone function objects cannot be duplicated by the structured clone algorithm; attempting to throws a data_clone_err exception. cloning dom nodes likewise throws a data_clone_err exception. certain object properties are not preserved: the last
index property of regexp objects is not preserved. property descriptors, setters, getters, and similar metadata-like features are not duplicated. fo...
...read/write in the duplicate, since that's the default. the prototype chain is not walked or duplicated. note: native error types can be cloned in chrome, and firefox is working on it. supported types object type notes all primitive types however, not symbols. boolean objects string objects date regexp last
index is not preserved. blob file filelist arraybuffer arraybufferview including other typed arrays. imagebitmap imagedata array object only plain objects (e.g. from object literals) map set ...
Using Web Workers - Web APIs
reference documentation on workers and additional guides. you can run whatever code you like inside the worker thread, with some exceptions. for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object. but you can use a large number of items available under window, including websockets, and data storage mechanisms like
indexeddb. see functions and classes available to workers for more details. data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message event's data attribute.) the data is copied rather than shared. workers may, in turn,...
...everal browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host, and port). note: in firefox, shared workers cannot be shared between documents loaded in private and non-private windows (bug 1177621). spawning a shared worker spawning a new shared worker is pretty much the same as with a dedicated worker, but with a different constructor name (see
index.html and
index2.html) — each one has to spin up the worker using code like the following: var myworker = new sharedworker('worker.js'); one big difference is that with a shared worker you have to communicate via a port object — an explicit port is opened that the scripts can use to communicate with the worker (this is done implicitly in the case of dedicated workers). the port connection n...
Window.getComputedStyle() - Web APIs
syntax var style = window.getcomputedstyle(element [, pseudoelt]); element the element for which to get the computed style. ...
...rned cssstyledeclaration object contains active values for css property longhand names. for example, border-bottom-width instead of the border-width and border shorthand property names. it is safest to query values with only longhand names like font-size. shorthand names like font will not work with most browsers. css property values may be accessed using the getpropertyvalue(propname) api or by
indexing directly into the object such as obj['z-
index'] or obj.z
index. the values returned by getcomputedstyle are resolved values. these are usually the same as css 2.1’s computed values, but for some older properties like width, height, or padding, they are instead the same as used values. originally, css 2.0 defined the computed values as the "ready to be used" final values of properties after c...
XPathResult.snapshotItem() - Web APIs
exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown. example the following example shows the use of the snapshotitem() method. ...
... exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown. example the following example shows the use of the snapshotitem() method. ...
Basic form hints - Accessibility
these cases. the example below shows a radio button group implemented using an unordered list. note that on line 3, the <ul> element sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group. ...
...sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group. <h3 id="rg1_label">lunch options</h3> <ul class="radiogroup" id="rg1" role="radiogroup" aria-labelledby="rg1_label"> <li id="r1" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tab
index="0" role="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> describing with aria form controls sometimes have a description associated with them, in addition to the label. aria provides the aria-de...
Alerts - Accessibility
this method takes three parameters: the id of the input that is to be...
...se"); removeoldalert(); } } </script> the checkvalidity function the primary method in javascript used for form validation is the checkvalidity function. this method takes three parameters: the id of the input that is to be validated, the term to search for to ensure validity, and the error message to be inserted into the alert. to see if it is valid, the function checks whether the
indexof the input’s value is anything greater than -1. a value of -1 or less is returned if the
index of the search term could not be found within the value. if invalid, the function does two things: it sets the element’s aria-invalid attribute to “true”, which will indicate to screen readers that there is invalid content in here. it will call the addalert function to add the alert with th...
:target - CSS: Cascading Style Sheets
the :target css pseudo-class represents a unique element (the target element) with an id matching the url's fragment. /* selects an element with an id matching the current url's fragment */ :target { border: 2px solid black; } for example, the following url has a fragment (denoted by the # sign) that points to an element called section2: http://www.example.com/
index.html#section2 the following element would be selected by a :target selector when the current url is equal to the above: <section id="section2">example</section> syntax :target examples a table of contents the :target pseudo-class can be used to highlight the portion of a page that has been linked to from a table of contents. html <h3>table of contents</h3> <ol> <li><a href="#p1">jump to the first paragraph!</a></li> ...
... align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-
index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: ""; cursor: default; } result specifications specificatio...
CSS Tutorials - CSS: Cascading Style Sheets
ground images css allows you to resize images used as an element's background. this tutorial describes how to achieve this in a simple way. media queries the size of the screens, or the kind of devices like touchscreens or printed sheets vary greatly nowadays. media queries are the fundamental building blocks in achieving web sites that render everywhere in their best quality. understanding z-
index controlling superposition of boxes is a basic feature that is very quickly needed by web developers. though not that difficult, it requires a basic knowledge of css. intermediate-level css tutorials after the release of css 2 (level 1), new features have been added to css. some of them are fancy and are pretty self contained. they are easy to use for anybody with a fair knowledge of basic con...
... allowing you to create complex layouts. though the simplest way to achieve such layout, they are more complex to use for people without too much experience. css multi-column layouts css3 introduces a new layout allowing you to easily define multiple columns in an element. though multi-column text is not that common on devices like screens, this is particularly useful on printed pages, or for
indexes. css flexible boxes layouts this new layout allow you to give boxes flexibility, allowing them to be resized smoothly. it is a powerful way to describe complex interfaces. ...
WAI ARIA Live Regions/API Support - Developer guides
c or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. ...
... iaccessible2 event object about to be hidden or removed children_changed::remove (fired on the parent, with event data pointing to the child
index of the accessible object to be removed) event_object_hide* (fired on the actual accessible object about to go away) object shown or inserted children_changed::add (fired on the parent, with event data pointing to the child
index of the inserted accessible object) event_object_show* (fired on the actual new accessible object) object replaced with different object (this happens especially if an object's interfaces or role changes) children_changed::remove followed immediately by children_change::add event_object_hide followed immediately by event_object_show text removed text_changed::delete ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
d, or name is empty, the input's value is not submitted with the form! (disabled controls, unchecked radio buttons, unchecked checkboxes, and reset buttons are also not sent.) there are two special cases: _charset_ : if used as the name of an <input> element of type hidden, the input's value is automatically set by the user agent to the character encoding being used to submit the form. is
index: for historical reasons, the name is
index is not allowed. name and radio buttons the name attribute creates a unique behavior for radio buttons. only one radio button in a same-named group of radio buttons can be checked at a time. selecting any radio button in that group automatically deselects any currently-selected radio button in the same group. the value of that one checked radio but...
...the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid pseudoclass. the step attribute is expressed in seconds. the step scale factor is 1000 (which converts the seconds to milliseconds, as used in the other algorithms). the default step is 60 seconds. see client-side validation for more information. tab
index global attribute valid for all elements, including all the input types, an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation. as all input types except for input of type hidden are focusable, this attribute should not be used on form controls, because doing so would require the management of the focus ord...
HTML elements reference - HTML: Hypertext Markup Language
ea consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application. <nav> the html <nav> element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. common examples of navigation sections are menus, tables of contents, and
indexes. <section> the html <section> element represents a standalone section — which doesn't have a more specific semantic element to represent it — contained within an html document. text content use html text content elements to organize blocks or sections of content placed between the opening <body> and closing </body> tags. important for accessibility and seo, these elem...
... a particular area in which another html document can be displayed. a frame should be used within a <frameset>. <frameset> the html <frameset> element is used to contain <frame> elements. <image> the obsolete html image element (<image>) is an obsolete remnant of an ancient version of html lost in the mists of time; use the standard <img> element instead. <is
index> <is
index> was an obsolete html element that put a text field in a page for querying the document. <keygen> the html <keygen> element exists to facilitate generation of key material, and submission of the public key as part of an html form. this mechanism is designed for use with web-based certificate management systems. it is expected that the <keygen> element will be used in an...
Using HTTP cookies - HTTP
avior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage apis. cookies are sent with every request, so they can worsen performance (especially for mobile data connections). modern apis for client storage are the web storage api (localstorage and sessionstorage) and
indexeddb. to see stored cookies (and other storage that a web page can use), you can enable the storage inspector in developer tools and select cookies from the storage tree. creating cookies after receiving an http request, a server can send one or more set-cookie headers with the response. the cookie is usually stored by the browser, and then the cookie is sent with requests made to the same se...
...ese regulations. other ways to store information in the browser another approach to storing data in the browser is the web storage api. the window.sessionstorage and window.localstorage properties correspond to session and permanent cookies in duration, but have larger storage limits than cookies, and are never sent to a server. more structured and larger amounts of data can be stored using the
indexeddb api, or a library built on it. other techniques have been created to cause cookies to be recreated after they are deleted, known as "zombie" cookies. these techniques violate the principles of user privacy and user control, may violate data privacy regulations, and could expose a website using them to legal liability. ...
301 Moved Permanently - HTTP
direction is performed, not all user-agents align with it - you can still find this type of bugged software out there. ...
...s therefore recommended to use the 301 code only as a response for get or head methods and to use the 308 permanent redirect for post methods instead, as the method change is explicitly prohibited with this status. ...
Enumerability and ownership of properties - JavaScript
xcluding symbols) not available without extra code not available without extra code not available without extra code obtaining properties by enumerability/ownership note that this is not the most efficient algorithm for all cases, but useful for a quick demonstration. ...
...function(obj, prop) { return true; }, // inspired by http://stackoverflow.com/a/8024294/271577 _getpropertynames: function getallpropertynames(obj, iterateselfbool, iterateprototypebool, includepropcb) { var props = []; do { if (iterateselfbool) { object.getownpropertynames(obj).foreach(function(prop) { if (props.
indexof(prop) === -1 && includepropcb(obj, prop)) { props.push(prop); } }); } if (!iterateprototypebool) { break; } iterateselfbool = true; } while (obj = object.getprototypeof(obj)); return props; } }; detection table in for..in obj.haso...
Equality comparisons and sameness - JavaScript
which operation you choose depends on what sort of comparison you are looking to perform. briefly: double equals (=...
... which operation you choose depends on what sort of comparison you are looking to perform. briefly: double equals (=...
Keyed collections - JavaScript
maps map object ecmascript 2015 introduces a new data structure to map values to values. a map object is a simple key/value map and can iterate its elements in insertion order. the following code shows some basic operations with a map. see also the map reference page for more examples and the complete api. you can use a for...of loop to return an array of [key, value] for each iteration. ...
...that set objects store unique values—so any duplicate elements from an array are deleted when converting! array.from(myset); [...myset2]; myset2 = new set([1, 2, 3, 4]); array and set compared traditionally, a set of elements has been stored in arrays in javascript in a lot of situations. the new set object, however, has some advantages: deleting array elements by value (arr.splice(arr.
indexof(val), 1)) is very slow. set objects let you delete elements by their value. with an array, you would have to splice based on an element's
index. the value nan cannot be found with
indexof in an array. set objects store unique values. you don't have to manually keep track of duplicates. weakset object weakset objects are collections of objects. an object in the weakset may only occur once.
JavaScript modules - JavaScript
and then draw (and report information about) different shapes on the canvas. these are fairly trivial, but have been kept deliberately simple to demonstrate modules clearly. note: if you want to download the examples and run them locally, you'll need to run them through a local web server. basic example structure in our first example (see basic-modules) we have a file structure as follows:
index.html main.js modules/ canvas.js square.js note: all of the examples in this guide have basically the same structure; the above should start getting pretty familiar. the modules directory's two modules are described below: canvas.js — contains functions related to setting up the canvas: create() — creates a canvas with a specified width and height inside a wrapper <div> w...
...ynamic-module-imports directory we've got another example based on our classes example. this time however we are not drawing anything on the canvas when the example loads. instead, we include three buttons — "circle", "square", and "triangle" — that, when pressed, dynamically load the required module and then use it to draw the associated shape. in this example we've only made changes to our
index.html and main.js files — the module exports remain the same as before. over in main.js we've grabbed a reference to each button using a document.queryselector() call, for example: let squarebtn = document.queryselector('.square'); we then attach an event listener to each button so that when pressed, the relevant module is dynamically loaded and used to draw the shape: squarebtn.addeventlist...
Working with objects - JavaScript
type called fishes var fish = object.create(animal); fish.type = 'fishes'; fish.displaytype(); // output:fishes inheritance all objects in javascript inherit from at least one other object. the object being inherited from is known as the prototype, and the inherited properties can be found in the prototype object of the constructor. see inheritance and the prototype chain for more information.
indexing object properties you can refer to a property of an object either by its property name or by its ordinal
index. if you initially define a property by its name, you must always refer to it by its name, and if you initially define a property by an
index, you must always refer to it by its
index. this restriction applies when you create an object and its properties with a constructor function (...
... the exception to this rule is array-like object reflected from html, such as the forms array-like object. ...
Memory Management - JavaScript
2019, it is not possible to explicitly or programmatically trigger garbage collection in javascript. node.js node.js offers additional options and tools for configuring and debugging memory issues that may not be available for javascript executed within a browser environment. ...
... and tools for configuring and debugging memory issues that may not be available for javascript executed within a browser environment. ...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.
indexof is deprecated; use string.prototype.
indexof instead warning: string.last
indexof is deprecated; use string.prototype.last
indexof instead warning: string.localecompare is deprecated; use string.prototype.localecompare instead warning: string.match is deprecated; use string.prototype.match instead warning: string.normalize is ...
... strict'; var i, // we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', '
indexof', 'last
indexof', 'startswith', 'endswith', 'trim', 'trimleft', 'trimright', 'tolocalelowercase', 'normalize', 'tolocaleuppercase', 'localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', 'localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; st...
The arguments object - JavaScript
for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description note: if you're writing es6 compatible code, then rest parameters should be preferred. note: “array-like” means that arguments has a length property and properties
indexed from zero, but it doesn't have array's built-in methods like foreach() or map(). see §description for details. the arguments object is a local variable available within all non-arrow functions. you can refer to a function's arguments inside that function by using its arguments object. it has entries for each argument the function was called with, with the first entry's
index at 0. for examp...
... can use arguments.length to count how many arguments the function was called with. if you instead want to count how many parameters a function is declared to accept, inspect that function's length property. using typeof with arguments the typeof operator returns 'object' when used with arguments console.log(typeof arguments); // 'object' the type of individual arguments can be determined by
indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument properties arguments.callee reference to the currently executing function that the arguments belong to. forbidden in strict mode. arguments.length the number of arguments that were passed to the function. arguments[@@iterator] returns a new array iterator object that contains the values for each in...
Array.prototype[@@unscopables] - JavaScript
the @@unscopable symbol property contains property names that were not included in the ecmascript standard prior to the es2015 version. these properties are excluded from with statement bindings. description the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() find
index() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects. property attributes of array.prototype[@@unscopables] writable no enumerable no configurable yes examples use in with environments the following code works fine in es5 and below. however, in ecmascript 2015 and later, the array.prototype.keys() method was introdu...
...e the method and not the variable. this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with statement. var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "find
index", // "includes", "keys", "values"] specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@unscopables]' in that specification. ...
Array.prototype.copyWithin() - JavaScript
array to another location in the same array and returns it without modifying its length. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.copywithin(target[, start[, end]]) parameters target zero-based
index at which to copy the sequence to. if negative, target will be counted from the end. if target is at or greater than arr.length, nothing will be copied. if target is positioned after start, the copied sequence will be trimmed to fit arr.length. start optional zero-based
index at which to start copying elements from. if negative, start will be counted from the end. if start is omitted, copywith...
...the sequence to. if negative, target will be counted from the end. if target is at or greater than arr.length, nothing will be copied. if target is positioned after start, the copied sequence will be trimmed to fit arr.length. start optional zero-based
index at which to start copying elements from. if negative, start will be counted from the end. if start is omitted, copywithin will copy from
index 0. end optional zero-based
index at which to end copying elements from. copywithin copies up to but not including end. if negative, end will be counted from the end. if end is omitted, copywithin will copy until the last
index (default to arr.length). return value the modified array. description the copywithin works like c and c++'s memmove, and is a high-performance method to shift the ...
Array.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the
index of items in that array. the original array will not be modified. the source for this interactive demo is stored in a github repository. if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.slice([start[, end]]) parameters start optional zero-based
index at which to start extraction. a negative
index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. if start is undefined, slice starts from the
index 0. if start is greater than the ind...
...art[, end]]) parameters start optional zero-based
index at which to start extraction. a negative
index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. if start is undefined, slice starts from the
index 0. if start is greater than the
index range of the sequence, an empty array is returned. end optional zero-based
index before which to end extraction. slice extracts up to but not including end. for example, slice(1,4) extracts the second element through the fourth element (elements
indexed 1, 2, and 3). a negative
index can be used, indicating an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. if end is omitted, slice extracts thro...
Array.prototype.values() - JavaScript
syntax arr.values() return value a new array iterator object. examples iteration using for...of loop var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); for (let letter of iterator) { console.log(letter); } //"a" "b" "c" "d" "e" array.prototype.values is default implementation of array.prototype[symbol.iterator]. ...
...see iteration protocols. value: there are no values stored in the array iterator object; instead it stores the address of the array used in its creation and so depends on the values stored in that array. var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); console.log(iterator); // array iterator { } iterator.next().value; // "a" arr[1]=...
Atomics.add() - JavaScript
urns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.add(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to add a value to. value the number to add. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one of the ...
...typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to add a value to. value the number to add. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if
index is out of bounds in the typedarray. examples using add() const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); atomics.add(ta, 0, 12); // returns 0, the old value atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.add' in that specification. ...
Atomics.and() - JavaScript
urns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.and(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to compute the bitwise and. value the number to compute the bitwise and with. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror...
... description the bitwise and operation only yields 1, if both a and b are 1. ...
Atomics.compareExchange() - JavaScript
e expected value or not. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.compareexchange(typedarray,
index, expectedvalue, replacementvalue) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to exchange a value. expectedvalue the value to check for equality. replacementvalue the number to exchange. return value the old value at the given posi...
...replacementvalue) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to exchange a value. expectedvalue the value to check for equality. replacementvalue the number to exchange. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if
index is out of bounds in the typedarray. examples using compareexchange() const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); ta[0] = 7; atomics.compareexchange(ta, 0, 7, 12); // returns 7, the old value atomics.load(ta, 0); // 12 specifications ...
Atomics.exchange() - JavaScript
sition. this atomic operation guarantees that no other write happens between the read of the old value and the write of the new value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.exchange(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to exchange a value. value the number to exchange. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one ...
...rray. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to exchange a value. value the number to exchange. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if
index is out of bounds in the typedarray. examples using exchange() const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); atomics.exchange(ta, 0, 12); // returns 0, the old value atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.exchange' in that specification. ...
Atomics.or() - JavaScript
turns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.or(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to compute the bitwise or. value the number to compute the bitwise or with. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, ...
... description the bitwise or operation yields 1, if either a or b are 1. ...
Atomics.store() - JavaScript
the static atomics.store() method stores a given value at the given position in the array and returns that value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.store(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to store a value in. value the number to store. return value the value that has been stored. exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror,...
...pedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to store a value in. value the number to store. return value the value that has been stored. exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if
index is out of bounds in the typedarray. examples using store() var sab = new sharedarraybuffer(1024); var ta = new uint8array(sab); atomics.store(ta, 0, 12); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.store' in that specification. ...
Atomics.sub() - JavaScript
urns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.sub(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to subtract a value from. value the number to subtract. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not...
... one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to subtract a value from. value the number to subtract. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if
index is out of bounds in the typedarray. examples using sub const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); ta[0] = 48; atomics.sub(ta, 0, 12); // returns 48, the old value atomics.load(ta, 0); // 36 specifications specification ecmascript (ecma-262)the definition of 'atomics.sub' in that specification. ...
Atomics.wait() - JavaScript
the static atomics.wait() method verifies that a given position in an int32array still contains a given value and if so sleeps, awaiting a wakeup or a timeout. it returns a string which is either "ok", "not-equal", or "timed-out". note: this operation only works with a shared int32array and may not be allowed on the main thread. ...
...hat a given position in an int32array still contains a given value and if so sleeps, awaiting a wakeup or a timeout. it returns a string which is either "ok", "not-equal", or "timed-out". note: this operation only works with a shared int32array and may not be allowed on the main thread. syntax atomics.wait(typedarray,
index, value[, timeout]) parameters typedarray a shared int32array.
index the position in the typedarray to wait on. value the expected value to test. timeout optional time to wait in milliseconds. infinity, if no time is provided. return value a string which is either "ok", "not-equal", or "timed-out". exceptions throws a typeerror, if typedarray is not a shared int32array. throws a rangeerror, if
index is out of bounds in the typedarray. examples usin...
Atomics.xor() - JavaScript
urns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. 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 atomics.xor(typedarray,
index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array.
index the position in the typedarray to compute the bitwise xor. value the number to compute the bitwise xor with. return value the old value at the given position (typedarray[
index]). exceptions throws a typeerror...
... description the bitwise xor operation yields 1, if a and b are different. ...
NaN - JavaScript
...
...oing to be nan after it is coerced to a number, while the latter will return true only if the value is currently nan: isnan('hello world'); // true number.isnan('hello world'); // false additionally, some array methods cannot find nan, while others can. let arr = [2, 4, nan, 12]; arr.
indexof(nan); // -1 (false) arr.includes(nan); // true arr.find
index(n => number.isnan(n)); // 2 specifications specification ecmascript (ecma-262)the definition of 'nan' in that specification. ...
Object.getOwnPropertyNames() - JavaScript
array.prototype.filter() function to remove the enumerable keys (obtained with object.keys()) from a list of all keys (obtained with object.getownpropertynames()) thus giving only the non-enumerable keys as output. ...
... function to remove the enumerable keys (obtained with object.keys()) from a list of all keys (obtained with object.getownpropertynames()) thus giving only the non-enumerable keys as output. var target = myobject; var enum_and_nonenum = object.getownpropertynames(target); var enum_only = object.keys(target); var nonenum_only = enum_and_nonenum.filter(function(key) { var
indexinenum = enum_only.
indexof(key); if (
indexinenum == -1) { // not found in enum_only keys, // meaning that the key is non-enumerable, // so return true so we keep this in the filter return true; } else { return false; } }); console.log(nonenum_only); specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertynames' in that specification. ...
RegExp.prototype[@@search]() - JavaScript
string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.search](str) parameters str a string that is a target of the search. return value integer if successful, [@@search]() returns the
index of the first match of the regular expression inside the string. otherwise, it returns -1. description this method is called internally in string.prototype.search(). for example, the following two examples return the same result. 'abc'.search(/a/); /a/[symbol.search]('abc'); this method exists for customizing the search behavior in regexp subclasses. examples direct call this method can b...
... different this and the different arguments order. var re = /-/g; var str = '2016-01-02'; var result = re[symbol.search](str); console.log(result); // 4 using @@search in subclasses subclass of regexp can override [@@search]() method to modify the behavior. class myregexp extends regexp { constructor(str) { super(str) this.pattern = str; } [symbol.search](str) { return str.
indexof(this.pattern); } } var re = new myregexp('a+b'); var str = 'ab a+b'; var result = str.search(re); // string.prototype.search calls re[@@search]. console.log(result); // 3 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@search]' in that specification. ...
RegExp() constructor - JavaScript
his can also be another regexp object or literal (for the two regexp constructor notations only). patterns may include special characters to match a wider range of values than would a literal string. flags if specified, flags is a string that contains the flags to add. alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and last
index will be reset to 0) (as of es2015). if flags is not specified and a regular expressions object is supplied, that object's flags (and last
index value) will be copied over. flags may contain any combination of the following characters: g (global match) find all matches rather than stopping after the first match. i (ignore case) if u flag is also enabled, use unicode case folding. m...
... treat beginning and end characters (^ and $) as working over multiple lines. in other words, match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string. s ("dotall") allows . to match newlines. u (unicode) treat pattern as a sequence of unicode code points. (see also binary strings). y (sticky) matches only from the
index indicated by the last
index property of this regular expression in the target string. does not attempt to match from any later
indexes. examples literal notation and constructor there are two ways to create a regexp object: a literal notation and a constructor. the literal notation's parameters are enclosed between slashes and do not use quotation marks. the constructor function's para...
String.prototype.codePointAt() - JavaScript
ject = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; // `tointeger` var
index = position ? number(position) : 0; if (
index !=
index) { // better `isnan`
index = 0; } // account for out-of-bounds indices: if (
index < 0 ||
index >= size) { return undefined; } // get the first code unit var first = string.charcodeat(
index); var second; if ( // check if it’s the start of a surrogate pair first >= 0...
... { // better `isnan`
index = 0; } // account for out-of-bounds indices: if (
index < 0 ||
index >= size) { return undefined; } // get the first code unit var first = string.charcodeat(
index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size >
index + 1 // there is a next code unit ) { second = string.charcodeat(
index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; }; if (defineproperty) { definepro...
String.prototype.match() - JavaScript
n this case, the returned item will have additional properties as described below. additional properties as explained above, some results contain additional properties as described below. groups an object of named capturing groups whose keys are the names and values are the capturing groups or undefined if no named capturing groups were defined. see groups and ranges for more information.
index the
index of the search at which the result was found. input a copy of the search string. description if the regular expression does not include the g flag, str.match() will return the same result as regexp.exec(). other methods if you need to know if a string matches a regular expression regexp, use regexp.test(). if you only want the first match found, you might want to use regexp.ex...
...llowed by a decimal point and numeric character 0 or more times. the regular expression includes the i flag so that upper/lower case differences will be ignored. const str = 'for more information, see chapter 3.4.5.1'; const re = /see (chapter \d+(\.\d)*)/i; const found = str.match(re); console.log(found); // logs [ 'see chapter 3.4.5.1', // 'chapter 3.4.5.1', // '.1', //
index: 22, // input: 'for more information, see chapter 3.4.5.1' ] // 'see chapter 3.4.5.1' is the whole match. // 'chapter 3.4.5.1' was captured by '(chapter \d+(\.\d)*)'. // '.1' was the last value captured by '(\.\d)'. // the '
index' property (22) is the zero-based
index of the whole match. // the 'input' property is the original string that was parsed. using global and ignore case flags wi...
String.prototype.search() - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.search(regexp) parameters regexp a regular expression object. if a non-regexp object regexp is passed, it is implicitly converted to a regexp with new regexp(regexp). return value the
index of the first match between the regular expression and the given string, or -1 if no match was found. description when you want to know whether a pattern is found, and also know its
index within a string, use search(). (if you only want to know if it exists, use the similar test() method on the regexp prototype, which returns a boolean.) for more information (but slower execution) use match() ...
...or more information (but slower execution) use match() (similar to the regular expression exec() method). examples using search() the following example searches a string with two different regex objects to show a successful search (positive value) vs. an unsuccessful search (-1) let str = "hey jude" let re = /[a-z]/g let redot = /[.]/g console.log(str.search(re)) // returns 4, which is the
index of the first capital letter "j" console.log(str.search(redot)) // returns -1 cannot find '.' dot punctuation specifications specification ecmascript (ecma-262)the definition of 'string.prototype.search' in that specification. ...
Symbol.search - JavaScript
this function is called by the string.prototype.search() method. for more information, see regexp.prototype[@@search]() and string.prototype.search(). 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. ...
...xamples and send us a pull request. property attributes of symbol.search writable no enumerable no configurable no examples custom string search class caseinsensitivesearch { constructor(value) { this.value = value.tolowercase(); } [symbol.search](string) { return string.tolowercase().
indexof(this.value); } } console.log('foobar'.search(new caseinsensitivesearch('bar'))); // expected output: 3 specifications specification ecmascript (ecma-262)the definition of 'symbol.search' in that specification. ...
TypedArray.prototype.copyWithin() - JavaScript
the copywithin() method copies the sequence of array elements within the array to the position starting at target. the copy is taken from the
index positions of the second and third arguments start and end. the end argument is optional and defaults to the length of the array. this method has the same algorithm as array.prototype.copywithin. typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rototype.copywithin. typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start
index position where to copy the elements to. start source start
index position where to start copying elements from. end optional optional. source end
index position where to end copying elements from. return value the modified array. description see array.prototype.copywithin for more details. examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); u...
TypedArray.prototype.map() - JavaScript
repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.map(mapfn[, thisarg]) parameters mapfn a callback function that produces an element of the new typed array, taking three arguments: currentvalue the current element being processed in the typed array.
index optional the
index of the current element being processed in the typed array. array optional the typed array map() was called upon. thisarg optional value to use as this when executing mapfn. return value a new typed array. description the map() method calls a provided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array fro...
...nt being processed in the typed array. array optional the typed array map() was called upon. thisarg optional value to use as this when executing mapfn. return value a new typed array. description the map() method calls a provided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array from the results. mapfn is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes that are undefined, those which have been deleted, or which have never been assigned values. mapfn is invoked with three arguments: the value of the element, the
index of the element, and the typed array object being traversed. if a thisarg parameter is provided to map(), it will be passed to mapfn when invoked, for ...
TypedArray.prototype.reduce() - JavaScript
-examples and send us a pull request. syntax typedarray.reduce(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. description the reduce method executes the callback function once for each element present in the typed array, exclud...
... as the first argument to the first call of the callback. return value the value that results from the reduction. description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current
index, and the typed array over which iteration is occurring. the first time the callback is called, previousvalue and currentvalue can be one of two values. if initialvalue is provided in the call to reduce, then previousvalue will be equal to initialvalue and currentvalue will be equal to the first value in the typed array. if no initialvalue was provided, then previousvalue will be equal to the fir...
TypedArray.prototype.reduceRight() - JavaScript
e of the typed array types here. syntax typedarray.reduceright(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array.
index the
index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. description the reduceright method executes the callback function once for each element present in the typed array, e...
...he first argument to the first call of the callback. return value the value that results from the reduction. description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current
index, and the typed array over which iteration is occurring. the call to the reduceright callback would look something like this: typedarray.reduceright(function(previousvalue, currentvalue,
index, typedarray) { // ... }); the first time the function is called, the previousvalue and currentvalue can be one of two values. if an initialvalue was provided in the call to reduceright, then previousva...
WebAssembly.Table.prototype.get() - JavaScript
examples using get the following example (see table.html on github, and view it live also) compiles and instantiates the loaded table.wasm byte code using the webassembly.instantiatestreaming() method. ...
... examples using get the following example (see table.html on github, and view it live also) compiles and instantiates the loaded table.wasm byte code using the webassembly.instantiatestreaming() method. ...
WebAssembly.Table - JavaScript
ebassembly. note: tables can currently only store function references, but this will likely be expanded in the future. constructor webassembly.table() creates a new table object. instance properties table.prototype.length returns the length of the table, i.e. the number of elements. instance methods table.prototype.get() accessor function — gets the element stored at a given
index. table.prototype.grow() increases the size of the table instance by a specified number of elements. table.prototype.set() sets an element stored at a given
index to a given value. examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an initial size of 2 elements. we then print ...
... of the table instance by a specified number of elements. table.prototype.set() sets an element stored at a given
index to a given value. examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an initial size of 2 elements. we then print out the table length and contents of the two
indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null. var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an import object that contains the table: var importobj = { js: { tbl:tbl } }; finally, we load and inst...
WebAssembly.instantiate() - JavaScript
bassembly.memory objects. there must be one matching property for each declared import of the compiled module or else a webassembly.linkerror is thrown. return value a promise that resolves to a resultobject which contains two fields: module: a webassembly.module object representing the compiled webassembly module. this module can be instantiated again, shared via postmessage() or cached in
indexeddb. instance: a webassembly.instance object that contains all the exported webassembly functions. exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown. if the operation fails, the promise rejects with a webassembly.compileerror, webassembly.linkerror, or webassembly.runtimeerror, depending on the cause of the failure. secondary overload ...
...ported webassembly function that is exported by the instance. var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(result => result.instance.exports.exported_func() ); note: you can also find this example at
index.html on github (view it live also). second overload example the following example (see our
index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage(). var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod ...
Progressive web app structure - Progressive web apps (PWAs)
gress and not yet fully available in any of the major browsers. when it is available, it will be the fastest way of serving the content — the benefits are going to be huge in terms of performance. for working examples and more information, see the streams api documentation. structure of our example application the js13kpwa website structure is quite simple: it consists of a single html file (
index.html) with basic css styling (style.css), and a few images, scripts, and fonts. the folder structure looks like this: the html from the html point of view, the app shell is everything outside the content section: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to ...
...cation, 30000); } the service worker the last file we will quickly look at is the service worker: sw.js — it first imports data from the games.js file: self.importscripts('data/games.js'); next, it creates a list of all the files to be cached, both from the app shell and the content: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/
index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduate.eot', '/pwa-examples/js13kpwa/fonts/graduate.ttf', '/pwa-examples/js13kpwa/fonts/graduate.woff', '/pwa-examples/js13kpwa/favicon.ico', '/pwa-examples/js13kpwa/img/js13kgames.png', '/pwa-examples/js13kpwa/img/bg.png', '/pwa-examples/js13kpwa/icons/icon-32.png', '/p...
Structural overview of progressive web apps - Progressive web apps (PWAs)
api isn't yet fully supported by any of the major browsers. once it's available, however, it will be the fastest way to serve your app's content. the performance benefits will be truly spectacular. for working examples and more information, see the streams api documentation. structure of a sample application the js13kpwa web site's structure is quite simple. it consists of a single html file (
index.html), with basic css styling provided in style.css. also included are a few images, scripts, and fonts. the file and folder hierarchy looks like this: app.js data/ games.js img/ favicon.ico fonts/ icons/ img/ bg.png js13kgames.png
index.html js13kpwa.webmanifest style.css sw.js the html the html in the file
index.html creates the structure of the app. the par...
..., which is found in the file sw.js. this script begins by importing data from the file games.js in the data directory: self.importscripts("data/games.js"); then it creates a list of all the files that the service worker needs to cache. ...
Progressive web apps (PWAs)
ining a simple example and showing you how all the pieces work. introduction to progressive web apps progressive web app structure making pwas work offline with service workers how to make pwas installable how to make pwas re-engageable using notifications and push progressive loading technology guides client-side storage — a lengthy guide showing how and when to use web storage,
indexeddb, and service workers. using service workers — a more in-depth guide covering the service worker api. using
indexeddb — the fundamentals of
indexeddb, explained in detail. using the web storage api — the web storage api made simple. instant loading web apps with an application shell architecture — a guide to using the app shell coding pattern to create apps that load quickly. usin...
...modern app layout. mobile first — often when creating responsive application layouts, it makes sense to create the mobile layout as the default, and build wider layouts on top. add to home screen guide — learn how your apps can take advantage of add to home screen (a2hs). tools localforage — a nice simple javascript library for making client-side data storage really simple; it uses
indexeddb by default and falls back to web sql/web storage if necessary. serviceworkerware — an express-like microframework for easy service worker development. oghliner — not only a template but a tool for deploying offline web apps to github pages. sw-precache — a node module to generate service worker code that will precache specific resources. workbox — spiritual successor to sw-precach...
SVG Core Attributes - SVG: Scalable Vector Graphics
its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. ...
...non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the format defined in the tags for identifying languages (bcp47) ietf document. svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no tab
index the tab
index svg attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation. value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document. value type: <iri>; animatable: no xml:lang it is a universal attribute allowed in all xml dialects to m...
SVG Attribute reference - SVG: Scalable Vector Graphics
shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tab
index tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y vert-origin-x vert-origin-y viewbox viewtarget...
... xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate presentation attributes note that all svg presentation attributes can be used as css properties. alignment-...
<symbol> - SVG: Scalable Vector Graphics
rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-...
...opeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
<title>xtech svg demo</title> <style> stop.begin { stop-color:yellow; } stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-
index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" st...
...the only interesting part is the <...
Same-origin policy - Web security
ed it. data: urls get a new, empty, security context. exceptions in internet explorer internet explorer has two major exceptions to the same-origin policy: trust zones if both domains are in the highly trusted zone (e.g. corporate intranet domains), then the same-origin limitations are not applied. port ie doesn't include port into same-origin checks. therefore, https://company.com:81/
index.html and https://company.com/
index.html are considered the same origin and no restrictions are applied. these exceptions are nonstandard and unsupported in any other browser. changing origin a page may change its own origin, with some limitations. a script can set the value of document.domain to its current domain or a superdomain of its current domain. if set to a superdomain of the current ...
...o more properties than the above. location the following cross-origin access to location properties is allowed: methods location.replace attributes urlutils.href write-only. some browsers allow access to more properties than the above. cross-origin data storage access access to data stored in the browser such as web storage and
indexeddb are separated by origin. each origin gets its own separate storage, and javascript in one origin cannot read from or write to the storage belonging to another origin. cookies use a separate definition of origins. a page can set a cookie for its own domain or any parent domain, as long as the parent domain is not a public suffix. firefox and chrome use the public suffix list to determine if a...
Using shadow DOM - Web Components
reate a shadow root let shadow = this.attachshadow({mode: 'open'}); creating the shadow dom structure next, we use some dom manipulation to create the element's internal shadow dom structure: // create spans let wrapper = document.createelement('span'); wrapper.setattribute('class', 'wrapper'); let icon = document.createelement('span'); icon.setattribute('class', 'icon'); icon.setattribute('tab
index', 0); let info = document.createelement('span'); info.setattribute('class', 'info'); // take attribute content and put it inside the info span let text = this.getattribute('data-text'); info.textcontent = text; // insert icon let imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } let img = document.createelement('img'); img.src =...
... create some css to apply to the shadow dom let style = document.createelement('style'); style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; position: absolute; bottom: 20px; left: 10px; z-
index: 3; } img { width: 1.2rem; } .icon:hover + .info, .icon:focus + .info { opacity: 1; }`; attaching the shadow dom to the shadow root the final step is to attach all the created elements to the shadow root: // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); using our custom elemen...
Using the WebAssembly JavaScript API - WebAssembly
through some examples that explain how to use the webassembly javascript api, and how to use it to load a wasm module in a web page. note: you can find the sample code in our webassembly-examples github repo. preparing the example first we need a wasm module! grab our simple.wasm file and save a copy in a new directory on your local machine. next, let’s create a simple html file called
index.html in the same directory as your wasm file (can use our simple template if you haven’t got one easily available). now, to help us understand what is going on here, let’s look at the text representation of our wasm module (which we also meet in converting webassembly format to wasm): (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i3...
...on references are necessary to compile languages like c/c++ that have function pointers. in a native implementation of c/c++, a function pointer is represented by the raw address of the function’s code in the process’s virtual address space and so, for the safety reasons mentioned above, cannot be stored directly in linear memory. instead, function references are stored in a table and their
indexes, which are integers and can be stored in linear memory, are passed around instead. when the time comes to call a function pointer, the webassembly caller supplies the
index, which can then be safety bounds checked against the table before
indexing and calling the
indexed function reference. thus, tables are currently a rather low-level primitive used to compile low-level programming language ...
addon-page - Archive of obsolete content
. note: this module has no effect on fennec. for pages like this, navigational elements such as the awesome bar, search bar, or bookmarks toolbar are not usually relevant and distract from the content you are presenting. the addon-page module provides a simple way to have a page which excludes these elements. to use the module import it using require(). after this, the page loaded from "data/
index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("
index.html")); this only affects the page at "data/
index.html": all other pages are displayed normally. ...
page-mod - Archive of obsolete content
attached to a page-mod: var workers = []; var pagemod = require("sdk/page-mod").pagemod({ include: ['*'], contentscriptwhen: 'ready', contentscriptfile: data.url('pagemod.js'), onattach: function(worker) { workers.push(worker); } }); you can remove workers when they are no longer valid by listening to detach: var workers = []; function detachworker(worker, workerarray) { var
index = workerarray.
indexof(worker); if(
index != -1) { workerarray.splice(
index, 1); } } var pagemod = require("sdk/page-mod").pagemod({ include: ['*'], contentscriptwhen: 'ready', contentscriptfile: data.url('pagemod.js'), onattach: function(worker) { workers.push(worker); worker.on('detach', function () { detachworker(this, workers); }); } }); cleaning up on add-...
Images in HTML - Learn web development
k primer on urls and paths to refresh your memory on relative and absolute urls before continuing. so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could embed the image like so: <img src="dinosaur.jpg"> if the image was in an images subdirectory, which was inside the same directory as the html page (which google recommends for seo/
indexing purposes), then you'd embed it like this: <img src="images/dinosaur.jpg"> and so on. note: search engines also read image filenames and count them towards seo. therefore, you should give your image a descriptive filename; dinosaur.jpg is better than img835.png. you could embed the image using its absolute url, for example: <img src="https://www.example.com/images/dinosaur.jpg"> but thi...
Video and audio content - Learn web development
miro video converter and audacity. we'd like you to have a go! if you are unable to source any video or audio, then you can feel free to use our sample audio and video files to carry out this exercise. you can also use our sample code for reference. we would like you to: save your audio and video files in a new directory on your computer. create a new html file in the same directory, called
index.html. add <audio> and <video> elements to the page; make them display the default browser controls. give both of them <source> elements so that browsers will find the audio format they support best and load it. these should include type attributes. give the <video> element a poster that will be displayed before the video starts to be played. have fun creating your own poster graphic. for an ...
Introducing asynchronous JavaScript - Learn web development
cumstance. so you could have different actions to run on the response downloaded, such as processjson(), displaytext(), etc. note that not all callbacks are async — some run synchronously. an example is when we use array.prototype.foreach() to loop through the items in an array (see it live, and the source): const gods = ['apollo', 'artemis', 'ares', 'zeus']; gods.foreach(function (eachname,
index){ console.log(
index + '. ' + eachname); }); in this example we loop through an array of greek gods and print the
index numbers and values to the console. the expected parameter of foreach() is a callback function, which itself takes two parameters, a reference to the array name and
index values. however, it doesn't wait for anything — it runs immediately. promises promises are the new styl...
Graceful asynchronous programming with Promises - Learn web development
not really very async. the asynchronous nature is basically faked using settimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error handling, etc. one example we'd like to invite you to study, which does show a useful async application of the promise() constructor, is jake archibald's idb library. this takes the
indexeddb api, which is an old-style callback-based api for storing and retrieving data on the client-side, and allows you to use it with promises. in the code you'll see the same kind of techniques we discussed above being used there. the following block converts the basic request model used by many
indexeddb methods to use promises (see this code, for example). conclusion promises are a good way to...
Looping code - Learn web development
the loop has run, 1 will be added to i (i++), then the process will start again. when i becomes equal to cats.length (in this case, 5), the loop will stop, and the browser will move on to the next bit of code below the loop. note: we have made the condition i < cats.length, not i <= cats.length, because computers count from 0, not 1 — we are starting i at 0, and going up to i = 4 (the
index of the last array item). cats.length returns 5, as there are 5 items in the array, but we don't want to get up to i = 5, as that would return undefined for the last item (there is no array item with an
index of 5). so, therefore, we want to go up to 1 less than cats.length (i <), not the same as cats.length (i <=). note: a common mistake with conditions is making them use "equal to" (===) rath...
Fetching data from the server - Learn web development
we don't need anything more than a simple console.log(). you can test the fail case yourself: make a local copy of the example files (download and unpack the can-store zip file). run the code through a web server (as described above, in serving your example from a server). modify the path to the file being fetched, to something like 'produc.json' (make sure it is misspelled). now load the
index file in your browser (via localhost:8000) and look in your browser developer console. you'll see a message similar to "network request for produc.json failed with response 404: file not found". the second fetch block can be found inside the fetchblob() function: fetch(url).then(function(response) { return response.blob(); }).then(function(blob) { // convert the blob to an object url — ...
Test your skills: Arrays - Learn web development
o recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 3 for this final array task, we provide you with a starting array, and you will work in somewhat the opposite direction. you need to: remove the last item in the array. add two new names to the end of the array. go over each item in the array and add its
index number after the name inside parentheses, for example ryu (0). note that we don't teach how to do this in the arrays article, so you'll have to do some research. finally, join the array items together in a single string called mystring, with a separator of " - ". try updating the live code below to recreate the finished example: download the starting point for this task to work in your own...
Test your skills: Strings - Learn web development
rectly? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. strings 2 in this task you are provided with two variables, quote and substring, which contain two strings. we would like you to: retrieve the length of the quote, and store it in a variable called quotelength. find the
index position where substring appears in quote, and store that value in a variable called
index. use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and store it in a variable called revisedquote. try updating the live code below to recreate the finished example: download the starting point ...
Storing the information you need — Variables - Learn web development
ed in square brackets and separated by commas. try entering the following lines into your console: let mynamearray = ['chris', 'bob', 'jim']; let mynumberarray = [10, 15, 40]; once these arrays are defined, you can access each value by their location within the array. try these lines: mynamearray[0]; // should return 'chris' mynumberarray[2]; // should return 40 the square brackets specify an
index value corresponding to the position of the value you want returned. you might have noticed that arrays in javascript are zero-
indexed: the first element is at
index 0. you'll learn a lot more about arrays in a future article. objects in programming, an object is a structure of code that models a real-life object. you can have a simple object that represents a box and contains information about...
Adding features to our bouncing balls demo - Learn web development
the previous article as a starting point, and add some new and interesting features to it. prerequisites: before attempting this assessment you should have already worked through all the articles in this module. objective: to test comprehension of javascript objects and object-oriented constructs starting point to get this assessment started, make a local copy of
index-finished.html, style.css, and main-finished.js from our last article in a new directory in your local computer. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html, css and javascript into one of these online editors. if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> e...
JavaScript object basics - Learn web development
] to name.first name.last otherwise your methods will no longer work. bracket notation there is another way to access object properties — using bracket notation. instead of using these: person.age person.name.first you can use person['age'] person['name']['first'] this looks very similar to how you access the items in an array, and it is basically the same thing — instead of using an
index number to select an item, you are using the name associated with each member's value. it is no wonder that objects are sometimes called associative arrays — they map strings to values in the same way that arrays map numbers to values. setting object members so far we've only looked at retrieving (or getting) object members — you can also set (update) the value of object members by simply de...
Object building practice - Learn web development
s knowledge of these apis, and we hope that by the time you've finished this article you'll be interested in exploring them more. along the way we'll make use of some nifty objects, and show you a couple of nice techniques like bouncing balls off walls, and checking whether they have hit each other (otherwise known as collision detection). getting started to begin with, make local copies of our
index.html, style.css, and main.js files. these contain the following, respectively: a very simple html document featuring an <h1> element, a <canvas> element to draw our balls on, and elements to apply our css and javascript to our html. some very simple styles, which mainly serve to style and position the <h1>, and get rid of any scrollbars or margin around the edge of the page (so that it looks ...
Object prototypes - Learn web development
r javascript — try looking for the methods and properties defined on the prototype of the string, date, number, and array global objects, for example. these all have a number of members defined on their prototype, which is why for example when you create a string, like this: let mystring = 'this is my string.'; mystring immediately has a number of useful methods available on it, like split(),
indexof(), replace(), etc. note: it is worth reading our more in-depth guide to "using prototypes in javascript", once you've made sense of this section and wish to know more. this section is intentionally simplified to make these concepts a little easier to understand when you first meet them. important: the prototype property is one of the most confusingly-named parts of javascript — you might...
What is web performance? - Learn web development
ntioned above, you really should understand some specifics about how browsers work. this includes: how the browser works. when you request a url and hit enter / return, the browser finds out where the server is that holds that website's files, establishes a connection to it, and requests the files. see populating the page: how the browser works for a detailed overview. source order. your html
index file's source order can significantly affect performance. the download of additional assets linked to from the
index file is generally sequential, based on source order, but this can be manipulated and should definitely be optimized, realizing that some resources block additional downloads until their content is parsed and executed. the critical path. this is the process that the browser uses to...
Getting started with Ember - Learn web development
his would require url rewrites at build time and therefore be less efficient and more complicated to set up). in ember-cli-build.js, find the following code: let app = new emberapp(defaults, { // add options here }); add the following lines underneath it before saving the file: app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/
index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies. finally, find app.css, located at app/styles/app.css, and paste in the following: :focus, .view label:focus, .todo-list li .toggle:focus + label, .toggle-all:focus + label { /* !important needed bec...
JSErrorReport
or-reporting mechanism. syntax jserrorreport(); properties name type description filename const char * indicates the source file or url that produced the error condition. if null, the error is local to the script in the current html page. lineno unsigned line number in the source that caused the error. column unsigned zero-based column
index in line in the source that caused the error. ismuted bool the web platform allows scripts to be loaded from arbitrary cross-origin sources. this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its conte...
JSFunctionSpec
with an object. an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_initclass to create the functions and assign them to an object. jsfunctionspec can also be used to define an array element rather than a named property. array elements are actually individual properties. to define an array element, cast the element's
index value to const char*, initialize the name field with it, and specify the jsprop_
index attribute in flags. to define an array of jspropertyspec, use js_fs, js_fn, js_sym_fn, js_fninfo, js_self_hosted_fn, js_self_hosted_sym_fn, js_sym_fnspec, js_fnspec, and js_fs_end. see also mxr id search for jsfunctionspec jspropertyspec jsnative js_fs js_fn js_sym_fn js_fninfo js_self_hosted_fn js_sel...
JSNewResolveOp
ol (* jsnewresolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type description cx jscontext * pointer to the js context in which the property access is taking place. obj js::handleobject pointer to the object whose properties are being accessed. id js::handleid name or
index of the property being accessed. flags uint32_t obsolete since jsapi 31 flags giving contextual information about the ongoing property access. objp js::mutablehandleobject out parameter. on success, the resolve hook must set *objp to the object in which the property has been defined, or null if it was not defined. description like jsresolveop, but flags provide ...
JSObjectOps.defineProperty
tax jsbool (*jsdefinepropop)(jscontext *cx, jsobject *obj, jsid id, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * pointer to the js context in which the property is being defined. obj jsobject * the object on which the property is being defined. id jsid the name or
index of the property to define. value jsval the initial value for the new property. getter jspropertyop the getter for the new property. setter jspropertyop the setter for the new property. attrs unsigned int the property attributes for the new property. description define obj[id], an own property of obj named id, having the given ini...
JSObjectOps.getAttributes
a property. syntax typedef jsbool (*jsattributesop)(jscontext *cx, jsobject *obj, jsid id, jsproperty *prop, unsigned int *attrsp); name type description cx jscontext * pointer to the js context in which the property access is happening. obj jsobject * the object whose property attributes are being accessed. id jsid the name or
index of the property whose attributes are being accessed. prop jsproperty * the property whose attributes are being accessed. this may be null. attrsp unsigned int * in/out parameter. see the description section below. description get or set attributes of the property obj[id]. returns js_false on error or exception, else js_true with current attributes in *attrsp.
JSObjectOps.getProperty
lled during property accesses and don't have to implement any of that. syntax typedef jsbool (*jspropertyidop)( jscontext *cx, jsobject *obj, jsid id, jsval *vp); name type description cx jscontext * pointer to the js context in which the property access is happening. obj jsobject * the object to be accessed. id jsid the name or
index of the property to access. vp jsval * in/out parameter. see the description section below. description get, set, or delete obj[id], returning js_false on error or exception, js_true on success. if getting or setting, the new value is returned in *vp on success. if deleting without error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct p...
JSObjectOps.lookupProperty
ot call lookupproperty). syntax typedef jsbool (*jslookuppropop)(jscontext *cx, jsobject *obj, jsid id, jsobject **objp, jsproperty **propp); name type description cx jscontext * pointer to the js context in which the property lookup is happening. obj jsobject * the object whose properties are being searched. id jsid the name or
index of the property to look up. objp jsobject ** out parameter. if the property is found, the callback stores the object on which the property was found in *objp. propp jsproperty ** out parameter. on success, the callback stores in *propp a pointer to the property, if it exists, or null if it doesn't. description look for id in obj and its prototype chain, retur...
JSObjectOps.setProto
setobjectslotop. syntax typedef jsbool (*jssetobjectslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsobject *pobj); name type description cx jscontext * pointer to the js context in which the object's prototype or parent is being modified. obj jsobject * the object whose prototype or parent is being modified. slot uint32 the
index of the slot being modified: jsslot_proto for the jsobjectops.setproto callback, and jsslot_parent for the jsobjectops.setparent callback. pobj jsobject * the new prototype or parent object. description these hooks must check for cycles without deadlocking, and otherwise take special steps. see js_setprototype or js_setparent in js/src/jsobj.cpp for an example. ...
JSPropertyOp
jscontext * the context in which the property access is taking place. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being accessed. id js::handleid the name or
index of the property being accessed. this is either a string (unicode property identifier) or an integer (element
index). strict bool (jsstrictpropertyop only) if strict is true, treating the assignment as strict mode code. vp js::mutablehandlevalue in/out parameter. points to a js::value variable. the meaning of this variable is different for each of the hooks; see below...
JSResolveOp
f bool (* jsresolveop)(jscontext *cx, js::handleobject obj, js::handleid id); // obsolete since jsapi 36 name type description cx jscontext * pointer to the js context in which the property access is taking place. obj js::handleobject pointer to the object whose properties are being accessed. id js::handleid the name or
index of the property being resolved. resolvedp bool * out parameter. receives the result of resolve operation. description jsresolveop callback is a hook which is called when a property is not found on an object. it resolves a lazy property named by id in obj by defining it directly in obj. lazy properties are those reflected from some peer native property space (e.g., the dom ...
JS_AddExternalStringFinalizer
anymore and will not keep a pointer to it. the callback may not keep a reference to this jsstring, as its memory is about to be freed. description add a finalizer for external strings created by js_newexternalstring using a type-code returned from this function, and that understands how to free or release the memory pointed at by js_getstringchars(str). returns a nonnegative type
index if there is room for finalizer in the global gc finalizers table, else returns -1. in a js_threadsafe build, this function must be invoked on the primordial thread only, at startup—or else the entire program must single-thread itself while loading a module that calls this function. to remove an external string finalizer, use js_removeexternalstringfinalizer. see also js_removeexternalstrin...
JS_CheckAccess
*obj, jsid id, jsaccessmode mode, jsval *vp, unsigned int *attrsp); name type description cx jscontext * the context in which to perform the access check. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object that has the property being accessed. id jsid the name or
index of the property being accessed. mode jsaccessmode the type of access requested (read, write, etc.) vp jsval * out parameter. on success, *vp receives the property's stored value. attrsp unsigned int * out parameter. on success, *attrsp receives the property attributes. description js_checkaccess determines whether the property of obj given by i...
JS_FS
bol, selfhostedname, nargs, flags) ... // added in spidermonkey 38 #define js_sym_fnspec(symbol, call, info, nargs, flags, selfhostedname) ... // added in spidermonkey 38 #define js_fnspec(name,call,info,nargs,flags,selfhostedname) ... // added in spidermonkey 31 #define js_fs_end ... name type description name const char * the javascript name for the function. (or
index, if jsprop_
index is present in flags) symbol a member name of js::symbolcode the javascript symbol for the function. call jsnative pointer to the c/c++ implementation of the function. info const jsjitinfo * pointer to the jit info. nargs uint16_t the number of arguments the function expects. flags uint16 the bitwise or of ...
JS_ForwardGetPropertyTo
this article covers features introduced in spidermonkey 17 find a specified property and retrieve its value. syntax bool js_forwardgetpropertyto(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject onbehalfof, js::mutablehandlevalue vp); bool js_forwardgetelementto(jscontext *cx, js::handleobject obj, uint32_t
index, js::handleobject onbehalfof, js::mutablehandlevalue vp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. id or
index js::handleid or uint32_t name or
index of the property to look up. ...
JS_HasElement
determine whether a javascript array has an element in the specified
index. syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t
index, bool *foundp); name type description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element.
index uint32_t
index of the element to look up. foundp bool * out parameter. on success, it stores true to *foundp, false otherwise. description js_haselement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered
index. if the element exists, js_ha...
JS_IdArrayGet
this article covers features introduced in spidermonkey 17 get the item of a jsidarray. syntax jsid js_idarrayget(jscontext *cx, jsidarray *ida, unsigned
index) name type description cx jscontext * a context. ida jsidarray * the jsidarray to get the length.
index unsigned the
index of the id in the jsidarray. description js_idarrayget gets the item in the specified
index of the id array pointed to by ida. see also mxr id search for js_idarrayget jsidarray js_idarraylength bug 641027 ...
JS_LookupProperty
bool js_lookupucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::mutablehandlevalue vp); bool js_lookuppropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::mutablehandlevalue vp); // ---- obsolete since spidermonkey 31 ---- bool js_lookuppropertywithflags(jscontext *cx, js::handleobject obj, const char *name, unsigned flags, js::mutablehandlevalue vp); bool js_lookuppropertywithflagsbyid(jscontext *cx, js::handleobject obj, js::handleid id, unsigned flags, js::mutable...
JS_NewArrayObject
array(length). the new array has the specified length, but it doesn't have any elements. on success, js_newarrayobject returns the new array object. otherwise it reports an error as though by calling js_reportoutofmemory and returns null. obsolete since jsapi 30. js_newarrayobject with length parameter creates a new array object with the specified length. if vector is non-null, then for each
index i from 0 to length - 1, js_newarrayobject defines an enumerable array element with the value vector[i] on the new array. (this means that if length is nonzero and vector is null, the result is like the javascript expression new array(length). the new array has the specified length, but it doesn't have any elements.) it is often better to call js_newarrayobject(cx, 0, null), store the returned ob...
JS_NewDependentString
g str, size_t start, size_t length); name type description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring the string containing the characters for the new string. start size_t the start
index of the substring. length size_t length of the substring, in characters. description js_newdependentstring creates a new string as a substring of an existing javascript string, str. the new string contains the same characters as if it were created with the javascript method str.substr(start, length). the characters are not copied. instead, the new string shares str's existing ...
JS_NewRegExpObject
racters. flags unsigned regular expression flags. see below. flags name description regexp constructor flag jsreg_fold fold uppercase to lowercase. i jsreg_glob global execution, creates array of matches. g jsreg_multiline treat ^ and $ as begin and end of line. m jsreg_sticky only match starting at last
index. y description js_newregexpobject and js_newucregexpobject create a new regexp instance. the flags from the built-in regexp constructor properties ignorecase, global, multiline, and sticky are or'd in with the provided flags parameter. js_newregexpobjectnostatics and js_newucregexpobjectnostatics create a new regexp instance. they do not or in any regexp constructor properties. see...
JS_NextProperty
description cx jscontext * the js context in which to enumerate properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. iterobj js::handleobject the opaque iterator object returned by a previous call to js_newpropertyiterator. idp js::mutablehandleid out parameter. on success, *idp receives the name or
index of the next property name; or jsid_void if there are no more enumerable properties to visit. description on success, js_nextproperty returns true, with *idp containing the id of the next enumerable own property to visit using iterobj, or jsid_void if there is no such property left to visit. on error, it returns false, and the value left in *idp is undefined. see also bug 1081660 ...
JS_PSGS
s_psg(name, getter, flags) ... #define js_psgs(name, getter, setter, flags) ... #define js_self_hosted_get(name, gettername, flags) ... // added in spidermonkey 31 #define js_self_hosted_getset(name, gettername, settername, flags) ... // added in spidermonkey 31 #define js_ps_end ... name type description name const char * the javascript name for the property. (or
index, if jsprop_
index is present in flags) getter jsnative pointer to the c/c++ implementation of the getter function. setter jsnative pointer to the c/c++ implementation of the setter function. flags uint16 the bitwise or of any number of property attributes. gettername const char * the function's name in self-hosted javascript code for gett...
JS_ParseJSON
js_parsejsonwithreviver(jscontext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp); name type description cx jscontext * pointer to a js context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ch jsobject * the object to be searched. chars const jschar * the characters of the string. len uint32 the length of the string.
index jsint (in js_parsejsonwithreviver only) a reviver function to apply to the created value after parsing; see json.parse. vp jsval * out parameter. *vp receives the value after parsing (and optionally, processing by the reviver). if an error occurs, the value left in *vp is undefined. description use these functions to parse a sequence of characters as json. the parsing rules applied by these...
JS_SetArrayLength
r of elements, or to change the number of elements allocated for an array. if you set a shorter array length on an existing array, the elements that no longer fit in the array are destroyed. setting the number of array elements does not initialize those elements. to initialize an element call js_defineelement. if you call js_setarraylength on an existing array, and length is less than the highest
index number for previously defined elements, all elements greater than or equal to length are automatically deleted. on success, js_setarraylength returns true. otherwise it returns false. see also mxr id search for js_setarraylength js_defineelement js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setelement ...
JS_SetPropertyAttributes
integer containing the attribute value to set. it is the bitwise or of zero or more of the following values: flag purpose jsprop_enumerate property is visible in for and in loops. jsprop_readonly property is read only. jsprop_permanent property cannot be deleted. jsprop_exported property can be imported by other objects. jsprop_
index property is actually an
index into an array of properties, and is cast to a const char *. if js_setpropertyattributes cannot locate an object with the specified property, it returns js_false, and the value left in *foundp is undefined. if the specified property or the specified object does not exist, foundp is set to js_false. then, if the property exists, but is associated with a diff...
Shell global objects
ehaviour ensures that a falsy value means that we are not in ion, but expect a compilation to occur in the future. conversely, a truthy value means that we are either in ion or that there is litle or no chance of ion ever compiling the current script. assertjitstackinvariants() iterates the jit stack and check that stack invariants hold. setcompileroption(option, number) set a compiler option
indexed in jscompileoption enum to a number. setioncheckgraphcoherency(bool) set whether ion should perform graph consistency (debug-only) assertions. these assertions are valuable and should be generally enabled, however they can be very expensive for large (wasm) programs. serialize(data, [transferables, [policy]]) serialize data using js_writestructuredclone. returns a structured clone buffer ob...
TPS Tests
helpful. (note that the python testrunner will generally still kill firefox after a tps test runs for 5 or so minutes, so it's often helpful to kill the python testrunner outright, and then use aboutsync in a different instance of the browser). a tps failure may not point directly to the problem. for example, most errors involving bookmarks look like "places item not found in expected
index", which could mean a number of issues. the other engines are similarly unhelpful, and will likely fail if there's any problem, without really indicating what the problem is. it's common for the phase after the problem to be the one reporting errors (e.g. if one phase doesn't upload what it should, we won't notice until the next phase). tps runs one "cleanup" phase for each profile (even ...
Gecko object attributes
called "cycles", which moves to the next option in the same way a manual click does. applied to: role_cell for the <xul:tree/> note: it's not exposed currently table related attributes layout-guess true when gecko's heuristic determines that it is a table that is probably used for layout, not for table. value not set means it is probably a data table. applied to: role_table table-cell-
index the
index of the table cell accessible. use nsiaccessibletable and nsiaccessibletablecell instead. applied to role_cell hypertext attributes formatting "block" if the object uses block formatting, and thus starts on a new line and ends with a hard line break that is not visible in the actual text. for example, a heading, paragraph, or list item is typically formatted as a block, but t...
Using the Places livemark service
-1); the first parameter is the id of the folder in which to create the livemark. the second parameter is the livemark's name as it will appear in the bookmark's title. the third parameter is the uri of the site the livemark was created from (specified as an nsiuri object. fourth argument is the uri of the actual rss feed. the last argument takes in the
index to insert at, or -1 to append the new livemark to the end of the folder. you can convert a string into an nsiuri using nsiioservice. when creating livemarks during startup, you should use the nsilivemarkservice.createlivemarkfolderonly() to avoid http traffic. this creates the encapsulating livemark without actually fetching the rss feed's contents. var bmsvc = components.classes["@mozilla.org/b...
Creating a Python XPCOM component
ef write(self): print self.yourname def change(self, newname): self.yourname = newname then register your component; the procedure is the same for any component, but will not work if python components weren't enabled. to register the component, touch the .autoreg (a hidden file) in the bin directory, or delete xpti.dat. then, the next time mozilla starts, it will rebuild the
index of components, including any new one in the 'components' directory. it is helpful to then start mozilla from the command line to see if new components register successfully. generating implementation templates the module xpcom.xpt is used internally to process type information, but it has a nice feature - it can spit out a template for a python implementation of any interface. just execute this f...