Search completed in 1.01 seconds.
1770 results for "item":
Your results are loading. Please wait...
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 13 more matches
mssitemodejumplistitemremoved - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssitemodejumplistitemremoved event occurs when mssitemodeshowjumplist is called and an item has been removed from a jump list by the user. ...
...ior may change in the future. the mssitemodejumplistitemremoved event occurs when mssitemodeshowjumplist is called and an item has been removed from a jump list by the user. this proprietary method is specific to internet explorer and microsoft edge. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitemremoved", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjumplist was called. this event is not triggered if mssitemodeclearjumplist has been called. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interfac...
itemprop - HTML: Hypertext Markup Language
the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. ...
... properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. ...
...s forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. ...
...And 48 more matches
itemtype - HTML: Hypertext Markup Language
the global attribute itemtype specifies the url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names. for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details. in this case, musicevent would be the url used by itemtype, with startdate and location as itemprop's which musicevent defines. ...
...he schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names. for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details. in this case, musicevent would be the url used by itemtype, with startdate and location as itemprop's which musicevent defines. ...
...s a standard set of type names and property names. for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details. in this case, musicevent would be the url used by itemtype, with startdate and location as itemprop's which musicevent defines. ...
...And 44 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in this guide we will be exploring the three properties that are applied to flex items, which enable us to control the size and flexibility of the items along the main axis — flex-grow, flex-shrink, and flex-basis. fully understanding how these properties work with growing and shrinking items is the real key to mastering flexbox. a first look our three properties control the following aspects of a flex item's flexibility: flex-grow: how much of the positive free space does this item get? flex-shrink: how much negative free space can be removed from this item? flex-basis: what is the size of the item before growing and shrinking happens? the properties are usually expressed as the shorthand flex property. the following code would set the flex-grow property to 2, flex-shrink to 1 and...
...here we will explore them in depth in order that you can fully understand what the browser is doing when you use them. ...
...u will have already had an introduction to the properties. here we will explore them in depth in order that you can fully understand what the browser is doing when you use them. important concepts when working on the main axis there are a few concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. ...
...And 38 more matches
MenuItems - Archive of obsolete content
features of the menuitem element the menuitem element has a number of features beyond just being a label for a menu command. adding shortcut keys to menu items a shortcut key may be associated with a menu item. unlike the access key, which only functions while the menu is open, a shortcut key works at any time. a shortcut key can be created using the key element. in reality, the keyboard shortcut is handled by the key element, however, the menu item will display the shortcut next to its label. this allows the user to discover what shortcut keys are available by looking at the menus. ...
... reality, the keyboard shortcut is handled by the key element, however, the menu item will display the shortcut next to its label. this allows the user to discover what shortcut keys are available by looking at the menus. <keyset> <key id="open-key" modifiers="accel" key="o"/> <key id="close-key" modifiers="accel" key="c"/> </keyset> <menubar> <menu label="view"> <menupopup> <menuitem label="open" key="open-key"/> <menuitem label="close" key="close-key"/> </menupopup> </menu> </menubar> the two menuitems are associated with a key using the key attribute. it should be set to the id of a key element within the same document. ...
...the "accel" modifier key varies on each platform, but is the key typically used for shortcut keys. ...
...And 35 more matches
place-items - CSS: Cascading Style Sheets
the css place-items shorthand property allows you to align items along both the block and inline directions at once (i.e. the align-items and justify-items properties) in a relevant layout system such as grid or flexbox. if the second value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...exbox. if the second value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...econd value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 32 more matches
itemscope - HTML: Hypertext Markup Language
itemscope is a boolean global attribute that defines the scope of associated metadata. specifying the itemscope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element. a related attribute, itemtype, is used to specify the valid url of a vocabulary (such as schema.org) that describes the item and its properties context. in each of the following examples, the vocabulary is from schema.org. every html element may have an itemscope attribute specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the it...
...ry html element may have an itemscope attribute specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the itemtype as "http://schema.org/movie", and specifies three related itemprop attributes. ...
... itemscope attribute specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the itemtype as "http://schema.org/movie", and specifies three related itemprop attributes. <div itemscope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="https://youtu.be/0ay1xikx7by" itemprop="trailer">trailer</a> </div> structured data the following table shows the structured data from the preceding example. ...
...And 28 more matches
justify-items - CSS: Cascading Style Sheets
the css justify-items property defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis. the source for this interactive example is stored in a github repository. if 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 effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns the items inside their containing block on the inline axis. for absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. in table cell layouts, this property is ignored (more about al...
... absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. ...
...t values of top, left, bottom, and right. ...
...And 26 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
one of the reasons that flexbox quickly caught the interest of web developers is that it brought proper alignment capabilities to the web for the first time. it enabled proper vertical alignment, so we can at last easily center a box. in this guide, we will take a thorough look at how the alignment and justification properties work in flexbox. to center our box we use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. we use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. you can take a look at the code of this example below. change the size of the container or nested element and the nested element always remains centered. properties that control alignment t...
... align-content — described in the spec as for “packing flex lines”; controls space between flex lines on the cross axis. we will also discover how auto margins can be used for alignment in flexbox. ...
... axis, which in this case the inline axis running horizontally. you can take a look at the code of this example below. change the size of the container or nested element and the nested element always remains centered. properties that control alignment the properties we will look at in this guide are as follows. justify-content — controls alignment of all items on the main axis. align-items — controls alignment of all items on the cross axis. align-self — controls alignment of an individual flex item on the cross axis. align-content — described in the spec as for “packing flex lines”; controls space between flex lines on the cross axis. we will also discover how auto margins can be used for alignment in flexbox. note: the alignment properties in flexbox have been pl...
...And 23 more matches
menuitem - Archive of obsolete content
ormation is available in the xul tutorial. ...
...able in the xul tutorial. ...
...if this value is set, it overrides a...
...And 21 more matches
align-items - CSS: Cascading Style Sheets
the css align-items property sets the align-self value on all direct children as a group. in flexbox, it controls the alignment of items on the cross axis. in grid layout, it controls the alignment of items on the block axis within their grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if 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 block axis within their grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... their grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 21 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
flexbox was designed as a single dimensional layout, meaning that it deals with laying out items as a row or as a column — but not both at once. there is however the ability to wrap flex items onto new lines, creating new rows if flex-direction is row and new columns if flex-direction is column. in this guide i will explain how this works, what it is designed for and what situations really require css grid layout rather than flexbox. making things wrap the initial value of the flex-wrap property is nowrap. this means that if you have a set of flex items that are too wide for their container, they will overflow it. if you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or c...
...ut rather than flexbox. making things wrap the initial value of the flex-wrap property is nowrap. this means that if you have a set of flex items that are too wide for their container, they will overflow it. if you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or column wrap. items will then wrap in the container. in the next example i have ten items all with a flex-basis of 160px and the ability to grow and shrink. ...
...o wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or column wrap. items will then wrap in the container. in the next example i have ten items all with a flex-basis of 160px and the ability to grow and shrink. once the first row gets to a point where there is not enough space to place another 160 pixel item, a new flex line is created for the items and so on until all of the items are placed. as the items can grow, they will expand larger than 160 px in order to fill each row completely. ...
...And 17 more matches
Dragging and Dropping Multiple Items - Web APIs
caution: all of the methods and properties with 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 fu...
...es not use the datatransferitem interface nor the datatransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain", "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.
...ing 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("text/plain", "url3...
...And 14 more matches
ARIA: Listitem role - Accessibility
a shopping list, recipe steps, driving directions. ...
...a shopping list, recipe steps, driving directions. ...
...a shopping list, recipe steps, driving directions. ...
...And 13 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
new layout methods such as flexbox and grid bring with them the possibility of controlling the order of content. in this article we will take a look at ways in which you can change the visual order of your content when using flexbox. we will also consider the implications of reordering items from an accessibility point of view. reverse the display of the items the flex-direction property can take one of four values: row column row-reverse column-reverse the first two values ​​keep the items in the same order that they appear in the document source order and display them sequentially from the start line. the second two values ​​reverse the items by switching the start and end lines. remember that the start line relates to writing modes. the row-related examples abov...
... remember that the start line relates to writing modes. the row-related examples above demonstrate how row and row-reverse work in a left-to-right language such as english. if you are working in a right-to-left language like arabic then row would start on the right, row-reverse on the left. this can seem like a neat way to display things in reverse order however you should be mindful that the items are only visually displayed in reverse order. the specification says the following on this matter: “note: the reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order. this allows authors to manipulate the visual presentation while leaving the source order intact for non-css uas and for linear models ...
...ng on this matter: “note: the reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order. this allows authors to manipulate the visual presentation while leaving the source order intact for non-css uas and for linear models such as speech and sequential navigation.” - ordering and orientation if your items were links or some other element that the user could tab to, then the tabbing order would be the order that these items appear in the document source — not your visual order. if you are using a reverse value, or otherwise reordering your items, you should consider whether you actually need to change the logical order in the source. the specification continues with a warning not to use reorder...
...And 13 more matches
Multiple item extension packaging - Archive of obsolete content
from the release of firefox 53, multiple item extension packages are no longer supported and will not load. as a consequence, these packages are no longer accepted by amo. a multiple item package provides the ability to package multiple installable bundles which can then be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requirements as an extension except as noted below. there is currently no feature to prevent or warn the user when installing an older version of an extension. ...
...xpi file extension) and themes (e.g. jar file extension). ...
...xpi file extension) and themes (e.g. jar file extension). ...
...And 12 more matches
DataTransferItem.webkitGetAsEntry() - Web APIs
this will be either filesystemfileentry or filesystemdirectoryentry. ...
...this will be either filesystemfileentry or filesystemdirectoryentry. ...
...this will be either filesystemfileentry or filesystemdirectoryentry. example in this example, a drop zone is created, which responds to the drop event by scanning through the dropped files and directories, outputting a hierarchical directory listing. ...
...And 12 more matches
DataTransferItemList.remove() - Web APIs
example this example shows the use of the remove() method. ...
... example this example shows the use of the remove() method. ...
... example this example shows the use of the remove() method. ...
...And 10 more matches
Add a Context Menu Item - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to add items and submenus to the firefox context menu, use the context-menu module. here's an add-on that adds a new context menu item. the item is displayed whenever something in the page is selected. ...
...rial you'll need to have learned the basics of jpm. to add items and submenus to the firefox context menu, use the context-menu module. here's an add-on that adds a new context menu item. the item is displayed whenever something in the page is selected. ...
... have learned the basics of jpm. to add items and submenus to the firefox context menu, use the context-menu module. here's an add-on that adds a new context menu item. the item is displayed whenever something in the page is selected. ...
...And 9 more matches
DataTransfer.items - Web APIs
the read-only datatransfer property items property is a list of the data transfer items in a drag operation. the list includes one item for each item in the operation and if the operation had no items, the list is empty. syntax itemlist = datatransfer.items; return value a datatransferitemlist object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
...tatransfer.items; return value a datatransferitemlist object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
...ult(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("... ...
...And 9 more matches
listitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a listbox. 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. ...
...gle 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, tabindex, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, 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 label attribute for the element. ...
... side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. ...
...And 8 more matches
appendItem - Archive of obsolete content
« xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
... « xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
... « xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
...And 7 more matches
<menuitem> - HTML: Hypertext Markup Language
Web › HTML › Element › menuitem
permitted content none, it is an empty element. ...
...rough a popup menu. this includes context menus, as well as menus that might be attached to a menu button. a command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. commands can also optionally include a checkbox or be grouped to share radio buttons. (menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) content categories none. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents the <menu> element, where that element is in the popup me...
... omission must have a start tag and must not have an end tag. permitted parents the <menu> element, where that element is in the popup menu state. (if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints. checked boolean attribute which indicates whether the command is selected. may only be used when the type attribute is checkbox or radio. command specifies the id of a separate element, indicating a command to be invoked indirectly. may not ...
...And 7 more matches
itemref - HTML: Hypertext Markup Language
properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. itemref provides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an itemscope attribute specified. note: the itemref attribute is not part of the microdata data model. it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
...ified. note: the itemref attribute is not part of the microdata data model. it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
...ref attribute is not part of the microdata data model. it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
...And 7 more matches
toolbaritem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only an item that appears on a toolbar. this element should wrap all customizable items (unless they're instances of toolbarbutton). if you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
...ey're instances of toolbarbutton). if you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
...you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
...And 6 more matches
nsIUpdateItem
1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is obsolete; instead of using the extension manager, you should use the addon manager. ...
...ring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type description iconurl astring the url of the icon that can be shown for this item. read only. id astring the guid of the item. read only. installlocationkey astring the name of the install location where this item is installed. read only. maxappversion astring the maximum version of the application that this item works with, in fvf format. read only. minappversion astring the minimum version of the application that th...
...ead only. id astring the guid of the item. read only. installlocationkey astring the name of the install location where this item is installed. read only. maxappversion astring the maximum version of the application that this item works with, in fvf format. read only. minappversion astring the minimum version of the application that this item works with, in fvf format. read only. name astring the name of this item. read only. objectsource astring returns a js object source representing an nsiupdateitem. read only. targetappid astring the target application id used for checking compatibility for this item. note: add-ons can specify a targetapplication id of toolkit@mozilla.org in th...
...And 6 more matches
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. ...
... « 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. ...
...And 5 more matches
Adding items to the Folder Pane
first, some necessary background on how the folder pane constructs the data it displays. the folder pane tracks modifications to a user's folders and accounts. each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. ...
...ines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the form of an array of folder-tree-items. listening for folder pane rebuilds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. the following code snippet listens for that event: let gnumbersext = { load: function gne_load() { window.removeeventlistener("load", gnumbersext.load, false); let tree = document.getelementbyid(...
... function gne_load() { window.removeeventlistener("load", gnumbersext.load, false); let tree = document.getelementbyid("foldertree"); tree.addeventlistener("maprebuild", gnumbersext._insert, false); }, _insert: function gne__insert() { // this function is called when a rebuild occurs } }; window.addeventlistener("load", gnumbersext.load, true); the structure of folder-tree-items the folder pane stores its current display data in a property called _rowmap. this property is an array of folder-tree-items. each item in this array satisfies the following interface: id (attribute) a unique string for this object. must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, at...
...And 5 more matches
removeItemAt - Archive of obsolete content
« xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
... « xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
... « 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. ...
...And 4 more matches
selectItemRange - Archive of obsolete content
this method does nothing for single-selection list boxes. ...
...this method does nothing for single-selection list boxes. ...
...this method does nothing for single-selection list boxes. ...
...And 4 more matches
Enumerator.item - Archive of obsolete content
non-standard. do not use! ...
... non-standard. do not use! ...
... non-standard. do not use! ...
...And 4 more matches
ROLE_MENUITEM
« gecko roles page represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. interfaces nsiaccessnode nsiaccessible children no children. ...
... « gecko roles page represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. interfaces nsiaccessnode nsiaccessible children no children. ...
... « gecko roles page represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. interfaces nsiaccessnode nsiaccessible children no children. ...
...And 4 more matches
DataTransferItemList.add() - Web APIs
the datatransferitemlist.add() method creates a new datatransferitem using the specified data and adds it to the drag data list. the item may be a file or a string of a given type. if the item is successfully added to the list, the newly-created datatransferitem object is returned. syntax datatransferitem = datatransferitemlist.add(data, type); datatransferitem = datatransferitemlist.add(file); parameters data a string representing the drag item's data. type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. ...
... example this example shows the use of the add() method. ...
... example this example shows the use of the add() method. ...
...And 4 more matches
DataTransferItemList.clear() - Web APIs
return value undefined example this example shows the use of the clear() method. ...
... return value undefined example this example shows the use of the clear() method. ...
... return value undefined example this example shows the use of the clear() method. ...
...And 4 more matches
DataTransferItemList.length - Web APIs
the read-only length property of the datatransferitemlist interface returns the number of items currently in the drag item list. syntax length = datatransferitemlist.length; value the number of drag data items in the list, or 0 if the list is empty or disabled. the drag item list is considered to be disabled if the item list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. ...
...m list is considered to be disabled if the item list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
... will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
...And 4 more matches
insertItem - Archive of obsolete content
usually, the last argument will be null as it is mainly for the use of the customize dialog. the id should match an element in the toolbar's toolbarpalette. ...
...usually, the last argument will be null as it is mainly for the use of the customize dialog. the id should match an element in the toolbar's toolbarpalette. ...
...usually, the last argument will be null as it is mainly for the use of the customize dialog. the id should match an element in the toolbar's toolbarpalette. ...
...And 3 more matches
ROLE_OUTLINEITEM
« gecko roles page represents an item in an outline or tree structure. ...
... « gecko roles page represents an item in an outline or tree structure. ...
... « gecko roles page represents an item in an outline or tree structure. ...
...And 3 more matches
ClipboardItem - Web APIs
access to the contents of the clipboard is gated behind the permissions api: the clipboard-write permission is granted automatically to pages when they are in the active tab. the clipboard-read permission must be requested, which you can do by trying to read data from the clipboard. note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface. ...
...ted behind the permissions api: the clipboard-write permission is granted automatically to pages when they are in the active tab. the clipboard-read permission must be requested, which you can do by trying to read data from the clipboard. note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface. note: you can only pass in one clipboard item at a time. constructor clipboarditem.clipboarditem() creates a new clipboarditem object, with the mime type as the key and blob as the value properties this interface provides the following properties. types read only returns an array of mime types available within the clipboarditem. methods this interface defines the following methods. gettype() returns a promise that resolv...
...erties this interface provides the following properties. types read only returns an array of mime types available within the clipboarditem. methods this interface defines the following methods. gettype() returns a promise that resolves with a blob of the requested mime type, or an error if the mime type is not found. examples writing to clipboard here we're writing a new clipboarditem.clipboarditem() to the clipboard by requesting a png image using the fetch api, and in turn, the responses' blob() method, to create the new clipboarditem. ...
...And 3 more matches
MSSiteModeEvent - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. mssitemodeevent provides event properties that are specific to pinned site events. this proprietary method is specific to internet explorer and microsoft edge. dom information inheritance hierarchy event mssitemodeevent methods method description initevent initializes a new generic event that the createevent method created. *note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventdefa...
...constructor pattern for synthetic events is deprecated. preventdefault cancels the default action of an event. stopimmediatepropagation prevents any further propagation of an event. stoppropagation prevents propagation of an event beyond the current target. properties property description actionurl gets the url of a jump list item that is removed. *this property is not supported for windows store apps using javascript. bubbles gets a value that indicates whether an event propagates up from the event target. buttonid gets the thumbnail toolbar button id that is clicked. *this property is not supported for windows store apps using javascript. cancelable gets a value that indicates whether ...
... gets the element that the event was originally dispatched to. compare to target. target gets the element that is the target of the event. timestamp gets the time, in milliseconds, when an event occurred. ...
...And 3 more matches
getNextItem - Archive of obsolete content
« xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists. ...
... « xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists. ...
... « xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists. ...
...And 2 more matches
getPreviousItem - Archive of obsolete content
« xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists. ...
... « xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists. ...
... « xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists. ...
...And 2 more matches
richlistitem - Archive of obsolete content
attributes disabled, searchlabel, selected, tabindex, value properties accessible, control, disabled, label, selected, tabindex, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. ...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. searchlabel type: 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 ind...
...ed 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 selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, ...
...And 2 more matches
treeitem - Archive of obsolete content
set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. ...
...set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. ...
...set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. ...
...And 2 more matches
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
summary: an obscure bug in gecko causes list-item markers to be differently sizeed than the text of the list item, but there is a fix authors can use. learn how to correctly size list item markers in gecko 0.9.4, the basis of netscape 6.2.x and compuserve 7. shortly before mozilla 0.9.4 was finished, a bug was introduced that affects the sizing of list item markers (such as the numbers in an ordered list). while this bug was corrected shortly after 0.9.4 was finished, the bug still affects all netscape 6.2.x versions, as well as compuserve 7.0. the problem in affected browsers, list item markers will very often appear to be too big compared to the text in the list item itself. ...
...(such as the numbers in an ordered list). while this bug was corrected shortly after 0.9.4 was finished, the bug still affects all netscape 6.2.x versions, as well as compuserve 7.0. the problem in affected browsers, list item markers will very often appear to be too big compared to the text in the list item itself. this is most obvious in ordered lists, where the number that precedes each list item may be obviously different than the content that follows it. in fact, the markers were set to be a uniform size that did not change to match the content of the list items, so in rare cases the marker might actually appear to be smaller. see bug 110360, which explains the problem and shows when the fix was applied. in addition, when a document is displayed in "quirks" mode in mozilla 0.9.4 and la...
...see bug 97351 for more details. the solution fortunately, there are mozilla-specific css-like rules that can be used to correct both problems. ...
...And 2 more matches
Storage.getItem() - Web APIs
Web › API › Storage › getItem
the getitem() method of the storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given storage object. syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. example the following function retrieves three data items from local storage, then uses them to set custom styles on a page. ...
...); parameters keyname a domstring containing the name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. example the following function retrieves three data items from local storage, then uses them to set custom styles on a page. ...
...e name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. example the following function retrieves three data items from local storage, then uses them to set custom styles on a page. ...
...And 2 more matches
Storage.setItem() - Web APIs
Web › API › Storage › setItem
particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. ...
...particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. ...
...sed a key name and value, will add that key to the given storage object, or update that key's value if it already exists. syntax storage.setitem(keyname, keyvalue); parameters keyname a domstring containing the name of the key you want to create/update. keyvalue a domstring containing the value you want to give the key you are creating/updating. return value undefined. exceptions setitem() may throw an exception if the storage is full. particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. (safari sets the quota to 0 bytes in private mode, unlike other browsers, which allow storage in private mode using separate data containers.) hence developers should make sure to always catch possible exceptions from setitem(). example the following ...
...And 2 more matches
itemid - HTML: Hypertext Markup Language
the itemid global attribute provides microdata in the form of a unique, global identifier of an item. an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes. also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. however, the following example correctly illustrates that a u...
...ocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. however, the following example correctly illustrates that a urn may also be used. this inconsistency may reflect the incomplete nature of the microdata specification. example html <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f. ...
...lowing example correctly illustrates that a urn may also be used. this inconsistency may reflect the incomplete nature of the microdata specification. example html <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f. ...
...And 2 more matches
menuitem.name - Archive of obsolete content
« xul reference home 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. ...
... « xul reference home 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. ...
... « xul reference home 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. ...
...s with the same name as put into a group. only one menuitem in each radio group can be checked at a time. ...
addItemToSelection - Archive of obsolete content
...
... ...
... ...
... ...
removeItemFromSelection - Archive of obsolete content
...
... ...
... ...
... ...
VBArray.getItem - Archive of obsolete content
dimension1, ..., dimensionn specifies the exact location of the desired element of the vbarray. n equals the number of dimensions in the vbarray. example the following example consists of three parts. the first part is vbscript code to create a visual basic safe array. ...
...> section to run the other two parts. ...
...not supported in windows 8.
...not supported in windows 8.x store apps. see version information. applies to: vbarray object ...
nsIJumpListItem
widget/public/nsijumplistitem.idlscriptable implements windows 7 taskbar jump list item interfaces. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing. method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type. read only. ...
... email message, etc.). to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing. method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type. read only. constants constant value description jumplist_item_empty 0 empty list item. jumplist_item_separator 1 separator. jumplist_item_link 2 web link item. jumplist_item_shortcut 3 application shortcut. methods equals() compare this item to another. ...
...tribute type description type short retrieves the jump list item type. read only. constants constant value description jumplist_item_empty 0 empty list item. jumplist_item_separator 1 separator. jumplist_item_link 2 web link item. jumplist_item_shortcut 3 application shortcut. methods equals() compare this item to another. compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijumplistitem item ); parameters item another nsijumplistitem to compare to. ...
..._item_link 2 web link item. jumplist_item_shortcut 3 application shortcut. methods equals() compare this item to another. compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijumplistitem item ); parameters item another nsijumplistitem to compare to. ...
DataTransferItem.getAsFile() - Web APIs
if the item is a file, the datatransferitem.getasfile() method returns the drag data item's file object. if the item is not a file, this method returns null. syntax file = datatransferitem.getasfile(); parameters none. return value file if the drag data item is a file, a file object is returned; otherwise null is returned. example this example shows the use of the getasfile() method in a drop event handler. ...
...le, this method returns null. syntax file = datatransferitem.getasfile(); parameters none. return value file if the drag data item is a file, a file object is returned; otherwise null is returned. example this example shows the use of the getasfile() method in a drop event handler. ...
...ile, a file object is returned; otherwise null is returned. example this example shows the use of the getasfile() method in a drop event handler. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // dra...
... target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... drop: uri"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... drop: file "); } } } specifications specification status comment html living standardthe definition of 'getasfile()' in that specification.
DataTransferItem.getAsString() - Web APIs
the datatransferitem.getasstring() method invokes the given callback with the drag data item's string data as the argument if the item's kind is a plain unicode string (i.e. kind is string). syntax datatransferitem.getasstring(callback); parameters callback a callback function that has access to the data transfer item's string data. see callback below for details. return value undefined callback the callback parameter is a callback function which accepts one parameter: domstring the drag data item's string data. the callback return value is undefined. example this example shows the use of the getasstring() method as an inline function in a drop event handler. ...
... undefined callback the callback parameter is a callback function which accepts one parameter: domstring the drag data item's string data. the callback return value is undefined. example this example shows the use of the getasstring() method as an inline function in a drop event handler. ...
...the callback return value is undefined. example this example shows the use of the getasstring() method as an inline function in a drop event handler. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // dra...
... target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... drop: uri"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... drop: file "); } } } specifications specification status comment html living standardthe definition of 'getasstring()' in that specificatio...
DataTransferItem.type - Web APIs
the read-only datatransferitem.type property returns the type (format) of the datatransferitem object representing the drag data item. the type is a unicode string generally given by a mime type, although a mime type is not required. some example types are: text/plain and text/html. syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. ...
...e type is a unicode string generally given by a mime type, although a mime type is not required. some example types are: text/plain and text/html. syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. ...
... syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // dra...
... target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... drop: uri"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... drop: file "); } } } specifications specification status comment html living standardthe definition of 'type' in that specification. liv...
SVGAltGlyphItemElement - Web APIs
the svgaltglyphitemelement interface corresponds to the <altglyphitem> element. ...
...interface corresponds to the <altglyphitem> element. ...
...0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgaltglyphitemelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent inter...
... recommendation initial definition ...
currentItem - Archive of obsolete content
...
... ...
... ...
selectedItems - Archive of obsolete content
...
... ...
... ...
Flex Item - MDN Web Docs Glossary: Definitions of Web-related terms
the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
... the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
...nts with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
ClipboardItem() - Web APIs
the clipboarditem() constructor of the clipboard api creates a new clipboarditem object which represents data to be stored or retrieved via the clipboard api, that is clipboard.write() and clipboard.read() respectively. note: image format support varies by browser. see the browser compatibility table for the clipboard interface. syntax var clipboarditem = new clipboarditem(clipboarditemdata); parameters clipboarditemdata an object with the mime type as the key and blob as the value. note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface. ...
...item = new clipboarditem(clipboarditemdata); parameters clipboarditemdata an object with the mime type as the key and blob as the value. note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface. examples the below example requests a png image using the fetch api, and in turn, the responses' blob() method, to create a new clipboarditem and write it to the clipboard, using the clipboard api. note: you can only pass in one clipboard item at a time. ...
...i, and in turn, the responses' blob() method, to create a new clipboarditem and write it to the clipboard, using the clipboard api. note: you can only pass in one clipboard item at a time. async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification. working draft initial definition. ...
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an error if the mime type is not found. syntax var blob = clipboarditem.gettype(type); parameters type a valid mime type. return value a promise that resolves with a blob object. exceptions domexception the type does not match a known mime type. typeerror no parameter is specified or the type is not that of the clipboarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. ...
...wn mime type. typeerror no parameter is specified or the type is not that of the clipboarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. ...
...not that of the clipboarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification. ...
ClipboardItem.types - Web APIs
the read-only types property of the clipboarditem interface returns an array of mime types available within the clipboarditem syntax var types = clipboarditem.types; value an array of available mime types. examples in the below example, we're returning all items on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the specified type, an error is returned. ...
...me types. examples in the below example, we're returning all items on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the specified type, an error is returned. ...
...s on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the specified type, an error is returned. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification. ...
DataTransferItem.kind - Web APIs
the read-only datatransferitem.kind property returns a datatransferitem representing the drag data item kind: some text or some file. syntax var itemkind = datatransferitem.kind; return value a domstring representing the drag data item's kind. it must be one of the following values: 'file' if the drag data item is a file. 'string' if the kind of drag data item is a plain unicode string. example this example shows the use of the kind property. ...
...nsferitem.kind; return value a domstring representing the drag data item's kind. it must be one of the following values: 'file' if the drag data item is a file. 'string' if the kind of drag data item is a plain unicode string. example this example shows the use of the kind property. ...
...data item is a file. 'string' if the kind of drag data item is a plain unicode string. example this example shows the use of the kind property. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("... drop: html"); } else if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) { // drag data it...
DataTransferItem - Web APIs
the datatransferitem object represents one drag data item. during a drag operation, each drag event has a datatransfer property which contains a list of drag data items. each item in the list is a datatransferitem object. this interface has no constructor. properties datatransferitem.kind read only the kind of drag data item, string or file. datatransferitem.type read only the drag data item's type, typically a mime type. methods datatransferitem.getasfile() returns the file object associated with the drag data item (or null if the drag item is not a file). datatransferitem.getasstring() invokes the specified callback with the drag data item string as its argument. ...
...this will generally be either a filesystemfileentry or filesystemdirectoryentry object. example all of this interface's methods and properties have their own reference page, and each reference page has an example of its usage. ...
...ng the selected file's entry in its file system. this will generally be either a filesystemfileentry or filesystemdirectoryentry object. example all of this interface's methods and properties have their own reference page, and each reference page has an example of its usage. specifications specification status comment html living standardthe definition of 'datatransferitem' in that specification. living standard initial definition. html 5.1the definition of 'datatransferitem' in that specification. recommendation w3c snapshot of whatwg file and directory entries apithe definition of 'datatransferitem.webkitgetasentry()' in that specification. draft definition of webkitgetasentry() as part of the file and directory entries api. ...
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 ea...
...e at the specified index, or null if index is less than zero or greater than or equal to the length property. usage notes the item() method returns a numbered element from an htmlcollection. in javascript, it is easier to treat the htmlcollection as an array and to index it using array notation. see the example below. ...
...l if index is less than zero or greater than or equal to the length property. usage notes the item() method returns a numbered element from an htmlcollection. in javascript, it is easier to treat the htmlcollection as an array and to index it using array notation. see the example below. ...
HTMLMenuItemElement - Web APIs
the htmlmenuitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eve...
...andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlmenuitemelement" target="_top"><rect x="301" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmenuitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesthis inte...
... recommendation snapshot of the html living standard. ...
HTMLSelectElement.item() - Web APIs
the htmlselectelement.item() method returns the element corresponding to the htmloptionelement whose position in the options list corresponds to the index given in the parameter, or null if there are none. in javascript, using the array bracket syntax with an unsigned long, like selectelt[index] is equivalent to selectelt.nameditem(index). syntax var item = collection.item(index); var item = collection[index]; parameters index is an unsigned long. return value item is a htmloptionelement. examples html <form> <select id="myformcontrol" type="textarea"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript // returns the htmloptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications ...
... recommendation initial definition, snapshot of html living standard ...
... recommendation initial definition, snapshot of html living standard ...
Storage.removeItem() - Web APIs
the removeitem() method of the storage interface, when passed a key name, will remove that key from the given storage object if it exists. the storage interface of the web storage api provides access to a particular domain's session or local storage. if there is no item associated with the given key, this method will do nothing. syntax storage.removeitem(keyname); parameters keyname a domstring containing the name of the key you want to remove. return value undefined. example the following function creates three data items inside local storage, then removes the image data item. ...
...age. if there is no item associated with the given key, this method will do nothing. syntax storage.removeitem(keyname); parameters keyname a domstring containing the name of the key you want to remove. return value undefined. example the following function creates three data items inside local storage, then removes the image data item. function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); localstorage.removeitem('image'); } we can do the same for the session storage. ...
...he following function creates three data items inside local storage, then removes the image data item. function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); localstorage.removeitem('image'); } we can do the same for the session storage. function populatestorage() { sessionstorage.setitem('bgcolor', 'red'); sessionstorage.setitem('font', 'helvetica'); sessionstorage.setitem('image', 'mycat.png'); sessionstorage.removeitem('image'); } note: to see this used within a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.removeitem' in that specification. livi...
treeitem.label - Archive of obsolete content
además label ...
... además label ...
menulist.appendItem - Archive of obsolete content
« xul reference home appenditem( label, value, description ) return type: element creates a new menuitem element and adds it to the end of the menulist. you may optionally set a value and description. the function returns the new item. ...
... « xul reference home appenditem( label, value, description ) return type: element creates a new menuitem element and adds it to the end of the menulist. you may optionally set a value and description. the function returns the new item. ...
removeAllItems - Archive of obsolete content
...
... ...
itemCount - Archive of obsolete content
« xul reference itemcount type: integer read only property holding the number of child items. ...
... « xul reference itemcount type: integer read only property holding the number of child items. ...
Sizing items in CSS - Learn web development
understanding how big the different features in your design will be is important, and in this lesson we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. ...
...th understanding the concepts here before moving on. ...
nsIDOMStorageItem
dom/interfaces/storage/nsidomstorageitem.idlscriptable this interface represents an object in dom storage. this is for session storage. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage. attributes attribute type description secure boolean if true, the item was stored for an https page. note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this at...
...e, the item was stored for an https page. note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this attribute is irrelevant for storage that is bound to an origin. value domstring the value associated with the item. see also dom storage structured client-side storage (html 5 specification) nsidomstorage nsidomstorage2 ...
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. ...
...ring is returned if the index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname = style.item(index); parameters index is the index of the node to be fetched. the index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified index. javascript has a special simpler syntax for obtaining an item from a nodelist by index: var propertyname = style[index]; example var style = document.getelementbyid('div1').style; var propertyname = style.item(1); // or simply style[1] - returns the second style listed specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.item()' in that specification. working draft ...
DOMTokenList.item() - Web APIs
Web › API › DOMTokenList › item
the item() method of the domtokenlist interface returns an item in the list by its index. syntax tokenlist.item(index) parameters index a domstring representing the index of the item you want to return. return value a domstring representing the returned item. it returns null if the number is greater than or equal to the length of the list. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then retrieve the last item in the list using item(tokenlist.length - 1), and write it into the <span>'s node.textcontent. ...
...es in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then retrieve the last item in the list using item(tokenlist.length - 1), and write it into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let item = classes.item(classes.length-1); span.textcontent = item; the output looks like this: specifications specification status comment domthe definition of 'item()' in that specification. living standard initial definition ...
DataTransferItemList - Web APIs
the datatransferitemlist object is a list of datatransferitem objects representing items being dragged. during a drag operation, each dragevent has a datatransfer property and that property is a datatransferitemlist. this interface has no constructor. properties datatransferitemlist.length read only an unsigned long that is the number of drag items in the list. methods datatransferitemlist.add() adds an item (either a file object or a string) to the drag item list and returns a datatransferitem object for the new item. datatransferitemlist.remove() removes the drag item from the list at the given index. datatransferitemlist.clear() removes all of the drag items from the list. datatransferitemlist.datatransferitem() getter that returns a datatransferitem at the given index. ...
...emoves all of the drag items from the list. datatransferitemlist.datatransferitem() getter that returns a datatransferitem at the given index. example each of this interface's methods and properties has a reference page, and each reference page has an example of its usage. specifications specification status comment html living standardthe definition of 'datatransferitemlist' in that specification. living standard html 5.1the definition of 'datatransferitemlist' in that specification. recommendation not included in w3c html5 recommendation ...
HTMLFormControlsCollection.namedItem() - Web APIs
the htmlformcontrolscollection.nameditem() method returns the radionodelist or the element in the collection whose name or id match the specified name, or null if no node matches. note that this version of nameditem() hides the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null. example html <form> <input id="my-form-control" type="textarea"> </form> javascript // returns the htmlinputelement representing #my-form-control elem1 = document.forms[0]['my-form-control']; specifications ...
... living standard html5the definition of 'htmlformcontrolscollection' in that specification. ...
HTMLSelectElement.namedItem() - Web APIs
the htmlselectelement.nameditem() method returns the htmloptionelement corresponding to the htmloptionelement whose name or id match the specified name, or null if no option matches. in javascript, using the array bracket syntax with a string, like selectelt["value"] is equivalent to selectelt.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring. return value item is a htmloptionelement. example html <form> <select id="myformcontrol"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status comment ...
...element. example html <form> <select id="myformcontrol"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status comment html living standardthe definition of 'htmlselectelement.nameditem()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.nameditem()' in that specification. recommendation initial definition, snapshot of html living standard ...
NamedNodeMap.getNamedItem() - Web APIs
the getnameditem() method of the namednodemap interface returns the attr corresponding to the given name, or null if there is no corresponding attribute. ...
... the getnameditem() method of the namednodemap interface returns the attr corresponding to the given name, or null if there is no corresponding attribute. ...
NodeList.item() - Web APIs
Web › API › NodeList › item
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. ...
... 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. 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 ...
PaymentItem - Web APIs
the paymentitem dictionary is used by the payment request api to describe a single line item on a payment request. this might be an item or service being purchased or a tax or other charge. properties amount secure context a paymentcurrencyamount object describing the monetary value of the item. label secure context a string specifying a human-readable name or description of the item or service being charged for. this may be displayed to the user by the user agent, depending on the design of the interface. pending secure context a boolean value which is true if the specified amount has not yet been finalized. this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. the user agent may show this i...
...e which is true if the specified amount has not yet been finalized. this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. the user agent may show this information but is not required to do so. specifications specification status comment payment request apithe definition of 'paymentitem' in that specification. candidate recommendation initial definition. ...
SpeechGrammarList.item() - Web APIs
syntax var myfirstgrammar = speechgrammarlistinstance[0]; returns a speechgrammar object. ...
... draft ...
SpeechRecognitionResult.item() - Web APIs
syntax var myalternative = speechrecognitionresultinstance[0]; returns a speechrecognitionalternative object. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... draft ...
SpeechRecognitionResultList.item() - Web APIs
syntax var myresult = speechrecognitionresultlistinstance[0]; returns a speechrecognitionresult object. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... draft ...
TouchList.item() - Web APIs
Web › API › TouchList › item
the item() method returns the touch object at the specified index in the touchlist. syntax var touchpoint = touchlist.item(index); parameters index the index of the touch object to retrieve. the index is a number in the range of 0 to one less than the length of the touchlist. return value touchpoint the requested touch object from the touchlist. returns null if the index is not less than the length of the list. example this code example illustrates the use of the touchlist interface's item method and the length property. ...
...touch object from the touchlist. returns null if the index is not less than the length of the list. example this code example illustrates the use of the touchlist interface's item method and the length property. target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation ...
XPathResult.snapshotItem() - Web APIs
the snapshotitem() method of the xpathresult interface returns an item of the snapshot collection or null in case the index is not within the range of nodes. unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. syntax var node = result.snapshotitem(i); return value the node at the given index within the node set of the xpathresult. 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. html <div>xpath example</div> <div>tag names of the matched nodes: <output></output></div> javascript var xpath = "//div"; var result = do...
...owing example shows the use of the snapshotitem() method. html <div>xpath example</div> <div>tag names of the matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); var node = null; var tagnames = []; for(var i = 0; i < result.snapshotlength; i++) { var node = result.snapshotitem(i); tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotitem()' in that specification. recommendation initial definition ...
<display-listitem> - CSS: Cascading Style Sheets
the list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its list-style properties (for example a bullet point) together with a principal box of the specified type for its own contents. syntax a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. ...
...-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-style-position: inside; } result specifications specification status css display module level 3the definition of 'display-listitem' in that specification. candidate recommendation ...
Add a Menu Item to Firefox - Archive of obsolete content
the sdk doesn't provide a built-in api to add new menu items to firefox. but it's extensible by design, so anyone can build and publish modules for add-on developers to use. to see how to use third-party modules to add a new menu item, see the tutorial on using third-party modules with jpm. ...
listitem.type - Archive of obsolete content
...
menuitem.key - Archive of obsolete content
...
menuitem.type - Archive of obsolete content
« xul reference home type type: one of the values below can be used to create checkable menuitems or for radio button menuitems. checkbox the menuitem is checked. the checked attribute determines whether the menuitem is checked or not. radio the menuitem becomes part of a radio group. other menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more information on adding checkmarks to menus in the xul tutorial ...
DOMMenuItemActive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
DOMMenuItemInactive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
getIndexOfItem - Archive of obsolete content
« xul reference home getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. ...
getItemAtIndex - Archive of obsolete content
...
getSelectedItem - Archive of obsolete content
« xul reference home getselecteditem( index ) return type: element when multiple items are selected, you can retrieve each selected item using this method. the argument index specifies the index in the list of the selected items, not the row number of the item. the item index is zero-based, thus this example will return the first selected item: getselecteditem(0). ...
selectItem - Archive of obsolete content
« xul reference home selectitem( item ) return type: no return value deselects all of the currently selected items and selects the given item. a select event is sent after the selection is made. ...
toggleItemSelection - Archive of obsolete content
« xul reference home toggleitemselection( item ) return type: no return value if the specified item is selected, it is deselected. if it is not selected, it is selected. other items in the list box that are selected are not affected, and retain their selected state. ...
focusedItem - Archive of obsolete content
« xul reference focuseditem type: radio element holds the currently focused item in the radiogroup, which may or may not be the same as the selected item. you can change the focused item by setting this property. ...
menuitem.control - Archive of obsolete content
...
selectedItem - Archive of obsolete content
« xul reference selecteditem type: element holds the currently selected item. if no item is currently selected, this value will be null. you can select an item by setting this value. a select event will be sent to the controlling container (i.e. the listbox, richlistbox, radiogroup, etc., not the list item that was selected) when it is changed either via this property, the selectedindex property, or changed by the user. ...
listitem-iconic - Archive of obsolete content
« xul reference home listitem-iconic use this class to have an image appear on the listitem. specify the image using the image attribute. ...
menuitem-iconic - Archive of obsolete content
« xul reference home menuitem-iconic use this class to have an image appear on the menuitem. specify the image using the image attribute. ...
menuitem-non-iconic - Archive of obsolete content
« xul reference home menuitem-non-iconic normally, menuitems have a margin to the left for an image or checkmark. this class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup. ...
nsIDOMXULSelectControlItemElement
inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type description accesskey domstring command domstring control nsidomxulselectcontrolelement read only. crop domstring disabled boolean image domstring label domstring selected boolean read only. ...
CSSValueList.item() - Web APIs
Web › API › CSSValueList › item
the item() method of the cssvaluelist interface 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 the index is greater than or equal to the number of values in the list, this method returns null. syntax var cssvalue = cssvaluelist.item(index); parameters index an unsigned long representing the index of the css value within the collection. return value a cssvalue object at the index position in the cssvaluelist, or null if that is not a valid index. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvaluelist.item' in that specification. obsolete initial definition ...
DataTransfer.mozItemCount - Web APIs
the datatransfer.mozitemcount property returns the number of items being dragged. this can be used, for example, to get the number of files being dragged. note: this property is gecko-specific. this property is read only . syntax datatransfer.mozitemcount; return value a number representing the number of items being dragged. example this example shows the use of the mozitemcount property. function drop_handler(event) { var files = []; var dt = event.datatransfer; for (var i = 0; i < dt.mozitemcount; i++) files.push(dt.mozgetdataat("application/x-moz-file", i)); } specifications this property is not defined in any web standard. ...
<altGlyphItem> - SVG: Scalable Vector Graphics
the <altglyphitem> element provides a set of candidates for glyph substitution by the <altglyph> element. usage context categoriestext content elementpermitted contentone or more <glyphref> elements example attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphitemelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyphitem>' in that specification. recommendation initial definition ...
context-menu - Archive of obsolete content
adds items, submenus, and menu separators to the page's context menu. usage instead of manually adding items when particular contexts occur and then removing them when those contexts go away, you bind items to contexts, and the adding and removing is automatically handled for you. items are bound to contexts in much the same way that event listeners are bound to events. when the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. if no items are bound, none are added. likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-...
...bound to the current context are automatically added to the menu. if no items are bound, none are added. likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. if ...
... a certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. if the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.overflowthreshold preference) all of the menu items will instead appear in an overflow menu to avoid making the context menu too large. specifying contexts as its name implies, the context menu should be reserved for the occurrence of specific contexts. co...
...And 71 more matches
Index - Web APIs
Web › API › Index
al, houdini, reference the csspositionvalue constructor creates a new csspositionvalue object which represents values for properties that take a position, for example object-position. 437 csspositionvalue.x api, css typed object model api, csspositionvalue, experimental, houdini, property, reference, x the x property of the csspositionvalue interface returns returns the item's position along the web page's horizontal axis. 438 csspositionvalue.y api, css typed object model api, csspositionvalue, experimental, houdini, property, reference, y the y property of the csspositionvalue interface returns the item's position along the vertical axis. 439 cssprimitivevalue api, cssprimitivevalue, interface, reference the cssprimitivev...
...styledeclaration.getpropertypriority() method interface returns a domstring that provides all explicitly set priorities on the css property. 459 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.pare...
...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, 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,...
...And 66 more matches
Index - Archive of obsolete content
41 addon-page add-on sdk, add-ons, extensions, obsolete, reference create a page that does not contain navigational elements. 42 base64 add-on sdk 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, notification...
... jpm no summary! 140 package.json commonjs, jpm, sdk, add-on, package.json the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons. ...
...d-on, package.json the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons. ...
...And 65 more matches
nsIAnnotationService
["@mozilla.org/browser/annotation-service;1"] .getservice(components.interfaces.nsiannotationservice); note: the annotation service is not thread-safe. you should only use it from the main thread. ...
...tion-service;1"] .getservice(components.interfaces.nsiannotationservice); note: the annotation service is not thread-safe. you should only use it from the main thread. ...
...n autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setitemannotation(in long long aitemid, in autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setpageannotationstring(in nsiuri auri, in autf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration); boolean setitemannotationstring(in long long aitemid, in autf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint32(in nsiuri auri, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint32(in long long aitemid, in autf8string aname, in long avalue, in long aflags, in unsigned short ae...
...And 65 more matches
nsINavBookmarksService
bookmarks consist of a set of user-customizable folders. a uri in history can be contained in one or more such folders. 1.0 67 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: @mozilla.org/browser/nav-bookmarks-service;1. ...
...ervice, use: var navbookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.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 aindex); 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 e...
... only! obsolete since gecko 1.9 void getbookmarkidsforuri(in nsiuri auri, [optional] out unsigned long count, [array, retval, size_is(count)] out long long bookmarks); note: renamed from getbookmarkfolders in gecko 1.9 void getbookmarkidsforuritarray(in nsiuri auri, in print64array aresult); native code only! ...
...And 60 more matches
Enhanced Extension Installation - Archive of obsolete content
ication directory. aside from the work of locating the firefox executable in the first place (which varies from platform to platform), this is very limiting because: it forces the third party application to package its firefox integration hooks as a xpi. it forces it to have write access to the firefox directory in order to be installed, which may not always be the case. it forces its items to be located in different places on the user's disk - some vendors wish to keep all of their installed content within c:\program files\foo\ for example. there is no clean uninstall procedure, as the -install-global-extension flag was designed only as a means to install items for all user profiles, not as a means for third party installers to register their components. the system for in...
...ugh. when a newer version fo an existing extension is installed, files for the newer version are copied into the folder used by the older version, and obsolete files are not cleaned up. this can lead to incompatibilities, mysterious crashes and other problems. there are not enough guards in the upgrade and uninstall process to handle failure and abort the operation, restoring the previous state. items that are installed must be visible in the extension manager user interface, even if the extension type is just an integration hook that has no meaningful ui presence. extension installation and registration is also prohibitively difficult/annoying for developers, who are forced to either dangerously hand-edit all the appropriate manifest files, or package their code as a xpi and install it that...
...tem, chrome registry etc to locate files during the startup process). in the profile directory, the file compatibility.ini stores information about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items. when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autoreg file is written to the profile directory as well, which tells the startup code that the system has been modified, so that it destroys the component registries, finishes pending transactions and regenerates metadata appropriately. datasource structure the extens...
...And 54 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
image but not both. this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. 3 a xul bestiary add-ons, extensions, needstechnicalreview, xul this xulnote presents some of the key concepts and terms in the xul development environment. ...
...ate status, for instance whether the user is online or whether there are new messages. 3 a xul bestiary add-ons, extensions, needstechnicalreview, xul this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. ...
...nt environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to expose text properly for various xul element types. sections in bold are to ...
...And 50 more matches
nss tech note5
p for ckf_en_de_. ...
... ck_mechanism_type ciphermech = ckm_des_cbc_pad <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(ciphermech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* alwys returns internal slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.data = /* ptr to an array of key bytes */ keyitem.len = /* length of the array of key bytes */ /* turn the secitem into a key object */ pk11symkey* symkey = pk11_importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); ...
... cka_encrypt, &keyitem, null); if generating the key - see section generate a symmetric key <big>prepare the parameter for crypto context. iv is relevant only when using cbc mode of encryption. ...
...And 49 more matches
Encrypt Decrypt_MAC_Using Token
, "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id. */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key. */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mech...
...1_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key. */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key. *...
...er); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code. ...
...And 47 more matches
JXON - Archive of obsolete content
are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json. ...
...nly some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json. ...
...xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json. ...
...And 46 more matches
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
is still under development, the api currently lives in the future and must be imported before it is used: jetpack.future.import("menu"); menus all menus in jetpack are jetpack.menu objects, including both built-in firefox menus and menus that features create. to create a new menu, use one of the jetpack.menu constructors below. constructors jetpack.menu() creates an empty menu. jetpack.menu(menuitems) creates a menu with the given items. parameters menuitems an array of menuitems. jetpack.menu(properties) creates a menu with specific properties. parameters properties an object defining any of the properties below. the items property may be used to define an array of menuitems. properties property type description befo...
...nu, context) and otherwise as beforeshow(menu). menu is the menu object to which beforeshow is attached. context is an object describing the context in which the menu was shown. beforeshow may modify the menu, and when the menu is shown, it will reflect the changes. isshowing boolean true if the menu is currently visible and false otherwise. read-only. ...
...menu). menu is the menu object to which beforeshow is attached. context is an object describing the context in which the menu was shown. beforeshow may modify the menu, and when the menu is shown, it will reflect the changes. isshowing boolean true if the menu is currently visible and false otherwise. read-only. items array an array of menuitems in the menu. read-only. ...
...And 39 more matches
Vue conditional rendering: editing existing todos - Learn web development
previous overview: client-side javascript frameworks next now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view, and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for in...
... some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to do conditional rendering in vue. creating an editing component we can start by creating a separate component to handle the editing functionality. in your components directory, create a new file called todoitemeditform.vue. copy the following code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for &quot;{{label}}&quot;</label> <input :id="id" type="text" autocomplete="off" v-model.lazy.trim="newlabel" /> </div> <div class="btn-group"> <button type="button" class="btn" @click="oncancel"> ...
...r {{label}}</span> </button> </div> </form> </template> <script> export default { props: { label: { type: string, required: true }, id: { type: string, required: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height:...
...And 37 more matches
places/bookmarks - Archive of obsolete content
create, modify, and retrieve bookmarks. usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria. save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. ...
...ks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria. save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. each retrieved bookmark item represents only a snapshot of state at a specific time. the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user. examples creating a new bookmark let { bookmark, save } = require("sdk/places/bookmarks"); // create a new bookmark instance, unsaved let bookmark = bookmark({ title: "mozilla",...
.... ...
...And 33 more matches
Places Developer Guide
fox 3. it provides code samples for many common use-cases, such as crud operations, searching, and observing. overview places is the umbrella term for a set of apis for managing browsing history and uri metadata first introduced in firefox 3. it encompasses history, bookmarks, tags, favicons, and annotations. there are two models of identity in the system: uris, and unique integer identifiers for items in the bookmark system. some of the apis are uri-centric, some use item ids. the api signature and context usually make clear which is required. bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting...
... in the bookmark system. some of the apis are uri-centric, some use item ids. the api signature and context usually make clear which is required. bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting items in the bookmarks collection. ...
...ure and context usually make clear which is required. bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting items in the bookmarks collection. ...
...And 33 more matches
nsINavBookmarkObserver
toolkit/components/places/nsinavbookmarksservice.idlscriptable this interface is an observer for bookmark changes. ...
... toolkit/components/places/nsinavbookmarksservice.idlscriptable this interface is an observer for bookmark changes. ...
... toolkit/components/places/nsinavbookmarksservice.idlscriptable this interface is an observer for bookmark changes. ...
...And 33 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
this specification details how alignment should work in all the different layout methods. layout methods will conform to the specification where possible and implement individual behavior based on their differences (features and constraints). while the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the css grid layout method has been widely adopted. ...
... which blocks are laid out in block layout. if you have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. the inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. we are able to align the content inside grid areas, and the grid tracks themselves on these two axes. ...
... have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. the inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. we are able to align the content inside grid areas, and the grid tracks themselves on these two axes. aligning items on the block axis the align-self and align-items properties control alignment on the block axis. ...
...And 33 more matches
Menus - Archive of obsolete content
ted. this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box. see menu buttons for more information. toolbarbutton toolbar buttons can also support menus. this works just like it does for other buttons. see menu buttons for more information. menulist a menulist is used when you wish the user to select from a list of items. for this type of menu, one of the items within it is selected. when another item is selected, the label of the item is set as the label of the menulist. other user interfaces call this type of widget a combobox. you may also see a popup tag used in place of the menupopup tag. the popup tag is deprecated but is equivalent to the menupopup tag. menu tag overview the following shows a simple m...
... this type of widget a combobox. you may also see a popup tag used in place of the menupopup tag. the popup tag is deprecated but is equivalent to the menupopup tag. menu tag overview the following shows a simple menu example, containing a menubar with a single menu labeled 'file'. <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> </menubar> there are five tags used in this example, described briefly here: menubar a row of menus that appears along the top of the window or screen. it should contain menu elements. menu a label of a menu on a menubar, for insta...
...enuitem label="exit"/> </menupopup> </menu> </menubar> there are five tags used in this example, described briefly here: menubar a row of menus that appears along the top of the window or screen. it should contain menu elements. menu a label of a menu on a menubar, for instance 'file' or 'tools'. a menu can also be used as the label of a submenu. menupopup a popup containing items to appear on a menu. the menupopup in the example above is a child of the 'file' menu and will appear when the menu label is clicked. menuitem a single item to appear on a menu. when the user moves the mouse over a menuitem, it will highlight the item. the cursor keys can also be used to adjust which menuitem is the current item. a menuitem is associated with a command to carry out. men...
...And 32 more matches
listbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a list of items where one or more of the items may be selected. a listbox may contain multiple columns. there are numerous methods which allow the items in the listbox to be retrieved and modified. you may specify the number of rows to display in the list using the rows attribute. additional rows can be viewed using a scroll bar. a listbox is expected 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. attributes ...
...e 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. ...
...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. ...
...And 32 more matches
richlistbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is 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. ...
... 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. ...
...hen 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. ...
...And 32 more matches
mix-blend-mode - CSS: Cascading Style Sheets
t | difference | exclusion | hue | saturation | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="col"> <div class="note">blending in isolation (no blending with the background)</div> <div class="row isolate"> <div class="cell"> normal <div class="container normal"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <defs> <lineargradient id="red"> <stop offset="0" stop-color="hsl(0,100%,50%)" /> <stop offset="100%" stop-color="hsl(0,0%,100%)" /> </lineargradient> <lineargradient id="green"> <stop offset="0" stop-color="hsl(120,100%,...
..."hsl(120,100%,50%)" /> <stop offset="100%" stop-color="hsl(120,0%,100%)" /> </lineargradient> <lineargradient id="blue"> <stop offset="0" stop-color="hsl(240,100%,50%)" /> <stop offset="100%" stop-color="hsl(240,0%,100%)" /> </lineargradient> </defs> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> multiply <div class="container multiply"> <div class="group"> <div class...
..." cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> multiply <div class="container multiply"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> darken ...
...And 32 more matches
Enc Dec MAC Output Public Key as CSR
file.\n\n", ""); exit(-1); } /* map option letter enumerated commad type */ static commandtype option2command(const char* c) { switch (*c) { case 'g': return gen_csr; case 'e': return encrypt; case 'd': return decrypt; default: return unknown; } } /* * wrap the symkey using public key */ secstatus wrapkey(pk11symkey* key, seckeypublickey *pubkey, secitem **wrappedkey) { secstatus rv; secitem *data = (secitem *)port_zalloc(sizeof(secitem)); if (!data) { pr_fprintf(pr_stderr, "error while allocating memory\n"); rv = secfailure; goto cleanup; } data->len = seckey_publickeystrength(pubkey); data->data = (unsigned char*)port_zalloc((data->len)*sizeof(unsigned int)); if (!data->data) { pr_f...
...->len)*sizeof(unsigned int)); if (!data->data) { pr_fprintf(pr_stderr, "error while allocating memory\n"); rv = secfailure; goto cleanup; } rv = pk11_pubwrapsymkey(ckm_rsa_pkcs, pubkey, key, data); if (rv != secsuccess) { rv = secfailure; } else { *wrappedkey = data; return secsuccess; } cleanup: if (data) { secitem_freeitem(data, pr_true); } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_false...
...return secfailure; } pr_fprintf(outfile, "%s\n", header); printasascii(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(type, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(type, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't create a cont...
...And 30 more matches
nss tech note4
a "level" in a hierarchical namespace), a text description, and some other things. ...
...on, and some other things. ...
...ether the extension is critical value : the value of the extension looping through all extensions certcertextension** extensions =cert->extensions; if (extensions) { while (*extensions) { secitem *ext_oid = &(*extensions)->id; secitem *ext_critical = &(*extensions)->critical; secitem *ext_value = &(*extensions)->value; /* id attribute of the extension */ secoiddata *oiddata = secoid_findoid(ext_oid); if (oiddata == null) { /* oid not found */ /* secitem ext_oid has type (secitemtype), data (unsigned char *) and len (unsigned int) field...
...And 30 more matches
Microdata DOM API - Web APIs
mplemented in some browsers for a long time. nowadays, they have been abandoned and removed from all browsers and are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. ...
...en abandoned and removed from all browsers and are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. ...
...nd are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. it returns a nodelist containing the items with the specified types, or all types if no argument is specified. ...
...And 30 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
6.0 / seamonkey 2.3) a regular expression is a special kind of string (i.e. a sequence of characters) that matches patterns of characters in other strings. microsummary generators use them to identify the pages that the generators know how to summarize by matching patterns in those pages' urls. ...
...tch the urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, see creating a microsummary. urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters. ...
...detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, see creating a microsummary. urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters. here's a url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 in this url, the domain name is "cgi.ebay.com", the file path is "/ws/ebayisapi.dll", and the query parameters are "?viewitem&item=280018439106". matching an ebay url to match this url with a regular expression, we need to put characters into the regular expression that match the characters in the url. most of the...
...And 29 more matches
Client-side storage - Learn web development
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. new school: web storage and indexeddb the "easier" features we mentioned above are as follows: the web storage api provides a very simple syntax for storing and retrieving smaller, data items consisting of a name and a corresponding value. this is useful when you just need to store some simple data, like the user's name, whether they are logged in, what color to use for the background of the screen, etc. the indexeddb api provides the browser with a complete database system for storing complex data. this can be used for things from complete sets of customer records to even complex d...
...orage data is contained within two object-like structures inside the browser: sessionstorage and localstorage. the first one persists data for as long as the browser is open (the data is lost when the browser is closed) and the second one persists data even after the browser is closed and then opened again. we'll use the second one in this article as it is generally more useful. the storage.setitem() method allows you to save a data item in storage — it takes two parameters: the name of the item, and its value. try typing this into your javascript console (change the value to your own name, if you wish!): localstorage.setitem('name','chris'); the storage.getitem() method takes one parameter — the name of a data item you want to retrieve — and returns the item's value. now typ...
...ers: the name of the item, and its value. try typing this into your javascript console (change the value to your own name, if you wish!): localstorage.setitem('name','chris'); the storage.getitem() method takes one parameter — the name of a data item you want to retrieve — and returns the item's value. now type these lines into your javascript console: let myname = localstorage.getitem('name'); myname upon typing in the second line, you should see that the myname variable now contains the value of the name data item. the storage.removeitem() method takes one parameter — the name of a data item you want to remove — and removes that item out of web storage. ...
...And 29 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
li><a href="">nav 2</a></li> <li><a href="">nav 3</a></li> </ul> </nav> <article class="content"> <h1>main article area</h1> <p>in this layout, we display the areas in source order for any screen less that 500 pixels wide. we go to a two column layout, and then to a three column layout by redefining the grid, and the placement of items on the grid.</p> </article> <aside class="side">sidebar</aside> <div class="ad">advertising</div> <footer class="main-footer">the footer</footer> </div> as we are using grid-template-areas to create the layout. outside of any media queries i need to name the areas. we name areas using the grid-area property. .main-head { grid-area: header; } .content { grid...
...we are using grid-template-areas to create the layout. outside of any media queries i need to name the areas. we name areas using the grid-area property. .main-head { grid-area: header; } .content { grid-area: content; } .main-nav { grid-area: nav; } .side { grid-area: sidebar; } .ad { grid-area: ad; } .main-footer { grid-area: footer; } this will not create any layout, however our items now have names we can use to do so. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row tracks but this layout dictates a single column, and rows will be...
...o. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid. .wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } after setting up a mobile layout we will get this single column at all screen sizes, we can now add a media query and redefine our layout for the circumstance of having enough screen real estate to show two columns. @media (min...
...And 29 more matches
Arrays - Learn web development
prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to understand what arrays are and how to manipulate them in javascript. ...
... prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to understand what arrays are and how to manipulate them in javascript. ...
... single objects that contain multiple values stored in a list. array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value. maybe we've got a series of product items and their prices stored in an array, and we want to loop through them all and print them out on an invoice, while totaling all the prices together and printing out the total price at the bottom. if we didn't have arrays, we'd have to store every item in a separate variable, then call the code that does the printing and adding separately for each item. this would be much longer to write out, les...
...And 28 more matches
Using the Places annotation service
which one to use is usually dictated by the application. ...
...which one to use is usually dictated by the application. uri's are easier to use for services that want to annotate a web page loaded in the browser, while id's are easier to use for services already working with the places database. ...
...which one to use is usually dictated by the application. uri's are easier to use for services that want to annotate a web page loaded in the browser, while id's are easier to use for services already working with the places database. id's also offer the ability to add annotations to containers and queries of the database. ...
...And 27 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
this article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of these guides. when we describe flexbox as being one dimensional we are describing the fact that flexbox deals with layout in one dimension at a time — either as a row or as a column. ...
...n the block direction. the cross axis the cross axis runs perpendicular to the main axis, therefore if your flex-direction (main axis) is set to row or row-reverse the cross axis runs down the columns. if your main axis is column or column-reverse then the cross axis runs along the rows. understanding which axis is which is important when we start to look at aligning and justifying flex items; flexbox features properties that align and justify content along one axis or the other. start and end lines another vital area of understanding is how flexbox makes no assumption about the writing mode of the document. in the past, css was heavily weighted towards horizontal and left-to-right writing modes. modern layout methods encompass the range of writing modes and so we no longer assume ...
...xt will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other. you can read more about the relationship between flexbox and the writing modes specification in a later article; however, the following description should help explain why we do not talk about left and right and top and bottom when we describe the direction that our flex items flow in. if the flex-direction is row and i am working in english, then the start edge of the main axis will be on the left, the end edge on the right. if i were to work in arabic, then the start edge of my main axis would be on the right and the end edge on the left. in both cases the start edge of the cross axis is at the top of the flex container and the end edge at the bottom, as both...
...And 27 more matches
Manipulating Lists - Archive of obsolete content
« previousnext » the xul listbox provides a number of specialized methods. list manipulation the listbox element provides numerous methods to retrieve and manipulate its items. although listboxes may be manipulated using the standard dom functions as well, it is recommended that the specialized listbox functions be used instead when possible. these functions are bit simpler and will do the right thing. the appenditem() function is used to append a new item to the end a list. ...
...ox functions be used instead when possible. these functions are bit simpler and will do the right thing. the appenditem() function is used to append a new item to the end a list. similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the list structure. here is an example: example 1 : source view <script> function additem(){ document.getelementbyid('thelist').appenditem("thursday", "thu"); } </script> <listbox id="thelist"/> <button label="add" oncommand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the listitem element. the value is used only as an extra optional value...
...ementbyid('thelist').appenditem("thursday", "thu"); } </script> <listbox id="thelist"/> <button label="add" oncommand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the listitem element. the value is used only as an extra optional value associated with an item which you might wish to use in a script. similarly, there is also an insertitemat() and a removeitemat() function which inserts a new item and removes an existing item respectively. the syntax is as follows: list.insertitemat(3, "thursday", "thu"); list.removeitemat(3); the insertitemat() function takes an additional argument, the position to insert the new item. ...
...And 26 more matches
Rendering a list of Vue components - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. ...
... prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. ...
... prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. ...
...And 26 more matches
Accessibility API cross-reference
they also define a list of possible object states, such as focused, read-only, checked, etc. an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-platform, but there is currently no cross-platform accessibility api. ...
... ipc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets. these tables describe how various accessibility apis define possible roles of an object, and states. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc. this table is the start of a cross-reference, so we can spot the differences and similarities in the apis. aria is a standard developed as part of the web accessibility initiative, which uses markup syntax quite familiar to users of html, xml, sgml and others. the roles it specifies have alre...
...n that contains mostly site-oriented content, rather than page-specific content. ...
...And 26 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
e time. the two specifications share some common features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with grid. one-dimensional vs. two-dimensional layout a simple example can demonstrate the difference between one- and two-dimensional layouts. in this first example, i am using flexbox to lay out a set of boxes. i have five child items in my container, and i have given the flex properties values so that they can grow and shrink from a flex-basis of 150 pixels. i have also set the flex-wrap property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; backgroun...
...this is where you want a two-dimensional layout method:...
...94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { width: 500px; display: flex; flex-wrap: wrap; } .wrapper > div { flex: 1 1 150px; } in the image, you can see that two items have wrapped onto a new line. these items are sharing the available space and not lining up underneath the items above. this is because when you wrap flex items, each new row (or column when working by column) becomes a new flex container. space distribution happens across the row. a common question then is how to make those items line up. this is where you want a two-dimensional layout method: you want to control the alignment by row ...
...And 26 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data state. note: if you need to check your code against our version, you can find a finished version of the sample vue app code in our todo-vue repository. ...
...e syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state. creating a todoitem component let's create our first component, which will display a single todo item. we'll use this to build our list of todos. in your moz-todo-vue/src/components directory, create a new file named todoitem.vue. open the file in your code editor. create the component's template section by adding <template></template> to the top of the file. create a <script></script> section below your templ...
... template section by adding <template></template> to the top of the file. create a <script></script> section below your template section. inside the <script> tags, add a default exported object export default {}, which is your component object. your file should now look like this: <template> </template> <script> export default {}; </script> we can now begin to add actual content to our todoitem. vue templates are currently only allowed a single root element — one element needs to wrap everything inside the template section (this will change when vue 3 comes out). we'll use a <div> for that root element. add an empty <div> inside your component template now. inside that <div>, let's add a checkbox and a corresponding label. add an id to the checkbox, and a for attribute map...
...And 25 more matches
ARIA Test Cases - Accessibility
een readers should indicate that this button has an associated menu. screen magnifiers should give indication (if this is not done visually anyway). when the button is pressed, the menu should be tracked like any other menu. when closing the menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indicated as menu buttons. menus are tracked, closing menus also results in correct focus tracking. partial fail in v-pc-mode. the fact that a button is a menu button is not indicated with the virtual curs...
...r closed, the new open/closed state should be spoken. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 fail. label and current content as well as role are spoken, also when typing in a new value, that gets reflected. but when dropping down the lists of states in either example, after the second or so list item, jaws turns off forms mode, and the user has to turn off v cursor to be able to make selections or tab to anything useful. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - ...
...the groupbox, the description for the entire groupbox should be read by a screen reader. when the button is focused, the description of the button should be read after the button's label and role are read by the screen reader. regression testers should test both tabbing forward and back, to make sure that the groupbox description and button description are both read when the button is the first item focused in the groupbox. (al) alternatively, description are not read automatically but may be accessible from a hotkey. however, if the screen reader does not at least indicate that the description exists, users are likely to miss important information. markup used: role="description" and aria-describedby notes: results: at firefox ie opera safari jaws 9 ...
...And 25 more matches
Flexbox - Learn web development
this article explains all the fundamentals. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to use the flexbox layout system to create web layouts. why flexbox? for a long time, the only reliable cross browser-compatible tools available for creating css layouts were things like floats and positioning. ...
...tart with, we need to select which elements are to be laid out as flexible boxes. to do this, we set a special value of display on the parent element of the elements you want to affect. in this case we want to lay out the <article> elements, so we set this on the <section>: section { display: flex; } this causes the <section> element to become a flex container, and its children to become flex items. the result of this should be something like so: so, this single declaration gives us everything we need — incredible, right? we have our multiple column layout with equal sized columns, and the columns are all the same height. this is because the default values given to flex items (the children of the flex container) are set up to solve common problems such as this. to be clear, let's rei...
... same height. this is because the default values given to flex items (the children of the flex container) are set up to solve common problems such as this. to be clear, let's reiterate what is happening here. the element we've given a display value of flex to is acting like a block-level element in terms of how it interacts with the rest of the page, but its children are being laid out as flex items — the next section will explain in more detail what this means. note also that you can use a display value of inline-flex if you wish to lay out an element's children as flex items, but have that element behave like an inline element. ...
...And 24 more matches
EncDecMAC using token object - sample 3
intf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *k...
...ad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't create a context\n"); goto cleanup; } cleanup: i...
...er, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ secstatus crypt(pk11context *ctx, unsigned char *out, unsigned int *outlen, unsigned int maxout, unsigned char *in, unsigned int inlen) { secstatus rv; rv = pk11_cipherop(ctx, out, outlen, maxout, in, inlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "crypt failed : pk11_cipherop returned %d\n", rv); go...
...And 23 more matches
<ul>: The Unordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ul
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ul> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...webtv interface, but not all browsers support it: triangle. if not present and if no css list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list. warning: do not use this attribute, as it has been deprecated; use the css list-style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle, or a square. the bullet style is not defined in the html description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as d...
... which can be of several forms, like a dot, a circle, or a square. the bullet style is not defined in the html description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as desired. moreover, the nested lists may alternate between <ol> and <ul> without restriction. ...
...And 23 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ion to chrome that probably leaves a lot of unanswered questions. if you keep in mind the following three points at the very least, the next section, developing a simple extension, should help flesh out your understanding. an extension’s gui, or chrome, can consist of three kinds of package: content, locale, and skin. use a cross-package overlay on top of browser.xul to add a button or menu item to the firefox browser window. the chrome manifest plays two important roles: it registers the contents of the chrome packages, and invokes the cross-package overlay. developing a simple extension: hello world in this section, we will write an extremely simple “hello world” extension that only displays the time.3 phase 1: test install our first step will be to perform a test installat...
...wo important roles: it registers the contents of the chrome packages, and invokes the cross-package overlay. developing a simple extension: hello world in this section, we will write an extremely simple “hello world” extension that only displays the time.3 phase 1: test install our first step will be to perform a test installation consisting of the minimum code needed to add a new menu item to the tools menu (figure 3). fixme: figure 3: menu after phase 1 complete source file structure first set up the work folders you’ll use to organize your extension’s source files. the folder can be wherever you want, but for the purposes of this guide, we’ll assume it’s at c:\extensions\helloworld . create folders and files in your work folder as shown in figure 4. the purpose of each...
...this gives basic information about the extension, and is required in order for the extension to be installed in firefox.. chrome.manifest this is the chrome manifest described in the earlier section. registers packages and invokes cross-package overlays. content/overlay.xul xul file that will be overlaid on the firefox browser window, adding buttons, menu items, etc. content/clock.xul content/clock.js the xul to display a clock in the window, and the javascript to control its operation (these files will be used in phase 2). create install manifest fill in the install.rdf file as shown in listing 1. listing 1: content for install.rdf <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="h...
...And 22 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
progname, dbdir, headerfilename, encryptedfilename); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-d -d <dbdirpath> -b <headerfilename> -e <encryptfilename> -o <opfilename>\n"); exit(-1); } } /* * sign the contents of input file using private key and * return result as secitem */ secstatus signdata(const char *infilename, seckeyprivatekey *pk, secitem *res) { secstatus rv = secfailure; unsigned int nb; unsigned char ibuf[4096]; prfiledesc *infile = null; sgncontext *sgn = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_...
... if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (sgn) { sgn_destroycontext(sgn, pr_true); } return rv; } /* * verify the signature using public key */ secstatus verifydata(const char *infilename, seckeypublickey *pk, secitem *sigitem, secupwdata *pwdata) { unsigned int nb; unsigned char ibuf[4096]; secstatus rv = secfailure; vfycontext *vfy = null; prfiledesc *infile = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", ...
...vfycontext *vfy = null; prfiledesc *infile = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } vfy = vfy_createcontext(pk, sigitem, sec_oid_pkcs1_md5_with_rsa_encryption, pwdata); if (!vfy) { pr_fprintf(pr_stderr, "unable to create context for verifying signature\n"); rv = secfailure; goto cleanup; } rv = vfy_begin(vfy); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_begin\n"); goto clean...
...And 22 more matches
Encrypt Decrypt MAC Keys As Session Objects
", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mecha...
...11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */...
...ler); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't...
...And 21 more matches
Encrypt and decrypt MAC using token
", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mecha...
...11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */...
...ler); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't...
...And 21 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */...
...ler); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't...
...And 21 more matches
sample2
rr, "%s -d -d %s -b %s -e %s -o : output file name is not found\n", progname, dbdir, headerfilename, encryptedfilename); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-d -d <dbdirpath> -b <headerfilename> -e <encryptfilename> -o <opfilename>\n"); exit(-1); } } /* * sign the contents of input file using private key and * return result as secitem */ secstatus signdata(const char *infilename, seckeyprivatekey *pk, secitem *res) { secstatus rv = secfailure; unsigned int nb; unsigned char ibuf[4096]; prfiledesc *infile = null; sgncontext *sgn = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto ...
...fprintf(pr_stderr, "problem while sgn_update\n"); goto cleanup; } } rv = sgn_end(sgn, res); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (sgn) { sgn_destroycontext(sgn, pr_true); } return rv; } /* * verify the signature using public key */ secstatus verifydata(const char *infilename, seckeypublickey *pk, secitem *sigitem, secupwdata *pwdata) { unsigned int nb; unsigned char ibuf[4096]; secstatus rv = secfailure; vfycontext *vfy = null; prfiledesc *infile = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } vfy = vfy_createcontext(pk, sigitem, sec_...
..., header); pr_fprintf(outfile, "%s\n", buf); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; break; default: return secfailure; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * read cryptographic parameters from the header file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv = secsuccess; prfiledesc* file = null; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char *header; char *trailer; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); rv = secfailure; goto cleanup; } switch (type) { case pubkey: header = pubkey_h...
...And 21 more matches
Places utilities for JavaScript
d. anode - the bookmark aiid - the return interface wanted. there are several predefined versions of this for common calls. these just take in the node, as the interface is already defined: asvisit(anode) asfullvisit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here. load_in_sidebar_anno - this annotation is associated with bookmarks or items that should load in the sidebar automatically. description_anno - this annotation stores description information about a bookmark. post_data_anno - i need to clarify here, but i think this is the name of the annotation that stores information for keyword searches from a bookmark. lmanno_feeduri - need to clarify here too, but i think for each livemark, there is an bookmark which contains an a...
...; boolean nodeisreadonly(nsinavhistoryresultnode anode); boolean nodeishost(nsinavhistoryresultnode anode); boolean 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 getindexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsin...
... getindexofnode(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, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword...
...And 21 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
out: the support for different writing modes that is built into the specification. for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. ...
...uide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. if we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. ...
...nd other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. if we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. in the code snippet below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container: .container { position: relative; } .item { position: absolute; top: 20px; left: 30px; } <div class="container"> <div class="item">item</div> </div> another place you might see physical keywords in use, is when using text-align: right to align text to the right. there are also physical properties in css.
...And 21 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
<button label="button" style="min-width: 10em;"/> listing 7: setting the size of a button using css markup hidden and collapsed the hidden and collapsed attributes act as switches to turn off the display of elements. setting hidden="true" disables display of that element. this has the same effect as setting display: none in css. you would use this to set a hidden or absent state, for example items that aren't displayed in contextual menus. setting collapsed="true" sets an element's height and width to 0, but the element is treated as being present. this is equivalent to setting visibility: collapse in css. use this to "roll up" sidebars that aren't currently in use. disabled while not appropriate for all elements, you can use the disabled attribute to temporarily disable input to an el...
... in an application or web service. in the past, a combination of html and javascript was used to produce this sort of complex ui structure, but in xul, it can be handled easily just by writing tags. creating the menu listing 9 shows how the menu element and its related elements are combined. this produces the output seen in figure 6. ...
...cation or web service. in the past, a combination of html and javascript was used to produce this sort of complex ui structure, but in xul, it can be handled easily just by writing tags. creating the menu listing 9 shows how the menu element and its related elements are combined. this produces the output seen in figure 6. ...
...And 19 more matches
Gecko info for Windows accessibility vendors
ws_to = 0x1006 }; enum { navrelation_flows_from = 0x1007 }; these two relations allow the reading flow to break out of the normal dom flow. both flows_to and flows_from are set in markup from the single dynamic content accessibility aaa:flowsto relation -- the inverse flow_from relation is automatically calculated. ...
...he reading flow to break out of the normal dom flow. both flows_to and flows_from are set in markup from the single dynamic content accessibility aaa:flowsto relation -- the inverse flow_from relation is automatically calculated. these relations can affect the calculation for the next next or previous item of a certain type. ...
...and flows_from are set in markup from the single dynamic content accessibility aaa:flowsto relation -- the inverse flow_from relation is automatically calculated. these relations can affect the calculation for the next next or previous item of a certain type. ...
...And 18 more matches
NSS Sample Code Sample1
e. in particular, this // creates the key pair that is used for wrapping keys int init(); // generates keys for encryption (aes) and macing. the // wrapped keys are stored in data files. int generatekeys(); // gets the server's public key (wrapping key) to // send to another server. this becomes the input to // the exportkeys method on the remote server. ...
...er. this becomes the input to // the exportkeys method on the remote server. int exportpublickey(secitem **pubkeydata); // export the encryption and key using the key // provided. the key should come from another server // in the cluster. (the admin should verify this.) // // in this example, the server must be started to perform // this function (see start()) int exportkeys(secitem *pubkey, secitem **wrappedenckey, secitem **wrappedmackey); // import the keys received from another server in the // cluster. the admin should make sure the keys actually // came from the correct source. ...
...(for completeness) int shutdown(); // compare keys in two server instances. ...
...And 18 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
in addition to the ability to place items accurately onto a created grid, the css grid layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items. you can see auto-placement in action in the simplest of ways by creating a grid on a set of items. if you give the items no placement information they will position themselves on the grid, one in each grid cell. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px...
... sizin...
...pper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> default rules for auto-placement as you can see with the above example, if you create a grid all child items will lay themselves out one into each grid cell. the default flow is to arrange items by row. grid will lay an item out into each cell of row 1. if you have created additional rows using the grid-template-rows property then grid will continue placing items in these rows. if the grid does not have enough rows in the explicit grid to place all of the items new implicit rows will be created. sizing rows in the implicit grid the default for automatically created rows in the implici...
...And 18 more matches
Microdata - HTML: Hypertext Markup Language
pages. search engines and web crawlers can extract and process microdata from a web page and use it to provide a richer browsing experience for users. search engines benefit greatly from direct access to this structured data because it allows search engines to understand the information on web pages and provide more relevant results to users. ...
...nt results to users. microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. microdata is an attempt to provide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic microformats. at a high level, microdata consists of a group of name-value pairs. the groups are called items, and each name-value pair is a property. items and properties are represented by regular elements. to create an item, the itemscope attribute is used. to add a property to an item, the itemprop attribute is used on one of the item's descendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set ...
...cendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert performance, with startdate and location properties to specify the concert's key details. in this case, schema.org music event would be the url used by itemtype and startdate and location would be itemprop's that schema.org music event defines. note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item. web developers can design a custom vocabulary or use vocabularies available on the web, such as the widely used schema.org vocabulary. a collection of commonly us...
...And 18 more matches
Tree View Details - Archive of obsolete content
« previousnext » this section will describe some more features of tree views. creating a hierarchical custom view in the last section, we created a simple tree view that implemented only a minimum amount of functionality. next, let's look at some additional functions that views may implement. here, we will examine how to create a hierarchical set of items using the view. this is a fairly tricky process as it involves keeping track of which items have children and also which rows are open and closed. nesting level every row in the tree has a nesting level. the topmost rows are at level 0, the children of those rows are at level 1, their children at level 2 and so on. the tree will query the view for each row by calling its getlevel method to find out the level of that row.
... the nesting lines along the side of the tree. the getparentindex method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value. all of these methods must be implemented by the view for children to be handled properly. containers there are also three functions, iscontainer, iscontainerempty and iscontaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if a row is a container and might contain children. the iscontainerempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is required to keep track of this. the tree will call this method to ...
...this method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a style sheet may be used to style items based on various properties such as whether a row is open. this is described in a later section. a non-empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. empty containers will not have a twisty, but will still be treated like a container. when the user clicks the twisty to open a row, the tree will call the view's toggleope...
...And 17 more matches
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
ts, the data to display inside the tree is not specified using tags, but is determined from a view object. the view object implements the nsitreeview interface. the view is queried for the data to appear in the tree. there are several ways in which trees are used, as listed below. the second column lists the interfaces available via the tree's view property. the third column indicates whether treeitem element are used. if you would like to allow the tree to be horizontally scrolled, simply set the width attributes for each column to make the tree wider than its containing object. tree type view interfaces has dom nodes? description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element. in th...
...make the tree wider than its containing object. tree type view interfaces has dom nodes? description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element. in this situation, a content view (which implements the interface nsitreecontentview) which is a more specialized type of view, uses the treeitem elements and their descendants to determine the data to display in the tree. however, the treeitems are not displayed directly; they are used only as data to the content view. however, the content view will automatically update the tree if treeitems are changed. rdf tree nsitreeview, nsixultreebuilder no this tree is generated from an rdf datasource. it is used when a tree has a...
...this is the type that should be used for rdf generated trees with lots of rows. ...
...And 17 more matches
Index
Mozilla › Tech › XPCOM › Index
he code you've already created in the first part of the tutorial (see weblock1.cpp in the previous chapter) and uses xpcom tools that make coding a lot easier and more efficient. it also introduces a basic string type that is used with many of the apis in both xpcom and gecko. 113 detailed xpcom hashtable guide guide, xpcom a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: 114 how to build an xpcom component in javascript add-ons, extensions, javascript, tutorial, xpcom if you are looking for add-on sdk solution for xpcom javascript components then check ou...
...r multiple objects with a numeric, zero-based index. 121 xpcom changes in gecko 2.0 gecko 2.0, xpcom several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code. 122 xpcom hashtable guide a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: 123 mozilla::services namespace developing mozilla, xpcom the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom app...
... getrelation this method returns accessible relation for this accessible object by index. 271 getrelations this method returns multiple accessible relations for this accessible object. 272 getstate this method retrieves states of the accessible. 273 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. 274 help help text associated with node. 275 indexinparent the 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent. 276 keyboardshortcut provides localized string of access...
...And 17 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. ...
... dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
...And 17 more matches
Using the CSS Painting API - Web APIs
arameters of the paint() function include the drawing context, paint size and properties. to be able to access properties, we include the static inputproperties() method, which provides live access to css properties, including regular properties and custom properties, and returns an array of property names. we'll take a look at inputarguments in the last section. ...
...nd returns an array of property names. we'll take a look at inputarguments in the last section. example let's create a list of items with a background image that rotates between three different colors and three widths. in our css, we provide a different color and a width subtractor for the background box we've created via the --boxcolor and --widthsubtractor custom properties. ...
...of property names. we'll take a look at inputarguments in the last section. example let's create a list of items with a background image that rotates between three different colors and three widths. in our css, we provide a different color and a width subtractor for the background box we've created via the --boxcolor and --widthsubtractor custom properties. ...
...And 17 more matches
Responsive Navigation Patterns - Progressive web apps (PWAs)
are often not the optimal way to present information on small screens because of the reduced screen real estate. therefore, it is necessary to consider the presentation of content and ease of navigation for all screen sizes. note: html/css for the corresponding patterns will be available soon. pattern 1: top toggle menu in this pattern, as the screen width is reduced, the top navigation items rearrange until there is not enough space. at that point, some items move from the top navigation to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. pros: one button in header maximizes space for ...
...space. at that point, some items move from the top navigation to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. ...
...ion to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. ...
...And 17 more matches
Using XML Data Islands in Mozilla - Archive of obsolete content
s not specify an executable script type. when putting xml in a data block, you need to make sure that the xml content you are embedding does not have an end tag that case-insensitively matches "</script>". ...
...utable script type. when putting xml in a data block, you need to make sure that the xml content you are embedding does not have an end tag that case-insensitively matches "</script>". ...
... block, you need to make sure that the xml content you are embedding does not have an end tag that case-insensitively matches "</script>". ...
...And 16 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in this article we will fully explore how this fundamental feature of the specification works. starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. the lines are numbered for columns and rows, and are indexed from 1. note that grid is indexed according to the writing mode of the document. in a left to right language such as english line 1 is on the left-hand side of the grid. ...
...we will learn more about the interaction between writing modes and grids in a later guide. a basic example as a very simple example we can take a grid with 3 column tracks and 3 row tracks. this gives us 4 lines in each dimension. inside our grid container i have four child elements. if we do not place these on to the grid in any way they will lay out according to the auto-placement rules, one item in each of the first four cells. if you use the firefox grid highlighter you can see how the grid has defined columns and rows. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480...
...it should also start on the first row line, at the top of the grid and span to the fourth row line. .box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4; } as ...
...And 16 more matches
justify-content - CSS: Cascading Style Sheets
the interactive example below demonstrates some of the values using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lease clone https://github.com/mdn/interactive-examples and send us a pull request. the alignment is done after the lengths and auto margins are applied, meaning that, if in a flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. ...
... us a pull request. the alignment is done after the lengths and auto margins are applied, meaning that, if in a flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. ...
...And 16 more matches
The Essentials of an Extension - Archive of obsolete content
ding standards are based on mozilla's or other known and used standards. ...
...'s or other known and used standards. ...
... section, moving on to the most important part of the content: <menubar id="main-menubar"> <menu id="xulschoolhello-hello-menu" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.hellomenu.accesskey;" insertafter="helpmenu"> <menupopup> <menuitem id="xulschoolhello-hello-menu-item" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloitem.accesskey;" oncommand="xulschoolchrome.browseroverlay.sayhello(event);" /> </menupopup> </menu> </menubar> <vbox id="appmenusecondarypane"> <menu id="xulschoolhello-hello-menu-2" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.hellomenu.accesskey;" insertafter="appmenu_addons"> <menupopup> <menuitem id="xulschoolhello-hello-menu-item-2" l...
...And 15 more matches
menulist - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be used for drop-down choice lists. the user may select one of the elements displayed in the menulist. the currently selected choice is displayed on the menulist 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. attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inpu...
...ent may be used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
...e information is available in the xul tutorial. ...
...And 15 more matches
SVGPointList - Web APIs
defines a list of svgpoint objects. an svgpointlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...objects. an svgpointlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ed as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...And 15 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
lematic, with different parts of css moving on at different speeds. css was therefore modularised, and the various css specifications are different modules that make up css today. these modules relate to each other, and are at different stages of development. the box alignment module for many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container. flexbox provides access to properties that allow the alignment of items on their cross axis and justification of items on the main axis. these properties started life in the flexbox specification, but are now also part of the box alignment specification. this specification details how alignment works in all layout — not just flexbox. box alignment deals with alignment...
...cement of the spec. these properties apply only to flex layout until css box alignment level 3 is finished and defines their effect for other layout modes. additionally, any new values defined in the box alignment module will apply to flexible box layout; in otherwords, the box alignment module, once completed, will supercede the definitions here." in a later article in this series — aligning items in a flex container — we will take a thorough look at how the box alignment properties apply to flex items. the gap properties a recent addition to the box alignment specification has been the row-gap and column-gap properties, along with the shorthand gap. these properties were initially defined in the css grid specification and named grid-row-gap, grid-column-gap and grid-gap. they have be...
...ng with the shorthand gap. these properties were initially defined in the css grid specification and named grid-row-gap, grid-column-gap and grid-gap. they have been renamed and moved to box alignment in order that they can be used in all layout methods — this will ultimately include flexbox. until browsers implement the gap properties for flexbox, margins have to be used to create gaps between items. writing modes in the basic concepts of flexbox article, i explained that flexbox is writing mode aware. writing modes are fully detailed in the css writing modes specification, which details how css supports the various different writing modes that exist internationally. we need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out...
...And 15 more matches
align-content - CSS: Cascading Style Sheets
the css align-content property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. the interactive example below use grid layout to demonstrate some of the values of this property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...ctive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...And 15 more matches
align-self - CSS: Cascading Style Sheets
the align-self css property overrides a grid or flex item's align-items value. in grid, it aligns the item inside the grid area. in flexbox, it aligns the item on the cross axis. the source for this interactive example is stored in a github repository. if 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 property doesn't apply to block-level boxes, or to table cells. if a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
...one https://github.com/mdn/interactive-examples and send us a pull request. the property doesn't apply to block-level boxes, or to table cells. if a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
... us a pull request. the property doesn't apply to block-level boxes, or to table cells. if a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
...And 15 more matches
justify-self - CSS: Cascading Style Sheets
d inside its alignment container along the appropriate axis. the source for this interactive example is stored in a github repository. if 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 effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns an item inside its containing block on the inline axis. for absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. in table cell layouts, this property is ignored (more about alignment in block, absolute positioned and table layout) in flexbox layouts, this property is ignored (more about align...
... for absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. ...
...note that justify-self is ignored in flexbox layouts. ...
...And 15 more matches
Adding menus and submenus - Archive of obsolete content
tems. if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. ...
...hould be positioned near the top of the xul document, and the code should be similar to this: <toolbox> <menubar id="xulschoolhello-menubar"> <menu id="xulschoolhello-greeting-menu" label="&xulschoolhello.greeting.label;"> <menupopup> <menuitem label="&xulschoolhello.greet.short.label;" oncommand="xulschoolchrome.greetingdialog.greetingshort(event);" /> <menuitem label="&xulschoolhello.greet.medium.label;" oncommand="xulschoolchrome.greetingdialog.greetingmedium(event);" /> <menuitem label="&xulschoolhello.greet.long.label;" oncommand="xulschoolchrome.greetingdialog.greetinglong(event);" /> <menuseparator /> <menuitem label="&xulschoolhello.greet.custom.label;" oncommand="xulschoolchrome.greetingdialog...
... oncommand="xulschoolchrome.greetingdialog.greetingcustom(event);" /> </menupopup> </menu> </menubar> </toolbox> this code displays a simple menu with options for 3 different types of greetings, a menuseparator, and finally an option to show a custom greeting. ...
...And 14 more matches
Extensions - Archive of obsolete content
adding a new menu the main menu bar in firefox has the id 'main-menubar'. to add a new menu onto the main application menubar, you will need to overlay this menubar. for instance: <menubar id="main-menubar"> <menu label="search" insertbefore="tools-menu"> <menupopup> <menuitem label="web"/> <menuitem label="mail"/> </menupopup> </menu> </menubar> this menu is added to the main menu bar just before the tools menu. the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. note that the menu will not appear until it has a <menupopup>. adding a new menuitem you might wish to add a new item to one of the menus. this can be done by overlaying the popup to append the item to. for a list of the ids of the menus for ...
...e insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. note that the menu will not appear until it has a <menupopup>. adding a new menuitem you might wish to add a new item to one of the menus. this can be done by overlaying the popup to append the item to. for a list of the ids of the menus for firefox, see firefox menus. for example, to add an item to the end of the tools menu, use the following: <menupopup id="menu_toolspopup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus. because of this, the new item might not appear at the end of the menu but before a menuitem added by another extension, depending on the order in which the overlays are applied. as you cannot...
...menupopup id="menu_toolspopup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus. because of this, the new item might not appear at the end of the menu but before a menuitem added by another extension, depending on the order in which the overlays are applied. as you cannot predict this order, you should not rely on any menuitems being in particular positions in the presence of other extensions. modifying the context menu an extension may wish to modify the context menu associated with the browser area. normally, this menu displays menu items specific to what was context clicked or focused. ...
...And 14 more matches
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
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. ...
...create submenus. more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...And 14 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
this is what we'll cover in this article. ...
...this is what we'll cover in this article. ...
... the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about handling forms in vue, and by association, events, models, and methods. creating a new to-do form we now have an app that displays a list of to-do items. however, we can't update our list of items without manually changing our code! let's fix that. let's create a new component that will allow us to add a new to-do item. in your components folder, create a new file called todoform.vue. add a blank <template> and a <script> tag like before: <template></template> <script> export default {}; </script> let's add in an html for...
...And 14 more matches
CustomizableUI.jsm
it is available in the firefox window as the customizableui property on the window. if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets. manage the areas in which these widgets are shown. ...
...overflowable', that is, if there are too many widgets to fit in the toolbar's horizontal space, the excess widgets will be placed in a panel accessible from an anchor (chevron) in the toolbar. in order to register such a toolbar, set the 'overflowable' property to true, and provide the id of the anchor in the 'anchor' property. widgets widget is the term that customizableui uses for each of the items in a customizable area. note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/removing widgets in all windows for you. there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style w...
... instance is destroyed because of this. awidgetid is the widget whose instance is being destroyed, adocument the document in which this is happening. only fired for api-based widgets. onwidgetdrag(awidgetid, aarea) fired both when and after customize mode drag handling system tries to determine the width and height of widget awidgetid when dragged to a different area. aarea will be the area the item is dragged to, or undefined after the measurements have been done and the node has been moved back to its 'regular' area. oncustomizestart(awindow) fired when opening customize mode in awindow. oncustomizeend(awindow) fired when exiting customize mode in awindow. onwidgetoverflow(anode, acontainer) fired when a widget's dom node is overflowing its container, a toolbar, and will be displayed...
...And 14 more matches
Mail event system
lders, and then forwards it on to any nsifolderlisteners that have registered themselves. the nsimsgmailsession interface actually only allows adding and removal of listeners - the notifications happen through the nsifolderlistener interface as well. methods each event type has a two methods associated with it: notify*<event> - in the nsifolder interface, and nsimsgmailsession interface. onitem*<event> - in the nsifolderlistener interface. the mail session implements this interface. where <event> is the type of event, such as boolpropertychanged or the generic event . sample control flow here is an example of a possible flow of control when a new message is added to a folder. in this example, there is a dialog open that shows properties for this folder including the message co...
...ining 4 messages. because the number of messages in the folder have increased, this change in total message count needs to be broadcast to the world. the folder calls notifyintpropertychanged on itself with the atom that represents "totalmessages": this->notifyintpropertychanged(ktotalmessagesatom, 4, 5);. notifypropertychanged broadcasts this event to each its nsifolderlisteners by calling onitemintpropertychanged on each listener: listener->onintpropertychanged(this, ktotalmessagesatom, 4, 5); the dialog is one of these folder-specific listeners. in its implementation of onintpropertychanged, it uses this information to update the message count in the dialog. notifypropertychanged then broadcasts this event to the mail session: mailsession->onintpropertychanged(this, ktot...
...all folders and receives this notification. in its implementation of onintpropertychanged, it notifies rdf (via the nsirdfobserver system) that the message count has changed. rdf handles the notification by updating the message counts in the folder pane. ...
...And 14 more matches
Accessibility Inspector - Firefox Developer Tools
implemented, the accessibility engine had to be explicitly turned on. starting in firefox 79, it is automatically enabled when you do one of the following: choose accessibility in the tools > web developer menu. select the accessibility tab in the developer tools toolbox. right-click in the main browser window, and choose inspect accessibility properties in the context menu. right-click an item in the html pane of the page inspector, and choose show accessibility properties in the context menu. once activated, the accessibility engine remains running until you close the developer tools toolbox. if you don't wish to allow the accessibility features to be automatically enabled, you can use the configuration editor (also known as about:config) to define the preference devtools.accessibi...
...n't wish to use the accessibility features at all, you can use the configuration editor to set the preference devtools.accessibility.enabled to false. if you do this, the ways listed above for activating the accessibility inspector do nothing. features of the accessibility panel the enabled accessibility panel looks like so: on the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. each item has two properties listed: role — the role this item has on the page (e.g., pushbutton, or footer). this can be either a default role provided by the browser, or a role given to it via a wai-aria role attribut...
... for the current page. items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. each item has two properties listed: role — the role this item has on the page (e.g., pushbutton, or footer). this can be either a default role provided by the browser, or a role given to it via a wai-aria role attribute. name — the name this item has on the page. the name depends on the element; for example, the name of most text elements is simply their textcontent, whereas form elements' names are the contents of their associated <label>. on the right-hand side, you can see further information about the currently selected item. the listed properties are as follows: name — the item's name, as described above. ...
...And 14 more matches
SVGNumberList - Web APIs
. 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. ...
...ct 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. ...
...t 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. ...
...And 14 more matches
SVGTransformList - Web APIs
ansformlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...esignated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...modify the object will result in an exception being thrown. ...
...And 14 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
in this guide we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method. why choose flexbox? in a perfect world of browser support, the reason you'd choose to use flexbox is because you want to lay a collection of items out in one direction or another. as you lay out your items you want to control the dimensions of the items in that one dimension, or control the spacing between items. these are the uses that flexbox was designed for. you can read more about the difference between flexbox and css grid layout in relationship of flexbox to other layout methods, where we discuss how flexbox fits into the overall picture of css layout. in reality we also often use flexbox for jobs that might be better done by grid layou...
...n reality we also often use flexbox for jobs that might be better done by grid layout, as a fallback for grid, and also in order to get alignment capabilities. this is something that may well change once box alignment is implemented in block layout. in this guide i look at some of the typical things you might use flexbox for today. navigation a common pattern for navigation is to have a list of items displayed as a horizontal bar. this pattern, as basic as it seems, was difficult to achieve before flexbox. it forms the most simple of flexbox examples, and could be considered the ideal flexbox use case. when we have a set of items that we want to display horizontally, we may well end up with additional space. we need to decide what to do with that space, and have a couple of options. we eith...
...s pattern, as basic as it seems, was difficult to achieve before flexbox. it forms the most simple of flexbox examples, and could be considered the ideal flexbox use case. when we have a set of items that we want to display horizontally, we may well end up with additional space. we need to decide what to do with that space, and have a couple of options. we either display the space outside of the items — therefore spacing them out with white space between or around them — or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space. space distributed outside the items to distribute the space between or around the items we use the alignment properties in flexbox, and the justify-content property. you can read more about thi...
...And 14 more matches
flex - CSS: Cascading Style Sheets
Web › CSS › flex
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... interpreted as <flex-grow>. the second value must be one of: a <number>: then it is interpreted as <flex-shrink>. a valid value for width: then it is interpreted as <flex-basis>. three-value syntax: the values must be in the following order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. ...
...lowing order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. values initial the item is sized according to its width and height properties. it shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container. this is equivalent to setting "flex: 0 1 auto". auto the item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container. this is equivalent to setting "flex: 1 1 auto". none the item is sized according to its width and height properties. it is fully inflexible: it neither shrinks nor grows in relation to the flex container. this is equivalent ...
...And 14 more matches
Indexed collections - JavaScript
when these values are specified, the array is initialized with them as the array's elements. the array's length property is set to the number of arguments. the bracket syntax is called an "array literal" or "array initializer." it's shorter than other forms of array creation, and so is generally preferred. see array literals for details. to create an array with non-zero length, but without any items, either of the following can be used: // this... let arr = new array(arraylength) // ...results in the same array as this let arr = array(arraylength) // this has exactly the same effect let arr = [] arr.length = arraylength note: in the above code, arraylength must be a number. otherwise, an array with a single element (the provided value) will be created. calling arr.length will return ...
...'dusty' is indexed at 30, so cats.length returns 30 + 1). remember, javascript array indexes are 0-based: they start at 0, not 1. this means that the length property will be one more than the highest index stored in the array: let cats = [] cats[30] = ['dusty'] console.log(cats.length) // 31 you can also assign to the length property. ...
...writing a value that is shorter than the number of stored items truncates the array. writing 0 empties it entirely: let cats = ['dusty', 'misty', 'twiggy'] console.log(cats.length) // 3 cats.length = 2 console.log(cats) // logs "dusty, misty" - twiggy has been removed cats.length = 0 console.log(cats) // logs []; the cats array is empty cats.length = 3 console.log(cats) // logs [ <3 empty items> ] iterating over arrays a common operation is to iterate over the values of an array, processing each one in some way. the simplest way to do this is as follows: let colors = ['red', 'green', 'blue'] for (let i = 0; i < colors.length; i++) { console.log(colors[i]) } if you know that none of the elements in your array evaluate to false in a boolean context—if your array consists only o...
...And 14 more matches
Bookmarks - Archive of obsolete content
tp://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 nsinavbookmarksservice.getbookmarkidsforuri() method. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {});...
..."@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the specified uri (in this case, "http://google.com"). ...
...); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the specified uri (in this case, "http://google.com"). manipulating existing items there are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. this section covers some of them. the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method. ...
...And 13 more matches
ContextMenus - Archive of obsolete content
a typical usage is for the user to right-click on an element to display a menu of commands pertaining to what was clicked on. context menu events there are various ways in which a context menu can be opened. the most common is by clicking on an element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. ...
...d event for example. attaching context menus a context menu may be attached to an element using the context attribute, which may be applied to any xul element. the value of the context attribute should be the id of a context menu within the same document. in the example, a context menu is attached to a grid. <window id="main-window"> <popupset> <menupopup id="ins-del-menu"> <menuitem label="insert"/> <menuitem label="delete"/> </menupopup> </popupset> </window> <grid context="ins-del-menu"> <columns> <column/> <column flex="1"/> </columns> <rows id="rows"> <row align="center"> <label value="name:"/> <textbox/> </row> </rows> </grid> the same context menu can be attached to multiple elements. just set the context attribute on ...
...u want the context menu to apply to. one technique is to attach a context menu to an entire document area. for instance, the firefox browser applies a single context menu to the browser area which displays web pages. ...
...And 13 more matches
Using Remote XUL - Archive of obsolete content
menus and buttons the mozilla.org web site uses an html navigation bar on the left-hand side of its pages to provide site navigation. the bar consists of a set of links organized into four main categories: the mozilla organization, developer docs, testing, and tools. the bar also contains two links that are independent of any category: faq and search. the categorized links are analogous to menu items organized into menus, where clicking the link/selecting the menu item performs some function, so we'll use xul menu elements to implement them in our document. the independent links, on the other hand, are similar to xul buttons, which perform a function when pressed, so we'll use the button element for those. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/the...
...es of menus. it can also contain other elements. it serves to group menus together into a single horizontal bar like the one you see at the top of many desktop applications. the menu element defines a pull-down menu, and the button element defines a pressable button. both menus and buttons take a label attribute whose value is the text to display in the element. source | rendered step 4: menu items menus aren't terribly useful unless they contain selectable items. to add items to a menu, we need to first add a menupopup element and then put menuitem elements within it for each item we want to appear on the menu. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu label="the mozilla organization"> <menupopup> ...
...en't terribly useful unless they contain selectable items. to add items to a menu, we need to first add a menupopup element and then put menuitem elements within it for each item we want to appear on the menu. ...
...And 13 more matches
What is RSS - Archive of obsolete content
ssword public. news web sites use rss to provide everyone with a list of their newest articles. ...
... <lastbuilddate>wed, 27 jul 2005 00:30:30 -0700</lastbuilddate> <link>http://news.example.com/</link> <item> <title>news flash: i like bread</title> <guid ispermalink="false">4d4a0a12-f188-4c97-908b-eea27213c2fe</guid> <pubdate>wed, 27 jul 2005 00:30:30 -0700</pubdate> <link>http://news.example.com/artcle/554</link> </item> <item> <title>big news today: birds fly</title> <guid ispermalink="false">c4a63f09-b45b-466b-8773-6ff264001ab7</guid> <pubdate>tue, 19 jul 2005 04:32:51 -0700</pubdate> <link>http://news.example.com/artcle/553</link> </item> <item> <title>fire is hot</title> <guid ispermalink="false">c1795324-d5ea-44f...
... <pubdate>tue, 19 jul 2005 04:32:51 -0700</pubdate> <link>http://news.example.com/artcle/553</link> </item> <item> <title>fire is hot</title> <guid ispermalink="false">c1795324-d5ea-44fa-95b1-b5ce2090d4f1</guid> <pubdate>sun, 15 may 2005 13:02:08 -0700</pubdate> <link>http://news.example.com/artcle/552</link> </item> </channel> </rss> bloggers use rss to provide everyone with a list of their newest blog posts. for example: <?xml version="1.0"?> <rss version="2.0"> <channel> <title>joe blow's blog</title> <description>this is the weblog of joe blow</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://joe-blow.example.net/</link> ...
...And 13 more matches
Accessible Toolkit Checklist
pace opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable. default tab order should be in document order. ...
...size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable. default tab order should be in document order. ...
...on mac os x, ctrl+space is used to bring up the context menu. most widgets (like checkboxes) can have a label outside of themselves, which should focus the widget when clicked on, or when its mnemonic is pressed. ...
...And 13 more matches
Manipulating bookmarks using Places
tp://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 nsinavbookmarksservice.getbookmarkidsforuri() method. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {});...
..."@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the specified uri (in this case, "http://google.com"). ...
...); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the specified uri (in this case, "http://google.com"). manipulating existing items there are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. this section covers some of them. the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method. ...
...And 13 more matches
SVGStringList - Web APIs
svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ist 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. ...
...And 13 more matches
Using the Web Storage API - Web APIs
rs. this article provides a walkthrough of how to make use of this technology. basic concepts storage objects are simple key-value stores, similar to objects, but they stay intact through page loads. the keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). you can access these values like an object, or with the storage.getitem() and storage.setitem() methods. these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. ...
... reopened. these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties are members of) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved, and removed. a different storage object is used for the sessionstorage and localstorage for each origin — they function and are controlled separately. so, for example, initially calling localstorage on a document will return a storage object; calling sessionstorage on a document will return a different storage object. both of these can be manipulated in the same way, bu...
...ror, which means that we've used up all available storage space, but storage is actually available. our feature detection should take these scenarios into account. ...
...And 13 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
ed onto the grid within these column and row lines. css grid layout has the following features: fixed and flexible track sizes you can create a grid with fixed track sizes – using pixels for example. this sets the grid to the specified pixel which fits to the layout you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. grid also contains an algorithm to control the placement of items not given an explicit position on the grid. creation of additional tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add addit...
... an explicit position on the grid. creation of additional tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add additional rows and columns when needed. features such as adding “as many 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 tha...
...erful 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 that element become grid items. in this example, i have a containing div with a class of wrapper and, inside are five child elements. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> i make the .wrapper a grid container. .wrapper { display: grid; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; backgrou...
...And 13 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
u do not have to use grid in an all or nothing way. you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method. overwriting of legacy methods with grid layout works surprisingly well, due to the way grid interacts with these other methods. floats we have typically used floats to create multiple column layouts. if you have floated an item, which is also a grid item in a supporting browser, the float will no longer apply to the item. the fact is that a grid item takes precedence. in the example below, i have a simple media object. in a non-supporting browser, i use float, however i have also defined the container as a grid container, in order to use the alignment properties that are implemented in css grids. the float no longer ap...
...s very simple, and we can get away without needing to write code that would be a problem to browsers that do not support grid, and legacy code is not an issue to our grid supporting browsers. however, things are not always so simple. in this next example, i have a set of floated cards. i have given the cards a width, in order to float them. ...
...verwrite older methods.</p> </li> <li class="card"><h2>six</h2> <p>we can use css grid to overwrite older methods.</p> </li> </ul> </div> the example demonstrates the typical problem that we have with floated layouts: if additional content is added to any one card, the layout breaks. ...
...And 13 more matches
Code snippets - Archive of obsolete content
t shows how to load all tabs from other computers. components.utils.import("resource://services-sync/main.js"); // obtain a reference to the main firefox window. let mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data. for each (let client in tabsengine.getallclients()) {...
...p the cleartext of each record in a collection to the console. ...
...rtext of each record in a collection to the console. ...
...And 12 more matches
More Menu Features - Archive of obsolete content
however, you can create submenus by simply placing the menu element inside the menupopup element. ...
... because the menu element is valid even when it isn't directly placed inside a menu bar. the example below creates a simple submenu inside the file menu example 1 : source view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menu id="new-menu" label="new"> <menupopup id="new-popup"> <menuitem label="window"/> <menuitem label="message"/> </menupopup> </menu> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog. we'll just add a few simple command...
...xit"/> </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog. we'll just add a few simple commands to a file menu and an edit menu. this is similar to the example above. ...
...And 12 more matches
Introduction to client-side frameworks - Learn web development
are to client-side frameworks. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand how client-side javascript frameworks came to exist, what problems they solve, what alternatives there are, and how to go about choosing one. a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, composed of static documents. the web became not just a place to read things, but to do things. javascript’s popularity steadily increased. developers who worked with javascript wrote tools to solve the problems they faced, and packaged them into reusable packages called libraries, so they could share their solutions with others. this shared ecosystem of lib...
...ist of tasks. the verbosity of dom changes building html elements and rendering them in the browser at the appropriate time takes a surprising amount of code. ...
... of code. let's say that our state is an array of objects structured like this: const state = [ { id: 'todo-0', name: 'learn some frameworks!' } ] how do we show one of those tasks to our user? we want to represent each task as a list item – an html <li> element inside of an unordered list element (a <ul>). ...
...And 12 more matches
Python binding for NSS
ed as utf-8 first before being passed to nss/nspr. python-nss tries to be flexible when generating a print representation of complex objects. for simplicity you can receive a block of formatted text but if you need more control, such as when building gui elments you can access a list of "lines", each line is paired with an indentation level value. the (indent, text) pairs allow you to insert the item into a gui tree structure or simply change the indentation formatting. deprecated elements of the python-nss api are marked with python deprecation warnings as well as being documented in the nss module documentation. as of python 2.7 deprecation warnings are no longer reported by default. it is suggested python developers using python-nss periodically run their code with deprecation warnings en...
... release 0.16.0 release date 2014-10-29 scm tag pynss_release_0_16_0...
... release 0.16.0 release date 2014-10-29 scm tag pynss_release_0_16_0 source download ...
...And 12 more matches
Gecko Roles
role_titlebar represents a title or caption bar for a window. used by msaa only, this is supported automatically by microsoft windows. role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. ...
... role_window represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by microsoft windows. role_internal_frame a sub-document. role_menupopup represents a menu, which presents a list of options from which the user can make a selection to perform an action. role_menuitem represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. role_tooltip represents a tooltip that provides helpful hints; this is generally displayed at the mouse cursor position. role_application represents a main window for an application. role_document represents a document window. a document window is always...
...ed at the mouse cursor position. role_application represents a main window for an application. role_document represents a document window. a document window is always contained within an application window. role_pane represents a pane within a frame or document window. users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls. role_chart represents a graphical image used to represent data. role_dialog represents a dialog box or message box. role_border represents a window border. role_grouping logically groups other objects. role_separator used to v...
...And 12 more matches
Gloda examples
examples for using gloda. see creating a gloda message query for more examples. ...
...e examples. ...
... messages in a conversation regardless of the folder in which they are stored, b) search messages by subject 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 */ ...
...And 12 more matches
SVGLengthList - Web APIs
ects. an svglengthlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ns that attempts to modify the object will result in an exception being thrown. ...
...And 12 more matches
SVGPathSegList - Web APIs
svg path segment list interface this interface defines a list of svgpathseg objects. ...
... svg path segment list interface this interface defines a list of svgpathseg objects. ...
...t list interface this interface defines a list of svgpathseg objects. ...
...And 12 more matches
Layout using named grid lines - CSS: Cascading Style Sheets
in this guide we are going to look at how these two things work together when we use named lines. line naming is incredibly useful, but some of the more baffling looking grid syntax comes from this combination of names and track sizes. once you work through some examples it should become clearer and easier to work with. naming lines when defining a grid you can assign some or all of the lines in your grid a name when you define your grid with the grid-template-rows and grid-template-columns properties. ...
...gh you do not need to name all of the lines on your grid. you might choose to name just some key lines for your layout. .wrapper { display: grid; grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end]; grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end]; } once the lines have names, we can use the name to place the item rather than the line number. .box1 { grid-column-start: main-start; grid-row-start: main-start; grid-row-end: main-end; } .box2 { grid-column-start: content-end; grid-row-start: main-start; grid-row-end: content-end; } .box3 { grid-column-start: content-start; grid-row-start: main-start; } .box4 { grid-column-start: content-start; grid-column-end: main-end; grid-row-star...
...e something in that area should i wish to. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } i’m using the same grid definitions as above, however this time i am going to place a single item into the named area content. .wrapper { display: grid; grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end]; grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end]; } .thing { grid-area: content; } <div class="wrapper"> <div class="thing">i am placed in an area named content.</div> </div> we don’t need to...
...And 12 more matches
Closures - JavaScript
mples, each closure had its own lexical environment. here though, there is a single lexical environment that is shared by the three functions: counter.increment, counter.decrement, and counter.value. the shared lexical environment is created in the body of an anonymous function, which is executed as soon as it has been defined (also known as an iife). the lexical environment contains two private items: a variable called privatecounter, and a function called changeby. you can't access either of these private members from outside the anonymous function. instead, you can access them using the three public functions that are returned from the anonymous wrapper. those three public functions are closures that share the same lexical environment. thanks to javascript's lexical scoping, they each hav...
... the helptext array defines three helpful hints, each associated with the id of an input field in the document. the loop cycles through these definitions, hooking up an onfocus event to each one that shows the associated help method. ...
... the helptext array defines three helpful hints, each associated with the id of an input field in the document. the loop cycles through these definitions, hooking up an onfocus event to each one that shows the associated help method. if you try this code out, you'll see that it doe...
...And 12 more matches
Array.from() - JavaScript
isnan(number)) return 0; if (number === 0 || !isfinite(number)) return number; return (number > 0 ? ...
... if (number === 0 || !isfinite(number)) return number; return (number > 0 ? ...
...let k be 0. ...
...And 12 more matches
Actions - Archive of obsolete content
will be copied for each matching result (though see below for an exception) and inserted into the document. let's look at a simple example first. <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <button uri="?relateditem" label="?relateditem"/> </action> </template> </vbox> in this example, we omit the <xul:rule> element around the <xul:action> as it is optional when we want to generate content unconditionally. instead, the action element is placed directly inside the <xul:template> element after the query is d...
...e created for each result. there are three results, so three buttons will be created. here is the [example], and an image of what it looks like: the template builder iterates through the three results, processing the body of the action for each one in turn. the uri attribute on the button is used to specify the ending or member variable. ...
... for each one in turn. the uri attribute on the button is used to specify the ending or member variable. in this example, there's only one variable to use, ?relateditem, since ?start is the starting point and the start and end points cannot be the same. there are a number of things that will happen for each result. let's look at the results again: (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/b) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/c) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/d) the builder will start with the first result. the button element will be copied and inserted into the document after the template. the id attribute of the new element will be set to the ...
...And 11 more matches
XUL controls - Archive of obsolete content
e xul reference. <button> a button that can be pressed by the user. <button label="save" accesskey="s"/> more information about the button element. button reference <button type="menu"> a button that has a drop down menu attached to it. pressing the button opens the menu. <button type="menu" label="view"> <menupopup> <menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more information about this type of menu button element. button reference related elements: menupopup menuitem <button type="menu-button"> a button that that has a separate arrow button with a menu attached to it. unlike with the 'menu' type, a separate action may be performed w...
...type of menu button element. button reference related elements: menupopup menuitem <button type="menu-button"> a button that that has a separate arrow button with a menu attached to it. unlike with the 'menu' type, a separate action may be performed when the main part of the button is pressed. <button type="menu-button" label="new"> <menupopup> <menuitem label="new document"/> <menuitem label="new image"/> </menupopup> </button> more information about this type of menu button element. button reference related elements: menupopup menuitem <checkbox> a control that may be turned on and off, typically used to create options which may be enabled or disabled. <checkbox label="show toolbar lab...
...an image specified by a url. <image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. ...
...And 11 more matches
menupopup - Archive of obsolete content
keys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position, state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a menupopup may be attached to a menulist. <menulist> <menupopup> <menuitem label="mozilla" value="http://mozilla.org"/> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net"/> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> the following example shows how a menupopup can be used as a context menu for an element. when the label is right-clicked, the menu will be dis...
... left type: integer overrides the horizontal position of the popup specified by the showpopup method. ...
... left type: integer overrides the horizontal position of the popup specified by the showpopup method. ...
...And 11 more matches
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
b 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 selectedindex. more information is available in the xul tutorial. attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends. this feature is...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. onclosetab type: script code this script will be called when the close tab button is clicked. onnewtab not in firefox type: script code this script will be called when the new tab button is clicked. onselect type: script code this event is sent to the tabs element when this ta...
... script code this script will be called when the close tab button is clicked. onnewtab not in firefox type: script code this script will be called when the new tab button is clicked. onselect type: script code this event is sent to the tabs element when this tab is changed. selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. setfocus type: boolean if true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are navigated via the keyboard. if this attribute is false, the focus does not change during navigation. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user press...
...And 11 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
sic examples the following examples demonstrate how some of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. ...
...me of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. flexbox alignment example in this example, three flex items are aligned on the main axis using justify-content and on the cross axis using align-items. the first item overrides the align-items set on the group by setting align-self to center. key concepts and terminology the specification de...
...g align-self to center. key concepts and terminology the specification details some alignment terminology to make it easier to discuss these alignment properties outside of their implementation within a particular layout method. there are also some key concepts which are common to all layout methods. relationship to writing modes alignment is linked to writing modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom and left. instead we describe alignment in terms of the start and end of the particular dimension we are working with. this ensures that alignment works in the same way whichever writing mode the document has. two dimensions of alignment when using the box alignment properties you will align content o...
...And 11 more matches
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash. ...
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row: foo; will choose the start/end edge of t...
...obal values */ grid-row: inherit; grid-row: initial; grid-row: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? cont...
...And 11 more matches
MenuModification - Archive of obsolete content
modifying a menu menus have a number of methods which may be used to add and remove items. adding items to a menu the appenditem method may be used to append a new item to the end of the popup associated with a menu. this method will create a new menuitem element and insert it into the popup. this method may only be used with the menu element. <script> function addtomenu() { var menu = document.getelementbyid("edit-menu"); menu.appenditem("insert", "insert"); } </script> <menu id="edit-menu"/> <button label="add" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. ...
...ment and insert it into the popup. this method may only be used with the menu element. <script> function addtomenu() { var menu = document.getelementbyid("edit-menu"); menu.appenditem("insert", "insert"); } </script> <menu id="edit-menu"/> <button label="add" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. this function appends a new item to the menu's popup with the label insert. the first argument to appenditem is the label of the menuitem, and the second argument is a value to associate with the item. ...
...ert"); } </script> <menu id="edit-menu"/> <button label="add" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. this function appends a new item to the menu's popup with the label insert. the first argument to appenditem is the label of the menuitem, and the second argument is a value to associate with the item. this value be set as the menuitem's value attribute and can be used for whatever purpose is desired. note how in this example, the menu does not have a child menupopup. ...
...And 10 more matches
XUL Questions and Answers - Archive of obsolete content
they wrote: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="test-window" title="check list test" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <listbox rows="4"> <listhead> <listheader label="multi-column"/> </listhead> <listcols> <listcol flex="1"/> </listcols> <listitem> <listcell type="checkbox" value="1" label="vghkvghk"/> </listitem> <listitem> <listcell type="checkbox" value="2" label="vghjkvk" checked="true"/> </listitem> <listitem> <listcell type="checkbox" value="3" label="hukfzgjcfj" disabled="true"/> </listitem> </listbox> <listbox rows="4"> <listhead> <listheader label="single-column"/> </listhead> <listitem type...
...if user wants checkbox support for multicolumn lists, then they will have to implement one. ...
...if user wants checkbox support for multicolumn lists, then they will have to implement one. ...
...And 10 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
inside of the iframe. okay to use html inside of iframe. see browser element for more info. ...
...o use html inside of iframe. see browser element for more info. ...
...label text--></label> <listbox id="listid"> <listitem value="val" label="<!--item text-->"/> </listbox> <label control='listid2' value='<!--list label-->' /> <listbox rows="5" id='listid2'> <listcols> <listcol/> <listcol/> <listcol/> </listcols> <listhead> <listheader label="name" /> <listheader label="sex" /> <listheader label="color" /> </listhead> <listitem> <label value="<!--pearl-->" /> <label value="<!--female-->" /> <label value="<!--gray-->" /> </listitem> </listbox> i don't seem to be able to find a straightforward way to read the header labels in jaws. ...
...And 10 more matches
Introduction to CSS layout - Learn web development
her is due to the fact that they are styled with display: block. if you create a link around some text inside a paragraph, that link remains inline with the rest of the text, and doesn’t break onto a new line. this is because the <a> element is display: inline by default. you can change this default display behavior. for example, the <li> element is display: block by default, meaning that list items display one below the other in our english document. if we change the display value to inline they now display next to each other, as words would do in a sentence. the fact that you can change the value of display for any element means that you can pick html elements for their semantic meaning, without being concerned about how they will look. the way they look is something that you can change. ...
...lay value to inline they now display next to each other, as words would do in a sentence. the fact that you can change the value of display for any element means that you can pick html elements for their semantic meaning, without being concerned about how they will look. the way they look is something that you can change. in addition to being able to change the default presentation by turning an item from block to inline and vice versa, there are some bigger layout methods that start out as a value of display. however, when using these, you will generally need to invoke additional properties. the two values most important for our purposes when discussing layout are display: flex and display: grid. flexbox flexbox is the short name for the flexible box layout module, designed to make it easy...
...portant for our purposes when discussing layout are display: flex and display: grid. flexbox flexbox is the short name for the flexible box layout module, designed to make it easy for us to lay things out in one dimension — either as a row or as a column. to use flexbox, you apply display: flex to the parent element of the elements you want to lay out; all its direct children then become flex items. we can see this in a simple example. the html markup below gives us a containing element, with a class of wrapper, inside which are three <div> elements. by default these would display as block elements, below one another, in our english language document. however, if we add display: flex to the parent, the three items now arrange themselves into columns. this is due to them becoming flex ite...
...And 10 more matches
Focus management with Vue refs - Learn web development
or non-mouse users. specifically, when a user activates the "edit" button, we remove the "edit" button from the dom, but we don't move the user's focus anywhere, so in effect it just disappears. this can be disorienting for keyboard and non-visual users. to understand what's currently happening: reload your page, then press tab. you should see a focus outline on the input for adding new to-do items. press tab again. the focus should move to the "add" button. hit it again, and it'll be on the first checkbox. one more time, and focus should be on the first "edit" button. activate the "edit" button by pressing enter. the checkbox will be replaced with our edit component, but the focus outline will be gone. this behavior can be jarring. in addition, what happens when you press tab again v...
...o reason about and understand. to use a ref in a component, you add a ref attribute to the element that you want to access, with a string identifier for the value of the attribute. it's important to note that a ref needs to be unique within a component. no two elements rendered at the same time should have the same ref. ...
... that you want to access, with a string identifier for the value of the attribute. it's important to note that a ref needs to be unique within a component. no two elements rendered at the same time should have the same ref. adding a ref to our app so, let's attach a ref to our "edit" button in todoitem.vue. ...
...And 10 more matches
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
e, an element laid out with flexbox has the word flex next to it as shown in the following image: click the word flex in the html pane to keep the overlay visible when you move the mouse away from the container. in the infobar when you hover over an element in the html pane, you will see a tooltip that gives you more information about the element. when you hover over a flex container or flex item, the tooltip includes the appropriate information. this header is a flex container: each navbar link is a flex item: the nav element within the header is both a flex item and a flex container which holds the navigation links: in the css pane in the css pane's rules view, any instance of a display: flex declaration gets a small flexbox icon next to the word flex. clicking the icon tog...
... the layout flex container section the css pane's layout view includes a collapsible "flex container" section. ...
...nce of a display: flex declaration gets a small flexbox icon next to the word flex. clicking the icon toggles the display of an overlay on the page, which appears over the selected flex container that displays an outline around each flex item: the overlay will still be shown when you select other elements from the inspector panel, so you can edit related css properties and see how the flex items are affected by your changes. the layout flex container section the css pane's layout view includes a collapsible "flex container" section. if you expand the section without selecting a flexbox container, it will only display the message, "select a flex container or item to continue". once you select an element whose display is defined as flex, the panel will include a number of options for vi...
...And 10 more matches
HTML Drag and Drop API - Web APIs
lects a draggable element, drags the element to a droppable element, and then releases the dragged element. during drag operations, several event types are fired, and some events might fire many times, such as the drag and dragover events. each drag event type has an associated global event handler: event on event handler fires when… drag ondrag …a dragged item (element or text selection) is dragged. dragend ondragend …a drag operation ends (such as releasing a mouse button or hitting the esc key; see finishing a drag.) dragenter ondragenter …a dragged item enters a valid drop target. (see specifying drop targets.) dragexit ondragexit …an element is no longer the drag operation's immediate selection tar...
...nd ondragend …a drag operation ends (such as releasing a mouse button or hitting the esc key; see finishing a drag.) dragenter ondragenter …a dragged item enters a valid drop target. (see specifying drop targets.) dragexit ondragexit …an element is no longer the drag operation's immediate selection target. dragleave ondragleave …a dragged item leaves a valid drop target. dragover ondragover …a dragged item is being dragged over a valid drop target, every few hundred milliseconds. dragstart ondragstart …the user starts dragging an item. (see starting a drag operation.) drop ondrop …an item is dropped on a valid drop target. (see performing a drop.) note: neither dragstart nor dra...
... dragstart ondragstart …the user starts dragging an item. (see starting a drag operation.) drop ondrop …an item is dropped on a valid drop target. (see performing a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os. interfaces the html drag and drop interfaces are dragevent, datatransfer, datatransferitem and datatransferitemlist. the dragevent interface has a constructor and one datatransfer property, which is a datatransfer object. datatransfer objects include the drag event's state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item. datatransfer objects also have methods to add or remove items to the drag's data. ...
...And 10 more matches
Box alignment in Flexbox - CSS: Cascading Style Sheets
details how alignment works in various layout methods; on this page, we explore how box alignment works in the context of flexbox. as this page aims to detail things which are specific to flexbox and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. ...
...ignment works in the context of flexbox. as this page aims to detail things which are specific to flexbox and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example, three flex items are aligned on the main axis using justify-content and on the cross axis using align-items. the first item overrides the align-items values set on the group by setting align-self to center. the axes and flex-direction flexbox respects the writing mode of the document, therefore if you are working in english and set justify-content to flex-end this will align the items to the end of the flex container. if you are working with flex-direction set to row, this alignment will be in the...
...ts the writing mode of the document, therefore if you are working in english and set justify-content to flex-end this will align the items to the end of the flex container. if you are working with flex-direction set to row, this alignment will be in the inline direction. however, in flexbox you can change the main axis by setting flex-direction to column. in this case, justify-content will align items in the block direction. ...
...And 10 more matches
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
values: row (default) | row-reverse | column | column-reverse spec: https://drafts.csswg.org/css-flexbox/#flex-direction-property @mixin flex-direction($value: row) { @if $value == row-reverse { -webkit-box-direction: revers...
... display: -webkit-inline-box; display: -moz-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-flex; } %inline-flex { @include inline-flex; } flexbox direction the flex-direction property specifies how flex items are placed in the flex container, by setting the direction of the flex container's main axis. this determines the direction in which flex items are laid out in. values: row (default) | row-reverse | column | column-reverse spec: https://drafts.csswg.org/css-flexbox/#flex-direction-property @mixin flex-direction($value: row) { @if $value == row-reverse { -webkit-box-direction: reverse; -webkit-box-orient: horizontal; -moz-box-direction: reverse; -moz-box-orient: horizontal; } @else if $value == column { -we...
...properties, which together define the flex container's main and cross axes. values: row (default) | nowrap spec: https://drafts.csswg.org/css-flexbox/#flex-flow-property @mixin flex-flow($values: (row nowrap)) { // no webkit/ff box fallback. -webkit-flex-flow: $values; -ms-flex-flow: $values; flex-flow: $values; } flexbox order the order property controls the order in which flex items appear within their flex container, by assigning them to ordinal groups. value: any integer (0 is the default) spec: https://drafts.csswg.org/css-flexbox/#order-property @mixin order($int: 0) { -webkit-box-ordinal-group: $int + 1; -moz-box-ordinal-group: $int + 1; -webkit-order: $int; -ms-flex-order: $int; order: $int; } flexbox grow the flex-grow property sets the flex grow ...
...And 10 more matches
grid-column - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: grid-column-end grid-column-start syntax this property is specified as one or two <grid-line> values. ...
...hand is set to the value after the slash. each <grid-line> value can be specified as: either the auto keyword or a <custom-ident> value or an <integer> value or both <custom-ident> and <integer>, separated by a space or the keyword span together with either a <custom-ident> or an <integer> or both. values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column: foo; will choose the start/end edge o...
...utomatically generate implicit named lines of this form, so specifying grid-column: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <int...
...And 10 more matches
paint() - CSS: Cascading Style Sheets
Web › CSS › paint
ction defines an <image> value generated with a paintworklet. syntax paint(workletname, parameters) where: workletname the name of the registered worklet. parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments via the css paint() function. ...
...arameters) where: workletname the name of the registered worklet. parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments via the css paint() function. ...
... workletname the name of the registered worklet. parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments via the css paint() function. ...
...And 10 more matches
ui/toolbar - Archive of obsolete content
showing and hiding toolbars by default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden initially by passing hidden:true as an option in its constructor. after that, though, you can't show or hide the toolbar pr...
...gle toolbar for all browser windows, so operations like show and hide work across all browser windows. if you need to customize content for a particular browser window, you can do that by messaging the window-specific frame hosted by that toolbar. globals constructors toolbar(options) creates a toolbar. the only mandatory option is title, but for the toolbar to contain any actual content, the items parameter must also be supplied, and must contain at least object. this add-on creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame(...
...-on creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({ url: "./my-frame.html" }); var toolbar = toolbar({ title: "player", items: [button, frame] }); this add-on creates a toolbar with one frame, that's hidden initially, and that logs show and hide events: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame], hidden: true, onshow: showing, onhide: hiding }); function...
...And 9 more matches
Recursive Generation - Archive of obsolete content
this extra arrow which neither b or d have causes an extra set of buttons to be created. ...
...this extra arrow which neither b or d have causes an extra set of buttons to be created. ...
...this extra arrow which neither b or d have causes an extra set of buttons to be created. ...
...And 9 more matches
Theme changes in Firefox 2 - Archive of obsolete content
out the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsummary-related css. browser/browser.css needs to be updated to include new css for microsummaries, search fields, iconic bookmark menu items, and more. browser/dropmark-nav-small.png new file; used as the drop-down menu arrow on the navigation buttons, when using small icons. browser/dropmark-nav.png new file; used as the drop-down menu arrow on the navigation buttons. browser/enginemanager.css new file; css used for the search engine manager. browser/feeds/addfeedreader.css new file; c...
...ayed behind all tabs. global/toolbar.css needs to be updated to include new styles. mozapps/extensions/about.css updated with a simplified set of style names, since several styles were identical. mozapps/extensions/extensions.css css for the add-ons manager window. updated to support the new features of the firefox 2 add-ons manager. mozapps/extensions/itemdisabledfader.png new file; a translucent png used as an overlay on top of items that are disabled in the add-ons manager. mozapps/extensions/itemenabledfader.png new file; a translucent png used as an overlay on top of items that are enabled in the add-ons manager. mozapps/extensions/notifybadges.png new file; contains the icons used ito badge the icons for add-ons in t...
... in the add-ons manager. mozapps/extensions/notifybadges.png new file; contains the icons used ito badge the icons for add-ons in the add-on manager window to indicate their status. these look like this in the default theme: the first icon (green here) indicates that an add-on has an update available. the second icon (yellow here)appears to be used for blocklisted items; trying to confirm. the third icon (red here) indicates that an add-on is disabled, either by the user or because it's incompatible with the application. the fourth icon (blue here)(not sure what this one means). mozapps/extensions/question.png new file; used in the add-ons manager when you check for updates. if no updates are found, this icon is displayed at the l...
...And 9 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
round trips. 5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface. the api can be seen as a simple contract (the interface) between the application offering it and other items, such as third party software or hardware. 6 aria accessibility, glossary aria (accessible rich internet applications) is a w3c specification for adding semantics and other metadata to html to cater to users of assistive technology. 7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastr...
...involved in the design of a website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings. this can be used for example to work out what should go on each page of a website. the name comes from the fact that often card sorting is carried out by literally writing the items to sort onto cards, and then arranging the cards into piles. 67 carddav carddav, glossary, infrastructure carddav (vcard extension to webdav) is a protocol standardized by the ietf and used to remote-access or share contact information over a server. 68 certificate authority cryptography, glossary, security a certificate authority (ca) is an organization...
... (ect) refers to the measured network performance, returning a cellular connection type, like 3g, even if the actual connection is tethered broadband or wifi, based on the time between the browser requesting a page and effective type of the connection. 127 element codingscripting, glossary, html an element is a part of a webpage. in xml and html, an element may contain a data item or a chunk of text or an image, or perhaps nothing. a typical element includes an opening tag with some attributes, enclosed text content, and a closing tag. 128 empty element codingscripting, glossary, intermediate an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes). 129 encapsulation ...
...And 9 more matches
WAI-ARIA basics - Learn web development
<h1>...</h1> <nav> <ul>...</ul> <form> <!-- search form --> </form> </nav> </header> <main> <article>...</article> <aside>...</aside> </main> <footer>...</footer> if you try testing the example with a screenreader in a modern browser, you'll already get some useful information. for example, voiceover gives you the following: on the <header> element — "banner, 2 items" (it contains a heading and the <nav>). on the <nav> element — "navigation 2 items" (it contains a list and a form). on the <main> element — "main 2 items" (it contains an article and an aside). on the <aside> element — "complementary 2 items" (it contains a heading and a list). on the search form input — "search query, insertion at beginning of text". on the <footer> element — "f...
... if you go to voiceover's landmarks menu (accessed using voiceover key + u and then using the cursor keys to cycle through the menu choices), you'll see that most of the elements are nicely listed so they can be accessed quickly. however, we could do better here. ...
...nt. in cases like these, this is very useful — a search form like this one is a very common, easily recognised feature, and adding a visual label would spoil the page design. <input type="search" name="q" placeholder="search query" aria-label="search through site content"> now if we use voiceover to look at this example, we get some improvements: the search form is called out as a separate item, both when browsing through the page, and in the landmarks menu. the label text contained in the aria-label attribute is read out when the form input is highlighted. beyond this, the site is more likely to be accessible to users of older browsers such as ie8; it is worth including aria roles for that purpose. and if for some reason your site is built using just <div>s, you should definitely in...
...And 9 more matches
Supporting older browsers - Learn web development
spend the time on things which make the site more accessible, thus serving far more users. there is a middle ground between a plain html page and all the bells and whistles, and css has actually made creating these fallbacks pretty straightforward. creating fallbacks in css css specifications contain information that explains what the browser does when two layout methods are applied to the same item. this means that there is a definition for what happens if a floated item, for example, is also a grid item using css grid layout. couple this information with the knowledge that browsers ignore css that they don’t understand, and you have a way to create simple layouts using the legacy techniques we have already covered, which are then overwritten by your grid layout in modern browsers that un...
...s that they don’t understand, and you have a way to create simple layouts using the legacy techniques we have already covered, which are then overwritten by your grid layout in modern browsers that understand it. in the below example, we have floated three <div>s so they display in a row. any browser that does not support css grid layout will see the row of boxes as a floated layout. a floated item that becomes a grid item loses the float behaviour, which means that by turning the wrapper into a grid container, the floated items become grid items. if the browser supports grid layout it will display the grid view, if not it ignores the display: grid and related properties and the floated layout is used. * {box-sizing: border-box;} .wrapper { background-color: rgb(79,185,227); padding:...
...rapper into a grid container, the floated items become grid items. if the browser supports grid layout it will display the grid view, if not it ignores the display: grid and related properties and the floated layout is used. ...
...And 9 more matches
Index - Learn web development
ash course in the basic features of javascript via a completely practical tutorial. here you'll build up a simple "guess the number" game, step by step. 77 arrays arrays, article, beginner, codingscripting, javascript, join, learn, pop, push, l10n:priority, shift, split, unshift in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides. 78 basic math in javascript — numbers and operators article, beginner, codingscripting, guide, javascript, learn, math, operators, augmented, increment, l10n:priority, maths, modulo in this article we h...
... syntax, how to invoke and define them, scope, and parameters. 93 image gallery assessment, beginner, codingscripting, conditionals, event handler, javascript, learn, loops, events, l10n:priority now that we've looked at the fundamental building blocks of javascript, we'll test your knowledge of loops, functions, conditionals and events by getting you to build a fairly common item you'll see on a lot of websites — a javascript-powered image gallery. 94 introduction to events article, beginner, codingscripting, event handler, guide, javascript, learn, events, l10n:priority events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired. for example, if ...
...t be an exhaustive study; just what you need to know at this stage. 95 looping code article, beginner, codingscripting, do, guide, javascript, learn, loop, break, continue, for, l10n:priority, while programming languages are very useful for rapidly completing repetitive tasks, from multiple basic calculations to just about any other situation where you've got a lot of similar items of work to complete. here we'll look at the loop structures available in javascript that handle such needs. 96 making decisions in your code — conditionals article, beginner, codingscripting, conditionals, javascript, learn, switch, conditions, else, if, l10n:priority, ternary in any programming language, the code needs to make decisions and carry out actions accordingly d...
...And 9 more matches
NSS functions
sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cachestaticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypublickey mxr 3.6 and later seckey_copysubjectpublickeyinfo mxr 3.4 and later ...
...link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...d source code references. the nss version column indicates which versions of nss support the function. ...
...And 9 more matches
TPS Bookmark Lists
okmark objects valid properties are: uri: the bookmark uri. required. title: the bookmark title. optional. defaults to the bookmark uri. loadinsidebar: true or false. optional. toggles the "load in sidebar" property. description: the bookmark description. optional. tags: an array of tags for the bookmark. optional. keyword: the keyword for the bookmark. optional. after: the title of the bookmark item expected to be found after this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions. changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action. the properties for this object include the uri, title, loadinsidebar, des...
... actions. changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action. ...
... bookmark, causing that bookmark to be positioned below the current one) example: { uri: "http://www.google.com", title: "google", loadinsidebar: false, tags: [ "google", "computers", "misc" ] } livemark objects valid properties are: livemark: the livemark name. required. siteuri: the livemark's uri. optional. feeduri: the livemark's feed uri. required. after: the title of the bookmark item expected to be found after this livemark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this livemark; used only in verify and modify actions. changes: an object containing new properties to be set for this livemark when this asset list is used in a modify action. the properties for this object include the livemark, siteuri, feeduri pro...
...And 9 more matches
nsIAccessibleRole
esents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by ms windows. role_internal_frame 10 a sub-document or iframe. role_menupopup 11 represents a menu, which presents a list of options from which the user can make a selection to perform an action. it is used for role="menu". role_menuitem 12 represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. it is used for xul:menuitem, role="menuitem". role_tooltip 13 represents a tooltip that provides helpful hints. role_application 14 represents a main window for an application. it is used for role="application". also refer to role_app_root. role_document 15 represents a do...
...application. it is used for role="application". also refer to role_app_root. role_document 15 represents a document window. a document window is always contained within an application window. it is used for role="document". role_pane 16 represents a pane within a frame or document window. users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls. it is used for the first child of a or iframe. role_chart 17 represents a graphical image used to represent data. role_dialog 18 represents a dialog box or message box. it is used for xul:dialog, role="dialog". role_border 19 represents a window border. role...
...x. it is used for xul:dialog, role="dialog". role_border 19 represents a window border. role_grouping 20 logically groups other objects. there is not always a parent-child relationship between the grouping object and the objects it contains. it is used for html:textfield, xul:groupbox, role="group". role_separator 21 used to visually divide a space into two regions, such as a separator menu item or a bar that divides split panes within a window. it is used for xul:separator, html:hr, role="separator". role_toolbar 22 represents a toolbar, which is a grouping of controls (push buttons or toggle buttons) that provides easy access to frequently used features. it is used for xul:toolbar, role="toolbar". role_statusbar 23 represents a status bar, which is an area at the bottom of a window...
...And 9 more matches
nsIInstallLocation
efox 4, unless you specify <em:unpack>. ...
...this is different from restricted...
...this is different from restricted because it's not whether or not the location *might* be restricted, it's wheth...
...And 9 more matches
nsIMacDockSupport
this can be used, for example, to display the number of unread messages in an email client. dockmenu nsistandalonemenu the menu to display when the user right-clicks on the application's icon in the dock. methods activateapplication() activates the application, making it the frontmost application. the application should call this to activate itself when one of its dock menu items are selected, since doing so does not automatically activate the application. void activateapplication( in boolean aignoreotherapplications ); parameters aignoreotherapplications if true, the application is activated regardless of the state of other applications. if false, the application is only activated if other applications are not currently active. about dockmenu by default fir...
...ce doing so does not automatically activate the application. void activateapplication( in boolean aignoreotherapplications ); parameters aignoreotherapplications if true, the application is activated regardless of the state of other applications. if false, the application is only activated if other applications are not currently active. about dockmenu by default firefox adds two menu items to the dock menu. the menu items are "new window" and "new private window". if permanent private browsing mode is enabled then the "new private window" menu item is hidden. this is created by using the dockmenu attribute of nsimacdocksupport here: http://mxr.mozilla.org/mozilla-release/source/browser/base/content/browser.js#1562 this is seen here: if you were to copy and follow that example yo...
... can be done like this: var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); console.log('docksupport:', docksupport); var win = services.wm.getmostrecentwindow('navigator:browser'); var macmenu = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmenuitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem'); macmenuitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplicat...
...And 9 more matches
Demo Addon
x.msgdatabase.enumeratemessages(). each message is a 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. ...
...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. ...
... 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. ...
...And 9 more matches
grid-area - CSS: Cascading Style Sheets
Web › CSS › grid-area
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if four <grid-line> values are specified, grid-row-start is set to the first value, grid-column-start is set to the second value, grid-row-end is set to the third value, and grid-column-end is set to the fourth value. ...
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-area: foo; will choose the start/end edge of that named grid area...
...-area span; /* global values */ grid-area: inherit; grid-area: initial; grid-area: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-area: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? con...
...And 9 more matches
JavaScript Client API - Archive of obsolete content
r data that you can make use of (note that guids must be allowed to change and should be url friendly). if not, you may have to invent your own mapping from data objects to guids as long as it's consistent. in this case, it is highly recommended to use the utils.makeguid() helper to generate new guids: let newguid = utils.makeguid(); your store object must implement the following methods: itemexists(id) createrecord(id, collection) changeitemid(oldid, newid) getallids() wipe() create(record) update(record) remove(record) you may also find it useful to override other methods of the base implementation, for example applyincomingbatch if the underlying storage for your data supports batch operations. createrecord the createrecord( id, collection ) method gets called by the...
...) changeitemid(oldid, newid) getallids() wipe() create(record) update(record) remove(record) you may also find it useful to override other methods of the base implementation, for example applyincomingbatch if the underlying storage for your data supports batch operations. createrecord the createrecord( id, collection ) method gets called by the engine to request a new record for an item with a given guid. it's your store's responsibility to instantiate a record object, assign the given guid, and return it. itemexists(guid) should simply return true if an item with the given guid exists in the store, false otherwise. changeitemid(oldid, newid) must find the stored item currently associated with the guid oldid and change it to be associated with the guid newid. ...
... object, assign the given guid, and return it. itemexists(guid) should simply return true if an item with the given guid exists in the store, false otherwise. changeitemid(oldid, newid) must find the stored item currently associated with the guid oldid and change it to be associated with the guid newid. getallids() must return an iterable list containing the guids of every item being stored on the local system. this can be a dictionary-type object where the keys are the guids and the values are whatever; or it can simply be a list of guids. this is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server. ...
...And 8 more matches
Working With Directories - Archive of obsolete content
directory or the 'pictures' directory do not exist, they will be created. thus, you do not have to create a series of directories individually, the set will all be created if needed. naturally, if the 'myfiles' directory already exists, it won't be recreated. ...
...ted if needed. naturally, if the 'myfiles' directory already exists, it won't be recreated. iterating over the files in a directory the directory object's directoryentries (nsifile.attributes) attribute is used to get a list of the items in a directory. it returns an enumeration which can be iterated over. ...
...directory already exists, it won't be recreated. iterating over the files in a directory the directory object's directoryentries (nsifile.attributes) attribute is used to get a list of the items in a directory. it returns an enumeration which can be iterated over. function getlatestfile() { var lastmod = 0; var homedir = io.getfile("home", ""); var items = homedir.directoryentries; while (items.hasmoreelements()) { var item = items.getnext().queryinterface(components.interfaces.nsifile); if (item.isfile() && item.lastmodifiedtime > lastmod.lastmodifiedtime) lastmod = item; } return lastmod; } this example iterates through the files in the home directory and looks for the file with the latest modification time (the last file in that directory that was written to). as...
...And 8 more matches
List Controls - Archive of obsolete content
« previousnext » xul has a number of types of elements for creating list boxes. list boxes a list box is used to display a number of items in a list. the user may select an item from the list. xul provides two types of elements to create lists, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes. they work similar to the html select element, which performs both functions, but the xul elements have additional features. the simplest list box uses the listbox element for the box itself, and the listitem element for each item. ...
...s, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes. they work similar to the html select element, which performs both functions, but the xul elements have additional features. the simplest list box uses the listbox element for the box itself, and the listitem element for each item. for example, this list box will have four rows, one for each item. example 1 : source view <listbox> <listitem label="butter pecan" /> <listitem label="chocolate chip" /> <listitem label="raspberry ripple" /> <listitem label="squash swirl" /> </listbox> like with the html option element, you can assign a value for each item using the value attribute. you can then use the value in a script. the list box will default to a suitable size, but you can ...
...attribute. you can then use the value in a script. the list box will default to a suitable size, but you can control the size with the rows attribute. set it to the number of rows to display in the list box. a scroll bar will appear that the user can use to display the additional rows. the following example demonstrates these additional features: example 2 : source view <listbox rows="3"> <listitem label="butter pecan" value="bpecan" /> <listitem label="chocolate chip" value="chocchip" /> <listitem label="raspberry ripple" value="raspripple" /> <listitem label="squash swirl" value="squash" /> </listbox> the example has been changed to display only 3 rows at a time. values have also been added to each item in the list. list boxes have some additional features, which will be described ...
...And 8 more matches
Simple Menu Bars - Archive of obsolete content
» in this section, we'll see how to create a menu bar with menus on it. creating a menu xul has a number of different ways of creating menus. the most basic way is to add a menu bar with a row of menus on it like many applications have. you can also create popup menus. the menu features of xul consist of a number of different elements which allow you to create menu bars or popup menus. the items on the menus can be customized quite easily. we've already seen part of how to make menus using the menulist. this section will build on that. menu bars are usually created much like a toolbar. the menu bar can optionally be placed inside a toolbox and the menu would work just like any other toolbar. xul does have some special elements which provide special functionality typical of menus. ther...
...menus, which are explained briefly here and in detail afterwards: menubar the container for the row of menus. menu despite the name, this is actually only the title of the menu on the menubar. this element can be placed on a menubar or can be placed separately. menupopup the popup box that appears when you click on the menu title. this box contains the list of menu commands. menuitem an individual command on a menu. this would be placed in a menupopup. menuseparator a separator bar on a menu. this would be placed in a menupopup. you can customize the menus on the menubar to have whatever you want on them on all platforms except the macintosh. this is because the macintosh has its own special menu along the top of the screen controlled by the system. although you can ...
...controlled by the system. although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied. you should keep this is mind when creating menus. ...
...And 8 more matches
radiogroup - Archive of obsolete content
ected 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. ...
...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. ...
...ither 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, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribut...
...And 8 more matches
toolbar - Archive of obsolete content
ening the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. ...
...ab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a 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. attributes autohide, currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, height...
...lity problem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette. ...
...And 8 more matches
tooltip - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable men...
... noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds. ...
...nupopup > menu { max-width: none; } default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window. 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. noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds. if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be...
...And 8 more matches
Styling lists - Learn web development
the <dl> element has a top and bottom margin of 16px (1em), but no padding set. the <dd> elements have margin-left of 40px (2.5em.) the <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. handling list spacing when styling lists, you need to adjust their styles so they ...
.... these are inherited by everything on the page. rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs. this means that each paragraph and list will have the same font size and top and bottom spacing, helping to keep the vertical rhythm consistent. rule 4 sets the same line-height on the paragraphs and list items — so the paragraphs and each individual list item will have the same spacing between lines. this will also help to keep the vertical rhythm consistent. rules 5 and 6 apply to the description list — we set the same line-height on the description list terms and descriptions as we did with the paragraphs and list items. again, consistency is good! we also make the description terms have bold f...
...plore some list-specific properties. there are three properties you should know about to start with, which can be set on <ul> or <ol> elements: list-style-type: sets the type of bullets to use for the list, for example, square or circle bullets for an unordered list, or numbers, letters or roman numerals for an ordered list. list-style-position: sets whether the bullets appear inside the list items, or outside them before the start of each item. list-style-image: allows you to use a custom image for the bullet, rather than a simple square or circle. bullet styles as mentioned above, the list-style-type property allows you to set what type of bullet to use for the bullet points. in our example, we've set the ordered list to use uppercase roman numerals, with: ol { list-style-type: up...
...And 8 more matches
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
ode(nsinode* node); private: nscomarray<nsinode> mnodes; }; // typesafety of mnodes ensures that we only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them. when the object goes out of scope, all its members are released. ...
...afety of mnodes ensures that we only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them. when the object goes out of scope, all its members are released. ...
... we only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them. when the object goes out of scope, all its members are released. ...
...And 8 more matches
Creating a gloda message query
s 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. you may also see new messages show up if new messages are indexed that meet the constraints. ...
...ring) 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. ...
...e 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. ...
...And 8 more matches
DataTransfer.types - Web APIs
e special-cased for legacy reasons (for example "text"). syntax datatransfer.types; return value an array of the data formats used in the drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. ...
...return value an array of the data formats used in the drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. example this example shows the use of the types and items properties. ...
...ult(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("... ...
...And 8 more matches
FileSystemDirectoryReader.readEntries() - Web APIs
isplay: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascript content first, let's look at the recursive scanfiles() function. this function takes as input a filesystementry representing an entry in the file system to be scanned and processed (the item parameter), and an element into which to insert the list of contents (the container parameter). note that to read all files in a directory, readentries needs to be called repeatedly until it returns an empty array. in chromium-based browsers, the following example will only return a max of 100 entries. let dropzone = document.getelementbyid("dropzone"); let listing = document.getelementbyid("...
...o which to insert the list of contents (the container parameter). note that to read all files in a directory, readentries needs to be called repeatedly until it returns an empty array. in chromium-based browsers, the following example will only return a max of 100 entries. ...
...read all files in a directory, readentries needs to be called repeatedly until it returns an empty array. in chromium-based browsers, the following example will only return a max of 100 entries. ...
...And 8 more matches
Using the group role - Accessibility
a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page. when the role is added to an element, the browser will send out an accessible group event to assistive technology products which can then notify the user about it. a group should be used to form a logical collection of items with related functionality, such as children in a tree widget forming a collection of siblings in a hierarchy, or a collection of items having the same container in a directory. however, when a group is used in the context of list, authors must limit its children to listitem elements. group elements may be nested. proper handling of a group by assistive technologies is determined by the context...
...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. ...
...added directly into the html source code. ...
...And 8 more matches
ARIA: listbox role - Accessibility
the listbox role is used for lists from which a user may select one or more items which are static and, unlike html <select> elements, may contain images. description the listbox role is used to identify an element that creates a list from which a user may select one or more static items, similar to the html <select> element. unlike <select>, a listbox can contain images. each child of a listbox should have a role of option. it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. elements with the role li...
... group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. elements with the role listbox have an implicit aria-orientation value of vertical. when a list is tabbed to, the first item in the list will be selected if nothing else already is. up/down arrows navigate the list, and pressing shift + up/down arrows will move and extend the selection. typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string). ...
...when a list is tabbed to, the first item in the list will be selected if nothing else already is. up/down arrows navigate the list, and pressing shift + up/down arrows will move and extend the selection. typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string). if the current item has an associated context menu, shift+f10 will launch that menu. if list items are checkable, space can be used to toggle checkboxes. for selectable list items, space toggles their selection, shift+space can be used to select contiguous items, ctrl+arrow moves without selecting, and ctrl+space can be used to select non-contiguous items. it is recommended that a checkbox, link or other method be u...
...And 8 more matches
display - CSS: Cascading Style Sheets
Web › CSS › display
detail of what happens when display: flex is declared is defined in the css flexible box model specification. see the table at the end of this document for all of the individual specifications. syntax the css display property is specified using keyword values. keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout. valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generates o...
...ing html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. list item <display-listitem> the element generates a block box for the content and a separate list-item inline box. a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in brows...
...tion, see the following material, which covers the various values of display in depth. ...
...And 8 more matches
list-style-position - CSS: Cascading Style Sheets
the list-style-position css property sets the position of the ::marker relative to a list item. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand list-style. note: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: in...
...r more information on this, see bug 36854. syntax /* keyword values */ list-style-position: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. ...
... /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
...And 8 more matches
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. 20 is global attributes, html, reference, is the is global attribute allows you to specify that a standard html element should behave like a defined custom built-in element (see using custom elements for more details). 21 itemid attribute, global attribute, html, html microdata, microdata, reference, itemid the itemid global attribute provides microdata in the form of a unique, global identifier of an item. 22 itemprop attribute, global attribute, html, html microdata, microdata, reference the itemprop global attribute is used to add properties to an item. every html element can have an i...
...html, html microdata, microdata, reference, itemid the itemid global attribute provides microdata in the form of a unique, global identifier of an item. 22 itemprop attribute, global attribute, html, html microdata, microdata, reference the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. ...
...nt can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. 23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. ...
...And 8 more matches
Building Menus With Templates - Archive of obsolete content
this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. ...
...et to menu. this allows for better performance as the entire content of a complex menu does not need to be created until the user needs to use the menu. it is very simple to create a menu using a template. here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <menuitem uri="?" label="?name"/> </menupopup> </action> </template> </button> <button label="children" oncommand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button. the query generates a list of the person tags within the datasource and outputs the action body for each one. the uri attribute has not been placed o...
...mmand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button. the query generates a list of the person tags within the datasource and outputs the action body for each one. the uri attribute has not been placed on the menupopup element which is the direct child of the action element but has instead been placed on the menuitem element. this causes the menupopup to only be created once. the menuitem elements however will be repeated for each result from the query. this makes sense, as we only want one menupopup to be created but multiple menuitem elements. the second button in the example displays an alert with the number of children the template-driven button has. if you press this button before opening the menu, there...
...And 7 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
in thunderbird 2 requires seamonkey 1.1 type: string a string which is passed to the search component. autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif set to true, the best match will be filled into the textbox as the user types. if false, the default, the value will not be filled in until the user selects an item. as of gecko 1.9.1, this attribute is now always specified in lower case. autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the input. if false, only the text that hasn't been entered yet will be filled in. the textbox.autofill attribute must be set to true to use this feature. as of gecko 1.9.1, ...
...ofill attribute must be set to true to use this feature. as of gecko 1.9.1, this attribute is superseded by the completedefaultindex attribute. autofill new in thunderbird 3 requires seamonkey 2.0 type: boolean if set to true, the best match will be filled into the textbox as the user types. if false, the default, the value will not be filled in until the user selects an item. completedefaultindex 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. crop type: boolean this attribute is not used and is only provided for compatibility with the menulist element. disableautocomplete obsol...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. disablehistory obsolete since gecko 2.0 type: boolean note: applies to: thunderbird and seamonkeyif false, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results. the default value is true, hiding the dropdown button. this attribute only wo...
...And 7 more matches
More Tree Features - Archive of obsolete content
« previousnext » here, we'll see more features of trees. hierarchical trees the tree element is also used to create hierarchical lists, like that found in a file manager or a browser's bookmarks list. the tree view has a number of functions which specify the hierarchy of the items in a tree. each item in the tree has a level starting at 0. the topmost items in the tree will have a level of 0, the children of those items will have a level of 1, the children below that will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. the tree will draw the open and close icons to open and close a parent item as well as lines connecting the children to their parents. the tree will also handle drawing the rows w...
...the tree will also handle drawing the rows with the right level of indenting. however, the view will need to make sure it keeps track of the level of the rows as necessary. this can sometimes be quite tricky, but fortunately, the built-in content tree view does all of the hard work for us. to create a set of nested rows, all we need to do is add a second treechildren element inside the parent treeitem. you can then add items inside that to specify the child rows of an item. don't put the inner treechildren element inside the treerow as this won't work. you can repeat this process to create deeply nested trees. essentially, a treeitem element can contain either single rows which are declared with the treerow element or a set of rows which are declared with the treechildren element. there are tw...
...en element inside the treerow as this won't work. you can repeat this process to create deeply nested trees. essentially, a treeitem element can contain either single rows which are declared with the treerow element or a set of rows which are declared with the treechildren element. there are two other things you need to do to make sure the hierarchy works properly. first, you need to mark the treeitem element that has children as a container. you do this by adding the container attribute to it as follows: <treeitem container="true" /> this allows the user to click on the row that corresponds to the treeitem to expand and collapse the inner rows. you can have the child rows initially displayed by adding the open attribute. when the user expands and collapses the parent, the view's toggleopenst...
...And 7 more matches
Tree Selection - Archive of obsolete content
« previousnext » the section will describe how to get and set the selected items in a tree. getting the selected tree items each item in a tree (that corresponds to treeitem element, if using content tree view) may be selected individually. if you add the seltype attribute to the tree, set to the value single, the user may only select one row at a time. otherwise, the user may select multiple rows, which will not necessarily be contiguous. the tree provides a number of functions which can be used to determine whether an item is selected. handling the select event first, let's see how we can determine when an item is selected. the onselect() event handler may be added to the tree element. when the user selects an item from the tree, the event handler is called. the user may also chang...
...the syntax of the onselect() event handler is shown below. ...
... be added to the tree element. when the user selects an item from the tree, the event handler is called. the user may also change the selection by using the cursor keys. if the user holds down the cursor key to rapidly scroll through the 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 currentindex, 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 i...
...And 7 more matches
Trees - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Trees
number of treecol elements, one for each column. each column will appear as a header at the top of the tree. the second part, the tree body, contains the data to appear in the tree and is created with a treechildren tag. the tree is unique in that the body of the tree consists only of a single widget which draws all of the data in the tree. this contrasts with the listbox, where individual listitem and listcell tags are used to specify the rows in the listbox. in a tree, all of the data to be displayed is supplied by a separate object, called a tree view. when it comes time to display a cell, the tree widget will call out to this tree view to determine what to display, which in turn will be drawn by the tree. the tree is smart enough to only ask for information from the view for those rows ...
...pace. the content tree view having said that the data to be displayed in a tree comes from a view and not from xul tags, there happens to be a built-in tree view which gets its data from xul tags. this may be a bit confusing, but essentially, one of the built-in tree views uses a set of tags which can be used to specify information about the data in the tree. the following tags are used: treeitem this contains a single parent row and all its descendants. this element also serves as the item which can be selected by the user. the treeitem tag would go around the entire row so that it is selectable as a whole. treerow a single row in the tree, which should be placed inside a treeitem tag. treecell a single cell in a tree. this element would go inside a treerow element. conveniently, ...
...he tree. when the tree needs to display a row, the tree asks the content tree view for a cell's label by calling the view's getcelltext function, which in turn gets the data from the label of the appropriate treecell. however, the three elements listed above are not displayed directly. they are used only as the source for the data for the view. thus, only a handful of attributes apply to the treeitem and related elements. for instance, you cannot change the appearance of the tree rows using the style attribute or with other css properties and the box related features such as flexibility and orientation cannot be used. in addition, mouse and other user interface events do not fire at these elements. in fact, apart from some tree specific attributes, the only attributes that will have any effe...
...And 7 more matches
Implementation Status - Archive of obsolete content
supported 3.2.1 common attributes supported 3.2.2 linking attributes supported 3.2.3 single-node binding attributes supported 3.2.4 node-set binding attributes supported 3.2.5 model item property attributes partial in some cases a loop error can occur on valid bindings 302168; 3.3.1 model supported 3.3.2 instance partial instance element with two child element does not trigger exception 337302; 3.3.3 submission partial no support for @indent and ...
...d call supported 5. datatypes section title status notes bugs 5.1 xml schema built-in datatypes partial whitespace facet not supported. ...
...section title status notes bugs 5.1 xml schema built-in datatypes partial whitespace facet not supported. ...
...And 7 more matches
NSS Sample Code sample2
s. this example shows the use of a raw key. */ #include "nss.h" #include "pk11pub.h" /* example key & iv */ unsigned char gkey[] = {0xe8, 0xa7, 0x7c, 0xe2, 0x05, 0x63, 0x6a, 0x31}; unsigned char giv[] = {0xe4, 0xbb, 0x3b, 0xd3, 0xc3, 0x71, 0x2e, 0x58}; int main(int argc, char **argv) { ck_mechanism_type ciphermech; pk11slotinfo* slot = null; pk11symkey* symkey = null; secitem* secparam = null; pk11context* enccontext = null; secitem keyitem, ivitem; secstatus rv, rv1, rv2; unsigned char data[1024], buf1[1024], buf2[1024]; int i, result_len, tmp1_outlen, tmp2_outlen; /* initialize nss * if your application code has already initialized nss, you can skip it * here. * this code uses the simplest...
...slot(ciphermech, null); /* slot = pk11_getinternalkeyslot(); is a simpler alternative but in * theory, it *may not* return the optimal slot for the operation. for * des ops, internal slot is typically the best slot */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); goto out; } /* nss passes blobs around as secitems. these contain a pointer to * data and a length. turn the raw key into a secitem. */ keyitem.type = sibuffer; keyitem.data = gkey; keyitem.len = sizeof(gkey); /* turn the raw key into a key object. we use pk11_originunwrap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_importsymkey(slot,...
...secitem. */ keyitem.type = sibuffer; keyitem.data = gkey; keyitem.len = sizeof(gkey); /* turn the raw key into a key object. we use pk11_originunwrap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); if (symkey == null) { fprintf(stderr, "failure to import key into nss (err %d)\n", pr_geterror()); goto out; } /* set up the pkcs11 encryption paramters. ...
...And 7 more matches
nss tech note1
mmon. quickder was written to be as compatible as possible with the classic decoder, in order to ease migration to it in areas of critical performance bottlenecks. for this reason, i will first describe all the common functionality of the two decoders, before outlining their differences. the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeitem(prarenapool *pool, void *dest, const sec_asn1template *t, secitem *item); secstatus sec_quickderdecodeitem(prarenapool* arena, void* dest, const sec_asn1template* templateentry, secitem* src); here is a description of the arguments : secitem* src† is a structure containing a pointer to the binary data to be decoded, as well as its size. const sec_asn1template* templateentry is a poi...
..._dynamic or sec_asn1_xtrn : specifies that the component format is defined in a dynamic subtemplate. there is no difference between the two macros. the sub field of the template points to a callback function of type sec_asn1templatechooser that returns the subtemplate depending on the component data. sec_asn1_skip: specifies that the decoder should skip decoding of the component. ...
...fference between the two macros. the sub field of the template points to a callback function of type sec_asn1templatechooser that returns the subtemplate depending on the component data. sec_asn1_skip: specifies that the decoder should skip decoding of the component. sec_asn1decodeitem can only skip required components and will assert if you try to skip an optional component. sec_quickderdecodeitem supports skipping the decoding of optional components if you define the tag of the component in the template sec_asn1_inner: recurse into the component and saves its content, without the surrounding asn.1 tag and length sec_asn1_save: saves the component data, but does not proceed to the next component if within a sequence template array. this means the next template will reprocess the same...
...And 7 more matches
ssltyp.html
selected ssl types and structures chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them. additional types are described with the functions that use them or in the header files. types and structures managing secitem memory types and structures these types and structures are described here: certcertdbhandle certcertificate pk11slotinfo secitem seckeyprivatekey secstatus additional types used by a single function only are described with the function's entry in each chapter. some of these functions also use types defined by nspr and described in the nspr reference. <a name="> many of the struct...
...escription of a function often implies reference counting. never alter the contents of a certificate structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. pk11slotinfo an opaque structure representing a physical or logical pkcs #11 slot. ...
...ef struct pk11slotinfostr pk11slotinfo; secitem a structure that points to other structures. syntax #include <seccomon.h> #include <prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, siencodedcertbuffer, sidernamebuffer, siencodednamebuffer, siasciinamestring, siasciistring, sideroid } secitemtype; typedef struct secitemstr secitem; struct secitemstr { secitemtype type; unsigned char *data; unsigned int len; }; description a secitem structure can be used to associate your own data with an ssl socket. to free a structure pointed to by a secitem, and, if desired, the secitem structure itself, use one the functions secitem_freeitem or secitem_zfreeitem. seckeyprivatekey...
...And 7 more matches
ExtensionManager (Toolkit)
the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
... the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
... the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
...And 7 more matches
nsIJumpListBuilder
p lists are built and then applied. modifying an applied jump list is not permitted. callers should begin the creation of a new jump list using initlistbuild(), add sub lists using addlisttobuild(), then commit the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. ...
...in the creation of a new jump list using initlistbuild(), add sub lists using addlisttobuild(), then commit the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump list is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. ...
...it the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump list is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. applications do not have control over the number of items allowed in jump lists; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may remove items from jump lists after they are committed. the system tracks removed items between commits. a list of these items is returned by a call to initlistbuild(). nsijumplistbuilder does not filter entries added that have been removed since the last commi...
...And 7 more matches
nsITreeView
1 drop_on 0 drop_after 1 indropbefore 0 obsolete since gecko 1.8 indropon 1 obsolete since gecko 1.8 indropafter 2 obsolete since gecko 1.8 methods candrop() methods used by the drag feedback code to determine if a drag is allowable at the current location. to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false when the orientation is not drop_on. note: drop_on will only be passed to candrop() if the item is a container; see iscontainer(). boolean candrop( in long index, in long orientation, in nsidomdatatransfer datatransfer ); parameters index the index of the row. orientation the position around the given row. defined in constant...
...amined to determine if a drop is possible. return value true if a drop is allowed at the current location; otherwise false. candropbeforeafter() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method used by the drag feedback code to determine if a drag is allowable at the current location. to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false from candropbeforeafter(). boolean candropbeforeafter( in long index, in boolean before ); parameters index the index of the item. before true to test drop before. false to test drop after. return value true if a drop event can occur. otherwise false. candropon() obsolete since gecko 1.8 (firefox 1.5 / thund...
... return value true if a drop event can occur. otherwise false. cyclecell() called on the view when a cell in a non-selectable cycling column (for example, unread/flag/and so on.) is clicked. ...
...And 7 more matches
XUL Overlays
Mozilla › Tech › XUL › Overlays
ents, as described in the example above overriding small pieces of a xul file without having to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document. ...
...e" xul files and what kind should be put in overlays, xul overlays generally define items that are not present in the basic versions of the ui, such as additional components. when plug-ins, browser extensions, or other applications provide new ui elements to the browser, these elements should be defined in overlay files. ...
...rowser, these elements should be defined in overlay files. the installation of a media plug-in, for example, may add new icons and menu items to the interface: in the navigatoroverlay.xul file or in a separate navigatorsspoverlay.xul file (where navigator.xul defines the basic ui for the navigator package), these new plug-in elements would be defined as a collection of elements or subtrees: <menuitem name="super stream player"/> <menupopup name="ss favorites"> <menuitem name="wave" src="mavericks.ssp"/> <menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute. thus, given the following...
...And 7 more matches
Storage - Web APIs
Web › API › Storage
the storage interface of the web storage api provides access to a particular domain's session or local storage. it allows, for example, the addition, modification, or deletion of stored data items. to manipulate, for instance, the session storage for a domain, a call to window.sessionstorage is made; whereas for local storage the call is made to window.localstorage. properties storage.length read only returns an integer representing the number of data items stored in the storage object. ...
...e session storage for a domain, a call to window.sessionstorage is made; whereas for local storage the call is made to window.localstorage. properties storage.length read only returns an integer representing the number of data items stored in the storage object. methods storage.key() when passed a number n, this method will return the name of the nth key in the storage. storage.getitem() when passed a key name, will return that key's value. storage.setitem() when passed a key name and value, will add that key to the storage, or update that key's value if it already exists. storage.removeitem() when passed a key name, will remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by ...
... when passed a key name and value, will add that key to the storage, or update that key's value if it already exists. storage.removeitem() when passed a key name, will remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function called setstyles() that grabs the data items using storage.getitem() and uses those values to update page styles. ...
...And 7 more matches
Box alignment in grid layout - CSS: Cascading Style Sheets
t, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items. we have access to all of the box alignment properties to help us achieve this. the inline axis is the axis that...
... is the axis that corresponds to the direction that words in a sentence would run in the writing mode used. therefore, in a horizontal language such as english or arabic the inline direction runs horizontally. should you be in a vertical writing mode the inline axis will run vertically. to align things on the inline axis you use the properties that start with justify-, justify-content, justify-items and justify-self. the block axis crosses the inline axis in the direction that blocks are displayed down the page — for example paragraphs in english are displayed one below the other vertically. this, therefore is the block dimension. to align things on the block axis you use the properties that start with align-, align-content, align-items and align-self. self alignment justify-self ...
...is crosses the inline axis in the direction that blocks are displayed down the page — for example paragraphs in english are displayed one below the other vertically. this, therefore is the block dimension. to align things on the block axis you use the properties that start with align-, align-content, align-items and align-self. ...
...And 7 more matches
grid-auto-flow - CSS: Cascading Style Sheets
the grid-auto-flow css property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...yntax /* keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; this property may take one of two forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. ...
...olumn dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; this property may take one of two forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. values row items are placed by filling each row in turn, adding new rows as necessary. if neither row nor column is provided, row is assumed. column items are placed by filling each column in turn, adding new columns as necessary. dense "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. this may cause items to appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" i...
...And 7 more matches
place-self - CSS: Cascading Style Sheets
the align-self and justify-self properties) in a relevant layout system such as grid or flexbox. if the second value is not present, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... for gr...
...es auto computes to the parent's align-items value. normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start. the property doesn't apply to block-level boxes, and to table cells. ...
...And 7 more matches
<menu> - HTML: Hypertext Markup Language
Web › HTML › Element › menu
permitted content if the element is in the list menu state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>. (list menu is the default state, unless the parent element is a <menu> in the context menu state.) if the element is in the context menu state: zero or more occurrences, in any order, of <menu> (context menu state only), <menuitem>, <hr>, <script>, and <template>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar or tree dom interface htmlmenuelement ...
...the toolbar state, which represents a toolbar consisting of a series of commands for user interaction. this might be in the form of an unordered list of <li> elements, or, if the element has no <li> element children, flow content describing available commands. this value is the default if the attribute is missing. ...
...f a series of commands for user interaction. this might be in the form of an unordered list of <li> elements, or, if the element has no <li> element children, flow content describing available commands. this value is the default if the attribute is missing. usage notes the <menu> and <ul> elements both represent an unordered list of items. ...
...And 7 more matches
getAttributeNS - Archive of obsolete content
some browsers do not support getattributens, the following might be used to work on them as well. while namespaced attributes are less common than namespaced elements, some standards such as xlink depend on them. note that all gecko-based browsers (including firefox) support dom:element.getattributens. this function is not necessary for gecko-based browsers. ...
...etattributens, the following might be used to work on them as well. while namespaced attributes are less common than namespaced elements, some standards such as xlink depend on them. note that all gecko-based browsers (including firefox) support dom:element.getattributens. this function is not necessary for gecko-based browsers. ...
...m as well. while namespaced attributes are less common than namespaced elements, some standards such as xlink depend on them. note that all gecko-based browsers (including firefox) support dom:element.getattributens. this function is not necessary for gecko-based browsers. ...
...And 6 more matches
onpopuphidden - Archive of obsolete content
« xul reference home onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
... « xul reference home onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
... « xul reference home onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
...And 6 more matches
PopupEvents - Archive of obsolete content
to open a context menu, whether by the keyboard or mouse. this event will be fired even for elements that don't have a context menu associated with them. for more information about how to use this event, see context menu events. popupshowing this event is fired on a menupopup, panel or tooltip just before it is made visible. ...
... popuphidden this event is fired on a menupopup, panel or tooltip once it has been hidden. the popupshowing event just before a popup is about to be displayed, a popupshowing event will fired on the popup. ...
...popup is about to be displayed, a popupshowing event will fired on the popup. this will occur regardless of how the popup is opened, either from user interaction or from a script calling the openpopup or openpopupatscreen methods. the typical usage of a listener of the popupshowing event is to adjust the content of the popup based on context. for instance, right clicking on an image might display items on a context menu pertaining to images, whereas clicking on a link would display only those items pertaining to links. within the listener for the popupshowing event, you can append to or modify the menu as needed before it is displayed. for examples of the use of the popupshowing event when used with context menus, see hiding and showing menu items based on context. however, this technique can ...
...And 6 more matches
Building Trees - Archive of obsolete content
you can use a template with a tree just like any other template. however, since templates are often used with trees—especially with large amounts of data—the template system supports a special builder just for creating trees. rather than generate content for every row in the tree, the results are stored in a list inside the builder. this means that dom nodes are not constructed for any of the items. this is much more efficient; creating large numbers of dom nodes adds a lot of overhead. the performance advantage is possible since trees only display text. as a result, the builder only has a few pieces of information to keep track of. to use the tree builder, you need to add a flags attribute to the root node: <tree datasources="template-guide-streets.rdf" ref="http://www.xulplanet.co...
... situations that call for this, typically when handling smaller amounts of data. however, the content builder becomes slower as the amount of data increases. apart from the flags attribute, the template syntax for the tree builder and the content builder are identical. however, the tree builder requires a very specific form to the action body. ...
... a single treeitem with its rows and cells. here is an example (using an rdf source): <tree id="photoslist" flex="1" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" flags="dont-build-content"> <treecols> <treecol id="name" label="name" flex="1"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://purl.org/dc/elements/1.1/title"/> <treecell label="rdf:http://purl.org/dc/elements/1.1/date"/> </treerow> </treeitem> </treechildren> </template> </tree> note: the tree columns (treecols) are declared outside the template as static content, since they only need to be declared once. this template...
...And 6 more matches
calICalendarViewController - Archive of obsolete content
summary a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. implementing a calicalendarviewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included. calendar/base/public/calicalendarviewcontroller.idlscriptable please add a summary to this article. ...
...calicalendarviewcontroller.idlscriptable please add a summary to this article. ...
...in many cases, acalendar will be the defaultcalendar of the displaycalendar of the calicalendar...
...And 6 more matches
Looping code - Learn web development
here we'll look at the loop structures available in javascript that handle such needs. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use loops in javascript. ...
... to maintain very quickly. loops really are the best. the standard for loop let's start exploring some specific loop constructs. the first, which you'll use most of the time, is the for loop — this has the following syntax: for (initializer; condition; final-expression) { // code to run } here we have: the keyword for, followed by some parentheses. inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is incremented to count the number of times the loop has run. it is also sometimes referred to as a counter variable. a condition — as mentioned before, this defines when the loop should stop looping. this is generally an expression featuring a comparison operator, a test to see if the exit...
... 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; </script> </body> </html> note: you can find this example code on github too (also see it running live). this shows a loop is used to iterate over the items in an array and do something with each of them — a very common pattern in javascript. here: the counter variable (sometimes known as an initializer or an iteration variable), i, starts at 0 (let i = 0). the loop has been told to run until i is no longer smaller than the length of the cats array. this is important — the condition is the condition under which the loop will still run. so in...
...And 6 more matches
Using Vue computed properties - Learn web development
these work similarly to methods, but only re-run when one of their dependencies changes. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. ...
...dvanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to use vue computed properties. using computed properties the aim here is to add a summary count of our to-do list. this can be useful for users, while also serving to label the list for assistive technology. if we have 2 of 5 items completed in our to-do list, our summary could read "3 items completed out of 5". while it might be tempting to do something like this: <h2>{{todoitems.filter(item => item.done).length}} out of {{todoitems.length}} items completed</h2> it would be recalculated on every render. for a small app like this, that probably doesn't matter too much. for bigger apps, or when the expression is more com...
... every render. for a small app like this, that probably doesn't matter too much. for bigger apps, or when the expression is more complicated, that could cause a serious performance problem. a better solution is to use vue’s computed properties. computed properties work similarly to methods, but only re-run when one of their dependencies changes. in our case, this would only re-run when the todoitems array changes. to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. adding a summary counter add the following code to your app component object, below the methods property. the list summary method will get the number of finished todoitems, and return a string reporting this. computed: { listsummary...
...And 6 more matches
Utility functions
link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...d source code references. the nss version column indicates which versions of nss support the function. ...
...h versions of nss support the function. ...
...And 6 more matches
nsINavHistoryResultNode
ribute 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. ...
...for other nodes, this value is 0. ...
...for other nodes, this value is 0. read only. icon autf8string this uri can be used as an image source uri and will give you the favicon for the page. ...
...And 6 more matches
ContentIndex - Web APIs
contentindex.getall returns a promise that resolves with an iterable list of content index entries. ...
... contentindex.getall returns a promise that resolves with an iterable list of content index entries. ...
...to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. ...
...And 6 more matches
DataTransfer - Web APIs
for more information about drag and drop, see html drag and drop api. this object is available from the datatransfer property of all drag events. constructor datatransfer() creates and returns a new datatransfer object. properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. the value must be none, copy, link or move. ...
...be none, copy, link or move. datatransfer.effectallowed provides all of the types of operations that are possible. must be one of none, copy, copylink, copymove, link, linkmove, move, all or uninitialized. datatransfer.files contains a list of all the local files available on the data transfer. if the drag operation doesn't involve dragging files, this property is an empty list. datatransfer.items read only gives a datatransferitemlist object which is a list of all of the drag data. datatransfer.types read only an array of strings giving the formats that were set in the dragstart event. gecko properties note: all of the properties in this section are gecko-specific. datatransfer.mozcursor gives the drag cursor's state. this is primarily used to control the cursor during tab...
...ernal drags or if the caller can't access the node. datatransfer.mozusercancelled read only this property applies only to the dragend event, and is true if the user canceled the drag operation by pressing escape. it will be false in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location. deprecated properties datatransfer.mozitemcount read only gives the number of items in the drag operation. removed in firefox 71. methods standard methods datatransfer.cleardata() remove the data associated with a given type. the type argument is optional. if the type is empty or not specified, the data associated with all types is removed. if data for the specified type does not exist, or the data transfer contains no data, th...
...And 6 more matches
Checking when a deadline is due - Web APIs
k to see if the form fields have all been filled in. if not, we drop a message into our developer notifications pane (see the bottom left of the app ui) to tell the user what is going on, and exit out of the function. ...
...n, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction opened for task addition.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var request = objectstore.add(newitem[0]); in this section we create an object called newitem that stores the data in the format required to insert it into the database. the next few lines open the databas...
... // add our newitem object to the object store var request = objectstore.add(newitem[0]); in this section we create an object called newitem that stores the data in the format required to insert it into 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 add...
...And 6 more matches
CSS Flexible Box Layout - CSS: Cascading Style Sheets
css flexible box layout is a module of css that defines a css box model optimized for user interface design, and the layout of items in one dimension. in the flex layout model, the children of a flex container can be laid out in any direction, and can “flex” their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. both horizontal and vertical alignment of the children can be easily manipulated. basic example in the following example a container has been set to display: flex, which means that the three child items become flex items. ...
...their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. both horizontal and vertical alignment of the children can be easily manipulated. basic example in the following example a container has been set to display: flex, which means that the three child items become flex items. the value of justify-content has been set to space-between in order to space the items out evenly on the main axis. an equal amount of space is placed between each item with the left and right items being flush with the edges of the flex container. you can also see that the items are stretching on the cross axis, due to the default value of align-items being stretch. the items stretch to the height of the flex container, making them each appear as tall as the tallest item. refe...
... the items are stretching on the cross axis, due to the default value of align-items being stretch. the items stretch to the height of the flex container, making them each appear as tall as the tallest item. reference css properties flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap order alignment properties the properties align-content, align-self, align-items and justify-content initially appeared in the flexbox specification, but are now defined in box alignment. the flexbox spec now refers to the box alignment specification for up to date definitions. also additional alignment properties are now defined in box alignment. ...
...And 6 more matches
Grid template areas - CSS: Cascading Style Sheets
you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...And 6 more matches
place-content - CSS: Cascading Style Sheets
; /* global values */ place-content: inherit; place-content: initial; place-content: unset; the first value is the align-content property value, the second the justify-content one. important: if the second value is not present, the first value is used for both, provided it is a valid value for both. if it is invalid for one or the other, the whole value will be invalid. values start the items are packed flush to each other toward the start edge of the alignment container in the appropriate axis. end the items are packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side. this only ...
...ach other toward the start edge of the alignment container in the appropriate axis. end the items are packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like start. flex-end the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end or cross-end side. this only applies to flex layout items. ...
...ner depending on the flex container's main-start or cross-start side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like start. flex-end the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end or cross-end side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like end. center the items are packed flush to each other toward the center of the alignment container. left the items are packed flush to each other toward the left edge of the alignment container. ...
...And 6 more matches
xml:base support in old browsers - Archive of obsolete content
f your browser has native support for node.baseuri. these two functions aim to allow some support for xml:base. note however, that this code is not based on a thorough examination of the specs related to forming base uris and could well have a number of errors. however, it is working in some of the cases tested. ...
...lated to forming base uris and could well have a number of errors. however, it is working in some of the cases tested. ...
...he 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.lastindexof('/')-1); if (link.lastindexof('/') !== link.length-1) { link += '/'; } link = loc.protocol + '//' + loc.host + dirpath + link; } } return link; } function getxmlbase (thisitem) { // fix: need to keep going up the chain if still a relative url!!!!! // var ns = 'http://www.w3.org/xml/1998/namespace'; var att, protocolpos; var xmlbase = ''; var abs = false; // avoid loop if node is not present if (!thisitem || !thisitem.nodename) { return xmlbase; } // check present element and higher up for xml:base // now check for the next matching local name up in the hier...
...And 5 more matches
Adding sidebars - Archive of obsolete content
ly familiar with the bookmarks and history sidebars. if not, you can open either one from the view > sidebar menu. they also have shortcuts to open or close them using the keyboard. the code required to add a sidebar is very simple, as explained in creating a firefox sidebar. it's even simpler than that. all you need is to overlay the view sidebar menu. ...
... this workaround is necessary because you can't have an background image stretch using css. a less common use for the stack element is to use the left and top attributes on its children in order to have absolute positioning for the content on the layers. this kind of positioning can be useful for various artistic effects, as well as some type of desktop-like or dashboard-like interface, where items are located in positions determined by the user, and they can overlap with each other. this can become complicated very easily, though. remember that you can't have flexibility and absolute positioning at the same time. trees the bookmarks and history sidebars in firefox use the « xul reference « element to show their content. trees are another strong option when you need to show a great am...
...od amount of work before it fits your specific needs. it is in reality a hierarchical table view, so its content is defined in terms of rows and columns. ...
...And 5 more matches
XUL Events - Archive of obsolete content
e of a <checkbox> element has changed.closethe close event is executed when a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>. ...
...ment has changed.closethe close event is executed when a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>. ...
...n a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>. ...
...And 5 more matches
Special per-platform menu considerations - Archive of obsolete content
for many menu commands, convention dictates where these items will be placed. for instance, the edit menu always starts with the undo command if such a feature is available in the application, followed by redo, cut, copy, paste, and so forth. some menu items have specific common labels or locations where certain menu items would go that differ on each platform. for instance, on windows, the menu item which exits the application is labeled "exit" and is normally placed at the end of the file menu. the mac application menu on the macintosh, an extra menu exists beside the file menu; its name is the same as the name of the application. this menu contains a number of items that pertain to the application. ...
...instance, on windows, the menu item which exits the application is labeled "exit" and is normally placed at the end of the file menu. the mac application menu on the macintosh, an extra menu exists beside the file menu; its name is the same as the name of the application. this menu contains a number of items that pertain to the application. for instance, this is the proper place to put the menu items which open the application preferences and which quit the application. this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu. on the mac, these menu items will be moved onto the application menu, but on other platforms, they will be left in their original locations. this makes it easier to write the same xul code f...
...which quit the application. this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu. on the mac, these menu items will be moved onto the application menu, but on other platforms, they will be left in their original locations. this makes it easier to write the same xul code for all platforms. here is a list of the menu item ids which are automatically handled. menu_filequitseparator the separator just before the quit/exit item. menu_filequititem the item which exits the application. menu_prefsseparator the separator just before the preferences/options item. menu_preferences the item which opens the application preferences. aboutseparator the separator just...
...And 5 more matches
RDF Query Syntax - Archive of obsolete content
next » let's look at a simple query with two statements. each statement is placed as a direct child of the <query> element within the template. <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <rule> ... </rule> </template> </vbox> this query has two statements, each specified with a different tag. the template won't generate anything yet since we still need to fill in the content to be generated which goes in the missing part inside the rule. however, the template builder will be able to compile the rules and examine...
...more understandable. for this discussion, assume that so far we have a single potential result as above. the content tag doesn't do anything else at this point, meaning it doesn't add anything else to the network of potential results, so processing continues on to the next statement, the triple, which looks like this: <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> the triple statement is used to follow arcs or arrows in the rdf graph. the predicate attribute specifies the labels of the arrows to follow. in the triple used here, the predicate is 'http://www.xulplanet.com/rdf/relateditem', so we know that the builder will look for arrows with that label. the builder can either follow the arrows in a forward or backward direc...
...known yet. recall the data in the potential results set: (?start = http://www.xulplanet.com/rdf/a) this was the seed data created by the content statement. ...
...And 5 more matches
Static Content - Archive of obsolete content
« previousnext » creating a menuitem in the filter list to show all items is fairly easy. this item doesn't need to be generated from the datasource. instead it will be what is called static content in a template. the static content is any content that is a sibling of the template element. this content is displayed as is without affecting the generated content from the template. ...
...tic content in a template. the static content is any content that is a sibling of the template element. this content is displayed as is without affecting the generated content from the template. ...
...the content will be displayed just like it would be as if the template wasn't present. that is, before the template is examined, the menu...
...And 5 more matches
XPCOM Examples - Archive of obsolete content
to create a window menu with a list of the currently open windows in the application. the datasource for this is rdf:window-mediator. we can use this as in the following example: example 1 : source <toolbox> <menubar id="windowlist-menubar"> <menu label="window"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <template> <rule> <menuitem uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a list of all the open windows. try this example by opening a number of browser windows and you'll see that they are all listed on the menu. window mediator component this is fine for displaying a list of open windows, but...
..."/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a list of all the open windows. try this example by opening a number of browser windows and you'll see that they are all listed on the menu. window mediator component this is fine for displaying a list of open windows, but we would like to enhance this so that clicking on the menu item will switch to that window. this is accomplished by using the window mediator component. it implements the interface nsiwindowdatasource. the code below shows how to get a component which implements it: var wmdata = components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getservice(); wmdata.queryinterface(components.interfaces.nsiwindowdatasource); this code retrieves a window ...
...rdf datasource. you can also get this component through the rdf service, which is another service that manages rdf datasources. the nsiwindowdatasource interface has a function getwindowforresource, which can be used to get the window given a resource. in the earlier example, we generated the list of windows and added it to a menu via a template. the template generates an id attribute on each menuitem element. the value of this attribute can be used as the resource. that means that in order to switch the window focus, we need to do the following: determine the element that the user clicked on. get the value of the id attribute from the element. pass this value to getwindowforresource() to get a window object. switch the focus to this window. the example below shows how we might do th...
...And 5 more matches
Widget Cheatsheet - Archive of obsolete content
see the periodic table of xul for more examples. ...
... see the periodic table of xul for more examples. ...
... see the periodic table of xul for more examples. ...
...And 5 more matches
XUL Event Propagation - Archive of obsolete content
hrome://global/skin/" type="text/css"?> <window id="events" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="alert('window handler')"> <vbox> <vbox style="background-color: lightgrey;" oncommand="alert('box handler')"> <menu class="menu" label="file" oncommand="alert('menu handler')"> <menupopup> <menuitem oncommand="alert('new item alert')" label="new" /> <menuitem label="open" /> <menuitem oncommand="alert('close handler')" label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <menuitem oncommand="alert('edit source handler')" label="edit source" /> <menuitem label="reload" /> <menuitem label="view source" /> <...
...r')" label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <menuitem oncommand="alert('edit source handler')" label="edit source" /> <menuitem label="reload" /> <menuitem label="view source" /> </menupopup> </menu> </vbox> <spring flex="1" /> </vbox> </window> in this file, the lowest-down, or "leaf" elements are the menuitems. the hierarchy of the interface can be represented as follows: when one of these menuitems raises an event, any of the elements above it in the hierarchy can handle it. in the example above, when the menuitem raises the "command" event, indicating that it has been selected, the menupopup, the menu itself, the parent box, or the root window element itself can all take advantage of this. eve...
...ropagation" or event bubbling. event bubbling means you can handle events anywhere above the event-raising element in the hierarchy. if you cut and paste the source code from the example above into a separate file, you can see that the effect of these event handlers is to display as many as four different alert dialogs as the event bubbles up the hierarchy. for example, when you click the new menuitem from the file menu, the event handlers display alerts for "new item alert", "menu handler", "box handler", and "window handler." any or all of these event handler locations might be useful in your interface development. (see it happen.) for an event to be useful somewhere higher up, however, it is very often necessary to determine which element below the handler actually raised the event. for ex...
...And 5 more matches
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. ...
...cally drawn as a thin line. more information is available in the xul tutorial. attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, 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 overrides an assigned key set in the key attribute. this attribute does not...
... side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...And 5 more matches
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
h it will be cleared if the focus is within the panel. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
... cleared if the focus is within the panel. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
...us is within the panel. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. ...
...And 5 more matches
XForms Select1 Element - Archive of obsolete content
note, some representations of the select1 element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. ...
... #representations section to refer if the attribute is supported for every representation). incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select1 element can be bound to a node containing simple content. the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select1 control is bound to. representations the xforms select1 element can be represented by the...
...e = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open" is supported if incremental attribute value is false, the bound node is updated when the select1 control is blurred (i.e. ...
...And 5 more matches
CSS and JavaScript accessibility best practices - Learn web development
is that you can update the styling of a page feature to fit in your design, but don't change it so much that it no longer looks or behaves as expected. the following sections summarize the main html features to consider. "standard" text content structure headings, paragraphs, lists — the core text content of your page: <h1>heading</h1> <p>paragraph</p> <ul> <li>my list</li> <li>has two items.</li> </ul> some typical css might look like this: h1 { font-size: 5rem; } p, li { line-height: 1.5; font-size: 1.6rem; } you should: select sensible font sizes, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make sure your headings stand out from your body text, typically big and bold like the default styling. your lists should look...
...readers can read them out alongside: <label for="name">enter your name:</label> <input type="text" name="name" id="name"> we only do the validation when the form is submitted — this is so that we don't update the ui too often and potentially confuse screen reader (and possibly other) users: form.onsubmit = validate; function validate(e) { errorlist.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') { errorfield.style.left = '360px'; createlink(testitem); } } if(errorlist.innerhtml !== '') { e.preventdefault(); } } note: in this example, we are hiding and showing the error message box using absolute positioning rather than another method such as visibility or display, because i...
...erfere with the screen reader being able to read content from it. real form validation would be much more complex than this — you'd want to check that the entered name actually looks like a name, the entered age is actually a number and is realistic (e.g. nonnegative and less than 4 digits). here we've just implemented a simple check that a value has been filled in to each input field (if(testitem.input.value === '')). when the validation has been performed, if the tests pass then the form is submitted. if there are errors (if(errorlist.innerhtml !== '')) then we stop the form submitting (using preventdefault()), and display any error messages that have been created (see below). this mechanism means that the errors will only be shown if there are errors, which is better for usability. fo...
...And 5 more matches
Organizing your CSS - Learn web development
ection of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and lists and so on. /* || general styles */ body { ... } h1, h2, h3, h4 { ... } ul { ... } blockquote { ... } after this section we could define a few utility classes, for example a class that removes the default list style for lists we're going to display as flex items or in some other way. if you have a few things you know you will want to apply to lots of different elements, they can come in this section. /* || utilities */ .nobullets { list-style: none; margin: 0; padding: 0; } ... then we can add everything that is used sitewide. that might be things like the basic page layout, the header, navigation styling, and so on. /* || sitewide */ .mai...
...h a fixed size image, video or other element on one side, and flexible content on the other. it's a pattern we see all over websites for comments, listings, and so on. if you are not taking an oocss approach you might create custom css for the different places this pattern is used, for example creating a class called comment with a bunch of rules for the component parts, then a class called list-item with almost the same rules as the comment class except for some tiny differences. the differences between these two components is that the list-item has a bottom border, and images in comments have a border whereas list-item images do not. .comment { display: grid; grid-template-columns: 1fr 3fr; } .comment img { border: 1px solid grey; } .comment .content { font-size: .8rem; } .list-...
... with almost the same rules as the comment class except for some tiny differences. the differences between these two components is that the list-item has a bottom border, and images in comments have a border whereas list-item images do not. .comment { display: grid; grid-template-columns: 1fr 3fr; } .comment img { border: 1px solid grey; } .comment .content { font-size: .8rem; } .list-item { display: grid; grid-template-columns: 1fr 3fr; border-bottom: 1px solid grey; } .list-item .content { font-size: .8rem; } in oocss, you would create one pattern called media that would have all of the common css for both patterns — a base class for things that are generally the shape of the media object. then we'd add an additional class to deal with those tiny differences, thus ext...
...And 5 more matches
Understanding client-side JavaScript frameworks - Learn web development
development. 2. ember app structure and componentization in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components. 3. ember interactivity: events, classes and state at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app. 4. ember interactivity: footer functionality, conditional rendering now it's time to start tackling the footer functionality in our app. here we'll get the todo counter to update to show ...
...ackground, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example. 2. ...
...te our own custom component — we'll start by creating a component to represent each item in the todo list. along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props and saving data state. 3. rendering a list of vue components at this point we've got a fully working component; we're now ready to add multiple todoitem components to our app. in this article we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive. 4. adding a new todo form: vue events, methods, and models we now have sample data in place and a loop that takes each bit of data and renders it inside a todoitem in our app. what we really...
...And 5 more matches
NSS 3.15 release notes
download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_rtm/src/ new in nss 3.15 new functionality support for ocsp stapling (rfc 6066, certificate status request) has been added for both client and server sockets. tls client applications may enable this via a call to ssl_optionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2. it replaces function secitem_reallocitem, which is now declared as obsolete. support for single-operation (eg: not multi-part) symmetric key encryption and decryption, via pk11_encrypt and pk11_decrypt. certutil has been updated to support creating name constraints extensions. new functions in ssl.h ssl_peerstapledocspresponse - returns the server's stapled ocsp ...
...nded for testing, permits the sending and receiving of raw ocsp request/responses. in secpkcs7.h sec_pkcs7verifydetachedsignatureattime - verifies a pkcs#7 signature at a specific time other than the present time. in xconst.h cert_encodenameconstraintsextension - matching function for cert_decodenameconstraintsextension, added in nss 3.10. in secitem.h secitem_allocarray secitem_duparray secitem_freearray secitem_zfreearray - utility functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues ...
... secitem_allocarray secitem_duparray secitem_freearray secitem_zfreearray - utility functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues with secitem_reallocitem, see bug 298649 and bug 298938. in pk11pub.h pk11_decrypt - performs decryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. pk11_encrypt - performs encryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. ...
...And 5 more matches
Utilities for nss samples
* password or the file to read it from */ } secupwdata; /* * printasascii */ extern void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len); /* * printashex */ extern void printashex(prfiledesc* out, const unsigned char *data, unsigned int len); /* * getdigit */ extern int getdigit(char c); /* * hextobuf */ extern int hextobuf(unsigned char *instring, secitem *outbuf, prbool ishexdata); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * checkpassword */ extern prbool checkpassword(char *cp); /* * getpassword */ extern char * getpassword(file *input, file *output, char *prompt, prbool (*ok)(char *)); /* * filepasswd extracts the password from a text file * * storing...
..._2_name:its_password * */ extern char * filepasswd(pk11slotinfo * slot, prbool retry, void *arg); /* * getmodulepassword */ extern char * getmodulepassword(pk11slotinfo *slot, int retry, void *pwdata); /* * generaterandom */ extern secstatus generaterandom(unsigned char *rbuf, int rsize); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * seedfromnoisefile */ extern secstatus seedfromnoisefile(const char *noisefilename); /* * filesize */ extern long filesize(const char* filename); /* * readderfromfile */ extern secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii); #endif /* _util_h */ util.c /* this source code f...
...port_alloc(outlen) : port_alloc(len); if (!outbuf->data) { return -1; } if (ishexdata) { while (*instring) { if ((*instring == '\n') || (*instring == ':')) { ...
...And 5 more matches
Rhino Debugger
and system.err streams to an internal javascript console window which provides an editable command line for you to enter javascript code and view system output. the console window maintains a history of the commands you have entered. you may move backward and forward through the history list by pressing the up/down arrow keys on the keyboard. opening scripts you may select the file->open menu item on the menu bar to load javascript scripts contained in files. this action will display a file-selection dialog box prompting you for the location of a script to load. the selected file will be compiled and displayed in a new window. running scripts you may select the file->run menu item on the menu bar to execute javascript scripts contained in files. this action will display a file-selection...
...f a script to execute. the loaded script will be run in a new thread and control will be given to the debugger on its first instruction. controlling execution the debugger provides the following facilities for you to control the execution of scripts you are debugging: step into to single step entering any function calls, you may do any of the following: select the debug->step into menu item on the menu bar press the step into button on the toolbar press the f11 key on the keyboard execution will resume. if the current line in the script contains a function call control will return to the debugger upon entry into the function. otherwise control will return to the debugger at the next line in the current function. step over to single step to the next line in the current f...
...y on the keyboard execution will resume. if the current line in the script contains a function call control will return to the debugger upon entry into the function. otherwise control will return to the debugger at the next line in the current function. ...
...And 5 more matches
Detailed XPCOM hashtable guide
hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...And 5 more matches
nsIApplicationCache
ache. clients can open a session with nsicacheservice.createsession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. ...
...n a session with nsicacheservice.createsession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. ...
...atesession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. constants constant value description item_manifest 1 this item is the application manifest. item_explicit 2 this item was explicitly listed in the application manifest. item_implicit 4 this item was navigated to in a top level browsing context, and named this cache's group as its manifest. item_dynamic 8 this item was added to the cache using the dynamic scripting api. item_foreign 16 this item was listed in the application manifest, but named a different cache group as its manifest. ...
...And 5 more matches
nsICollection
xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisupport...
...umerate(); 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 appended to the list. clear() removes all items from the collection. void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumer...
...s none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the specified index into the collection. nsisupports getelementat( in pruint32 index ); parameters index the index position of the item to be returned. return value nsisupports item at the index position. queryelementat() performs a queryinterface on the item at the specified index into the collection. void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result compar...
...And 5 more matches
nsIMsgFolder
rlistener(in nsifolderlistener listener); void notifypropertychanged(in nsiatom property, in acstring oldvalue, in acstring newvalue); void notifyintpropertychanged(in nsiatom property, in long oldvalue, in long newvalue); void notifyboolpropertychanged(in nsiatom property, in boolean oldvalue, in boolean newvalue); void notifypropertyflagchanged(in nsimsgdbhdr item, in nsiatom property, in unsigned long oldvalue, in unsigned long newvalue); void notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); void notifyitemadded(in nsisupports item); void notifyitemremoved(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendents(in nsisupportsarray descende...
...iatedname astring readonly: old nsifolder properties and methods. parent nsimsgfolder old nsifolder properties and methods. parentmsgfolder nsimsgfolder readonly: handy accessor when we want a msg folder. dbtransferinfo nsidbfolderinfo subfolders nsisimpleenumerator readonly: returns an enumerator containing a list of nsimsgfolder items that are subfolders of the instance this is called on. hassubfolders boolean readonly: returns true if this folder has sub folders. messages nsisimpleenumerator readonly: returns a list of components.interfaces.nsimsgdbhdr. numsubfolders unsigned long readonly: returns the number of sub folders that this folder has. invfeditsearchscope boo...
...rtychanged(in nsiatom property, in long oldvalue, in long newvalue); notifyboolpropertychanged() void notifyboolpropertychanged(in nsiatom property, in boolean oldvalue, in boolean newvalue); notifypropertyflagchanged() void notifypropertyflagchanged(in nsimsgdbhdr item, in nsiatom property, in unsigned long oldvalue, in unsigned long newvalue); notifyunicharpropertychanged() void notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); notifyitemadded() v...
...And 5 more matches
nsINavHistoryQueryOptions
y applied to the containers. asyncenabled boolean when true, the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, only bookmark folder containers support being opened asynchronously. ...
... the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, only bookmark folder containers support being opened asynchronously. excludeitemifparenthasannotation obsolete since gecko 13.0 autf8string this option excludes items from a bookmarks query if the parent of the item has this annotation. an example is to exclude livemark items (parent folders have the "livemark/feeduri" annotation). ignored for queries over history. excludeitems boolean this option excludes all uris and separators from a bookmarks query. this would be used if you just wanted a list of bookmark folders and queries (s...
...designed for cases where you want to give the user the option of filing something into a list of folders. it only affects cases where the actual folder result node would appear in its parent folder and filters it out. it doesn't affect the query at all, and doesn't affect more complex queries (such as "folders with annotation x"). expandqueries boolean when set, allows items with "place:" uris to appear as containers, with the container's contents filled in from the stored query. if not set, these will appear as normal items. doesn't do anything if excludequeries is set. defaults to false. note that this has no effect on folder links, which are place: uris returned by nsinavbookmarkservice's getfolderuri method. these are always expanded and will appear as b...
...And 5 more matches
nsINavHistoryResultObserver
ng anewkeyword); void nodelastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode aitem, in unsigned long aoldindex); void nodereplaced(in nsinavhistorycontainerresultnode aparentnode, in nsinavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long aindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, i...
...meters anode the node whose details have changed. anewvisitdate the new value for the last visit date and time for the node. anewaccesscount the new access count value for the node. nodeiconchanged() called right after a node's icon property has changed. void nodeiconchanged( in nsinavhistoryresultnode anode ); parameters anode the node whose icon has changed. nodeinserted() called when an item is inserted into a container. the item previously at the specified index (if any) and everything below it is shifted down by one. void nodeinserted( in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long anewindex ); parameters aparent the container into which to insert the item. anode the node to insert into the container; it may be either a ...
... nodekeywordchanged() called right after the a node's keyword property has changed. ...
...And 5 more matches
nsINavHistoryResultViewer
wtitle); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aoldindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavhistoryresultnode newitem, in unsigned long index); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode , in unsigned long anewindex); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this viewer m...
... nodekeywordchanged() called right after the keyword property of a node has changed. void nodekeywordchanged( in nsinavhistoryresultnode anode, in autf8string anewkeyword ); parameters anode the node whose title has changed. anewtitle the new value for the node's keyword property. nodemoved() called when a node is moved from aoldparent at aoldindex to anewparent at anewindex. ...
... the keyword property of a node has changed. void nodekeywordchanged( in nsinavhistoryresultnode anode, in autf8string anewkeyword ); parameters anode the node whose title has changed. anewtitle the new value for the node's keyword property. nodemoved() called when a node is moved from aoldparent at aoldindex to anewparent at anewindex. the item may be a container or a leaf. ...
...And 5 more matches
Storage Inspector - Firefox Developer Tools
s: 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 you a read-only view of storage. but we're working to let you edit storage contents in future releases. opening the s...
... 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. for indexed db or local storage an origin is a combination of protocol + hostname. ...
...tps://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 example), it will be added to each storage type automatically. clicking on a tree item will display detailed information about that item in the table widget on the right. for example, clicking on an origin ...
...And 5 more matches
ContentIndex.add() - Web APIs
Web › API › ContentIndex › add
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. ...
...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. ...
...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. ...
...And 5 more matches
DataTransfer.mozClearDataAt() - Web APIs
note: this method is gecko-specific. ...
... note: this method is gecko-specific. ...
... note: this method is gecko-specific. ...
...And 5 more matches
FileList - Web APIs
Web › API › FileList
note: prior to gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the filelist would contain only one file. starting with gecko 1.9.2, if the input element's multiple attribute is true, the filelist may contain multiple files. ...
...time, meaning that the filelist would contain only one file. starting with gecko 1.9.2, if the input element's multiple attribute is true, the filelist may contain multiple files. using the file list all <input> element nodes have a files attribute of type filelist on them which allows access to the items in this list. ...
...y contain multiple files. using the file list all <input> element nodes have a files attribute of type filelist on them which allows access to the items in this list. for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the list. ...
...And 5 more matches
Drag Operations - Web APIs
the draggable attribute in a web page, there are certain cases where a default drag behavior is used. these include text selections, images, and links. when an image or link is dragged, the url of the image or link is set as the drag data, and a drag begins. for other elements, they must be part of a selection for a default drag to occur. ...
...he default image and drag effects are suitable in most situations.) drag data all drag events have a property called datatransfer which holds the drag data (datatransfer is a datatransfer object). when a drag occurs, data must be associated with the drag which identifies what is being dragged. for example, when dragging the selected text within a textbox, the data associated with the drag data item is the text itself. similarly, when dragging a link on a web page, the drag data item is the link's url. the drag data contains two pieces of information, the type (or format) of the data, and the data's value. the format is a type string (such as text/plain for text data), and the value is a string of text. when the drag begins, you add data by providing a type and the data. during the drag, in...
...ks would check for the type text/uri-list. during a drop event, a listener would retrieve the data being dragged and insert it at the drop location. the drag data's types property returns a list of mime-type like domstrings, such as text/plain or image/jpeg. you can also create your own types. the most commonly used types are listed in the article recommended drag types. ...
...And 5 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
> firefox the element is drawn like a container for a checkbox, which may include a prelighting background effect under certain platforms. normally it would contain a label and a checkbox. ...
... which may include a prelighting background effect under certain platforms. normally it would contain a label and a checkbox. ...
...ckground effect under certain platforms. normally it would contain a label and a checkbox. ...
...And 5 more matches
list-style - CSS: Cascading Style Sheets
the list-style css shorthand property allows you set all the list style properties at once. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position list-style-type syntax /* type */ list-style: square; /* image *...
...e-type see list-style-type. list-style-image see list-style-image. list-style-position see list-style-position. none no list style is used. accessibility concerns safari has an issue whereby unordered lists with a list-style value of none applied to them will not be recognized as a list in the accessibility tree. to address this, add a zero-width space as pseudo-content before each list item to ensure the list is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 ...
...tyle: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:list-style-type: disclist-style-position: outsidelist-style-image: noneapplies tolist itemsinheritedyescomputed valueas each of the properties of the shorthand:list-style-image: none or the image with its uri made absolutelist-style-position: as specifiedlist-style-type: as specifiedanimation typediscrete formal syntax <'list-style-type'> | <'list-style-position'> | <'list-style-image'> examples setting list style type and position html list 1 <ul class="one"> <li>list item1</l...
...And 5 more matches
<li> - HTML: Hypertext Markup Language
Web › HTML › Element › li
the html <li> element is used to represent an item in a list. it must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). in menus and unordered lists, list items are usually displayed using bullet points. in ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. ...
...ch as a number or letter. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. ...
...ies none. permitted content flow content. tag omission the end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element. permitted parents an <ul>, <ol>, or <menu> element. though not a conforming usage, the obsolete <dir> can also be a parent. implicit aria role listitem when child of an ol, ul or menu permitted aria roles menuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem dom interface htmllielement attributes this element includes the global attributes. value this integer attribute indicates the current ordinal value of the list item as defined by the <ol> element. the only ...
...And 5 more matches
Array.prototype.filter() - JavaScript
1; } console.log(array.filter(isprime)); // [2, 3, 5, 7, 11, 13] filtering invalid entries from json the following example uses filter() to create a filtered json of all elements with non-zero, numeric id. ...
...r(isprime)); // [2, 3, 5, 7, 11, 13] filtering invalid entries from json the following example uses filter() to create a filtered json of all elements with non-zero, numeric id. ...
... // [2, 3, 5, 7, 11, 13] filtering invalid entries from json the following example uses filter() to create a filtered json of all elements with non-zero, numeric id. ...
...And 5 more matches
Array - JavaScript
he 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 operations cannot be applied to these named properties. ...
...rray elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. ...
...array's traversal and mutation operations cannot be applied to these named properties. ...
...And 5 more matches
XPath snippets - XPath
ne link function docevaluatearray (expr, doc, context, resolver) { var i, result, a = []; doc = doc || (context ? ...
...0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } getxpathforelement the following function allows one to pass an element and an xml document to find a unique string xpath expression leading back to that element. ...
...otitem(i); } return a; } getxpathforelement the following function allows one to pass an element and an xml document to find a unique string xpath expression leading back to that element. ...
...And 5 more matches
indexed-db - Archive of obsolete content
tabase. see bug 778197 and bug 786688. example this example uses the action button api, which is only available from firefox 29 onwards. here's a complete add-on that adds two buttons to the browser: the button labeled "add" adds the title of the current tab to a database, while the button labeled "list" lists all the titles in the database. the add-on implements helper functions open(), additem() and getitems() to open the database, add a new item to the database, and get all items in the database. var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; ...
... in the database. ...
...keyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } var store = db.createobjectstore("items", {keypath: "time"}); }; request.onsuccess = function(e) { database.db = e.target.result; }; request.onerror = database.onerror; }; function additem(name) { var db = database.db; var trans = db.transaction(["items"], "readwrite"); var store = trans.objectstore("items"); var time = new date().gettime(); var reque...
...And 4 more matches
util/list - Archive of obsolete content
experimental building blocks for composing lists. globals constructors list(element1, element2, ...) constructor can takes any number of elements and creates an instance of list populated with the specified elements. parameters element1 : object|string|number element2 : object|string|number ... : object|string|number functions addlistitem(list, item) function adds a item to a list. removelistitem(list, item) function removes an item from a list list an ordered collection (also known as a sequence) disallowing duplicate elements. list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is privat...
...cate elements. list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...ements. list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...And 4 more matches
Customizing the download progress bar - Archive of obsolete content
type="text/css"?> <overlay id="mydownloadoverlay" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> </overlay> in jar.mn, make sure that there is an asterisk in front of the entry for myextension.css so that it will be preprocessed. this is required since it contains platform-specific directives, as we will see. ...
...ocessed. this is required since it contains platform-specific directives, as we will see. the myextension.css file will look something like this: richlistitem progressmeter { %ifdef xp_win min-height: 17px !important; %else %ifdef xp_macosx -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_bg_osx.png) !important; %endif %endif } richlistitem .progress-bar { %ifdef xp_win -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_fd_win.png) !important; %else %ifdef xp_macosx background-image: url(chrome://myextension/skin/progress_fd_osx.gif) !important; %endif %endif } note: this file only supports windows and mac, but it would be straightforward to add support for linux. this is ...
...for all downloads. if you want to change it for certain specific downloads only, things get a bit trickier. ...
...And 4 more matches
MMgc - Archive of obsolete content
with object counts, byte counts, and percentage of total memory. it can also display stack traces for where every object was allocated. the report can be output to the console or to a file, and can be configured to be displayed pre/post sweep or via api call. ...
...tage of total memory. it can also display stack traces for where every object was allocated. the report can be output to the console or to a file, and can be configured to be displayed pre/post sweep or via api call. ...
...ect was allocated. the report can be output to the console or to a file, and can be configured to be displayed pre/post sweep or via api call. ...
...And 4 more matches
Monitoring downloads - Archive of obsolete content
the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download statu...
...the download being started; each row includes the // source uri, size, and start time. the end time and download speed // are both set to 0 at first, since we don't know those yet. // status is the same status value that came from the download manager. ...
... to update the record. we find a // record for the same source uri and start time, then update the end // time, size, and speed entries in the record. by matching on both // source uri and start time, we support logging multiple downloads of // the same file. ...
...And 4 more matches
MenuButtons - Archive of obsolete content
g the button alone should just open the menu and not execute a command directly. this works similarly to the menu tag, and would be used to present a set of commands to execute. to create a button of this type, set the type attribute of the button to 'menu'. ...
... to 'menu'. for instance, in the following example, pressing the 'view' button will open a menu which allows the user to select from a set of radio menuitems. presumably, when one is selected, the application view would be changed accordingly. when using the keyboard, pressing the down key will open the menu while the button is focused. <button type="menu" label="view"> <menupopup> <menuitem label="icons" type="radio" name="view"/> <menuitem label="list" type="radio" name="view"/> <menuitem label="details" type="radio" name="view"/> </menupopup> </button> note that when the menu is closed, the button doesn't indicate which view is selected. if you do want this indication, you should use a menulist instead. the same technique can be used for toolbarbuttons as well as bu...
...popup> </button> note that when the menu is closed, the button doesn't indicate which view is selected. if you do want this indication, you should use a menulist instead. the same technique can be used for toolbarbuttons as well as buttons. in the example below a toolbarbutton with an image has a menu associated with it. <toolbarbutton type="menu" image="cookies.png"> <menupopup> <menuitem label="block cookies" type="checkbox"/> <menuitem label="clear cookies"/> </menupopup> </toolbarbutton> the 'menu-button' button the 'menu-button' type of button is used when you want to attach a menu to a button but want to have a default action carried out when the button is pressed by itself. this is accomplished by dividing the button into two parts, one with the label and image to c...
...And 4 more matches
Adding more elements - Archive of obsolete content
« previousnext » we will conclude the discussion of boxes by adding some boxes to the find files dialog. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. ...
...reviousnext » we will conclude the discussion of boxes by adding some boxes to the find files dialog. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. ...
...de the discussion of boxes by adding some boxes to the find files dialog. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. <hbox> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> two drop down boxes have been added to the dialog. a spacer has be...
...And 4 more matches
Localization - Archive of obsolete content
e version: <description value="検索"/> you would declare an entity for each label or string of text that you use in your interface. you should not have any directly displayed text in the xul file at all. in addition to using entities for text labels, you should use them for any value that could be different in a different language. access keys and keyboard shortcuts for example. xul <menuitem label="&undo.label;" accesskey="&undo.key;"/> dtd <!entity undo.label "undo"> <!entity undo.key "u"> the example above uses two entities, one for the label on the undo menu item and the second for the access key. changing the find files example let's take a look at how we would put all of this together by modifying the find files dialog so that it uses a dtd file for all of its text str...
...file.css" type="text/css"?> <!doctype window system "chrome://findfile/locale/findfile.dtd"> <window id="findfile-window" title="&findwindow.title;" persist="screenx screeny width height" orient="horizontal" onload="initsearchlist()" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="findfile.js"/> <popupset> <menupopup id="editpopup"> <menuitem label="&cutcmd.label;" accesskey="&cutcmd.accesskey;"/> <menuitem label="&copycmd.label;" accesskey="&copycmd.accesskey;"/> <menuitem label="&pastecmd.label;" accesskey="&pastecmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_cmd" modifiers="accel" key="&cutcmd.commandkey;"/> <key id="copy_cmd" modifiers="accel" key="&copycmd.commandkey;"/> <k...
...iers="accel" key="&copycmd.commandkey;"/> <key id="paste_cmd" modifiers="accel" key="&pastecmd.commandkey;"/> <key id="close_cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&opencmd.label;" accesskey="&opencmd.accesskey;"/> <menuitem label="&savecmd.label;" accesskey="&savecmd.accesskey;"/> <menuseparator/> <menuitem label="&closecmd.label;" accesskey="&closecmd.accesskey;" key="close_cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu" label="&...
...And 4 more matches
The box model - Learn web development
in this lesson, we will take a proper look at the css box model so that you can build more complex layout tasks with an understanding of how it works and the terminology that relates to it. ...
...in this lesson, we will take a proper look at the css box model so that you can build more complex layout tasks with an understanding of how it works and the terminology that relates to it. ...
...elements inside a box are laid out in normal flow, which means that they behave just like any other block and inline elements (as explained above). we can, however, change the inner display type by using display values like flex. if we set display: flex; on an element, the outer display type is block, but the inner display type is changed to flex. any direct children of this box will become flex items and will be laid out according to the rules set out in the flexbox spec, which you'll learn about later on. note: to read more about the values of display, and how boxes work in block and inline layout, take a look at the mdn guide to block and inline layout. when you move on to learn about css layout in more detail, you will encounter flex, and various other inner values that your boxes can...
...And 4 more matches
Grids - Learn web development
gns where elements don’t jump around or change width as we move from page to page, providing greater consistency on our websites. a grid will typically have columns, rows, and then gaps between each row and column — commonly referred to as gutters. creating your grid in css having decided on the grid that your design needs, you can use css grid layout to create that grid in css and place items onto it. we will look at the basic features of grid layout first and then explore how to create a simple grid system for your project. the following video provides a nice visual explanation of using css grid: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). you will see an example with a container...
... at the basic features of grid layout first and then explore how to create a simple grid system for your project. the following video provides a nice visual explanation of using css grid: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). you will see an example with a container, which has some child items. by default these display in normal flow so the boxes display one below the other. we will be working with this file for the first part of this lesson, making changes to see how grid behaves. to define a grid we use the grid value of the display property. as with flexbox, this switches on grid layout, and all of the direct children of the container become grid items. add this to the css inside ...
... below the other. we will be working with this file for the first part of this lesson, making changes to see how grid behaves. to define a grid we use the grid value of the display property. as with flexbox, this switches on grid layout, and all of the direct children of the container become grid items. add this to the css inside your file: .container { display: grid; } unlike flexbox, the items will not immediately look any different. declaring display: grid gives you a one column grid, so your items will continue to display one below the other as they do in normal flow. to see something that looks more grid-like, we will need to add some columns to the grid. let's add three 200-pixel columns here. you can use any length unit, or percentages to create these column tracks. .container ...
...And 4 more matches
Getting started with CSS - Learn web development
e 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>emphasized</em> element.</p> <ul> <li>item one</li> <li>item two</li> <li>item <em>three</em></li> </ul> </body> </html> note: if you are reading this on a device or an environment where you can't easily create files, then don't worry — live code editors are provided below to allow you to write example code right here in the page. adding css to our document the very first thing we need to do is to tell the ht...
...and style an html element. we do this by targeting an element selector — this is a selector that directly matches an html element name. to target all paragraphs in the document you would use the selector p. to turn all paragraphs green you would use: p { color: green; } you can target multiple selectors at once, by separating the selectors with a comma. if i want all paragraphs and all list items to be green my rule looks like this: p, li { color: green; } try this out in the interactive editor below (edit the code boxes), or in your local css document. changing the default behavior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html readable by adding some default styling. headings ...
...names. this works as long as you want all of the elements of that type in your document to look the same. most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others. the most common way to do this is to add a class to your html element and target that class. in your html document, add a class attribute to the second list item. your list will now look like this: <ul> <li>item one</li> <li class="special">item two</li> <li>item <em>three</em></li> </ul> in your css you can target the class of special by creating a selector that starts with a full stop character. add the following to your css file: .special { color: orange; font-weight: bold; } save and refresh to see what the result is. you can apply the ...
...And 4 more matches
JavaScript basics - Learn web development
ten. 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 to set the personalized greeting. this won't do anything yet, but this will change soon. function setusername() { let myname = prompt('please enter your name.'); localstorage.setitem('name', myname); myheading.textcontent = 'mozilla is cool, ' + myname; } the setusername() function contains a prompt() function, which displays a dialog box, similar to alert(). this prompt() function does more than alert(), asking the user to enter data, and storing it in a variable after the user clicks ok. in this case, we are asking the user to enter a name. next, the code calls on an ap...
...ains a prompt() function, which displays a dialog box, similar to alert(). this prompt() function does more than alert(), asking the user to enter data, and storing it in a variable after the user clicks ok. in this case, we are asking the user to enter a name. next, the code calls on an api localstorage, which allows us to store data in the browser and retrieve it later. ...
...dialog box, similar to alert(). this prompt() function does more than alert(), asking the user to enter data, and storing it in a variable after the user clicks ok. in this case, we are asking the user to enter a name. next, the code calls on an api localstorage, which allows us to store data in the browser and retrieve it later. ...
...And 4 more matches
Useful string methods - Learn web development
'merry christmas my love', 'a happy christmas to all the family', 'you\'re all i want for christmas', 'get well soon']; for (let i = 0; i < greetings.length; i++) { let input = greetings[i]; // your conditional test needs to go inside the parentheses // in the line below, replacing what's currently there if (greetings[i]) { let listitem = document.createelement('li'); listitem.textcontent = input; list.appendchild(listitem); } } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; ...
... \'merry christmas my love\',' + '\n \'a happy christmas to all the family\',' + '\n \'you\\\'re all i want for christmas\',' + '\n \'get well soon\'];' + '\n' + '\nfor (let i = 0; i < greetings.length; i++) {' + '\n let input = greetings[i];' + '\n if (greetings[i].indexof(\'christmas\') !== -1) {' + '\n let result = input;' + '\n let listitem = document.createelement(\'li\');' + '\n listitem.textcontent = result;' + '\n list.appendchild(listitem);' + '\n }' + '\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (...
... code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="height: 250px; width: 95%"> const list = document.queryselector('.output ul'); list.innerhtml = ''; let cities = ['london', 'manchester', 'birmingham', 'liverpool']; for (let i = 0; i < cities.length; i++) { let input = cities[i]; // write your code just below here let result = input; let listitem = document.createelement('li'); listitem.textcontent = result; list.appendchild(listitem); } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width...
...And 4 more matches
Ember interactivity: Events, classes and state - Learn web development
along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. ...
...the @action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template. @action also binds the this of the function to the class instance. note: a decorator is basically a w...
...t the ui to update as well. and just like before, the add() function that will be called from the template gets annotated with the @action decorator to bind it to the class instance. this function's contents are fairly easy to understand — when the function is invoked, a new todo object instance is created with a text value of text, and the todos property value is updated to all of the current items inside the array (accessed conveniently using spread syntax), plus the new todo. using the service from our header component now that we've defined a way to add todos, we can interact with this service from the header.js input component to actually start adding them. first of all, the service needs to be injected into the template via the @inject decorator, which we’ll rename to @service fo...
...And 4 more matches
Handling common accessibility problems - Learn web development
ces > advanced > general, then uncheck "always use the cursor keys to navigate within pages". next, you have to open your mac's system preferences app, then go to keyboard > shortcuts, then select the all controls radio button. safari doesn't allow you to tab through links by default; to enable this, you need to open safari's preferences, go to advanced, and check the press tab to highlight each item on a webpage checkbox. important: you should perform this kind of test on any new page you write — make sure the functionality can be accessed by the keyboard. this example highlights the importance of using the correct semantic element for the correct job. it is possible to style any element to look like a link or button with css, and to behave like a link or button with javascript, but t...
...tent panel that is regularly updated using xmlhttprequest or fetch, a screenreader user might miss those updates. wai-aria do you need to use such complex functionality, or will plain old semantic html do instead? if you do need complexity, you should consider using wai-aria (accessible rich internet applications), a specification that provides semantics (in the form of new html attributes) for items such as complex form controls and updating panels that can be understood by most browsers and screen readers. to deal with complex form widgets, you need to use aria attributes like roles to state what role different elements have in a widget (for example, are they a tab, or a tab panel?), aria-disabled to say whether a control is disabled or not, etc. to deal with regularly updating regions o...
... many keyboard commands, and we won't list them all here. the basic ones you'll need for web page testing are in the following table. in the keyboard shortcuts, "vo" means "the voiceover modifier". most common voiceover keyboard shortcuts keyboard shortcut description vo + cursor keys move the vo cursor up, right, down, left. vo + spacebar select/activate items highlighted by the vo cursor. this includes items selected in the rotor (see below). vo + shift + down cursor move into a group of items (such as an html table, or a form, etc.) once inside a group you can move around and select items inside that group using the above commands as normal. vo + shift + up cursor move out of a group. vo + c (when inside a table) ...
...And 4 more matches
Dict.jsm
19 and above, you may also pass a json string to initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json. ...
...string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary. items iterator returns an iterator over all of the items in the dictionary; each item is returned as a pair (a two-element array) with the first element being the key and the second being the value. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guaran...
... array) with the first element being the key and the second being the value. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarantees are made as to what will happen. keys iterator returns an iterator over all the keys in the dictionary. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarantees are made as to what will happen. values iterator returns an iterator over all the values in the dictionary. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes duri...
...And 4 more matches
DOM Inspector internals - Firefox Developer Tools
there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey). initially, we will begin by focusing on inspector.xul and its entry point, and then expand our focus later to explain how these other inspectors differ. dom inspector from a high-level perspective the dom inspector primary ui consists of some toolbars and a panelset. the panelset...
...ot of overlays. some overlays can be described as host-integration overlays, and others as shared structure overlays. host-integration overlays dom inspector is a general-purpose extension, suitable for use with any mozilla toolkit host application. in order for dom inspector to be useful with its host application, though, there should be a way to launch dom inspector within it, e.g., by a menu item and an optional keyboard shortcut such as ctrl+shift+i (or cmd+shift+i). either the host applications must provide these themselves (usually bundling dom inspector with the application, too), or dom inspector must explicitly support them by providing its own menu items and keyboard shortcuts with host-integration overlays. dom inspector explicitly supports several mozilla project applications by...
...tor.xul, dom inspector's primary ui, will reveal that it contains almost no visible elements. as of this writing, there's a toolbox containing an empty menubar and an empty toolbar, as well as an empty vbox: <toolbox id="tbxinstoolbox"> <menubar id="mbrinspectormain"/> <toolbar id="tbinspectorprimary"/> </toolbox> <vbox id="bxinspectormain" flex="1"/> there are no menus, toolbar items, et cetera defined here. even most of the elements that aren't visible, such as key- and commandsets, are not defined in inspector.xul. these are pulled in from a series of overlays, so that the xul defining dom inspector's ui can be organized into discrete units. inspector.xul itself is only a skeleton describing the basic structure and layout of the primary dom inspector window, leaving most o...
...And 4 more matches
Content Index API - Web APIs
to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. ...
...t registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = 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. ...
... async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index...
...And 4 more matches
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. ...
... data should be added in order of preference, with the most specific format added first and the least specific format added last. ...
... data should be added in order of preference, with the most specific format added first and the least specific format added last. ...
...And 4 more matches
Using XMLHttpRequest - Web APIs
this.contenttype = bispost && otarget.enctype ? otarget.enctype : "application\/x-www-form-urlencoded"; this.technique = bispost ? this.contenttype === "multipart\/form-data" ? 3 : this.contenttype === "text\/plain" ? 2 : 1 : 0; this.receiver = otarget.action; this.status = 0; this.segments = []; var ffilter = this.technique === 2 ? plainescape : escape; for (var nitem = 0; nitem < otarget.elements.length; nitem++) { ofield = otarget.elements[nitem]; if (!ofield.hasattribute("name")) { continue; } sfieldtype = ofield.nodename.touppercase() === "input" ? ofield.getattribute("type").touppercase() : "text"; if (sfieldtype === "file" && ofield.files.length > 0) { if (this.technique === 3) { /* enctype is multipart/form-data...
... ofield.getattribute("type").touppercase() : "text"; if (sfieldtype === "file") { for (nfile = 0; nfile < ofield.files.length; ssearch += "&" + esca...
... ofield.getattribute("type").touppercase() : "text"; if (sfieldtype === "file") { for (nfile = 0; nfile < ofield.files.length; ssearch += "&" + escape(ofield.n...
...And 4 more matches
ARIA: List role - Accessibility
the aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list. <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children. ...
...ontainer with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children. there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g. a shopping list, recipe steps, driving directions. warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a list and its listitems — <ul>/<ol> and <li>. see best practices for a full example. associated wai-aria roles, states, and properties listi...
... keyboard interactions none. required javascript features none. ...
...And 4 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
ods supported in iaccessible - a minimal implementation would contain those marked "[important]": get_accparent: get the parent of an iaccessible. [important] get_accchildcount: get the number of children of an iaccessible. [important] get_accchild: get the child of an iaccessible. [important] get_accname: get the "name" of the iaccessible, for example the name of a button, checkbox or menu item. try to use unique names for each item in a dialog so that voice dictation software doesn't have to deal with extra ambiguity.[important] get_accvalue: get the "value" of the iaccessible, for example a number in a slider, a url for a link, the text a user entered in a field. [important] get_accdescription: get a long description of the current iaccessible. this is not really too useful. get_ac...
...rotected (for passwords), checked, etc. [important] get_acchelp: get context sensitive help for the iaccessible. get_acchelptopic: we don't use this, it's only if the windows help system is used. get_acckeyboardshortcut: what is the keyboard shortcut for this iaccessible (underlined alt+combo mnemonic) get_accfocus: which child is focused? [important] get_accselection: which children of this item are selected? get_accdefaultaction: get a description or name of the default action for this component, such as "jump" for links. accselect: select the item associated with this iaccessible. [important] acclocation: get the x,y coordinates, and the height and width of this iaccessible node. [important] accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or rig...
...jects marked [inserted by system]. windows will add those objects to your hierarchy for you. ...
...And 4 more matches
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the previous guide i explained block and inline layout in normal flow. all elements that are in flow, will be laid out using this method. in the following example i have a heading, paragraph, a list and a final paragraph which contains a strong element. the heading and paragraphs are block level, the strong element inline. ...
...ins a strong element. the heading and paragraphs are block level, the strong element inline. the list is displayed using flexbox to arrange the items into a row, however it too is participating in block and inline layout - the container has an outside display type of block. all of the elements can be said to be in flow. appearing on the page in the order that they are in the source. taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page. the root element therefore is out of flow, as the cont...
...i’ve added a background colour to the paragraphs, and then floated the div left. the div is now out of flow. as a float it is first laid out according to where it would be in normal flow, then taken out of flow and moved to the left as far as possible. ...
...And 4 more matches
grid-column-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (u...
...global values */ grid-column-end: inherit; grid-column-end: initial; grid-column-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes t...
...And 4 more matches
grid-row-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unle...
...pan; /* global values */ grid-row-end: inherit; grid-row-end: initial; grid-row-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. the <custom-ident> cannot take the span value. ...
...And 4 more matches
Adding captions and subtitles to HTML5 video - Developer guides
ents within the video's markup. all we need to do is to go through the video's texttracks, reading their properties and building the menu up from there: var subtitlesmenu; if (video.texttracks) { var df = document.createdocumentfragment(); var subtitlesmenu = df.appendchild(document.createelement('ul')); subtitlesmenu.classname = 'subtitles-menu'; subtitlesmenu.appendchild(createmenuitem('subtitles-off', '', 'off')); for (var i = 0; i < video.texttracks.length; i++) { subtitlesmenu.appendchild(createmenuitem('subtitles-' + video.texttracks[i].language, video.texttracks[i].language, video.texttracks[i].label)); } videocontainer.appendchild(subtitlesmenu); } this code creates a documentfragment, which is used to hold an unordered list containing our subtitles menu. ...
...nguage, video.texttracks[i].label)); } videocontainer.appendchild(subtitlesmenu); } this code creates a documentfragment, which is used to hold an unordered list containing our subtitles menu. first of all an option is added to allow the user to switch all subtitles off, and then buttons are added for each text track, reading the language and label from each one. ...
... videocontainer.appendchild(subtitlesmenu); } this code creates a documentfragment, which is used to hold an unordered list containing our subtitles menu. first of all an option is added to allow the user to switch all subtitles off, and then buttons are added for each text track, reading the language and label from each one. ...
...And 4 more matches
Proxy - JavaScript
let oldval = obj[prop]; if (prop === 'selected') { if (oldval) { oldval.setattribute('aria-selected', 'false'); } if (newval) { newval.setattribute('aria-selected', 'true'); } } // the default behavior to store the value obj[prop] = newval; // indicate success return true; } }); let i1 = view.selected = document.getelementbyid('item-1'); //giving error here, i1 is null console.log(i1.getattribute('aria-selected')); // 'true' let i2 = view.selected = document.getelementbyid('item-2'); console.log(i1.getattribute('aria-selected')); // 'false' console.log(i2.getattribute('aria-selected')); // 'true' note: even if selected: !null, then giving oldval.setattribute is not a function value correction and an extra property t...
...as you see, you can flexibly "define" properties without using object.defineproperties. this example can be adapted to find a table row by its cell. in that case, the target will be table.rows. let products = new proxy([ { name: 'firefox', type: 'browser' }, { name: 'seamonkey', type: 'browser' }, { name: 'thun...
... object created by the "little framework" published on the document.cookie page. /* var doccookies = ... ...
...And 4 more matches
ui/frame - Archive of obsolete content
it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a n...
...-on code, you can assign a listener to the frame's message event. the data property of the event is the message payload. var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: (e) => { console.log("new city: " + e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); from add-on to all frames to send a message from the add-on code to all frames, attached to all open browser windows, you can use frame.postmessage(). you can specify the frame's url property as the targetorigin: frame.postmessage(message, frame.url); this add-on listens for a frame script to send the "city changed" message above, and in response, updates all frames across all ...
... a real case it might ask a web service): var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var weather = { "london" : "rainy", "toronto" : "snowy", "san francisco" : "foggy" } var frame = new frame({ url: "./city-info.html", onmessage: (e) => { updateweather(e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); function updateweather(location) { frame.postmessage(weather[location], frame.url); } to listen to these messages in the frame script, add a listener to the window's message event: window.addeventlistener("message", updateweather, false); function updateweather(message) { var label = window.document.getelementbyid("weather"); label.textcontent = message.data; } from add-...
...And 3 more matches
Finding window handles - Archive of obsolete content
g.cgi?id=489045) now, let's move forward. first, in javascript, the code gets the nsibasewindow we want, it's a direct child of the top nsibasewindow. ...
...tils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * b...
...tils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id = ctypes.voidptr_t; let sel = ctypes.voidp...
...And 3 more matches
Tabbed browser - Archive of obsolete content
tion on getting access to the browser window in working with windows in chrome code. ...
...window in working with windows in chrome code. ...
...elect new tabs, and vice versa "window" new window "save" save to disk (with no filename hint!) openuilink( url, e, ignorebutton, ignorealt, allowkeywordfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held. ...
...And 3 more matches
Venkman Introduction - Archive of obsolete content
ons. the installation process is two steps. first, from within the browser you want to host the debugger application, visit the firefox add-ons page and click on the "install" link for the most recent version. when the download is complete, restart your browser (some windows users may also need to restart their computer as well). you can then access the debugger via a new, dynamically created menuitem in the tools menu of that browser, or else restart the browser with a special debugger option. to see which version of venkman you have, type /version in the interactive session view. for more information about the latest improvements and versions, see the venkman development page. there are two ways to start the debugger: from firefox, you can start it by selecting javascript debugger from ...
...pment menu in mozilla 1.x and netscape). you can also start the browser with the -venkman command line option, which launches venkman initially instead of an application front end. (note that venkman displays usage data when it starts up: "recorded local startup x, global yyy." this data comes from a counter built in to the application. for more information about this counter and the data, see item 2.2 in the venkman faq.) when you first start venkman, the basic views are arranged as in the screenshot above—though you can customize the layout and presence of the different views however you want, as we describe in the view customization section below. the scripts that have been loaded by the javascript engine appear in the loaded scripts window (for more information about how scripts ar...
...compiled source text for the selected function. this is the same text you would get from the tosource method of the function prototype. if the source text you are debugging is poorly formatted, pretty print can help make it easier to read by inserting line breaks and whitespace in appropriate places. when pretty print is enabled you will see a green check mark on the toolbar button, and the menu item will be checked as well. the loaded scripts view the loaded scripts view is in the top left portion of the window. when a file is loaded by the browser it will appear in this view, and when unloaded it will be removed. files are listed in alphabetical order, grouped by file type. file names are displayed after a color coded, single letter icon representing the file extension. figure 6 shows t...
...And 3 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to d...
...e url, which appears in place of the http url in pointers like the following global skin processing instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <menuitem> in one window brings up a new chrome: <menuitem value="mozilla help" oncommand="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bi...
...html were not, the term "dom" is used as a synonym for or instead of terms like "dynamic html" or "dhtml." the aom stands for the application object model, and is an extension of the dom up into the interface defined in xul. just as html is reflected in the dom as nodes like link, layer, and img, xul is reflected in the application object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole of which is manipulable from the standards upon which xul is based. near synonyms for xul there is much confusion about the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to appli...
...And 3 more matches
Dynamically modifying XUL-based user interface - Archive of obsolete content
all children of an element with id=someelement from the current document, by calling removechild() method to remove the first child, until there are no children remaining. note, that haschildnodes() and firstchild are also part of the dom api. var element = document.getelementbyid("someelement"); while(element.haschildnodes()){ element.removechild(element.firstchild); } inserting menu items to a menu this example adds two new menu items to a <menupopup>: to the start and to the end of it. it uses document.createelementns() method to create the items, and insertbefore() with appendchild() to insert the created xml elements within the document. note: document.createelementns() creates an element, but does not put it anywhere in the document. you need to use other dom methods, such...
... within the document. note: document.createelementns() creates an element, but does not put it anywhere in the document. you need to use other dom methods, such as appendchild() to insert the newly created element in the document. appendchild() appends the node after all other nodes, while insertbefore() inserts the node before the node referenced by its second parameter. ...
...ere in the document. you need to use other dom methods, such as appendchild() to insert the newly created element in the document. appendchild() appends the node after all other nodes, while insertbefore() inserts the node before the node referenced by its second parameter. ...
...And 3 more matches
Building Hierarchical Trees - Archive of obsolete content
« previousnext » a template may be used to generate hierarchical trees. this works just like with recursive generation using the content builder. each level of the tree is created using a successive iteration of the template build process. if the items are containers, the tree builder will mark the right rows as containers, so that they can be opened and closed with the small icon twisties on the left of the column. remember to make the left column the primary column for these to appear. to be able to do this, the tree builder must know that an item is a container. with an rdf datasource, this would usually be an rdf container such as a seq and the tree would display its children. for an xml datasource, the tree might display a node's children as the children in the tree, mak...
...f container such as a seq and the tree would display its children. for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy similar to that in the xml document. or, with more complex xpath expressions, a template could display a tree where the hierarchy wasn't directly like the xml document. if a node is a container, the tree item becomes a container, and the user may open the row by double-clicking it. note that this test is done on the member value not the reference value. for instance, in the photo example, we have a container 'http://www.xulplanet.com/rdf/myphotos' with three photos. three results will be generated from a simple rule with no extra conditions. it is the result, or the photo, that will be checked, not th...
...f" ref="http://www.xulplanet.com/rdf/myneighbourhood" flags="dont-build-content" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <treecols> <treecol id="address" primary="true" label="address" flex="1"/> <treecol id="floors" label="floors" flex="1"/> </treecols> <template> <rule rdf:type="http://www.xulplanet.com/rdf/house"> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://www.xulplanet.com/rdf/address"/> <treecell label="rdf:http://www.xulplanet.com/rdf/floors"/> </treerow> </treeitem> </treechildren> </rule> <rule> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://purl.org/dc/elements/1.
...And 3 more matches
Using Multiple Queries to Generate More Results - Archive of obsolete content
queries to generate results from different parts of the datasource. the first query will match the streets as before, but the second query will generate a result for each person. a header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
...datasource. the first query will match the streets as before, but the second query will generate a result for each person. a header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
...each person. a header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
...And 3 more matches
Commands - Archive of obsolete content
is invoked. there are two advantages to using this approach. first, it moves all your operations onto commands which can all be grouped together in one section of the xul file. this means that code is all together and not scattered throughout the ui code. the other advantage is that several buttons or other ui elements can be hooked up to the same command. ...
... if you re-enable the command, the buttons will become enabled again. ...
... example: controller implementation let's assume that we want to implement a listbox that handles the delete command. when the user selects delete from the menu, the listbox deletes the selected row. in this case, you just need to attach a controller to a listbox which will perform the action in its docommand method. try opening the example below (source view) in a browser window and selecting items from the list. you'll notice that the delete command on the browser's edit menu is enabled and that selecting it will delete a row. (see discussion about opening this example). the example below isn't completely polished. really, we should ensure that the selection and focus is adjusted appropriately after a deletion. <window id="controller-example" title="controller example" onload="init();" ...
...And 3 more matches
Keyboard Shortcuts - Archive of obsolete content
« previousnext » you could use keyboard event handlers to respond to the keyboard. however, it would be tedious to do that for every button and menu item (though it could be necessary when one's key commands are only triggered when the user is focused on a particular element). creating a keyboard shortcut xul provides methods in which you can define keyboard shortcuts. we've already seen in the section on menus that we can define an attribute called accesskey which specifies the key which a user can press to activate the menu or menu item. in the example below, the file menu can be selected by pressing alt + f together (or some other key combination for a specific platform). once the file menu is open, the close menu item can be selected by pressing c. example 1 : source v...
...when the key is pressed in this case, the button is selected. you might want to set up more general keyboard shortcuts however. for example, pressing ctrl + c to copy text to the clipboard. ...
... the text to the clipboard. note that textboxes have the clipboard shortcuts built-in so you don't have to implement them yourself. assigning a keyboard shortcut on a menu the second way is: if you are assigning a keyboard shortcut that performs a command that also exists on a menu, you can associate the key element directly with the menu command. to do this, also add a key attribute on the menuitem. ...
...And 3 more matches
Popup Menus - Archive of obsolete content
is described using the menupopup element. it has no special attributes and is a type of box. when invoked, it will display a window containing whatever you put inside the menupopup. however, you should always put an id attribute on the menupopup as it is used to associate the popup with an element. we'll see what this means soon. first, an example: <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> as can be seen here, a simple popup menu with three commands on it has been created. the menupopup element surrounds the three menuitem elements. you will also notice that the id has been set on the menupopup element itself. the popupset element surrounds the entire popup menu declaration. this ...
... put the id on the popup. that way it's easy to have multiple menupopups in one file. in the example above, we want to make the popup a context menu. that means that we need to use the context attribute and add it to the element which we want to have the popup associated with. the sample below shows how we might do this: example 1 : source view <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> <box context="clipmenu"> <label value="context click for menu"/> </box> here, the menupopup has been associated with a box. whenever you context-click (right-click) anywhere inside the box, the popup menu will appear. the popup will also appear even if you click on the children of the box, so ...
...lement, you can specify precisely where the popup appears. you cannot specify an exact pixel position. the position attribute can be used with all three popup types, although you probably would not change the value for tooltips. ...
...And 3 more matches
Updating Commands - Archive of obsolete content
paste command is valid when a textbox has the focus and there is something on the clipboard to paste. the command will become enabled whenever a textbox is focused and when the clipboard contents change. a command updater will listen for these situations and code can be executed which enables and disables commands as necessary. a simple command updater looks like this: <commandset id="updatepasteitem" commandupdater="true" events="focus" oncommandupdate="goupdatecommand('cmd_paste');"/> a command updater is indicated by using the commandupdater attribute, which should be set to true. the events attribute is used to list the events that the command updater listens for. you can specify multiple events by separating them with commas. in the example above, the...
...and updater listens for the focus event. this causes commands to be updated when an element receives the focus. when a focus event occurs, the code in the oncommandupdate attribute is called. in the example, the goupdatecommand method is called which is a function provided by the globaloverlay.js script described earlier. it will update the command and enable or disable necessary buttons and menu items. the code behind it is fairly simple. it just gets the necessary controller, calls its iscommandenabled method, and then enables or disables the command. if you have several commands to update, call the goupdatecommand method once for each command. note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event. e...
...s. select: occurs when the selected text changes. undo: occurs when the undo buffer changes. clipboard: occurs when the contents of the clipboard changes. the following example shows the command updaters used in the mozilla browser to update the edit menu commands. the functions used can be found in the 'chrome://communicator/content/utilityoverlay.js' script. ...
...And 3 more matches
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. fadein type: boolean this attribute is set to true if the tab is fading in or out. this typically means that the tab is in the process of appearing or disappearing. first-tab type: boolean this attribute will be set to true for the first tab. this attribute should not be set manually, but...
...ful in a theme if the first tab should be styled differently. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. 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 dis...
...And 3 more matches
toolbarbutton - Archive of obsolete content
egular button except that it may be rendered differently. typically, it is expected to have an image. more information is available in the xul tutorial. relevant accessbility guidelines all toolbar functionality should be duplicated elsewhere in the application 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. attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, oncommand, open, orient, tabindex, title, type, validate properties accesskey, accessibletype, autocheck, checkstate, checked, comma...
...accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <toolbar id="test-toolbar"> <toolbarbutton accesskey="p" label="plain"/> <toolbarbutton accesskey="c" label="checkbox" type="checkbox"/> <toolbarbutton accesskey="b" label="menu-button" type="menu-button"> <menupopup> <menuitem label="menu item 1"/> <menuitem label="menu item 2"/> </menupopup> </toolbarbutton> <toolbarbutton accesskey="m" label="menu" type="menu"> <menupopup> <menuitem label="menu item 1"/> <menuitem label="menu item 2"/> </menupopup> </toolbarbutton> </toolbar> <toolbar id="radio-toolbar"> <toolbarbutton accesskey="1" label="radio 1" type="radio" group="radiogroup"...
... side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed. normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical ...
...And 3 more matches
toolbarpalette - Archive of obsolete content
you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
...And 3 more matches
How to enable locale switching in a XULRunner application - Archive of obsolete content
able locales the available package locales are declared in the chrome manifest. ...
...ices into the xul code using fixed list items, or could take the elegant approach and construct the list dynamically. the dynamic list population requires an xpcom to query the currently selected locale as well as all locales available in the application package. ...
...= xulchromereg.getselectedlocale("localeswitchdemo"); var availablelocales = toolkitchromereg.getlocalesforpackage("localeswitchdemo"); // render locale menulist by iterating through the query result from getlocalesforpackage() const xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var localelistbox = document.getelementbyid("locale-listbox"); var selecteditem = null; while(availablelocales.hasmore()) { var locale = availablelocales.getnext(); var listitem = document.createelementns(xul_ns, "listitem"); listitem.setattribute("value", locale); listitem.setattribute("label", locale); if (locale == selectedlocale) { // is this the current locale? selecteditem = listitem; } localelistbox.appendchild(listitem); } ...
...And 3 more matches
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
net. with its own history and culture, it's responsible for the "first post!" phenomena, the anonymous coward, and the recognition of the slashdot effect, a phenomena that adorns its name. one of the quirks of slashdot is that it includes a comments count, a humorous department, a hit parade, and a section with every blog post. rss does not have any facilites for including this information in an <item>, so the rss slash module exists to fill in this gap. an example using the most popular element of the rss slash module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 ...
...the rss slash module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>review of sin city</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:comments>43</slash:comments> </item> <item> <title>what ...
... </item> <item> <title>what is the 3571st prime number</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</lastbuilddate></pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <slash:comments>72</slash:comments> </item> <item> <title>first article!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <slash:comments>118</slash:comments> </item> </channel> </rss> ...
...And 3 more matches
XForms Select Element - Archive of obsolete content
note, some representations of the select element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. ...
... list. possible values are open and closed, default is closed. incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of holding a sequence. the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select control is bound to. representations the xforms select element can be represented by the f...
...ul) list displaying a listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. ...
...And 3 more matches
Mobile accessibility - Learn web development
ill select it, and the device will read out what the app is. swiping left and right will move between apps, or buttons/controls if you are in a control bar. the device will read out each option. double-tapping anywhere will open the app/select the option. you can also "explore by touch" — hold your finger down on the screen and drag it around, and your device will read out the different apps/items you move across. if you want to turn talkback off: navigate back to the talkback menu screen (using the different gestures that are currently enabled.) navigate to the slider switch and activate it to turn it off. note: you can get to your home screen at any time by swiping up and left in a smooth motion. if you have more than one home screen, you can move between them by swiping two fi...
... bbc.co.uk. to enter the text of the url: select the url bar by swiping left/right till you get to it, and then double-tapping. hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. repeat for each character. once you've finished, find the enter key and press it. swipe left and right to move between different items on the page. swipe up and right with a smooth motion to enter the local content menu. swipe right until you find the "headings and landmarks" option. double-tap to select it. now you'll be able to swipe left and right to move between headings and aria landmarks. to go back to the default mode, enter the local context menu again by swiping up and right, select "default", and then double-tap t...
... your settings app and select accessibility > voiceover. press the voiceover slider to enable it (you'll also see a number of other options related to voiceover on this page). note: some older ios devices have the voiceover menu at settings app > general > accessibility > voiceover. ...
...And 3 more matches
Floats - Learn web development
and the content will wrap around it to the left. try changing the float value to right and replace margin-right with margin-left in the last ruleset to see what the result is. while we can add a margin to the float to push the text away, we can't add a margin to the text to move it away from the float. this is because a floated element is taken out of normal flow, and the boxes of the following items actually run behind the float. you can demonstrate this by making some changes to your example. add a class of special to the first paragraph of text, the one immediately following the floated box, then in your css add the following rules. these will give our following paragraph a background color. .special { background-color: rgb(79,185,227); padding: 10px; color: #fff; } to make the ...
...nd the paragraph still remains full width. clearing floats we have seen that the float is removed from normal flow and that other elements will display beside it, therefore if we want to stop the following element from moving up we need to clear it; this is achieved with the clear property. in your html from the previous example, add a class of cleared to the second paragraph below the floated item. then add the following to your css: .cleared { clear: left; } float example 3 <h1>simple float example</h1> <div class="box">float</div> <p class="special">lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lorem placerat vulputate. </p> <p class="cleared">duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet n...
... width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .special { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .cleared { clear: left; } you should see that the following paragraph clears the floated element and no longer comes up alongside it. the clear property accepts the following values: left: clear items floated to the left. right: clear items floated to the right. both: clear any floated items, left or right. clearing boxes wrapped around a float you now know how to clear something following a floated element, but let's see what happens if you have a tall float and a short paragraph, with a box wrapped around both elements. change your document so that the first paragraph and our floated b...
...And 3 more matches
HTML table advanced features and accessibility - Learn web development
to use them: the <thead> element must wrap the part of the table that is the header — this is usually the first row containing the column headings, but this is not necessarily always the case. if you are using <col>/<colgroup> element, the table header should come just below those. the <tfoot> element needs to wrap the part of the table that is the footer — this might be a final row with items in the previous rows summed, for example. you can include the table footer right at the bottom of the table as you'd expect, or just below the table header (the browser will still render it at the bottom of the table). the <tbody> element needs to wrap the other parts of the table content that aren't in the table header or footer. it will appear below the table header or sometimes footer, depen...
...t's recap briefly on how we use data tables. a table can be a handy tool, for giving us quick access to data and allowing us to look up different values. for example, it takes only a short glance at the table below to find out how many rings were sold in gent last august. to understand its information we make visual associations between the data in this table and its column and/or row headers. ...
...ircut</th> <td>hairdresser</td> <td>12/09</td> <td>great idea</td> <td>30</td> </tr> screenreaders will recognize markup structured like this, and allow their users to read out the entire column or row at once, for example. scope has two more possible values — colgroup and rowgroup. these are used for headings that sit over the top of multiple columns or rows. if you look back at the "items sold august 2016" table at the start of this section of the article, you'll see that the "clothes" cell sits above the "trousers", "skirts", and "dresses" cells. all of these cells should be marked up as headers (<th>), but "clothes" is a heading that sits over the top and defines the other three subheadings. "clothes" therefore should get an attribute of scope="colgroup", whereas the others wou...
...And 3 more matches
Working with Svelte stores - Learn web development
at the beginn...
...ectory. ...
...: import { writable } from 'svelte/store'; export const localstore = (key, initial) => { // receives the key of the local storage and an initial value const tostring = (value) => json.stringify(value, null, 2) // helper function const toobj = json.parse // helper function if (localstorage.getitem(key) === null) { // item not present in local storage localstorage.setitem(key, tostring(initial)) // initialize local storage with initial value } const saved = toobj(localstorage.getitem(key)) // convert to object const { subscribe, set, update } = writable(saved) // create the underlying writable store return { subscribe, set: (value) => { localstorage.se...
...And 3 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
totaltodos = todos.length let completedtodos = todos.filter(todo => todo.completed).length </script> now let's do something with that information. let's start by showing a status message. find the <h2> heading with an id of list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array. to prove it, go to that array, and try changing some of the todo object's completed property values, and even add a new todo object. observe how the numbers in the message are updated appropriately. dynamically generati...
...2 out of 3 items completed" message as before, but this time the information is coming from the todos array. to prove it, go to that array, and try changing some of the todo object's completed property values, and even add a new todo object. observe how the numbers in the message are updated appropriately. dynamically generating the todos from 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...
...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> element with the following simplified version to get an idea of how it works: <ul> {#each todos as to...
...And 3 more matches
Eclipse CDT Manual Setup
on to the root of your source tree, select an appropriate toolchain (e.g., "macosx gcc"), and click finish. the status bar at the bottom right of the window should now show that eclipse is "refreshing the workspace" (gathering a list of all the files in the source tree). ...
...lchain (e.g., "macosx gcc"), and click finish. the status bar at the bottom right of the window should now show that eclipse is "refreshing the workspace" (gathering a list of all the files in the source tree). click on the little green button beside this message to open the "progress" tab, and keep an eye on the "refreshing workspace" item as you continue with the steps below. ...
...he status bar at the bottom right of the window should now show that eclipse is "refreshing the workspace" (gathering a list of all the files in the source tree). click on the little green button beside this message to open the "progress" tab, and keep an eye on the "refreshing workspace" item as you continue with the steps below. (if an "indexing" item starts after the "refreshing the workspace" item has finished, click the little red box beside that item to cancel it, since we want to configure the project before the indexer runs.) initial project properties so that the indexer will run faster and give better results, and so that eclipse doesn't give results for irrelevant files, you should add some resource filters to have eclipse ignore certain non-source files and directories. note, you...
...And 3 more matches
NSS Sample Code Utilities_1
port_alloc(outlen) : port_alloc(len); if (!outbuf->data) { return -1; } if (ishexdata) { while (*instring) { if ((*instring == '\n') || (*instring == ':')) { ins...
... outbuf->data[truelen++] = digit1 << 4 | digit2; } } else { while (*instring) { if (*instring == '\n') { instring++; continue; } outbuf->data[truelen++] = *instring++; } outbuf->data[truelen] = '\0'; truelen = truelen-1; } outbuf->len = truelen; return 0; } /* * filetoitem */ secstatus filetoitem(secitem *dst, prfiledesc *src) { prfileinfo info; print32 numbytes; prstatus prstatus; prstatus = pr_getopenfileinfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size...
... prfileinfo info; print32 numbytes; prstatus prstatus; prstatus = pr_getopenfileinfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff */ static void echooff(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag &= ~echo; tcsetattr(fd, tcsaflush, &tio); } } /* * echoon */ static void echoon(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); ...
...And 3 more matches
NSS Sample Code sample5
rv; certcertificate *cert = null; seckeypublickey *pubkey = null; certsubjectpublickeyinfo *spki = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; char *pubkstr = base64_encoded_subjectpublickeyinfo; char *pvtkstr = base64_encoded_privatekeyinfo; secitem der; secitem nickname; pk11slotinfo *slot = null; /* initialize nss * you need to explicitly authenticate to the internal token if you use * nss_init insteadf of nss_nodb_init * invoke this after getting the internal token handle * pk11_authenticate(slot, pr_false, null); */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(st...
...(slot, pr_false, null); */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); goto cleanup; } /* get internal slot */ slot = pk11_getinternalkeyslot(); if (slot == null) { fprintf(stderr, "couldn't find slot (err %d)\n", pr_geterror()); goto cleanup; } rv = atob_convertasciitoitem(&der, pubkstr); if (rv!= secsuccess) { fprintf(stderr, "atob_convertasciitoitem failed %d\n", pr_geterror()); goto cleanup; } spki = seckey_decodedersubjectpublickeyinfo(&der); secitem_freeitem(&der, pr_false); pubkey = seckey_extractpublickey(spki); if (pubkey == null) { fprintf(stderr, "couldn't extract public key (err %d)\n", pr_geterror()); goto cleanup; } ...
... * publicvalue arg (4th) can be null for rsa key - i think it is even * ignored */ pk11_importderprivatekeyinfoandreturnkey(slot, &der,...
...And 3 more matches
NSS Sample Code sample6
id already exists */ genkey(1); /* generate a key with id 2. should succeed on first run on a fresh db, * should fail on successive runs because key with that id already exists */ genkey(2); /* generate a key with id 1 - this will fail because key with that id * already exists */ genkey(1); } void genkey(int id) { pk11slotinfo* slot = null; pk11symkey* key = null; secitem keyiditem; int keyid[1]; ck_mechanism_type ciphermech; /* using ckm_aes_cbc_pad mechanism for example */ ciphermech = ckm_aes_cbc_pad; slot = pk11_getinternalkeyslot(); /* slot = pk11_getbestslot(ciphermech, null); didn't work. * error code: token is read-only. ?? */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", ...
...ciphermech; /* using ckm_aes_cbc_pad mechanism for example */ ciphermech = ckm_aes_cbc_pad; slot = pk11_getinternalkeyslot(); /* slot = pk11_getbestslot(ciphermech, null); didn't work. * error code: token is read-only. ...
...es_cbc_pad mechanism for example */ ciphermech = ckm_aes_cbc_pad; slot = pk11_getinternalkeyslot(); /* slot = pk11_getbestslot(ciphermech, null); didn't work. * error code: token is read-only. ...
...And 3 more matches
Gecko object attributes
ual markup tag used to create this element (also used in xul). applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more information than the mapped role, which is best-fit. the role string may be a space-delimited list of roles. applied to: any role group attributes level for headings, the heading level. ...
.... applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more information than the mapped role, which is best-fit. the role string may be a space-delimited list of roles. applied to: any role group attributes level for headings, the heading level. for outline items, the indentation level. for diagrams with levels, each item can have its level specified. the level value is 1-based. applied to: grid, heading, listitem, row, tablist exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. the first item should have posinset="1", and the last item should have a posinset value equal to the setsize. applied to: listi...
...plied to: grid, heading, listitem, row, tablist exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. the first item should have posinset="1", and the last item should have a posinset value equal to the setsize. applied to: listitem, option exposed in aria: aria-posinset setsize if this item is in a group, this indicates the number of items in the group. this is useful when combined with the posinset object attribute. applied to: listitem, option exposed in aria: aria-setsize live region attribues atomic true when the entire region should be presented as a whole, when changes within it are considered important enough to automatically present. applied to: any role exposed vi...
...And 3 more matches
nsIAccessibleProvider
xultabbox 0x00001018 a com...
... xultabbox 0x00001018 a combination of a tabs object and a tabpanels object. x...
... xultab 0x00001017 the single tab in a dialog or tabbrowser/editor interface. xultabbox 0x00001018 a combination of a tabs object and a tabpanels object. xultabs 0x00001019 the collection of tab objects, usable in the tabbox and independent of as well. xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 xforms elements constants constant value description xformscontainer 0x00002000 used for xforms elements that provide accessible object for itself as well for anonymous content. this property is used for upload, input[type="xsd:gday"] and input[type="xsd:gmon...
...And 3 more matches
nsIAnnotationObserver
toolkit/components/places/public/nsiannotationservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void onitemannotationremoved(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the applicat...
...tionremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the application exits). void onitemannotationremoved( in long long aitemid, in autf8string aname ); parameters aitemid the item whose annotation is to be deleted. aname the annotation name. onitemannotationset() this method is called when an annotation value is set for an item. ...
...aname the annotation name. onpageannotationremoved() called when an annotation is deleted for a uri. if aname is empty, then all annotations for the given uri have been deleted. ...
...And 3 more matches
nsIApplicationCacheNamespace
gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) application caches can store a set of namespace entries that affect loads from the application cache. if a load from the cache fails to match on an exact cache entry, the namespace entries are searched for a substring match. ...
...rview void init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type description data acstring data associated with the namespace, such as a fallback. how this attribute is used varies depending on the namespace type. if the data is a uri, this attribute should be the uri's asciispec. read only. itemtype unsigned long a bit field indicating one or more namespace types. must be one or more of the constants defined under constants on this page. read only. namespacespec acstring the prefix of this namespace. this should be the asciispec of the uri prefix. read only. ...
...y. itemtype unsigned long a bit field indicating one or more namespace types. must be one or more of the constants defined under constants on this page. read only. namespacespec acstring the prefix of this namespace. this should be the asciispec of the uri prefix. read only. constants constant value description namespace_bypass 1 items matching this namespace can be fetched from the network when loading from this cache. the data attribute is not used. namespace_fallback 2 items matching this namespace can be fetched from the network when loading from this cache; however, if the load fails, the cache entry specified by the data attribute should be loaded intstead. ...
...And 3 more matches
nsIDOMStorage
1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) a dom window's session storage object can be retrieved from the window's sessionstorage attribute. a storage object stores an arbitrary set of key-value pairs, which may be retrieved, modified and removed as needed. ...
... be retrieved, modified and removed as needed. a key may only exist once within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed. method overview void clear(); domstring getitem(in domstring key); 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. getite...
... key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value an nsidomstorageitem object describing the data corresponding to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the cor...
...And 3 more matches
nsIDynamicContainer
scriptable this interface provides a base class for services that want to provide containers for temporary contents. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the service can fill result nodes directly into the container when it is opened. ...
...from: nsisupports last changed in gecko 1.9 (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. ...
...tainers for each container, registered to its service. method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void 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. ...
...And 3 more matches
Network request list - Firefox Developer Tools
u want to close the sidebar.) enter a string in the field with the placeholder text block resource when url contains. reload the page to test it with the specified url blocked. other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking. to turn a specific block off or on: toggle the checkbox next to that item. to delete a blocked item, click the x icon that appears when you focus the item. (starting with firefox 77) right-click any item in the list and choose from the context menu: enable all enables blocking of all items in the list. disable all disables blocking of all items in the list. remove all deletes all items in the list. blocking a specific url from the request list you...
...ou focus the item. (starting with firefox 77) right-click any item in the list and choose from the context menu: enable all enables blocking of all items in the list. disable all disables blocking of all items in the list. remove all deletes all items in the list. blocking a specific url from the request list you can also block a url from the request list: hover over the item you want to block in the request list. select block url from the context menu. when you refresh the page, that specific url will be blocked and a message will be added to the item in the list indicating that it has been blocked by the devtools. stop blocking a url from the request list hover over the item. select unblock url. ...
... note: (starting in firefox 80) you can also block and unblock urls from the web console, using the :block and :unblock helper commands. these accept any string, and affect any url containing the string. filtering requests you can filter requests by content type, by whether they are xmlhttprequests or websocket requests, or by request properties. ...
...And 3 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
nd()"> <p>hi</p> <p>hello</p> </body> javascript function set_background() { // get a list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a list of all the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only on...
...for example, if you ...
... the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only one item, which we retrieve by selecting the first element in that list using [0]. next, we get all the p elements that are descendants of the body: mybodyelements = mybody.getelementsbytagname("p"); finally, we get the second item from the list of p elements via myp = mybodyelements[1]; once you have gotten the dom object for an html element, you can set its properties. for example, if you want to set the style background color property, you just add: myp.style.background = "rgb(255,0,0)"; // setting inline style attribute creating textnodes with document.createtextnode("..") use the document object to invoke t...
...And 3 more matches
IDBObjectStore.put() - Web APIs
it returns an idbrequest object, and, in a separate thread, creates a structured clone of the value and stores the cloned value in the object store. this is for adding new records, or updating existing records in an object store when the transaction's mode is readwrite. if the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened. ...
...bjectstore.add method for an insert only method. bear in mind that if you have a idbcursor to the record you want to update, updating it with idbcursor.update() is preferable to using idbobjectstore.put(). doing so makes it clear that an existing record will be updated, instead of a new record being inserted. note: this feature is available in web workers. ...
...nly method. bear in mind that if you have a idbcursor to the record you want to update, updating it with idbcursor.update() is preferable to using idbobjectstore.put(). doing so makes it clear that an existing record will be updated, instead of a new record being inserted. note: this feature is available in web workers. ...
...And 3 more matches
Using IIR filters - Web APIs
ters and how they are implemented digitally. with that all in mind, let's take a look at the code to create an iir filter with the web audio api. setting our iirfilter co-efficients when creating an iir filter, we pass in the feedforward and feedback coefficients as options (coefficients is how we describe the values). both of these parameters are arrays, neither of which can be larger than 20 items. when setting our coefficients, the feedforward values can't all be set to zero, otherwise nothing would be sent to the filter. something like this is acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note:...
...w a frequency plot of the filter we've created with the data we get back from this method. we need to create three arrays. one of frequency values for which we want to receive the magnitude response and phase response for, and two empty arrays to receive the data. all three of these have to be of type float32array and all be of the same size. ...
...e get back from this method. we need to create three arrays. one of frequency values for which we want to receive the magnitude response and phase response for, and two empty arrays to receive the data. all three of these have to be of type float32array and all be of the same size. ...
...And 3 more matches
Web APIs
Web › API
ule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domi...
...y cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype double...
...ment htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlshadowelement htmlslotelement htmlsourceelement htmlspa...
...And 3 more matches
WAI-ARIA Roles - Accessibility
f its children should be treated similar to a desktop application, and no traditional html interpretation techniques should be used. this role should only be used to define very dynamic and desktop-like web applications.aria: article rolethe article role indicates a section of a page that could easily stand on its own on a page, in a document, or on a website. it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.aria: banner rolea banner role represents general and informative content frequently placed at the beginning of the page. this usually includes a logo, company name, search icon, photo related to the page, or slogan.aria: button rolethe button role should be used for clickable elements that trigger a re...
...provided to indicate relationships between sections.aria: img rolethe aria img role can be used to identify multiple elements inside page content that should be considered as a single image. these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner.aria: list rolethe aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list.aria: listbox rolethe listbox role is used for lists from which a user may select one or more items which are static and, unlike html <select> elements, may contain images.aria: listitem rolethe aria listitem role can be used to identify an item inside a list of items. it i...
...ttps://developer.mozilla.org/docs/web/accessibility/aria/aria_techniques). ones for which the first draft is completed have been removed from the below list. ...
...And 3 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
fill that promise of content separated from mark-up, however is it possible to go too far with this idea? is it possible that we could create an accessibility issue through our use of grids? re-ordering content in css grid layout we’ve already seen in these guides that grid gives us power to re-order the content of our page in various ways. we can use the order property, which will change how items auto-place. we can use grid-auto-flow: dense which will take items visually out of dom order. we can also position items using line-based placement of grid template areas, without considering their location in the source. the specification includes a section that covers reordering and accessibility. in the introduction to that section are details of what the specification expects browsers to do...
... details of what the specification expects browsers to do when the content is visually reordered using grid layout. grid layout gives authors great powers of rearrangement over the document. however, these are not a substitute for correct ordering of the document source. the order property and grid placement do not affect ordering in non-visual media (such as speech). likewise, rearranging grid items visually does not affect the default traversal order of sequential navigation modes (such as cycling through links, see e.g. tabindex html5). if you reorder things visually using grid layout, this will not change how the items are ordered if the content is being read out by a screen reader, or other text to speech user agent. in addition, the reordering will not change tab order. this means th...
... the specification warns authors (the csswg term for web developers) not to do this reordering. authors must use order and the grid-placement properties only for visual, not logical, reordering of content. style sheets that use these features to perform logical reordering are non-conforming. ...
...And 3 more matches
Subgrid - CSS: Cascading Style Sheets
ubgrid value for grid-template-columns and grid-template-rows. this guide details what subgrid does, and gives some use cases and design patterns that are solved by the feature. important: this feature is shipped in firefox 71, which is currently the only browser to implement subgrid. introduction to subgrid when you add display: grid to a grid container, only the direct children become grid items and can then be placed on the grid that you have created. the children of these items display in normal flow. you can "nest" grids by making a grid item a grid container. these grids however are independent of the parent grid and of each other, meaning that they do not take their track sizing from the parent grid. this makes it difficult to line nested grid items up with the main grid. if you ...
...l have three column tracks of the same size as the parent grid. gaps are inherited but can also be overridden with a different gap value. line names can be passed from the parent into the subgrid, and the subgrid can also declare its own line names. subgrid for columns in the example below i have a grid layout with nine 1fr column tracks and four rows that are a minimum of 100px tall. i place .item from column line 2 to 7, and row 2 to 4. i then make this grid item into a grid, giving it column tracks that are a subgrid and defining rows as normal. as the item spans five column tracks, this means that the subgrid has five column tracks. i can then place .subitem on this grid. the rows in this example are not a subgrid and so behave as a nested grid does normally. the grid area on the paren...
... the column tracks behave as a regular nested grid, but the rows are tied to the two tracks that the child spans. a subgrid in both dimensions you can of course define both rows and columns as a subgrid, as in the example below. this means that your subgrid is tied in both dimensions to the number of tracks on the parent. no implicit grid in a subgridded dimension if you need to autoplace items, and do not know how many items you will have, take care when creating a subgrid, as it will prevent additional rows being created to hold those items. take a look at the next example — it uses the same parent and child grid as in the example above, however inside the subgrid i have twelve items trying to autoplace into ten grid cells. as the subgrid is on both dimensions there is nowhere for...
...And 3 more matches
Consistent list indentation - CSS: Cascading Style Sheets
one of the most common style changes made to lists is a change in the indentation distance—that is, how far the list items are pushed over to the right. this often leads to frustration, because what works in one browser often doesn't have the same effect in another. for example, if you declare that lists have no left margin, they move over in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction. ...
...n, they move over in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction. making a list first, we consider a single, pure list item. ...
...r in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction. making a list first, we consider a single, pure list item. this list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself. it hangs alone in the void, simple and unadorned, as shown in figure 1. that dotted red border represents outer edges of the content-area of the list item. remember that, at this point, the list item has no padding or borders. if we add two more list items, we get a result like that shown in figure 2. now we...
...And 3 more matches
Column layouts - CSS: Cascading Style Sheets
a number of columns, and css provides several ways to do this. whether you use grid, flexbox or multi-column layout will depend on what you are trying to achieve, and in this recipe we explore these options. requirements there are a number of design patterns you might want to achieve with your columns: a continuous thread of content broken up into newspaper-style columns. a single row of items arranged as columns, with all heights being equal. multiple rows of columns lined up by row and column. the recipes you need to choose different layout methods in order to achieve your requirements. a continuous thread of content — multi-column layout if you create columns using multi-column layout your text will remain as a continuous stream filling each column in turn. the columns must...
... column in turn. the columns must all be the same size, and you are unable to target an individual column or the content of an individual column. you can control the gaps between columns with the column-gap property, and add a rule between columns using column-rule. download this example use multicol when: you want your text to display in newspaper-like columns. you have a set of small items you want to break into columns. you do not need to target individual column boxes for styling. a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. this is a different behavior to what you saw wi...
...dual column boxes for styling. a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. this is a different behavior to what you saw with multicol. there is currently no way to add a rule between flex items, and browser support for the column-gap and row-gap properties is limited. therefore to create gaps between items use a margin. download this example flexbox can also be used to create layouts where the flex items wrap onto new rows, by setting the flex-wrap property on the container to wrap. ...
...And 3 more matches
Visual formatting model - CSS: Cascading Style Sheets
different; see the block boxes section below for more details. the principal box when an element generates one or more boxes, one of them is the principal box, which contains its descendant boxes and generated content in the box tree, and is also the box involved in any positioning scheme. some elements may generate additional boxes in addition to the principal box, for example display: list-item generates more than one box (e.g. a principal block box and a child marker box). and some values (such as none or contents) cause the element and/or its descendants to not generate any boxes at all. anonymous boxes an anonymous box is created when there is not an html element to use for the box. this situation happens when, for example, you declare display: flex on a parent element, and directl...
...te any boxes at all. anonymous boxes an anonymous box is created when there is not an html element to use for the box. this situation happens when, for example, you declare display: flex on a parent element, and directly inside there is a run of text not contained in another element. in order to fix the box tree, an anonymous box is created around that run of text. it will then behave as a flex item, however, it cannot be targeted and styled like a regular box because there is no element to target. the same thing happens when you have text runs interspersed with block elements. in the next example i have a string inside a <div>; in the middle of my string is a <p> element containing part of the text. the string is split into three boxes in the box tree. the part of the string before th...
... section wrapped in the <em> element, then a final anonymous inline box. as with the anonymous block boxes, these anonymous inline boxes cannot be styled independently in the way the <em> can; they just inherit the styles of their container. other formatting contexts also create anonymous boxes. grid layout behaves in the same way as the flexbox example above, turning strings of text into a grid item with an anonymous box. multiple-column layout creates anonymous column boxes around the columns; these also cannot be styled or otherwise targetted. table layout will add anonymous boxes to create a proper table structure — for example adding an anonymous table row — if there was no box with display: table-row. line boxes line boxes are the boxes that wrap each line of text. you can see the...
...And 3 more matches
<color> - CSS: Cascading Style Sheets
tomato #ff6347 turquoise #40e0d0 violet #ee82ee wheat #f5deb3 whitesmoke #f5f5f5 yellowgreen #9acd32 css color module level 4 rebeccapurple #663399 transparent keyword the transparent keyword represents a fully transparent color. this makes the background behind the colored item completely visible. technically, transparent is a shortcut for rgba(0,0,0,0). compatibility note: to prevent unexpected behavior, such as in a <gradient>, the current css spec states that transparent should be calculated in the alpha-premultiplied color space. however, be aware that older browsers may treat it as black with an alpha value of 0. historical note: transparent wasn't a true colo...
... for readability. activetext text of active links buttonface background of push buttons buttontext text of push buttons canvas background of application content or documents canvastext text in application content or documents field background of input fields fieldtext text in input fields graytext text that is disabled highlight background of items that are selected in a control highlighttext text of items that are selected in a control linktext text of non-active, non-visited links visitedtext text of visited links deprecated system color keywords the following keywords were defined in earlier versions of the css color module. they are now deprecated. for use on public web pages. activeborder active window ...
...e threedface or buttonface when the mouse pointer is not over it). should be used with the -moz-buttonhovertext foreground color. -moz-buttonhovertext the text color of a button that the mouse pointer is over (which would be buttontext when the mouse pointer is not over it). should be used with the -moz-buttonhoverface background color. -moz-cellhighlight background color for selected item in a tree widget. should be used with the -moz-cellhighlighttext foreground color. see also -moz-html-cellhighlight. -moz-cellhighlighttext text color for a selected item in a tree. should be used with the -moz-cellhighlight background color. see also -moz-html-cellhighlighttext. -moz-combobox background color for combo-boxes. should be used with the -moz-comboboxtext foreground colo...
...And 3 more matches
grid-auto-columns - CSS: Cascading Style Sheets
the grid-auto-columns css property specifies the size of an implicitly-created grid column track or pattern of tracks. the source for this interactive example is stored in a github repository. if 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 a grid item is positioned into a column that is not explicitly sized by grid-template-columns, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns. syntax /* keyword values */ grid-auto-columns: min-content; grid-auto-columns: max-content; grid-auto-columns: auto; /* <length> values */ grid-auto-colum...
... like auto. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets...
...epresents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track-...
...And 3 more matches
grid-auto-rows - CSS: Cascading Style Sheets
the grid-auto-rows css property specifies the size of an implicitly-created grid row track or pattern of tracks. the source for this interactive example is stored in a github repository. if 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 a grid item is positioned into a row that is not explicitly sized by grid-template-rows, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows. syntax /* keyword values */ grid-auto-rows: min-content; grid-auto-rows: max-content; grid-auto-rows: auto; /* <length> values */ grid-auto-rows: 100px; grid-auto-rows: 20c...
... like auto. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets...
...nd the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. as a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track...
...And 3 more matches
grid-column-start - CSS: Cascading Style Sheets
this start position defines the block-start edge of the grid area. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...erty is specified as a single <grid-line> value. a <grid-line> value can be specified as: either the auto keyword or a <custom-ident> value or an <integer> value or both <custom-ident> and <integer>, separated by a space or the keyword span together with either a <custom-ident> or an <integer> or both. values auto a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name <custom-ident>-start, it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-start: foo; will choose the start edge of that named grid are...
...reas automatically generate implicit named lines of this form, so specifying grid-column-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> ||...
...And 3 more matches
grid-row-start - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...y is specified as a single <grid-line> value. a <grid-line> value can be specified as: either the auto keyword or a <custom-ident> value or an <integer> value or both <custom-ident> and <integer>, separated by a space or the keyword span together with either a <custom-ident> or an <integer> or both. values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo; will choose the start edge of that named grid ar...
...d areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <int...
...And 3 more matches
<ol>: The Ordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ol
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ol> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...ermitted parents any element that accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlolistelement attributes this element also accepts the global attributes. reversed this boolean attribute specifies that the list’s items are in reverse order. items will be numbered from high to low. start an integer to start counting from for the list items. always an arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or roman numerals. for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4". type sets the numbering type: a for lowercase letters a for u...
...="4". type sets the numbering type: a for lowercase letters a for uppercase letters i for lowercase roman numerals i for uppercase roman numerals 1 for numbers (default) the specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element. note: unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the css list-style-type property instead. usage notes typically, ordered list items display with a preceding marker, such as a number or letter. the <ol> and <ul> elements may nest as deeply as desired, alternating between <ol> and <ul> however you like. the <ol> and <ul> elements both represent a list of items. the difference is with the <ol>...
...And 3 more matches
contextmenu - HTML: Hypertext Markup Language
xtmenu global attribute is the id of a <menu> to use as the contextual menu for this element. a context menu is a menu that appears upon user interaction, such as a right-click. html5 now allows us to customize this menu. here are some implementation examples, including nested menus. example html <body contextmenu="share"> <menu type="context" id="share"> <menu label="share"> <menuitem label="twitter" onclick="shareviatwitter()"></menuitem> <menuitem label="facebook" onclick="shareviafacebook()"></menuitem> </menu> </menu> <ol> <li> anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu. </li> <li contextmenu="changefont" id="fontsizing"> on this specific list element, you ca...
... anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu. ...
... on twitter and facebook using the share menu from your context menu. ...
...And 3 more matches
Global attributes - HTML: Hypertext Markup Language
mode provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. used primarily on <input> elements, but is usable on any element while in contenteditable mode. is allows you to specify that a standard html element should behave like a registered custom built-in element (see using custom elements for more details). ...
... configuration to use when editing this element or its contents. used primarily on <input> elements, but is usable on any element while in contenteditable mode. is allows you to specify that a standard html element should behave like a registered custom built-in element (see using custom elements for more details). note: the item* attributes are part of the whatwg html microdata feature. itemid the unique, global identifier of an item. ...
...its contents. used primarily on <input> elements, but is usable on any element while in contenteditable mode. is allows you to specify that a standard html element should behave like a registered custom built-in element (see using custom elements for more details). note: the item* attributes are part of the whatwg html microdata feature. itemid the unique, global identifier of an item. itemprop used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. it provides a list of element ids (not itemids) with additional properties elsewhere in the document. ite...
...And 3 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
g with their equivalent dom2 counterparts that should be used instead. ...
...ivalent dom2 counterparts that should be used instead. ...
...for svg elements this is 'http://www.w3.org/2000/svg'. however, note carefully: ...
...And 3 more matches
Creating Event Targets - Archive of obsolete content
"bookmarks", navigate to it, and run jpm init, accepting all the defaults. ...
...e to it, and run jpm init, accepting all the defaults. ...
...he following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { console.log("added ", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: function(aitemid, avisitid, time) { console.log("visited ", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; exports.main = function() { bookmarkservice.addobserver(bookmarkobserver, false); }; exports.onunload = function() { bookmarkservice.removeobserver(bookmarkobserver); } tr...
...And 2 more matches
Using third-party modules (jpm) - Archive of obsolete content
ludes a command-line tool that you use to initialize, run, test, and package add-ons. the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article describes how you can use third-party modules with jpm. to follow this tutorial you'll need to have installed jpm and learned the basic jpm commands. to install menuitem you'll need to have git command. if you have error related to git, check you have latest git command installed. the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use. before the jpm tool was available, there wasn't any package manager for these community-developed modules,...
...here to find community-developed modules, or how to install and update them. with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox. module developers can publish sdk modules to npm, and add-on developers can install them from npm and build them into their add-ons. this article explains how to use npm-hosted third-party sdk modules with jpm. we'll use the menuitem package to add a new menu item to firefox. summary first, while in the root of your add-on, install the package that contains the modules you want to use: npm install menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". in your add-on code, you can require() modules by passing a path to the module starting from, but not...
...irefox. summary first, while in the root of your add-on, install the package that contains the modules you want to use: npm install menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules". the --save argument instructs npm ...
...And 2 more matches
Adding Events and Commands - Archive of obsolete content
which you use depend on the situation. elements only implement the events that are relevant to them, but there are several events that are implemented for most elements. these are some notable events you should keep in mind: oncommand. this is one of the most important and commonly used events in xul. it's very useful because it represents the most common action for input controls such as menu items, buttons and checkboxes. for a button, it represents the action of the user clicking on it, or focusing it with the keyboard and then pressing the enter key. it's an abstraction of the main way to interact with a control element. onselect. fired when the selection in a tree or listbox changes. onclick. triggered when the user clicks on the element, including right clicks. you shouldn't normall...
...o-online-broadcaster" /> </broadcasterset> these elements are completely invisible, so you can put them anywhere. it is recommended that you have them at the top of the xul code, along with script declarations and other invisible elements with as popupset and commandset. ...
...terset> these elements are completely invisible, so you can put them anywhere. it is recommended that you have them at the top of the xul code, along with script declarations and other invisible elements with as popupset and commandset. then you need to identify which of your xul elements will be linked to this broadcaster, using the observes attribute: <menuitem id="xulschoolhello-hello-menu-item" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloitem.accesskey;" observes="xulschoolhello-online-broadcaster" oncommand="xulschoolchrome.browseroverlay.sayhello(event);" /> the attribute value is set to be the id of the broadcaster element, indicating that this element will observe all attribute changes that happen in the broadcaster. you can have as many elements ...
...And 2 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
earrange toolbar buttons to their liking, possibly merging multiple toolbars in the process. firefox allows all of this by default, and if you don't pay attention to the details we describe here, your toolbar may not be as easy to customize as the rest. the first thing you need to do is add your buttons to the toolbar palette. the toolbarpalette is a collection of all toolbar buttons and toolbar items in firefox, including those added by extensions. to add your buttons, all you need to do is overlay the palette in your main browser overlay. <overlay id="xulschoolhello-browser-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="xulschoolhello-hello-world-button" class="toolbarbutton-1 chro...
...e. --> </toolbarpalette> <!-- more overlay stuff. --> </overlay> one detail that is easy to overlook is the fact that the toolbarpalette element is outside of the window element. if you put the toolbarpalette element inside the window element in your overlay, some weird errors will begin to happen. always set the label and tooltiptext attributes of a toolbarbutton. in the case of a toolbaritem element (discussed later), use the title attribute instead of label. tooltips are very important for users that want to know what a button does before clicking it. setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar bu...
...verlay file, as you would expect, but also in the chrome.manifest file. this is very important because the toolbar customization dialog won't work correctly without this. the way to include the file in the manifest is to add this line: style chrome://global/content/customizetoolbar.xul chrome://xulschoolhello/skin/toolbar.css if you are using xbl bindings (explained way ahead) for your toolbar items, you'll have to include the css files for those as well, each in a new line like the one above. we now have code that adds one or more buttons to the toolbar palette. the user can now use the customize dialog to add the buttons to the current firefox toolbars. in most cases this is not what you want as default behavior, because it would be very hard for the user to discover your buttons. keep i...
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
text="stockmenu" onclick="stockwatcher.refreshinformation()" /> </statusbar> now when the user clicks on the status bar panel, the stock information refreshes, but when they right-click on it, a context menu pops up. defining the menu is also easy. ...
...l, the stock information refreshes, but when they right-click on it, a context menu pops up. defining the menu is also easy. ...
...u pops up. defining the menu is also easy. ...
...And 2 more matches
List of Former Mozilla-Based Applications - Archive of obsolete content
world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer being developed name description additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive gale...
... chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking service ghostzilla browser archived version of ghostzilla site from 2005 homebase desktop operating environment for internet computers no longer available hp printer assistant printer utility hall of fame page mentions that this used an embedded versi...
...e using mozilla code?) icebrowser java browser sdk uses mozilla rhino --eol'ed in 2009 (jin'sync) office app launcher download page last updated on 12/21/06 kylix compiler and integrated development environment borland discontinued this product. ...
...And 2 more matches
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane 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 ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirs...
... docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstvisiblerow getindexofitem getitematindex getnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup ...
... getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex 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 reloadwithflags removeallitems removeallnotifications remov...
...And 2 more matches
PopupKeys - Archive of obsolete content
handling keys within menus when using a menupopup element, a keyboard listener is attached to the window that will handle keypresses for the menu. this allows items within the menu to be navigated with the cursor keys. the following table lists the keys that are checked, and what the menu keyboard listener does in response: cursor up/down move the highlight within the menu up or down, wrapping around if necessary. on linux and the macintosh, disabled items within the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. home/end move the highlight to the beginning or the end of the menu, selecting the ...
...if a menu is selected, the menu will open. escape closes the menu. if a chain of submenus is open, only one level of menus is closed. tab/f10 closes all menus in a chain of submenus. ...
...ithin the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. home/end move the highlight to the beginning or the end of the menu, selecting the first or last item. enter/return activate the currently highlighted item. if a menuitem is selected, this will close the menu and fire the menuitem's command event. if a menu is selected, the menu will open. escape closes the menu. if a chain of submenus is open, only one level of menus is closed. tab/f10 closes all menus in a chain of submenus. when letter keys are pressed, the accesskeys within the menu are selected. if an access key is a pressed that does not corr...
...And 2 more matches
Filtering - Archive of obsolete content
the data examined for new results. you can view a complete example of this in action. a menulist is used to allow one to select either a specific country, or select all to show all of the photos. when a choice is made, the applyfilter function as shown above is called and the template content gets rebuilt with the desired filter applied. in this example, the menulist is hard-coded to contain the items that we know are in the datasource. next, we'll look at also generating this list using a template. generating a filter menu templates may be used to generate any type of content. it is common to use a template to generate the items on a menu or in a listbox or tree. the syntax is the same regardless of what type of content is being created. in the previous example, we hard-coded a menulist w...
... a second triple is used to get the title for the country. ...
...?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> the action body will need to generate a <menuitem> for each result. it will also need to include a <menupopup> around all of the items. ...
...And 2 more matches
Rule Compilation - Archive of obsolete content
the query will apply. for example, the first rule might apply to results that represent books, while the second rule might apply only to results that are magazines. this way, different kinds of output can be created based on the specifics of the result. in many cases, you will only have need for one rule, as you want all results to be generated in the same manner. for instance, if generating the items in a listbox, you will typically use only one rule. if only one rule is needed, the rule element is optional. a template without any rules (or, in fact, one with a rule with no query defined) will generate output unconditionally for each result. template syntax outline here is the outline of the template syntax so far. <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http...
... the template builder process the query and output content. once done, the correct length can be returned. all of this is transparent to the xul developer. when the template builder decides to start generation is determined automatically, and you don't need to do anything special to get this to happen. however, there are two cases where content is not generated automatically: menus and child tree items. content inside a menu is not generated until the menu is opened. this makes sense since the user can't see the contents of the menu until it is open. however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened. this is an important distinction. that means that you will not be able to ...
...e menu is opened. this makes sense since the user can't see the contents of the menu until it is open. however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened. this is an important distinction. that means that you will not be able to rely on being able to retrieve the generated menu items until the menu is opened. a similar rule applies for child tree items. ...
...And 2 more matches
Template and Tree Listeners - Archive of obsolete content
ated fresh. the willrebuild method of any listeners will be called before the content is removed, and didrebuild method will be called when the content has been regenerated. this listener will also work for tree builders, and will call the appropriate methods before and after the tree has been generated. to assign a builder listener to a builder, use the addlistener method. ...
...be called before the content is removed, and didrebuild method will be called when the content has been regenerated. this listener will also work for tree builders, and will call the appropriate methods before and after the tree has been generated. to assign a builder listener to a builder, use the addlistener method. var somelistener = { item: null, willrebuild : function(builder) { this.item = builder.getresourceatindex(builder.root.currentindex); }, didrebuild : function(builder) { if (this.item) { var idx = builder.getindexofresource(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 ...
...rst 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 getresourceatindex and getindexofresource 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 getindexofresource method. (as this example uses the rdf resources directly, it requires elevated privileges so you will need a chrome url to test it.) you might also guess that the builder's root pr...
...And 2 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disa...
...box which, when pressed, will open a dropdown menu of all available results. focused type: boolean this attribute is true if the element is focused. forcecomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the textbox will be filled in with the best match when it loses the focus. if false, it will only be filled in when the user selects an item. highlightnonmatches new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, then the autocomplete field will be highlighted when no match has been found. ignoreblurwhilesearching new in thunderbird 3requires seamonkey 2.0 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear. inputtooltiptex...
... ignoreblurwhilesearching new in thunderbird 3requires seamonkey 2.0 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear. inputtooltiptext type: string the tooltip text for the textbox. 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. maxlength type: integer the maximum number of characters that the textbox allows to be entered. maxrows type: integer the number of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the remaining items. m...
...And 2 more matches
Things I've tried to do with XUL - Archive of obsolete content
there: if you create from js an element you want to bind, and if it is hidden when the listbox is first rendered, the listbox does not create a frame for it, and the xbl doesn't get attached... a workaround for that is to create the element, insert it in the document and set its style attribute with a -moz-binding property, all of that from c++ instead of js. multi-column listboxes when adding items to multi-column listboxes, you can't use the appenditem api: // auto-create and attach 1st cell var row = mylistbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a number of rows have been ad...
... attach 1st cell var row = mylistbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a number of rows have been added it breaks and stops displaying the first cell (the one specified by the appenditem call). ...
...el, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a number of rows have been added it breaks and stops displaying the first cell (the one specified by the appenditem call). ...
...And 2 more matches
Adding Style Sheets - Archive of obsolete content
s dialog so that its style comes from a separate style file. first, the modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
...om a separate style file. first, the modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
...e modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
...And 2 more matches
RDF Datasources - Archive of obsolete content
st. we'll display the history in a tree with three columns, the name, the url and the date. ...
...you can use any of the resources that you want. ...
...the ref attribute has been set to the root element in the r...
...And 2 more matches
XUL Reference - Archive of obsolete content
ollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack...
...lbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowser (firefox-only starting with firefox 3/gecko 1.9) tabbox tabpanel tabpanels tabs template textnode textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups --- too...
...pacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label caption image lists --- trees --- layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane ...
...And 2 more matches
XUL accessibility guidelines - Archive of obsolete content
navigation order should be logical, generally left to right, top to bottom. navigation order may vary depending on the nature of the application or the reading direction of the language. ensure that tab order is logical and all interactive elements can be accessed simply without the use of a mouse. you should be able to perform all functionality either directly in the application or through menu items or the context menu. trees provide alternative functionality for inaccessible operations. the column picker and column headers in xul trees are not keyboard accessible, consistent with the standard tree behavior on most contemporary operating systems. it is therefore necessary to provide a keyboard accessible alternative for accessing this functionality. the firefox "bookmarks manager" prov...
...ceive focus, they are not operable with a keyboard. in the bookmark manager this functionality is available under the view menu which is accessible to a keyboard user. toolbarbuttons by default, toolbar buttons cannot receive focus with a keyboard. the recommended way of fixing this is that all functionality associated with a toolbar be duplicated elsewhere in the application, such as in a menu item or context menu. in cases where duplication of functionality is not possible (such as a window without a menu bar), toolbar buttons can be made focusable by adding the special css rule -moz-user-focus: normal. (firefox's "print preview" window uses this fallback technique.) this should only be used as a last resort, and it should be consistent throughout a window (that is either all toolbar butto...
...ibute work with the correct platform-specific context menu triggers, including the keyboard button and appropriate mouse clicks. mouse dependent scripting functionality associated with mouse events such as onmouseover, onmousemove, and ondrag can only be activated with the use of the mouse. provide keyboard-accessible alternative access points for this functionality. consider using context menu items or other xul elements along with keyboard shortcuts. scrolling ensure that scrolling is keyboard accessible. many xul elements can be set to scroll using css. other elements, such as arrowscrollbox and listbox, are made to scroll automatically. as a general rule, elements set to scroll are inaccessible if the user cannot scroll to all the content using the keyboard. the arrowscrollbox, for exa...
...And 2 more matches
listcol - Archive of obsolete content
xamples | attributes | properties | methods | related ] a column in a listbox. you can make some columns flexible and other columns non-flexible. ...
...a listbox. you can make some columns flexible and other columns non-flexible. ...
...u can make some columns flexible and other columns non-flexible. ...
...And 2 more matches
listcols - Archive of obsolete content
s | properties | methods | related ] a container for the columns of a listbox, each of which are created with the listcol element. there should be only one listcols element in a list box. if there is no listcols element, the list box has a single column. ...
... listbox, each of which are created with the listcol element. there should be only one listcols element in a list box. if there is no listcols element, the list box has a single column. ...
...h of which are created with the listcol element. there should be only one listcols element in a list box. if there is no listcols element, the list box has a single column. ...
...And 2 more matches
menubar - Archive of obsolete content
side the menubar will be ignored. to look native (at least on windows), the menubar element needs to be placed inside a toolbox element. more information is available in the xul tutorial. ...
...ed. to look native (at least on windows), the menubar element needs to be placed inside a toolbox element. more information is available in the xul tutorial. ...
...enubar element needs to be placed inside a toolbox element. more information is available in the xul tutorial. attributes grippyhidden, statusbar properties accessibletype, statusbar examples <menubar id="sample-menubar"> <menu id="action-menu" label="action"> <menupopup id="action-popup"> <menuitem label="new"/> <menuitem label="save" disabled="true"/> <menuitem label="close"/> <menuseparator/> <menuitem label="quit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. when set to false, the d...
...And 2 more matches
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. focused type: boolean this attribute is true if the element is focused. group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one th...
...lects one the buttons, the others in the group are unchecked. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the ta...
...And 2 more matches
treecol - Archive of obsolete content
imary, sort, sortactive, sortdirection, src, type, width properties accessibletype style classes treecol-image examples this example shows a checkbox in the first column, requires the style below. ...
...mage examples this example shows a checkbox in the first column, requires the style below. <tree flex="1" editable="true"> <treecols> <treecol label="active" type="checkbox" editable="true"/> <treecol label="name" flex="1" /> </treecols> <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> to make the checkbox visible on some platforms, the following styles need to be added to the stylesheet (see treecol.type). on firefox 2.x and 3.x, all operating systems other than mac os x already use these styles by default. if targeting...
... side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } cycler type: boolean if true, then the column is a cycler column. in the case, clicking on a cell in the column will alternate its state between on and off. this is used, for example, in a mail window, for a column that indicates that the...
...And 2 more matches
0.90 - Archive of obsolete content
Archive › RSS › Version › 0.90
9/" > <channel> <title>mozilla dot org</title> <link>http://www.mozilla.org</link> <description>the mozilla organization web site</description> </channel> <image> <title>mozilla</title> <url>http://www.mozilla.org/images/moz.gif</url> <link>http://www.mozilla.org</link> </image> <item> <title>new status updates</title> <link>http://www.mozilla.org/status/</link> </item> <item> <title>bugzilla reorganized</title> <link>http://www.mozilla.org/bugs/</link> </item> <item> <title>mozilla party, 2.0!</title> <link>http://www.mozilla.org/party/1999/</link> </item> ...
...rather than for syndication. spe...
...rather than for syndication. ...
...And 2 more matches
Enumerator.moveFirst - Archive of obsolete content
non-standard. do not use! ...
... non-standard. do not use! ...
... non-standard. do not use! ...
...And 2 more matches
Legacy layout methods - Learn web development
ed this all seems! this knowledge will be helpful to you if you need to create fallback code for browsers that do not support newer methods, in addition to allowing you to work on existing projects which use these types of systems. it is worth bearing in mind, as we explore these systems, that none of them actually create a grid in the way that css grid layout creates a grid. they work by giving items a size, and pushing them around to line them up in a way that looks like a grid. a two column layout let's start with the simplest possible example — a two column layout. you can follow along by creating a new index.html file on your computer, filling it with a simple html template, and inserting the below code into it at the appropriate places. at the bottom of the section you can see a liv...
...s example from a mediarecorder api tutorial. anyway, back to our grids! any column that spans more than one column of our grid has a total width of 6.25% multiplied by the number of columns spanned plus 2.08333333% multiplied by the number of gutters (which will always be the number of columns minus 1). ...
...making these replacements in your own example, or look at our flexbox-grid.html example code (see it running live also). here we are turning each row into a flex container. with a flexbox-based grid we still need rows in order to allow us to have elements that add up to less than 100%. we set that container to display: flex. ...
...And 2 more matches
HTML Cheatsheet - Learn web development
kquote>the blockquote element indicates an extended quotation.</blockquote> the blockquote element indicates an extended quotation. ...
...dicates an extended quotation.</blockquote> the blockquote element indicates an extended quotation. ...
...e> the blockquote element indicates an extended quotation. ...
...And 2 more matches
Silly story generator - Learn web development
the top of the main.js file. this gives you three variables that store references to the "enter custom name" text field (customname), the "generate random story" button (randomize), and the <p> element at the bottom of the html body that the story will be copied into (story), respectively. in addition you've got a function called randomvaluefromarray() that takes an array, and returns one of the items stored inside the array at random. now look at the second section of the raw text file — "2. raw text strings". this contains text strings that will act as input into our program. we'd like you to contain these inside variables inside main.js: store the first, big long, string of text inside a variable called storytext. store the first set of three strings inside an array called inse...
...on to complete it and make it work properly. completing the result() function: create a new variable called newstory, and set its value to equal storytext. this is needed so we can create a new random story each time the button is pressed and the function is run. if we made changes directly to storytext, we'd only be able to generate a new story once. create three new variables called xitem, yitem, and zitem, and make them equal to the result of calling randomvaluefromarray() on your three arrays (the result in each case will be a random item out of each array it is called on). for example you can call the function and get it to return one random string out of insertx by writing randomvaluefromarray(insertx). next we want to replace the three placeholders in the newstory string —...
...there is a particular string method that will help you here — in each case, make the call to the method equal to newstory, so each time it is called, newstory is made equal to itself, but with substitutions made. ...
...And 2 more matches
JavaScript object basics - Learn web development
t be separated by a comma, and the name and value in each case are separated by a colon. the syntax always follows this pattern: const objectname = { member1name: member1value, member2name: member2value, member3name: member3value }; the value of an object member can be pretty much anything — in our person object we've got a string, a number, two arrays, and two functions. the first four items are data items, and are referred to as the object's properties. the last two items are functions that allow the object to do something with that data, and are referred to as the object's methods. an object like this is referred to as an object literal — we've literally written out the object contents as we've come to create it. this is in contrast to objects instantiated from classes, which w...
...ta, and are referred to as the object's methods. an object like this is referred to as an object literal — we've literally written out the object contents as we've come to create it. this is in contrast to objects instantiated from classes, which we'll look at later on. it is very common to create an object using an object literal when you want to transfer a series of structured, related data items in some manner, for example sending a request to the server to be put into a database. sending a single object is much more efficient than sending several items individually, and it is easier to work with than an array, when you want to identify individual items by name. dot notation above, you accessed the object's properties and methods using dot notation. the object name (person) acts as th...
...re efficient than sending several items individually, and it is easier to work with than an array, when you want to identify individual items by name. dot notation above, you accessed the object's properties and methods using dot notation. the object name (person) acts as the namespace — it must be entered first to access anything encapsulated inside the object. next you write a dot, then the item you want to access — this can be the name of a simple property, an item of an array property, or a call to one of the object's methods, for example: person.age person.interests[1] person.bio() sub-namespaces it is even possible to make the value of an object member another object. for example, try changing the name member from name: ['bob', 'smith'], to name : { first: 'bob', last: 's...
...And 2 more matches
TypeScript support in Svelte - Learn web development
adingel: htmlelement finally, you'll notice the following error reported, related to where we set the tabindex attribute. that's because typescript is type-checking the <h2> element and expects tabindex to be of type number. to fix it, replace tabindex="-1" with tabindex={-1}, like this: <h2 id="list-heading" bind:this={headingel} tabindex={-1}>{completedtodos} out of {totaltodos} items completed</h2> this way typescript can prevent us from incorrectly assigning it to a string variable. newtodo.svelte next we will take care of newtodo.svelte. as usual, add the lang='ts' attribute. the warning will indicate that we have to specify a type for the nameel variable. set its type to htmlelement like this: let nameel: htmlelement // reference to the name inp...
... import type { jsonvalue } from './types/json.type' export const localstore = (key: string, initial: jsonvalue) => { // receives the key of the local storage and an initial value const tostring = (value: jsonvalue) => json.stringify(value, null, 2) // helper function const toobj = json.parse // helper function if (localstorage.getitem(key) === null) { // item not present in local storage localstorage.setitem(key, tostring(initial)) // initialize local storage with initial value } const saved = toobj(localstorage.getitem(key)) // convert to object const { subscribe, set, update } = writable(saved) // create the under...
...etitem(key, tostring(initial)) // initialize local storage with initial value } const saved = toobj(localstorage.getitem(key)) // convert to object const { subscribe, set, update } = writable(saved) // create the underlying writable store return { subscribe, set: (value: jsonvalue) => { localstorage.setitem(key, tostring(value)) // save also to local storage as a string return set(value) }, update } } now if we try to create a localstore with something that cannot be converted to json via json.stringify(), for example an object with a function as a property, vs code/validate will complain about it: and best of all, it will even work with the $store aut...
...And 2 more matches
Componentizing our Svelte app - Learn web development
growing, it should be split into smaller subcomponents. both approaches should complement each other, and help you decide how to better organize your components. eventually, we will split up our app into the following components: alert.svelte: a general notification box for communicating actions that have occurred. newtodo.svelte: the text input and button that allow you to enter a new todo item. filterbutton.svelte: the all, active, and completed buttons that allow you to apply filters to the displayed todo items. todosstatus.svelte: the "x out of y items completed" heading. todo.svelte: an individual todo item. each visible todo item will be displayed in a separate copy of this component. moreactions.svelte: the check all and remove completed buttons at the bottom of the ui that al...
... in this article we will concentrate on creating the filterbutton and todo components; we'll get to the others in future articles. let's get started. ...
...that's because our todo component is receiving the todo via the prop, but it's not sending any information back to its parent. we'll fix this later on. sharing data between components: props-down, events-up pattern the bind directive is pretty straightforward and allows you to share data between a parent and child component with mini...
...And 2 more matches
Application cache implementation overview
update is running at the time. nsofflinecacheupdate it self is the core of the update process. during initiation the update is first looking for an existing nsiapplicationcache object using nsiapplicationcacheservice::getactivecache() with the manifest url to load from as an argument. when found, this update is processing an “update” and this cache is used as a cache to satisfy each manifest item and the manifest it self load from. otherwise, this is “first download”. then creates a new nsiapplicationcache for the given manifest url using nsiapplicationcacheservice::createapplicationcache(). this new cache version is now pending to be activated after all following long and complicated download process passes. until that it is not used for loading resources from. after these steps the ...
...ad process passes. until that it is not used for loading resources from. after these steps the update is in initialized state waiting to be scheduled. when the update is about to actually start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking state (+invokes onchecking event) and starts fetch of the manifest file. note: whenever a load of an items (including the manifest) fails due to a network or server error or leads to a redirect, the update fails and completely rollbacks any changes made (i.e. all files downloaded are deleted and the new cache version is discarded.) an md5 hash is then calculated from the manifest content we download from the server to be compared to existing md5 (in case of an “update”). during the load, manifest...
...alled for each finished entry load, including the manifest and is the main place handling each update state as following: on checking state, a state the update is at after manifest parsing has been done, loadcompleted checks whether the new hash, i.e. the manifest content, differs or this is just “first download”. if so, the update switches to downloading state and fetches in parallel items listed in the manifest by call to nsofflinecacheupdate::processnexturi(). if the new hash is identical, update invokes onnoupdate event and is 'finished'. then it associates any documents waiting for this update to finish with the current existing nsiapplicationcache. if the manifest load failed, onerror event is invoked and the update 'finishes'. the parallel load is implemented by ...
...And 2 more matches
NSS_3.12_release_notes.html
ug 401986: mac os x leopard build failure in legacydb bug 325805: diff considers mozilla/security/nss/cmd/pk11util/scripts/pkey a binary file bug 385151: remove the link time dependency from nss to softoken bug 387892: add entrust root ca certificate(s) to nss bug 433386: when system clock is off by more than two days, oscp check fails, can result in crash if user tries to view certificate [[@ secitem_compareitem_util] [[@ memcmp] bug 396256: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome...
... password bug 392522: integrity hashes must be updated when passwords are changed. ...
...bug 392522: integrity hashes must be updated when passwords are changed. ...
...And 2 more matches
sslcrt.html
upgraded documentation may be found in the current nss reference certificate functions chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid. syntax #include <cert.h> secstatus cert_verifycertnow( certcertdbhandle *handle, certcertificate *cert, ...
...pies of that structure and can cause severe problems. getting certificate information cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb nss_findcertkeatype cert_findcertbyname finds the certificate in the certificate database with a specified dn. syntax #include <cert.h> certcertificate *cert_findcertbyname ( certcertdbhandle *handle, secitem *name); parameters this function has the following parameters: handle a pointer to the certificate database handle. name the subject dn of the certificate you wish to find. returns if successful, the function returns a certificate object of type certcertificate. cert_...
...n ssl server certificate. syntax #include <nss.h> sslkeatype nss_findcertkeatype(certcertificate * cert); parameter this function has the following parameter: a the certificate to check. ...
...And 2 more matches
nsIDOMOfflineResourceList
o and removing resources from the cache, as well as for enumerating the dynamically managed resource list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. 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 ...
...ess of being updated. checking 2 the application cache manifest is being fetched and checked for updates. downloading 3 resources are being downloaded to be added to the cache. updateready 4 there is a new version of the application cache available. obsolete 5 the application cache group is now obsolete. methods mozadd() adds an item to the dynamically managed entries. the resource will be fetched and added to the application cache. void mozadd( in domstring uri ); parameters uri the uri of the resource to add to the list. mozhasitem returns a boolean value indicating whether or not the specified uri represents a resource that's in the application cache's list. note: this method has been deprecated. you should...
...mically managed entries. the resource will be fetched and added to the application cache. void mozadd( in domstring uri ); parameters uri the uri of the resource to add to the list. mozhasitem returns a boolean value indicating whether or not the specified uri represents a resource that's in the application cache's list. note: this method has been deprecated. you should use the mozitems attribute instead. void mozhasitem( in domstring uri ); parameters uri the uri of the resource to check. return value true if the resource is in the list, otherwise false. ...
...And 2 more matches
nsIDOMStorage2
the nsidomstorage2 interface represents the storage space used for local storage in the dom. items stored in local storage may only be accessed by the same origin that created the items in the first place. a 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. ...
...same origin that created the items in the first place. a 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(); pa...
...; domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the data 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( ...
...And 2 more matches
nsINavHistoryResultViewObserver
methods candrop() implement this method to report whether or not a drop is permitted onto the specified location. to provide behavior similar to the folder pane ...
... void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring action, in long row, in nsitreecolumn column); constants constant value description drop_before -1 the drag operation wishes to insert the dragged item before the indicated row. drop_on 0 the drag operation wishes to drop the dragged item onto the indicated row. ...
...n wstring action, in long row, in nsitreecolumn column); constants constant value description drop_before -1 the drag operation wishes to insert the dragged item before the indicated row. drop_on 0 the drag operation wishes to drop the dragged item onto the indicated row. drop_after 1 the drag operation wishes to insert the dragged item after the indicated row. methods candrop() implement this method to report whether or not a drop is permitted onto the specified location. to provide behavior similar to the folder pane in thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't drop_on. warning: do not change the content of the obser...
...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 aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); 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 aindex. ...
...e 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 aindex. 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 aindex ); parameters aindex the index of the item in the list. return value the nsitransactionlist of children associated with the item at aindex. 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. nsi...
...dex ); parameters aindex the index of the item in the list. return value the nsitransactionlist of children associated with the item at aindex. 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 aindex ); parameters aindex the index of the item in the list. return value missing description getnumchildrenforitem() returns the number of child (auto-aggreated) transactions the item at aindex has. long getnumchildrenforitem( in long aindex ); parameters aindex the index of the item in the list. ...
...And 2 more matches
XPCOM Interface Reference
ncachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcertlistener2nsibidikeyboardnsibinaryinputstreamnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitorn...
...entnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemo...
...arsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidownloadmanagernsidownloadmanageruinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsidroppedlinkhandlernsidroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservic...
...And 2 more matches
Add to iPhoto
eed to be shut down, we do need to close the library we opened using the js-ctypes api; that's where 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 { cfindex location; cfindex 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.cfra...
...n that build. cfmutablearray one thing about core foundation types that is interesting is the use of regular and mutable versions of the same data types. for example, the cfarray type describes an array, but cfarray objects can't be changed once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. all cfarray functions accept cfmutablearray objects, so you can use cfmutablearray with any routine that accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array. there's nothing particularly interesting about how we declare this api, but it will b...
...to" option if the user has right-clicked on an image. if (document.getelementbyid("contentareacontextmenu")) { document.getelementbyid("contentareacontextmenu").addeventlistener("popupshowing", iphoto.onpopup, false); } responding when the context menu is clicked when the user right-clicks an image, our handler gets called: onpopup: function() { var node = iphoto.getcurrentnode(); var item = document.getelementbyid("add-to-iphoto_menuitem"); if (item) { item.hidden = (node == null); // hide it if we're not on an image } } this code finds the image node the user right-clicked in by calling our getcurrentnode() method, then sets the hidden state of the "add image to iphoto" menu item based on whether or not an image node was found. the code to identify the node looks like...
...And 2 more matches
Element: mouseout event - Web APIs
ent. mouseout and mouseleave the following example illustrates the difference between mouseout and mouseleave events. the mouseleave event is added to the <ul> to color the list purple whenever the mouse exits the <ul>. mouseout is added to the list to color the targeted element orange when the mouse exits it. ...
...ween mouseout and mouseleave events. the mouseleave event is added to the <ul> to color the list purple whenever the mouse exits the <ul>. mouseout is added to the list to color the targeted element orange when the mouse exits it. when you try this out, you'll find that mouseout is delivered to the individual list items, while mouseleave goes to the overall list, courtesy of the hierarchy of the items and the fact that list items obscure the underlying <ul>. ...
...list purple whenever the mouse exits the <ul>. mouseout is added to the list to color the targeted element orange when the mouse exits it. when you try this out, you'll find that mouseout is delivered to the individual list items, while mouseleave goes to the overall list, courtesy of the hierarchy of the items and the fact that list items obscure the underlying <ul>. ...
...And 2 more matches
HTMLSelectElement.selectedOptions - Web APIs
f an htmloptgroupelement within the <select> element. in other words, any option contained within the <select> element may be part of the results, but option groups are not included in the list. if no options are currently selected, the collection is empty and returns a length of 0. example in this example, a <select> element with a number of options is used to let the user order various food items. html the html that creates the selection box and the <option> elements representing each of the food choices looks like this: <label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">peppe...
...ect id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <button name="order" id="order"> order now </button> <p id="output"> </p> the <select> element is set to allow multiple items to be selected, and it is 7 rows tall. note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected property. javascript the javascript code that establishes the event handler for the button, as well as the event handler itself, looks like this: let orderbutton = document.getelementbyid("order"); let itemlist = document.getelementbyid...
...elements using the selected property. ...
...And 2 more matches
HTMLSelectElement - Web APIs
ted with. if the element is not associated with of a <form> element, then it returns null. htmlselectelement.labelsread only a nodelist of <label> elements associated with the element. htmlselectelement.length an unsigned long the number of <option> elements in this select element. htmlselectelement.multiple a boolean reflecting the multiple html attribute, which indicates whether multiple items can be selected. htmlselectelement.name a domstring reflecting the name html attribute, containing the name of this 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,...
...ubmitting the form. htmlselectelement.selectedindex 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 multiple is true, in which case it is 4. htmlselectelement.typeread only a domstring represeting the form control's type. when multiple is true, it returns "select-multiple"; otherwise, it returns "select-one". htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the...
...d is now implemented on htmlelement. htmlselectelement.checkvalidity() checks whether the element has any constraints and whether it satisfies them. if the element fails its constraints, the browser fires a cancelable invalid event at the element (and returns false). htmlselectelement.focus() gives input focus to this element. this method is now 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 acces...
...And 2 more matches
IDBDatabase: error event - Web APIs
n (this will occur if, for example, a record with the given 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
...he objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('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.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transactio...
...', year: 2020 }; const db = dbopenrequest.result; db.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.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 ite...
...And 2 more matches
IDBObjectStore - Web APIs
ate thread, creates a structured clone of the value, and stores the cloned value in the object store. this is for updating existing records in an object store when the transaction's mode is readwrite. example this example shows a variety of different uses of object stores, from updating the data structure with idbobjectstore.createindex inside an onupgradeneeded function, to adding a new item to our object store with idbobjectstore.add. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in db. db = dbopenrequest.result; }; ...
... number has been // submitted via the window.indexeddb.open line above dbopenrequest.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" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified",...
... objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; // create a new item to add in to the object store var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: 'december', year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(ev...
...And 2 more matches
IDBTransaction.abort() - Web APIs
4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...eady for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...ion.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 2 more matches
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...tion.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 2 more matches
IDBTransaction.mode - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...tion.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 2 more matches
IDBTransaction.objectStore() - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...tion.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 2 more matches
IDBTransaction - Web APIs
uest = 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. ...
...saction, ready to add data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...ction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 2 more matches
NamedNodeMap - Web APIs
hough 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. namednodemap.length read only returns the amount of objects in the map. methods this interface doesn't inherit any method. ...
...th attr objects, which were originally a specialized class of node, and still are in some implementations. properties this interface doesn't inherit any property. namednodemap.length read only returns the amount of objects in the map. methods this interface doesn't inherit any method. namednodemap.getnameditem() returns a attr, corresponding to the given name. namednodemap.setnameditem() replaces, or adds, the attr identified in the map by the given name. ...
...ons. properties this interface doesn't inherit any property. namednodemap.length read only returns the amount of objects in the map. methods this interface doesn't inherit any method. namednodemap.getnameditem() returns a attr, corresponding to the given name. namednodemap.setnameditem() replaces, or adds, the attr identified in the map by the given name. namednodemap.removenameditem() removes the attr identified by the given map. namednodemap.item() returns the attr at the given index, or null if the index is higher or equal to the number of nodes. namednodemap.getnameditemns() returns a attr identified by a namespace and related local name. namednodemap.setnameditemns() replaces, or adds, the attr identified in the map by the given namespace and related local name. ...
...And 2 more matches
PaymentRequest.PaymentRequest() - Web APIs
constructor creates a new paymentrequest object which will be used to handle the process of generating, validating, and submitting a payment request. syntax var paymentrequest = new paymentrequest(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site accepts and any associated payment method specific data. each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website accepts. starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods. for example, the b...
...hods. for basic credit card services, this structure should match the basiccardrequest dictionary. details provides information about the requested transaction. this parameter contains the following fields: total the total amount of the payment request. id optional a free-form identifier for this payment request. if a value is not supplied, the browser will construct one. displayitems an array of optional line items for the payment request that the user agent may display, such as product details, tax, and shipping. shippingoptions the shipping options the user may choose from. if this sequence is blank, it indicates the merchant cannot ship to the current shipping address. the default shipping option may be indicated in this sequence. modifiers modifiers for specifi...
...the shipping options the user may choose from. if this sequence is blank, it indicates the merchant cannot ship to the current shipping address. the default shipping option may be indicated in this sequence. modifiers modifiers for specific payment methods; for example, adjusting the total amount based on the payment method. this parameter contains the following fields: additionaldisplayitems an array of items to be appended to the details.displayitems property. this property is commonly used to add a discount or surcharge line item indicating the different amount in details.modifiers.total. data a json-serializable object that provides optional information that might be needed by the supported payment methods. this has to conform to the structure defined in the basiccardreq...
...And 2 more matches
Using readable streams - Web APIs
unction called readstream() is invoked to read the data back out of the stream again. we also close the stream, as we’ve stopped enqueuing chunks to it. ...
...the data back out of the stream again. we also close the stream, as we’ve stopped enqueuing chunks to it. ...
...e stream, as we’ve stopped enqueuing chunks to it. ...
...And 2 more matches
:nth-last-child() - CSS: Cascading Style Sheets
the :nth-last-child() css pseudo-class matches elements based on their position among a group of siblings, counting from the end. /* selects every fourth element among any group of siblings, counting backwards from the last one */ :nth-last-child(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-child, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-child pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6...
...this is accomplished by combining the capabilities of the nth-last-child...
...e last three elements */ tr:nth-last-child(-n+3) { background-color: pink; } /* selects every element starting from the second to last item */ tr:nth-last-child(n+2) { color: blue; } /* select only the last second element */ tr:nth-last-child(2) { font-weight: 600; } result quantity query a quantity query styles elements depending on how many of them there are. in this example, list items turn red when there are at least three of them in a given list. this is accomplished by combining the capabilities of the nth-last-child pseudo-class and the general sibling combinator. ...
...And 2 more matches
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
tainers or table cells. the align-content property applies to the block axis in order to align the contents of the box within its container. if a content distribution method such as space-between, space-around or space-evenly is requested then the fallback alignment will be used, as the content is treated as a single alignment subject. justify-self the justify-self property is used to align an item inside its containing block on the inline axis. this property does not apply to floated elements or table cells. absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. align-self...
.... absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. align-self the align-self property does not apply to block-level boxes (including floats), because there is more than one item in the block axis. it also does not apply to table cells. absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. aligning in these layout methods today as we do not currently hav...
... alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. ...
...And 2 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
in browsers to make your decision. useful fallback techniques given that flexbox usage is initiated with value of the display property, when needing to support very old browsers which do not support flexbox at all, fallbacks can be created by overwriting one layout method with another. the specification defines what happens if you use other layout methods on an element which then becomes a flex item. floated items “float and clear do not create floating or clearance of flex item, and do not take it out-of-flow.” - 3. flex containers in the following live example, i have floated two blocks and then set display: flex on the container. the items are now flex items, which means they stretch to equal height. any float behaviour does not apply. you can test the fallback behaviour by remo...
...em, and do not take it out-of-flow.” - 3. flex containers in the following live example, i have floated two blocks and then set display: flex on the container. the items are now flex items, which means they stretch to equal height. any float behaviour does not apply. you can test the fallback behaviour by removing display: flex from the wrapper. display: inline-block once an inline-block item becomes a flex item, it is blockified and so behavior of display: inline-block like preserving white space between items no longer applies. remove display: flex to see the fallback behavior. you'll see white space added between the items, which is what happens when using display: inine-block as it prefers white space like other inline items. display: table- the css table display properties ...
...ween the items, which is what happens when using display: inine-block as it prefers white space like other inline items. display: table- the css table display properties are potentially very useful as a fallback, due to the fact that they allow design patterns such as full height columns and vertical centering and work back as far as internet explorer 8. if you use display: table-cell on an item in your html it takes on the styling of an html table cell. css creates anonymous boxes to represent these items so that you do not need to wrap each item in a wrapper to represent the html table row, and a second one to represent the table element itself, you can’t see or style these anonymous boxes; they are there purely to fix up the tree. if you then declare display: flex on the parent ite...
...And 2 more matches
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
ment 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. ...
...gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>dpcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfo...
...nsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-style-imagelist-style-positionlist-style-typelocal()mmarginmargin-blockmargin-block-endmargin-block-startmargin-bottommargin-inlinemargin-inline-endmargin-inline-startmargin-leftmargin-rightmargin-top::markermarks (...
...And 2 more matches
flex-basis - CSS: Cascading Style Sheets
the flex-basis css property sets the initial main size of a flex item. it sets the size of the content box unless otherwise set with box-sizing. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. ...
...n case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. syntax /* specify <'width'> */ flex-basis: 10em; flex-basis: 3px; flex-basis: auto; /* intrinsic sizing keywords */ flex-basis: fill; flex-basis: max-content; flex-basis: min-content; flex-basis: fit-content; /* automatically size based on the flex item’s content */ flex-basis: content; /* global values */ flex-basis: inherit; flex-basis: initial; flex-basis: unset; the flex-basis property is specified as either the keyword content or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicate...
.../* global values */ flex-basis: inherit; flex-basis: initial; flex-basis: unset; the flex-basis property is specified as either the keyword content or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in the initial release of flexible box layout, and thus some older implementations will not support it. the equivalent effect can be had by using auto together with a main size (width or height) of auto. history: originally, flex-basis:auto meant "look at my width or height property". then, flex-basis:auto was changed to mean automatic s...
...And 2 more matches
list-style-type - CSS: Cascading Style Sheets
the list-style-type css property sets the marker (such as a disc, character, or custom counter style) of a list item element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the color of the marker will be the same as the computed color of the element it applies to. only a few elements (<li> and <summary>) have a default value of display: list-item. however, the list-style-type property may be applied to any element whose display value is set to list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all list items. syntax /* partial l...
...one. note that: some types require a suitable font installed to display as expected. the cjk-ideographic is identical to trad-chinese-informal; it exists for legacy reasons. values <custom-ident> a identifier matching the value of a @counter-style or one of the predefined styles: symbols() defines an anonymous style of the list. <string> the specified string will be used as the item's marker. none no item marker is shown. disc a filled circle (default value) circle a hollow circle square a filled square decimal decimal numbers beginning with 1 cjk-decimal han decimal numbers e.g. 一, 二, 三, ..., 九八, 九九, 一〇〇 decimal-leading-zero decimal numbers padded by initial zeros e.g. 01, 02, 0...
... example example example hangul-consonant -moz-hangul-consonant example example example urdu -moz-urdu example accessibility concerns the voiceover screen reader has an issue where unordered lists with a list-style-type value of none applied to them will not be announced as a list. to address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 ...
...And 2 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
safe-url: the referer header will always include the origin, path and query string, but not the fragment, password, or username. this is unsafe because it can leak information from tls-protected resources to insecure origins. sizes one or more strings separated by commas, indicating a set of source sizes. each source size consists of: a media condition. this must be omitted for the last item in the list. a source size value. media conditions describe properties of the viewport, not of the image. for example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px. source size values specify the intended display size of the image. user agents use the current source size to select one of the sources supplied by the srcset at...
...ust have a start tag and must not have an end tag. permitted parents any element that accepts embedded content. ...
...rt tag and must not have an end tag. permitted parents any element that accepts embedded content. ...
...And 2 more matches
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
ptional caption) element represents self-contained content, potentially with an optional caption, which is specified using the (<figcaption>) element. <hr> the html <hr> element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section. ...
...ml <li> element is used to represent an item in a list. <main> the html <main> element represents the dominant content of the <body> of a document. the main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application. <ol> the html <ol> element represents an ordered list of items — typically rendered as a numbered list. <p> the html <p> element represents a paragraph. <pre> the html <pre> element represents preformatted text which is to be presented exactly as written in the html file. <ul> the html <ul> element represents an unordered list of items, typically rendered as a bulleted list. inline text semantics use the ...
...ction containing interactive controls for submitting information. <input> the html <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. <label> the html <label> element represents a caption for an item in a user interface. <legend> the html <legend> element represents a caption for the content of its parent <fieldset>. <meter> the html <meter> element represents either a scalar value within a known range or a fractional value. <optgroup> the html <optgroup> element creates a grouping of options within a <select> element. <option> the html ...
...And 2 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
anges regarding the last stable version svg 1.1. those changes are listed below including their support status within mozilla applications. ...
... the last stable version svg 1.1. those changes are listed below including their support status within mozilla applications. ...
...ersion svg 1.1. those changes are listed below including their support status within mozilla applications. ...
...And 2 more matches
Introduction to using XPath in JavaScript - XPath
the total number of nodes contained can be accessed through the snapshotlength property. snapshots do not change with document mutations, so unlike the iterators, the snapshot does not become invalid, but it may not correspond to the current document, for example, the nodes may have been move...
...the total number of nodes contained can be accessed through the snapshotlength property. snapshots do not change with document mutations, so unlike the iterators, the snapshot does not become invalid, but it may not correspond to the current document, for example, the nodes may have been moved, it...
... { alert( 'error: document tree modified during iteration ' + e ); } snapshots when the specified result type in the resulttype parameter is either: unordered_node_snapshot_type ordered_node_snapshot_type the xpathresult object returned is a static node-set of matched nodes, which allows us to access each node through the snapshotitem(itemnumber) method of the xpathresult object, where itemnumber is the index of the node to be retrieved. the total number of nodes contained can be accessed through the snapshotlength property. snapshots do not change with document mutations, so unlike the iterators, the snapshot does not become invalid, but it may not correspond to the current document, for example, the nodes may have been moved, it might contain nodes that no longer exist, or new no...
...And 2 more matches
util/collection - Archive of obsolete content
a simple list-like class and utilities for using it. usage a collection is ordered, like an array, but its items are unique, like a set. globals constructors collection([array]) creates a new collection. the collection is backed by an array. parameters array : array if array is given, it will be used as the backing array. this way the caller can fully control the collection. otherwise a new empty array will be used, and no one but the collection will have access to it. functions addcollectionproperty(object, propname, [backingarray]) adds a collection property to the given object. setting the property to a scalar value empties the collection and adds the value. setting it to an array empties the collection and adds all the items in the array. parameters object : object the pr...
...empties the collection and adds the value. setting it to an array empties the collection and adds all the items in the array. parameters object : object the property will be defined on this object. propname : string the name of the property. backingarray : array if given, this will be used as the collection's backing array. collection a collection object provides for...in-loop iteration. items are yielded in the order they were added. for example, the following code... var collection = require("sdk/util/collection"); var c = new collection.collection(); c.add(1); c.add(2); c.add(3); for (item in c) console.log(item); ... would print this to the console: 1 2 3 iteration proceeds over a copy of the collection made before iteration begins, so it is safe to mutate the collect...
...ion = require("sdk/util/collection"); var c = new collection.collection(); c.add(1); c.add(2); c.add(3); for (item in c) console.log(item); ... would print this to the console: 1 2 3 iteration proceeds over a copy of the collection made before iteration begins, so it is safe to mutate the collection during iteration; doing so does not affect the results of the iteration. methods add(itemoritems) adds a single item or an array of items to the collection. any items already contained in the collection are ignored. parameters itemoritems : object an item or array of items. returns collection : the collection. ...
...on made before iteration begins, so it is safe to mutate the collection during iteration; doing so does not affect the results of the iteration. methods add(itemoritems) adds a single item or an array of items to the collection. any items already contained in the collection are ignored. parameters itemoritems : object an item or array of items. returns collection : the collection. remove(itemoritems) removes a single item or an array of items from the collection. any items not contained in the collection are ignored. parameters itemoritems : object an item or array of items. returns collection : the collection. properties length the number of items in the collection array. ...
Tree - Archive of obsolete content
getting the cell from a mouse click your...
... getting the cell from a mouse click your first choice is likely to try <treecell onclick="yourfunc();"/> or something similar. but this wil...
... getting the cell from a mouse click your first choice is likely to try <treecell onclick="yourfunc();"/> or something similar. ...
... 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. ...
Install Manifests - Archive of obsolete content
tion> </em:targetapplication> gecko 1.9 based applications allow you to use the special targetapplication id toolkit@mozilla.org to say that the add-on is compatible with any toolkit app with a toolkit version matching the minversion and maxversion. type an integer value representing the type of add-on. 2 extensions 4 themes 8 locale 32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes. firefox 2 and previous supported a value of 16 to represent plug-ins. in firefox 3 this has been removed. version a versi...
...t be an https url, or you must include an updatekey. your server must send this file as text/rdf, text/xml or application/rdf+xml or the update checker may not work. the add-on manager will substitute the following values into this url in case you wish to generate the response rdf dynamically, such as using php or cgi: %req_version% the version of the request. currently 1 %item_id% the id of the add-on being updated %item_version% the version of the add-on being updated %item_maxappversion% the maxversion of the targetapplication object corresponding to the current application for the add-on being updated. %item_status% comma separated list of the add-ons operating status in the application. contains at the least either userenabled...
...he compiler/architecture combination used to compile the current application. %app_locale% the current application's locale. %update_type% update_type_compatibility(32), update_type_newversion(64) %compatibility_mode% related to default to compatible, values could be normal, ignore or strict. examples <em:updateurl>https://www.example.com/update.cgi?id=%item_id%&amp;version=%item_version%</em:updateurl> <em:updateurl>https://www.example.com/extension/windows.rdf</em:updateurl> for add-ons hosted on addons.mozilla.org: you may not specify an updateurl property. by default, mozilla applications using the add-on manager (such as firefox and thunderbird) will send update requests to addons.mozilla.org using the default web service. every time you uploa...
...onale behind removing this feature and the suggested workaround. <em:requires> has a similar syntax to the <em:targetapplication> tag (i.e. you must specify <em:id>, <em:minversion>, <em:maxversion> when using it). if the add-on specified by the <em:id> tag is not installed or has an incompatible version, the extension manager will disable your extension and show the message "requires additional items". you can add as many <em:requires> tags as you like. your extension will be disabled if any of the specified requirements fail. it is not possible to add dependencies that are specific to a <em:targetapplication>. see extension dependencies for more details. glossary restricted access area a restricted access area is an install location that could be restricted on a restricted-access account...
Custom XUL Elements with XBL - Archive of obsolete content
roperties, attributes, methods and event handlers. many complex elements such as tabs, buttons and input controls are implemented using xbl and simpler xul elements. as explained earlier, xul is really just boxes, text and images. we'll look into xbl using a modified version of the hello world extension. download the hello world xbl project, build it and test it for a while. you should see a new item in the hello world menu, that opens a binding test window where you can add "persons" to a list. xbl basics in order to create an xbl binding you'll need 2 files: the xbl file and a css file that binds an element name to your xbl declaration. if you look into the content directory, you'll see both files: person.xml - this is the main binding file. it holds all the code necessary to control t...
...gives you a little more flexibility with children, but it's rarely needed. one important thing to take into account is that you shouldn't use the id attribute in any content nodes. these nodes are part of the xul dom just like any other, and having an id attribute is bound to cause problems, given that you could have more than instance of your element in the same document and then multiple inner items with the same id. in order to work around this problem, the anonid attribute is used instead: <xul:label anonid="xulshoolhello-name-label" xbl:inherits="value=name" /> and then, in order to get a reference to the node from the js code in your binding, we use the getanonymouselementbyattribute dom method: let namelabel = document.getanonymouselementbyattribute( this, "anonid", "xu...
...delete it or clone it. but there is one thing you need to know about moving or cloning your node: all internal state in the node will be lost. this means that all your properties and fields will be reset. if you want some value to be preserved after such dom operations, you must set it as an attribute and not an internal value. methods our "person" binding has a single method that removes the item from the list: <method name="remove"> <parameter name="aevent" /> <body><![cdata[ this.parentnode.removechild(this); ]]></body> </method> as you can see, it's very easy to define a method and the parameters it takes. you can also have a return value using the return keyword, just like on regular js code. the method uses the parent node to remove the person node. simple enough. yo...
...ior of some methods and properties. you can leave the content alone by not including the content tag, and then just add the methods and properties you wish to override. all you need to do is match the names of the originals. all methods and properties that are not overriden will maintain their original behavior. with inheritance you could take the richlistbox element and modify it to make a rich item tree, or create a switch button that changes state everytime it's clicked. and all with very little additional code. keep it in mind when creating your custom elements because it can save you lots of time. replacing existing xul elements as seen in the beginning of this section, the actual binding process is determined by a simple css rule that associates the tag name with the binding. this mea...
In-Depth - Archive of obsolete content
rom the operating systems defaults. button, checkbox-container, checkbox, dialog, dualbutton, dualbutton-dropdown, listbox, menu, menulist-textfield, menulist-button, menulist, menulist-text, progressbar, progresschunk, radio-container, radio, resizer, resizerpanel, separator, scrollbar, statusbar, statusbarpanel, toolbarbutton, toolbox, toolbar, treeheadercell, treeheadersortarrow, treeview, treeitem, treetwisty, treetwistyopen, tooltip, textfield, tabpanels, tab, tab-left-edge, tab-right-edge, scrollbartrack-horizontal, scrollbartrack-vertical, scrollbarthumb-vertical, scrollbarthumb-horizontal, scrollbarbutton-right, scrollbarbutton-down, scrollbarbutton-left, scrollbarbutton-up, scrollbargripper-vertical, scrollbargripper-horizontal -moz-border-bottom-colors defines a series of colours. ea...
...here this would be used is on tabs. -moz-border-radius-bottomleft the same as -moz-border-radius but only applies to the bottom left corner. an example of where this would be used is on a footer. -moz-border-radius-bottomright the same as -moz-border-radius but only applies to the bottom right corner. an example of where this would be used is on a footer. -moz-box-direction controls which way the items in this box are displayed. normal in english web browsers items are displayed top to bottom and left to right. this will flip it around so items inside of this box will be displayed bottom to top and right to left. this is useful for, say, putting the navigation controls (back button) on the right hand side of the toolbar. values: normal, reverse -moz-image-region this is useful for dividing up ...
...ges. it uses a rect() object to determine the clipping region. check out the section on organizing images for more information. example: -moz-image-region: rect(168px 69px 189px 46px); -moz-opacity makes boxes semi-transparent. it takes a decimal value, 0.00 is invisible and 1.00 is totally visible. how do i know what to modify? now that you've got everything extracted and you know how to modify items, you might be wondering, how do i know where everything is? well there is an easy way to find out - using the dom inspector. if you didn't install it when you first installed mozilla you may have to run the installer again. load mozilla and one browser window. then open the dom inspector (tools->web development->dom inspector). click file->inspect and select the browser window. what appears in a...
...is is what we want. on the right hand side of the dom inspector, what will be listed is the dom node information. but what we're interested in is the css style rules. click the icon located above the dom information and choose css style rules. the side bar will now be split into two parts. at the top, there is a list of all the groups of styles that are applied to this object. when you select an item in the list the bottom portion will display the actual styles that are applied. go through this list one item at a time and find the one which applies the image to the button (.toolbarbutton-1). look at the file column. it says that the file is located in chrome://navigator/skin/. this is a small problem with the display in mozilla 1.2 what it means is \navigator\navigator.css (most of the time i...
getResultAt - Archive of obsolete content
...
... ...
... ...
... ...
Positioning - Archive of obsolete content
tion of a popup on screen may be controlled. default positioning of popups a top level menu popup is, by default, placed with the upper edge of the popup flush with the lower edge of the menu or button it is associated with. horizontally, the left edge of the menu popup is aligned with the left edge of the menu or button. a submenu, however, is placed by default to the right of the parent menu item, such that the top edge of the menu is aligned with the top edge of the parent menu item. however, the submenu will appear to the left instead for right to left locales. for both top level menus and submenus, they may appear above or to the left instead of their usual placement if there is not enough room to display the menu at full size below or to the right. if there is not enough room on eith...
...orner (or upper right corner in right to left locales) at the position where the mouse was clicked. context menus will appear offset down and to the right a couple of pixels so that the menu can be dismissed again just by clicking in the same place. if a context menu was opened via the keyboard only, the menu will appear at the top left corner of the document, or underneath the currently selected item if a list is focused. context menus will always appear in this location, and not respect any position attribute value. tooltips will always appear near the current mouse position, offset vertically by a small amount. the position attribute the position of all types of popups can be controlled in two ways. first, the position can be specified when using the popup's openpopup method. this is us...
...the user can close the context menu just by clicking in the same location. for a tooltip, the position attribute controls how the tooltip is anchored to the element with the tooltip attribute. you wouldn't normally use the position attribute on a tooltip; instead you would just want the tooltip to appear at its default position which is near the mouse pointer. for instance: <menupopup id="edititems" position="end_before"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="clipboard" popup="edititems"/> in this example, a menupopup is attached to a label via the popup attribute, which will cause the popup to appear when the label is left-clicked. the position attribute is used to specify that the popup should appear at the 'end_bef...
...p, panel or tooltip has a margin specified in a style sheet or using the inline style attribute, this margin will be applied around the outside of the popup. in the following example, the menupopup has a 2ex margin above it, so when opened, the popup will be placed a distance of 2ex below the bottom of the button. <button label="popup" type="menu"> <menupopup style="margin-top: 2ex;"> <menuitem label="cat"/> <menuitem label="dog"/> </menupopup> </button> this technique is used internally for tooltips. if you notice in the firefox browser when a tooltip is opened it appears not at the mouse position, but slightly below it. this is because the default theme has a 21 pixel top margin on tooltips that moves them down by that much. this is used so that the tooltip doesn't cover up wh...
Sorting Results - Archive of obsolete content
to the order of results of the sql query. for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order. when the reference node is an rdf seq container and the results are in that container, however, the template builder orders the results in the order the items appear in the seq. for instance, the photos are listed in the same order in this example as they appear in the seq in the datasource. this method of sorting a seq works best for the simple query syntax since it is obvious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern. for more complex queries, thi...
...tance, if a list of photos was displayed in a two column tree showing the title and description, you could sort by either title or description. the user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. sorting tree results we'll examine sorting of trees first since trees are the most common element used with sorted items. using a tree builder, you can sort the results in a tree by a column. to do this, place a sort attribute on a treecol element referring to the variable to sort by for that column. <treecol id="name" label="name" sort="?name" flex="1"/> <treecol id="date" label="date" sort="?date" flex="1"/> in this example, the first column will be sorted by the ?name variable and the second column by the ?dat...
...ags="dont-build-content"), sorting is done by placing the sort and sortdirection attributes on the root node of the template. the sortactive attribute is not needed. in this example, the list of people is sorted ascending by name. <listbox datasources="people2.xml" ref="*" querytype="xml" sort="?name" sortdirection="ascending"> <template> <query expr="*/*"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> it will often be the case that multiple items have the same value, especially for larger amounts of data. you can specify multiple sort keys to further define how a sort should be handled in the case where the values for the first sort key are the same. to do this, just add another key after the first separated by a space, as in the ...
...when sorting, the predicate specified in the sort attribute for the result is used to determine where in the content the generated output should be inserted. the is similar to using a variable but any predicate may be used, not just one that is used in the template. changing the sort to change the sorting for a template's generated contents, you can either change the sor...
Special Condition Tests - Archive of obsolete content
will not match in this case, but the second rule will match and a label will be created. the result can be seen if you try the example. ...
...l will be created. the result can be seen if you try the example. ...
...plate syntax: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule parent="vbox"> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <groupbox uri="?item"> <caption label="?title"/> </groupbox> </action> </rule> <rule> <binding subject="?item" predicate="http://www.xulplanet.com/rdf/address" object="?address"/> <action> <label uri="?item" value="?address"/> </action> </rule> </template> </vbox> containment tests for rdf sources, the simple rule syntax supports two special conditional...
...iner attribute instead. <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule iscontainer="true"> <menupopup> <menu uri="rdf:*" label="rdf:http://purl.org/dc/elements/1.1/title"/> </menupopup> </rule> <rule> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.xulplanet.com/rdf/address"/> </menupopup> </rule> </template> </button> the only difference in the code in this example is that the order of the rules has been switched around, the condition check for house has been removed and the iscontainer attribute has been added. since the iscontainer attribute is set to true, the rule will match as long as the...
Advanced Rules - Archive of obsolete content
?city" predicate="http://www.xulplanet.com/rdf/weather#name" object="?name"/> <triple subject="?city" predicate="http://www.xulplanet.com/rdf/weather#prediction" object="?pred"/> </conditions> generating content the content to generate for a rule is specified inside the action element. this should be the content for the rows of the tree, menu items, or whatever content you want to generate. within the content, you can refer to variables that were defined in the conditions. thus, in the weather example above, you could use the variables 'name' or 'pred' to display the city or prediction. you can use the 'list' or 'city' variables also, but they hold resources, not text, so they won't likely have meaningful values to users. in the simple rul...
... if using the don...
... adding additional bindings the final element you can add inside a rule is...
... adding additional bindings the final element you can add inside a rule is the bindings element. inside it, you place one or more binding elements. a binding in a rule has the same syntax as a triple and performs almost the same function. ...
Tabboxes - Archive of obsolete content
el="options"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical"> <description> enter your search criteria below and select the find button to begin the search. ...
...els> <tabpanel id="searchpanel" orient="vertical"> <description> enter your search criteria below and select the find button to begin the search. ...
...orient="vertical"> <description> enter your search criteria below and select the find button to begin the search. ...
...t: 10px"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="height: 10px"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </groupbox> </tabpanel> <tabpanel id="optionspanel" orient="vertical"> <checkbox id="casecheck" label="case sensitive search"/> <checkbox id="wordscheck" label="match entire filename"/> ...
Tree Box Objects - Archive of obsolete content
roll(){ var value = document.getelementbyid("tbox").value; var tree = document.getelementbyid("thetree"); var boxobject = tree.boxobject; boxobject.queryinterface(components.interfaces.nsitreeboxobject); boxobject.scrolltorow(value); } </script> <tree id="thetree" rows="4"> <treecols> <treecol id="row" label="row" primary="true" flex="1"/> </treecols> <treechildren> <treeitem label="row 0"/> <treeitem label="row 1"/> <treeitem label="row 2"/> <treeitem label="row 3"/> <treeitem label="row 4"/> <treeitem label="row 5"/> <treeitem label="row 6"/> <treeitem label="row 7"/> <treeitem label="row 8"/> <treeitem label="row 9"/> </treechildren> </tree> <hbox align="center"> <label value="scroll to row:"/> <textbox id="tbox"/> <butt...
...getelementbyid("row").value = row.value; document.getelementbyid("column").value = column.value; document.getelementbyid("part").value = part.value; } </script> <tree id="thetree" flex="1" onmousemove="updatefields(event);"> <treecols> <treecol id="utensil" label="utensil" primary="true" flex="1"/> <treecol id="count" label="count" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="fork"/> <treecell label="5"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="knife"/> <treecell label="2"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="spoon"/> <treecell label="8"/> </treerow> </treeitem> </treechildren> </tree> <l...
...oes when the user double clicks the twisty. the final value that may be returned is 'image' if there is an image in the tree cell and the coordinate corresponds to a location where the image is. of course, in many cases you may not care what part of the cell the coordinate is on and just want the row and column. to go in reverse and get the coordinates of a specific cell, use the getcoordsforcellitem() function. it takes seven arguments, as described below. var x = {}, y = {}, width = {}, height = {}; if (typeof tree.columns != "undefined") column = tree.columns[column]; tree.boxobject.getcoordsforcellitem( row, column, part, x, y, width, height ); the row, column, and part arguments are similar to those returned from the getcellat() function. again, the column should be either a string or...
...row, column, and part arguments are similar to those returned from the getcellat() function. again, the column should be either a string or a column object depending on which version you are using. the cell part type may be used to get the coordinates of either the text, the entire cell, the twisty or the image in the cell. the same values as the getcellat() function are used. the getcoordsforcellitem() function returns the x and y coordinates in addition to the width and height, all as out parameters. next, we'll look at rdf which can be used to automatically populate trees and other elements. « previousnext » ...
The Implementation of the Application Object Model - Archive of obsolete content
r architecture. let's consider another required feature that has heretofore gone unmentioned in this document: the need to take the same set of data and present it as completely different content models. the perfect example of this requirement is the personal toolbar. the personal toolbar must show up in a tree widget (in which case it has to be faking a tree content model, complete with <tt><treeitem></tt> and <tt><treecell></tt> nodes), or it must be able to show up on a toolbar (complete with <tt><button></tt> nodes and popup trees attached to folder buttons). in our current architecture, we have a set of content nodes obtained from any number of data sources. we've solved our aggregation of data problem, but we have no efficient way of taking the data and representing it in different ways,...
...tever content model you happen to have built that the transformation could be applied. if there is a common intermediate representation of the data in question, then we need only implement n translators, one for each content model representation that can hold our aggregate data. yet another example of this problem arises from the need to perform fast sorts on a potentially large number of content items. using the dom apis to walk the content nodes and reorder them would be an act of madness. futhermore, the original natural order of the items (e.g., in the case of bookmarks) would be lost. when performing the sort, it would be advantageous to be able to form the new sorted content model without losing or disrupting the natural sort. statement #3 the fact that the same hunk of aggregate data...
...own our intermediate representation and without even losing our original information. another problem that arises in the tree view is the need to reorder columns. if a conventional tree structure is used as the intermediate representation of our data, then the column reordering could result in a potentially enormous and time-consuming walk through the tree in order to reorder the children of each item. but suppose that instead we could store additional information about the tree's columns, namely in which order they occur, then the act of persistently saving a column reordering would take far less time (o(1) to swap two columns, as opposed to a worst case o(n) where n is the number of cells in the tree). some of you might be saying, "wait a minute. for sorting and column reordering, you have t...
...e xul and write over the original file (thus allowing local changes to a local file to be reflected right in the xul). referencing local data: the localdata attribute a tag that references local rdf data does so by using the localdata attribute, which gives the uri of the local data that should be merged in with the xul content tree. examples of tags that can reference local data are menu, menuitem, menubar, toolbox, toolbar, treebody, and treeitem. todo: outline the naming scheme for local data. give an example once i actually know what the naming scheme will be. talk to john mcmullen about 5.0 preferences and figure out where localdata will need to be used (likely on every form element control) talk to steve elmer. it's likely that this might be the desirable solution for buttons that...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
be fired on the key element. the key pressed must match the key attribute (or keycode attribute) as well as the modifiers attribute in order for the key element to be activated. for the shortcut defined using the key element to work, you must specify a command attribute (or an oncommand handler) on the key element. to display the shortcut defined with the key element in the ui, you can use <menuitem key="key element's id" command="command id" .../>. in order to use (non-default) key commands within specific elements, you will need to listen for key events. more information is available in the xul tutorial. attributes command, disabled, key, keycode, keytext, modifiers, oncommand, phase examples (example needed) attributes command type: id set to the id of a command element...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. key type: character the character that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are ...
...acter that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are listed at keyboard shortcuts. keytext type: string a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separated by spaces or commas. keys will map to other keys on platforms that do not have them. shift: the shift key. alt: the alt key. on the maci...
...on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in conjuction with an element's accesskey. any: indicates that all modifiers preceding it are optional. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. phase type: string the event phase where the handler is invoked. this should be set to the value capturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase. properties inherited properties align, , allowevents, , boxobject, builder, , , , ...
listcell - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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 t...
...f the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. type type: string this attribute is reserved for use by anonymous children of listitem; do not use. properties disabled type: boolean gets and sets the value of the disabled attribute. inherited properties align, , allowevents, , boxobject,...
...ven when no label text is set. ...
Windows and menus in XULRunner - Archive of obsolete content
lesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> <toolbox> <menubar id="menubar"> <menu id="file-menu" label="&file;"> <menupopup id="file-popup"> <menuitem label="&file.new;" oncommand="dofilenew();"/> <menuitem label="&file.open;" oncommand="dofileopen();"/> <menuitem label="&file.save;" oncommand="dofilesave();"/> <menuseparator/> <menuitem label="&file.exit;" oncommand="dofileexit();"/> </menupopup> </menu> <menu id="edit-menu" label="&edit;"> <menupopup id="edit-popup"> ...
...</window> ...
...file.open;" oncommand="dofileopen();"/> <menuitem label="&file.save;" oncommand="dofilesave();"/> <menuseparator/> <menuitem label="&file.exit;" oncommand="dofileexit();"/> </menupopup> </menu> <menu id="edit-menu" label="&edit;"> <menupopup id="edit-popup"> <menuitem label="&edit.undo;" oncommand="doeditundo();"/> <menuitem label="&edit.redo;" oncommand="doeditredo();"/> </menupopup> </menu> </menubar> <toolbar id="main-toolbar"> <toolbarbutton id="open" label="&file.open;" oncommand="dofileopen();"/> <toolbarbutton id="save" label="&file.save;" oncommand="dofilesave();"/> </toolbar> </toolbox> ... </window> notice that i used entity-references for the menu and toolbar label...
...in.js file. xul has a way to centralize commands and event handlers for menus and toolbars that do the same thing, like open and save in the above example. you can add a <commandset> and <command> elements like this: <commandset> <command id="cmd_open" label="&file.open;" oncommand="dofileopen();"/> <command id="cmd_save" label="&file.save;" oncommand="dofilesave();"/> </commandset> ... <menuitem command="cmd_open"/> <menuitem command="cmd_save"/> ... <toolbarbutton id="open" command="cmd_open"/> <toolbarbutton id="save" command="cmd_save"/> ... we can add images to the toolbar buttons through the css file. we could hard-code the images in the xul file itself, but css is a better practice. here’s the css file: /* global skin --------------------------------------------------- */ @im...
calICalendarView - Archive of obsolete content
as implemented here, it corresponds to the calendar containing all of the calievents and calitodos that shoud be shown in the view. in the vast majority of cases, this is calicompositecalendar. notice that a calicalendarview does not conta...
...ute calidatetime startdate; readonly attribute calidatetime enddate; readonly attribute boolean supportsdisjointdates; readonly attribute boolean hasdisjointdates; void setdatelist(in unsigned long acount, [array,size_is(acount)] in calidatetime adates); void getdatelist(out unsigned long acount, [array,size_is(acount),retval] out calidatetime adates); attribute caliitembase selecteditem; attribute calidatetime selectedday; attributes displaycalendar the displaycalendar is an implementation of the calicalendar interface. as implemented here, it corresponds to the calendar containing all of the calievents and calitodos that shoud be shown in the view. in the vast majority of cases, this is calicompositecalendar. notice that a calicalendarview does not contain any additem or...
...note that in most cases, this attribute will be set by the consumers of calicalendarview very early in an application/extension's loading process. ...
...check this attribute to determine whether or not the implementation allows for calls to setdatelist. if an implementation returns true for this attribute, it must allow for any arbitrary set of dates to be displayed. hasdisjointdates returns false if the dates being displayed represent a continuous list, and true if certain dates in between startdate and enddate may not be displayed. selecteditem returns a caliitembase corresponding to the currently active item in the view. other areas of the code may use this attribute for setting selection, editing purposes, or any other purpose. note: this will likely change to selecteditems and return an array of caliitembases in order to support selecting multiple items at once. selectedday the currently selected day in the display. other areas o...
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
for example, you could use it to include the entire contents of a blog post; or just a summary of it. however, the rss <description> element is only suppose to be used to includeplain text data. this obviously limits you. and since many peoplewrite in html information and formatting is lost with the rss <description> element. however, it has become common practice to putxml escaped html data in it. (even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. ...
...content module is shown below: <?xml version="1.0"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>a link in here</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <content:encoded><![cdata[this is a <a href="http://example.com/">link</a>.]]></content:encoded> </item> ...
... <title>a link in here</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <content:encoded><![cdata[this is a <a href="http://example.com/">link</a>.]]></content:encoded> </item> <item> <title>some italics html</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <content:encoded><![cdata[this is <i>italics</i>.]]></content:encoded> </item> <item> ...
...this element is used to include an html <description>. note: strictly speaking, the rss content module and <content:encoded> are not quite being used correctly. it requires intertwinment with rdf's xml serialization. ...
Enumerator.moveNext - Archive of obsolete content
non-standard. do not use! ...
... non-standard. do not use! ...
... non-standard. do not use! ...
...tem is set to undefined. ...
XForms Repeat Element - Archive of obsolete content
e spec), delete (see the spec) and setindex (see the spec) elements. ...
...y:line name="a"> <my:price>3.00</my:price> </my:line> <my:line name="b"> <my:price>32.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" no...
... <xf:delete ev:event="domactivate" at="index('anonidgridrepeat')" xbl:inherits="model, bind, nodeset"/> </xf:trigger> </xf:repeat> </xbl:content> </xbl:binding> </xbl:bindings> <style> div.grid { -moz-binding: url('#grid'); } </style> <xf:model> <xf:instance> <data xmlns=""> <repeat> <item> <input>input1</input> </item> <item> <input>input2</input> </item> <item> <input>input3</input> </item> </repeat> </data> </xf:instance> </xf:model> </head> <body> <xf:repeat nodeset="/data/repeat/item" id="gridrepeat"> <xf:input ref="input"/> </xf:repeat> <br/> <div class="gri...
...t1</input> </item> <item> <input>input2</input> </item> <item> <input>input3</input> </item> </repeat> </data> </xf:instance> </xf:model> </head> <body> <xf:repeat nodeset="/data/repeat/item" id="gridrepeat"> <xf:input ref="input"/> </xf:repeat> <br/> <div class="grid" nodeset="/data/repeat/item"/> </body> ...
2D maze game with device orientation - Game development
t value for each. ...
...initlevels function, we're adding the blocks into an array in the for loop using some of the framework-specific methods: for(var i=0; i<this.maxlevels; i++) { var newlevel = this.add.group(); newlevel.enablebody = true; newlevel.physicsbodytype = phaser.physics.arcade; for(var e=0; e<this.leveldata[i].length; e++) { var item = this.leveldata[i][e]; newlevel.create(item.x, item.y, 'element-'+item.t); } newlevel.setall('body.immovable', true); newlevel.visible = false; this.levels.push(newlevel); } first, add.group() is used to create a new group of items. then the arcade body type is set for that group to enable physics calculations. the newlevel.create method creates new items in the group with starting left and top positions, and its own image...
... the objects are stored in the this.levels array, which is by default invisible. ...
... the objects are stored in the this.levels array, which is by default invisible. ...
Cross Axis - MDN Web Docs Glossary: Definitions of Web-related terms
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. if your main axis is column or column-reverse then the cross axis runs along the rows. alignment of items on the cross axis is achieved with the align-items property on the flex container or align-self property on individual items. ...
...everse then the cross axis runs along the rows. alignment of items on the cross axis is achieved with the align-items property on the flex container or align-self property on individual items. in the case of a multi-line flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
...iner or align-self property on individual items. in the case of a multi-line flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
...ine flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
flex is a new value added to the css display property. along with inline-flex it causes the element that it applies to to become a flex container, and the element's children to each become a flex item. the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied. the flex property is a shorthand for the flexbox properties flex-grow, flex-shrink and flex-basis. in addition <flex> can refer to a flexible length in css grid layout. ...
...t's children to each become a flex item. the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied. the flex property is a shorthand for the flexbox properties flex-grow, flex-shrink and flex-basis. in addition <flex> can refer to a flexible length in css grid layout. ...
...t. ...
...items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Flex Container - MDN Web Docs Glossary: Definitions of Web-related terms
a flexbox layout is defined using the flex or inline-flex values of the display property on the parent item. this element then becomes a flex container, and each one of its children becomes a flex item. a value of flex causes the element to become a block level flex container, and inline-flex an inline level flex container. these values create a flex formatting context for the element, which is similar to a block formatting context in that floats will not intrude into the container, and the margins on the container will not collapse with those of the items. ...
...uses the element to become a block level flex container, and inline-flex an inline level flex container. ...
...ent, which is similar to a block formatting context in that floats will not intrude into the container, and the margins on the container will not collapse with those of the items. ...
...ot intrude into the container, and the margins on the container will not collapse with those of the items. ...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
flexbox is the commonly-used name for the css flexible box layout module, a layout model for displaying items in a single dimension — as a row or as a column. in the specification, flexbox is described as a layout model for user interface design. the key feature of flexbox is the fact that items in a flex layout can grow and shrink. space can be assigned to the items themselves, or distributed between or around the items. flexbox also enables alignment of items on the main or cross axis, thus providing a high level of control over the size and alignment of a group of items. ...
...design. the key feature of flexbox is the fact that items in a flex layout can grow and shrink. space can be assigned to the items themselves, or distributed between or around the items. flexbox also enables alignment of items on the main or cross axis, thus providing a high level of control over the size and alignment of a group of items. ...
...s. ...
...items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Images, media, and form elements - Learn web development
elements, you may well find that they behave slightly differently to other elements. for example, in a flex or grid layout elements are stretched by default to fill the entire area. images will not stretch, and instead will be aligned to the start of the grid area or flex container. you can see this happening in the example below where we have a two column, two row grid container, which has four items in it. all of the <div> elements have a background color and stretch to fill the row and column. the image, however, does not stretch. if you are following these lessons in order then you may not have looked at layout yet. just keep in mind that replaced elements, when they become part of a grid or flex layout, have different default behaviors, essentially to avoid them being stretched strang...
...forms such as <fieldset> and <legend>. html5 also contains attributes that enable web developers to indicate which fields are required, and even the type of content that needs to be entered. if the user enters something unexpected, or leaves a required field blank, the browser can show an error message. different browsers are inconsistent in how much styling and customization they allow for such items. styling text input elements elements that allow for text input, such as <input type="text">, specific types such as <input type="email">, and the <textarea> element are quite easy to style and tend to behave just like other boxes on your page. the default styling of these elements will differ however based on the operating system and browser that your user visits the site with. in the exampl...
...ngs in addition to the rules mentioned above, you should also set overflow: auto on <textarea>s to stop ie showing a scrollbar when there is no need for one: textarea { overflow: auto; } putting it all together into a "reset" as a final step, we can wrap up the various properties discussed above into the following "form reset" to provide a consistent base to work from. this includes all the items mentioned in the last three sections: button, input, select, textarea { font-family: inherit; font-size: 100%; box-sizing: border-box; padding: 0; margin: 0; } textarea { overflow: auto; } note: normalizing stylesheets are used by many developers to create a set of baseline styles to use on all projects. typically these do similar things to those described above, making sure that ...
...ips you'll find useful when you have to style html tables. ...
Attribute selectors - Learn web development
r contains value in its (space separated) list of values. [attr|=value] div[lang|="zh"] matches elements with an attr attribute whose value is exactly value or begins with value immediately followed by a hyphen. in the example below you can see these selectors being used. by using li[class] we can match any selector with a class attribute. this matches all of the list items except the first one. li[class="a"] matches a selector with a class of a, but not a selector with a class of a with another space-separated class as part of the value. it selects the second list item. li[class~="a"] will match a class of a but also a value that contains the class of a as part of a whitespace-separated list. it selects the second and third list items. substring matching sel...
..."box"] matches elements with an attr attribute whose value contains value anywhere within the string. (aside: it may help to note that ^ and $ have long been used as anchors in so-called regular expressions to mean begins with and ends with.) the next example shows usage of these selectors: li[class^="a"] matches any attribute value which starts with a, so matches the first two list items. li[class$="a"] matches any attribute value that ends with a, so matches the first and third list item. li[class*="a"] matches any attribute value where a appears anywhere in the string, so it matches all of our list items. case-sensitivity if you want to match attribute values case-insensitively you can use the value i before the closing bracket. this flag tells the browser to match asci...
...nsitively you can use the value i before the closing bracket. this flag tells the browser to match ascii characters case-insensitively. without the flag the values will be matched according to the case-sensitivity of the document language — in html's case it will be case sensitive. in the example below, the first selector will match a value that begins with a — it only matches the first list item because the other two list items start with an uppercase a. the second selector uses the case-insensitive flag and so matches all of the list items. note: there is also a newer value s, which will force case-sensitive matching in contexts where matching is normally case-insensitive, however this is less well supported in browsers and isn't very useful in an html context. next steps now we ...
...ead about pseudo-class and pseudo-element selectors. ...
CSS values and units - Learn web development
age using an <iframe>, so this won't work. to see this in action you'll have to try the example after opening it in its own browser tab. the third box uses em units. these are relative to the font size. i've set a font size of 1em on the containing <div>, which has a class of .wrapper. change this value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size. after following the instructions above, try playing with the values in other ways, to see what you get. ems and rems em and rem are the two relative lengths you are likely to encounter most frequently when sizing anything from boxes to text. it's worth understanding how these work, and the differences between them, especially when y...
...wo boxes is inside a wrapper that is 400 pixels wide. the second 200px wide box is the same width as the first one, but the second 40% box is now 40% of 400px — a lot narrower than the first one! try changing the width of the wrapper or the percentage value to see how this works. the next example has font sizes set in percentages. each <li> has a font-size of 80%, therefore the nested list items become progressively smaller as they inherit their sizing from their parent. note that, while many values accept a length or a percentage, there are some that only accept length. you can see which values are accepted on the mdn property reference pages. if the allowed value includes <length-percentage> then you can use a length or a percentage. if the allowed value only includes <length>, it...
...ve demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. position the <position> data type represents a set of 2d coordinates, used to position an item such as a background image (via background-position). it can take keywords such as top, left, bottom, right, and center to align items with specific bounds of a 2d box, along with lengths, which represent offsets from the top and left-hand edges of the box. a typical position value consists of two values — the first sets the position horizontally, the second vertically. if you only specify val...
...is useful but perhaps non-obvious knowledge to have! ...
Test your skills: Flexbox - Learn web development
the aim of this task is to get you working with flexbox and demonstrate your understanding of how flex items behave. below are four common design patterns which you might use flexbox to create, your task is to build them. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. flex layout one these list items are the navigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished...
... navigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout two these list items are all different sizes, but we want them to be displayed as three equal sized columns, no matter what content is in each item. ...
...er work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout two these list items are all different sizes, but we want them to be displayed as three equal sized columns, no matter what content is in each item. try updating the live code below to recreate the finished example: additional questions: can you now make the first item twice the size of the other items? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout three there are two elements in the html below, a div with a class of .parent which contains another div with a class of .child. use flexbox to center the child inside the parent. try updating the live code be...
...below, a div with a class of .parent which contains another div with a class of .child. use flexbox to center the child inside the parent. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout four in this final task arrange these items into rows as in the image. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors mentioned above. if you would like your work assessed, or are stuck and w...
Responsive design - Learn web development
mn-count: 3; } if you instead specify a column-width, you are specifying a minimum width. the browser will create as many columns of that width as will comfortably fit into the container, then share out the remaining space between all the columns. therefore the number of columns will change according to how much space there is. ...
...idth, you are specifying a minimum width. the browser will create as many columns of that width as will comfortably fit into the container, then share out the remaining space between all the columns. therefore the number of columns will change according to how much space there is. ...
...ining space between all the columns. therefore the number of columns will change according to how much space there is. .container { column-width: 10em; } flexbox in flexbox, flex items will shrink and distribute space between the items according to the space in their container, as their initial behavior. by changing the values for flex-grow and flex-shrink you can indicate how you want the items to behave when they encounter more or less space around them. ...
...uch space there is. .container { column-width: 10em; } flexbox in flexbox, flex items will shrink and distribute space between the items according to the space in their container, as their initial behavior. by changing the values for flex-grow and flex-shrink you can indicate how you want the items to behave when they encounter more or less space around them. in the example below the flex items will each take an equal amount of space in the flex container, using the shorthand of flex: 1 as described in the layout topic flexbox: flexible sizing of flex items. .container { display: flex; } .item { flex: 1; } note: as an example, we have rebuilt the simple responsive layout above, this time using flexbox. you can see how we no longer need to use strange percentage values to calc...
Styling links - Learn web development
org/files/12982/external-link-52.png') no-repeat 100% 0; background-size: 16px 16px; padding-right: 19px; } so what's going on here? we'll skip over most of the css, as it's just the same information you've looked at before. the last rule however is interesting — here we are inserting a custom background image on external links in a similar manner to how we handled custom bullets on list items in the last article — this time however we are using background shorthand instead of the individual properties. we set the path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. we also use background-size to specify the size we want the backgrou...
...ple. note: don't worry if you are not familiar with backgrounds and responsive web design yet; these are explained in other places. styling links as buttons the tools you've explored so far in this article can also be used in other ways. for example, states like hover can be used to style many different elements, not just links — you might want to style the hover state of paragraphs, list items, or other things. in addition, links are quite commonly styled to look and behave like buttons in certain circumstances — a website navigation menu is usually marked up as a list containing links, and this can be easily styled to look like a set of control buttons or tabs that provide the user with access to other parts of the site. let's explore how. first, some html: <ul> <li><a href="#...
...the default padding from the <ul> element, and sets its width to span 100% of the outer container (the <body>, in this case). <li> elements are normally block by default (see types of css boxes for a refresher), meaning that they will sit on their own lines. in this case, we are creating a horizontal list of links, so in the third rule we set the display property to inline, which causes the list items to sit on the same line as one another — they now behave like inline elements. the fourth rule — which styles the <a> element — is the most complicated here; let's go through it step by step: as in previous examples, we start by turning off the default text-decoration and outline — we don't want those spoiling our look. next, we set the display to inline-block — <a> elements ...
...ly the last <a> in the list, and removes the margin from it. done! the last three declarations are pretty simple and are mainly just for cosmetic purposes. we center the text inside each link, set the line-height to 3 to give the buttons some height (which also has the advantage of centering the text vertically), and set the text color to black. note: you may have noticed that the list items in the html are all put on the same line as each other — this is done because spaces/line breaks in between inline block elements create spaces on the page, just like the spaces in between words, and such spaces would break our horizontal navigation menu layout. so we've removed the spaces. you can find more information about this problem (and solutions) at fighting the space between inline bl...
Basic native form controls - Learn web development
dden" id="timestamp" name="timestamp" value="1286705410"> if you create such an element, it's required to set its name and value attributes. the value can be dynamically set via javascript. the hidden input type should not have an associated label. other text input types, like search, url, and tel, were added with html5. those will be covered in the next tutorial, html5 input types. checkable items: checkboxes and radio buttons checkable items are controls whose state you can change by clicking on them or their associated labels. there are two kinds of checkable item: the check box and the radio button. both use the checked attribute to indicate whether the widget is checked by default or not. it's worth noting that these widgets do not behave exactly like other form widgets. for most fo...
...kinds of checkable item: the check box and the radio button. both use the checked attribute to indicate whether the widget is checked by default or not. it's worth noting that these widgets do not behave exactly like other form widgets. for most form widgets, once the form is submitted all widgets that have a name attribute are sent, even if no value has been filled out. in the case of checkable items, their values are sent only if they are checked. if they are not checked, nothing is sent, not even their name. if they are checked but have no value, the name is sent with a value of on. note: you can find the examples from this section on github as checkable-items.html (see it live also). ...
...the associated <label> is generally placed immediately after the radio button or checkbox, with the instructions for the group of radio button or checkboxes generally being the content of the <legend>. ...
...the associated <label> is generally placed immediately after the radio button or checkbox, with the instructions for the group of radio button or checkboxes generally being the content of the <legend>. see the examples linked above for structural examples. ...
HTML text fundamentals - Learn web development
lists now let's turn our attention to lists. lists are everywhere in life—from your shopping list to the list of directions you subconsciously follow to get to your house every day, to the lists of instructions you are following in these tutorials! lists are everywhere on the web, too, and we've got three different types to worry about. ...
...ion to lists. lists are everywhere in life—from your shopping list to the list of directions you subconsciously follow to get to your house every day, to the lists of instructions you are following in these tutorials! lists are everywhere on the web, too, and we've got three different types to worry about. ...
...ctions you are following in these tutorials! lists are everywhere on the web, too, and we've got three different types to worry about. unordered unordered lists are used to mark up lists of items for which the order of the items doesn't matter—let's take a shopping list as an example. milk eggs bread hummus every unordered list starts off with a <ul> element—this wraps around all the list items: <ul> milk eggs bread hummus </ul> the last step is to wrap each list item in a <li> (list item) element: <ul> <li>milk</li> <li>eggs</li> <li>bread</li> <li>hummus</li> </ul> active learning: marking up an unordered list try editing the live sample below to create your very own html unordered list. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"...
... text area code textarea.onkeyup = function(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; ordered ordered lists are lists in which the order of the items does matter—let's take a set of directions as an example: drive to the end of the road turn right go straight across the first two roundabouts turn left at the third roundabout the school is on your right, 300 meters up the road the markup structure is the same as for unordered lists, except that you have to wrap the list items in an <ol> element, rather than <ul>: <ol> <li>drive to the e...
Manipulating documents - Learn web development
ight = window.innerheight; div.style.width = winwidth + 'px'; div.style.height = winheight + 'px'; } note: if you get stuck, have a look at our finished window resize example (see it live also). active learning: a dynamic shopping list to round off the article, we'd like to set you a little challenge — we want to make a simple shopping list example that allows you to dynamically add items to the list using a form input and button. when you add an item to the input and press the button: the item should appear in the list. each item should be given a button that can be pressed to delete that item off the list. the input should be emptied and focused ready for you to enter another item. the finished demo will look something like this: to complete the exercise, follow the s...
...e script. create three variables that hold references to the list (<ul>), <input>, and <button> elements. create a function that will run in response to the button being clicked. inside the function body, start off by storing the current value of the input element in a variable. next, empty the input element by setting its value to an empty string — ''. ...
...ction that will run in response to the button being clicked. inside the function body, start off by storing the current value of the input element in a variable. next, empty the input element by setting its value to an empty string — ''. create three new elements — a list item (<li>), <span>, and <button>, and store them in variables. append the span and the button as children of the list item. ...
...a variable. next, empty the input element by setting its value to an empty string — ''. create three new elements — a list item (<li>), <span>, and <button>, and store them in variables. append the span and the button as children of the list item. set the text content of the span to the input element value you saved earlier, and the text content of the button to 'delete'. append the list item as a child of the list. attach an event handler to the delete button, so that when clicked it will delete the entire list item it is inside. finally, use the focus() method to focus the input element ready for entering the next shopping list item. note: if you get really stuck, have a look at our finished shopping list (see it running live also.) summary we have reached the end of our stu...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
how components can also expose methods and variables. the following new components will be developed throughout the course of this article: moreactions: displays the check all and remove completed buttons, and emits the corresponding events required to handle their functionality. newtodo: displays the <input> field and add button for adding a new todo. todosstatus: displays the "x out of y items completed" status heading. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install ...
...ll the todos with the completed property updated accordingly, like this: const checkalltodos = (completed) => { todos = todos.map(t => { // shorter version: todos = todos.map(t => ({...t, completed})) return {...t, completed: completed} }) } in this case we are using the map() method, which returns a new array with the results of executing the provided function for each item. the function returns a copy of each todo using spread syntax and overwrites the property of the completed value accordingly. this solution has the added benefit of returning a new array with new objects, completely avoiding mutating the original todos array. note: svelte allows us to specify different options that affect how the compiler works. the <svelte:options immutable={true}/> option tel...
... what's happened to screenreader users. first we'll extract the status heading to its own component. create a new file — components/todosstatus.svelte. ...
... 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. how can we access those exported values fro...
Styling Vue components with CSS - Learn web development
now we can go through and begin editing our components to use some of these styles. adding css classes in vue we should apply the button css classes to the <button> in our todoform component. since vue templates are valid html, this is done in the same way to how you might do it in plain html — by adding a class="" attribute to the element. add class="btn btn__primary btn__lg" to your fo...
...</h2> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model.lazy.trim="label" class="input__lg" /> <button type="submit" class="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file. this will help improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-summary" class="stack-large"> adding scoped styles the last component we want to style is our todoitem component. to keep the style definitions close to the component we can add a <style> element inside it. however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and f...
...lement inside it. however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and fix the problem. this is where the scoped attribute can be useful — this attaches a unique html data attribute selector to all of your styles, preventing them from colliding globally. ...
...ss. last of all, to the <label> add a checkbox-label class. the updated template is below: the app should now have custom checkboxes. your app should look something like the screenshot below. summary our work is done on the styling of our sample app. in the next article we'll return to adding some more functionlity to our app, namely using a computed property to add a count of completed todo items to our app. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in reac...
mozbrowsercontextmenu
one or more menusystem objects (see the menusystem object, below), containing details of the standard menu(s) that will be shown. for example, if the user clicked on an image nested in an <a> tag, two menus are available — one with information related to the image, and one for the link. contextmenu a menu object (see the menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id. contextmenuitemselected an anonymous function that fires when a menu item is selected. the menusystem object an object defining a standard context menu that will be displayed. its properties are as follows: documenturi a domstring representing the url of the document the menu...
...ta and is bigger than 0 x 0, or false if not. action a domstring representing the action of a form, in the case of a form context menu. method a domstring representing the method of a form, in the case of a form context menu. name a domstring representing the name of a form, in the case of a form context menu. ...
...nting the name of a form, in the case of a form context menu. the menu object an object representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id. its properties are as follows: type a domstring representing the type of context menu displayed. it can be menu (a full menu) or menuitem (a single menu item.) label a domstring equal to the label attribute of the dom node the context menu is accessed on. icon the menu item's icon, if the context menu being accessed is a menu item. ...
...t clicked on, which contains the menu's id. its properties are as follows: type a domstring representing the type of context menu displayed. it can be menu (a full menu) or menuitem (a single menu item.) label a domstring equal to the label attribute of the dom node the context menu is accessed on. icon the menu item's icon, if the context menu being accessed is a menu item. id the menu item's id, if the context menu being accessed is a menu item. this is passed to the contextmenuitemselected() function, to indicate which item has been selected. items an array of further menu objects, which indicate the menu options available in a menu, if the context menu being accessed is a menu. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserconte...
NSPR Contributor Guide
we (the nspr module owners) sometimes disappoint our contributors when we must reject their contributions. we reject contributions for a variety of reasons. some of these reasons are not obvious to an outside observer. nspr wishes to document some guidelines for those who would contribute to nspr. these guidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance. ...
... who would contribute to nspr. these guidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance. general guidelines downward compatibility because many different applications, besides the mozilla client, use the nspr api, the api must remain downward compatible across even major releases. this means that the behavior of an existing public api item in nspr cannot change. should you need to have a similar api, with some slightly different behavior or different function prototype, then suggest a new api with a different name. c language api the nspr api is a c language api. please do not contribute java, c or other language wrappers. coding style nspr does not have a documented coding style guide. look at the extant code. make yours loo...
...owners do not now nor never have been involved with nspr 1.0.]. such is life. that said: there are some libraries that implement functions intended for use with applications using nspr, such as ...nsprpub/lib/libc/plgetopt.*. generally useful platform abstractions you agree to sustain, bug fix may rely on the nspr api may not rely on any other library api new platform ports all nspr api items must be implemented platform specific headers in pr/include/md/_platformname.[h!cfg] platform specific code in pr/src/md/platform/*.c make rules in config/_platform.mk documentation the files for nspr's documentation are maintained using a proprietary word processing system [don't ask]. document your work as described in [#newfeatures new features]. use the style of other nspr documentatio...
...te word processor and the derived html shows up on mozilla.org test cases you should provide test cases for all new features and new libraries. give consideration to providing a test case when fixing a bug if an existing test case did not catch a bug it should have caught. the new test cases should be implemented in the style of other nspr test cases. test cases should prove that the added api items work as advertized. test cases should serve as an example of how to use the api items. test cases should provoke failure of every api item and report its failure. frequently asked questions (faq) q: why was my contribution rejected? a: check the bugzilla report covering your contribution. original document information author: reed@reedloden.com last updated date: november 2, 2006 ...
NSS 3.12.5 release_notes
ion is changed from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use keyhi.h instead. ...
...from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use keyhi.h instead. ...
...gned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use keyhi.h instead. additional documentation in pk11pub.h: the caller of pk11_derencodepublickey should free the returned secitem with a secitem_freeitem(..., pr_true) call. ...
...ders the header file key.h is deprecated. please use keyhi.h instead. additional documentation in pk11pub.h: the caller of pk11_derencodepublickey should free the returned secitem with a secitem_freeitem(..., pr_true) call. pk11_readrawattribute allocates the buffer for returning the attribute value. the caller of pk11_readrawattribute should free the data buffer pointed to by item using a secitem_freeitem(item, pr_false) or port_free(item->data) call. in secasn1.h: if both pool and dest are null, the caller should free the returned secitem with a secitem_freeitem(..., pr_true) call. if pool is null but dest is not null, the caller should free the data buffer pointed to by dest with a secitem_freeitem(dest, pr_false) or port_free(dest->data) call. envir...
nss tech note7
blic key as a sequence of modulus and public exponent, both of which are integers. here is the asn.1 type definition: rsapublickey ::= sequence { modulus integer, -- n publicexponent integer -- e } the following sample code (error handling omitted for brevity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss. ...
...of modulus and public exponent, both of which are integers. here is the asn.1 type definition: rsapublickey ::= sequence { modulus integer, -- n publicexponent integer -- e } the following sample code (error handling omitted for brevity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss. ...
...oth of which are integers. here is the asn.1 type definition: rsapublickey ::= sequence { modulus integer, -- n publicexponent integer -- e } the following sample code (error handling omitted for brevity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss. ...
...etof(myrsapublickey,m_modulus), }, { sec_asn1_integer, offsetof(myrsapublickey,m_exponent), }, { 0, } }; prarenapool *arena; /* * point inpubkey.m_modulus and m_exponent at the data, and * then set their types to unsigned integers. */ inpubkey.m_modulus.type = siunsignedinteger; inpubkey.m_exponent.type = siunsignedinteger; arena = port_newarena(der_default_chunksize); sec_asn1encodeitem(arena, &derpubkey, &inpubkey, myrsapublickeytemplate); pubkey = seckey_importderpublickey(&derpubkey, ckk_rsa); port_freearena(arena, pr_false); public keys may be extracted from certificates. given a certficate (certcertificate *), use cert_extractpublickey() to extract its public key. the returned public key may be used after the certificate is destroyed. when the keys a...
OLD SSL Reference
ost important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them. additional types are described with the functions that use them or in the header files. types and structures certcertdbhandle certcertificate pk11slotinfo secitem seckeyprivatekey secstatus managing secitem memory secitem_freeitem secitem_zfreeitem chapter 4 ssl functions this chapter describes the core ssl functions. ssl initialization functions nss_init nss_initreadwrite ...
... seckey_getdefaultkeydb seckey_destroyprivatekey chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 fu...
... seckey_getdefaultkeydb seckey_destroyprivatekey chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communica...
... seckey_getdefaultkeydb seckey_destroyprivatekey chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cr...
XUL Accessibility
elements. name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulselectcontrolitemelement interface then it is used label property if the element doesn't implement nsidomxulselectcontrolelement then label attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content. <label value="it's label for control" control="control" /> <hbox role="grouping" id="contr...
...bel attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content. ...
...label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content. ...
...e control attribute, if the label element is found then use value attribute or its content. ...
Querying Places
by_annotation_ascending = 15 const unsigned short sort_by_annotation_descending = 16 const unsigned short results_as_uri = 0 const unsigned short results_as_visit = 1 const unsigned short results_as_full_visit = 2 (not yet implemented -- see bug 320831) attribute unsigned short sortingmode attribute autf8string sortingannotation attribute unsigned short resulttype attribute boolean excludeitems attribute boolean excludequeries attribute boolean excludereadonlyfolders attribute boolean expandqueries attribute boolean includehidden attribute boolean showsessions attribute unsigned long maxresults const unsigned short query_type_history = 0 const unsigned short query_type_bookmarks = 1 const unsigned short query_type_unified = 2 (not yet implemented -- see bug 378798) attribute ...
...ers all the results. (in other words, the keywords from the first query are anded with all queries.) keywords from subsequent query objects are ignored. this is bug 320332. bookmark queries there is a quick-start for doing simple bookmark queries in retrieving part of the bookmarks tree. the contents of bookmark folders can be retrieved by setting the "folders" member in the query object. ...
...ng the "folders" member in the query object. this item is an array of folder ids from the bookmark service. typically, you will only have one folder id in this list, which will given you the contents of that folder. you can set multiple folders and the result will be the intersection of all the folders. for sorting, you will generally want to use sort_by_none (the default) since this will return items in their "natural" order as specified by the user in the bookmarks manager. other sortings will work, however. for bookmark queries you will generally want no query parameters to retrieve all items from the requested folder(s). when you specify exactly one folder and no query parameters, the system will be more efficient querying and keeping the results up-to-date since this maps to exactly one...
... = node.queryinterface(ci.nsinavhistoryqueryresultnode); dump("query, place uri = " + query.uri + "\n"); break; case node.result_type_folder: // note that folder nodes are of type nsinavhistorycontainerresultnode by default, but // can be qi'd to nsinavhistoryqueryresultnode to access the query and options that // created it. dump("folder " + node.title + " id = " + node.itemid + "\n"); break; case node.result_type_separator: dump("-----------\n"); break; } the result view interface if you are mapping a result into ui, you can implement the nsinavhistoryresultviewer interface and attach it to the result with the nsinavhistoryresult.viewer attribute. this viewer will be called when the result tree changes, either as a result of user action or as a resu...
Observer Notifications
e-response" is fired, but it will not always appear. download manager these topics indicate that events related to the download manager have occurred. topic description download-manager-ui-done called when the list of downloads in the download manager windows finishes updating. this can happen multiple times, such as when the window first opens, when multiple items are removed, and when entering private browsing mode. download-manager-remove-download called when a download of the list is removed or all the list is cleared. the subject will be the download id wrapped in nsisupportspruint32, for one download removed, or null for multi download remove, for example when the download list is cleared. extension manager note: these notificati...
... note: these notifications are no longer available starting with gecko 2.0, instead use addonmanager.addaddonlistener() to receive similar events. this topic indicates when the extension manager performs some action. note that any action will be taken the next time the application starts. see nsiextensionmanager for details. ...
...e addonmanager.addaddonlistener() to receive similar events. this topic indicates when the extension manager performs some action. note that any action will be taken the next time the application starts. see nsiextensionmanager for details. topic data description em-action-requested item-installed a new extension has been installed. em-action-requested item-upgraded a different version of an existing extension has been installed. ...
...forms some action. note that any action will be taken the next time the application starts. see nsiextensionmanager for details. topic data description em-action-requested item-installed a new extension has been installed. em-action-requested item-upgraded a different version of an existing extension has been installed. em-action-requested item-uninstalled an addon has been marked to be uninstalled. em-action-requested item-enabled an addon has been enabled. em-action-requested item-disabled an addon has been disabled. em-action-requested item-cancel-action a previous action has been cancelled. idle service this topic indicates when actions related to the idle service, provided by ...
GroupPosition
apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
... apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
... apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
... apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. refer to accessible web specifications to get an idea what elements expose group information. ...
nsIDroppedLinkHandler
boolean candroplink( in nsidomdragevent aevent, in prbool aallowsamedocument ); parameters aevent a dragenter or dragover event. aallowsamedocument if false, drops are only allowed if the document of the source of the drag is different from the destination. this check includes any parent, sibli...
.... droplinks() given a drop event, determines the link being dragged. if non-empty links array is returned the caller can, for instance, load it. if empty links array is returned, there is no valid link to be dropped. ...
...turned, there is no valid link to be dropped. void droplinks( in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks ); parameters aevent a drop event. ...
... nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks ); parameters aevent a drop event. ...
nsIFeedProgressListener
void handleentry( in nsifeedentry entry, in nsifeedresult result ); parameters entry pointer to an nsifeedentry containing information about the entry that was just processed. result pointer to...
... overview void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void reporterror(in astring errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed. if the document is a standalone item or entry, the handlefeedatfirstentry() method will not already have been called, and the received nsifeedentry will have a null parent value. void handleentry( in nsifeedentry entry, in nsifeedresult result ); parameters entry pointer to an nsifeedentry containing information about the entry that was just processed. result pointer to an nsifeedresult containing the current informatio...
...eived nsifeedentry will have a null parent value. void handleentry( in nsifeedentry entry, in nsifeedresult result ); parameters entry pointer to an nsifeedentry containing information about the entry that was just processed. result pointer to an nsifeedresult containing the current information about the feed being processed. ...
... void handlefeedatfirstentry( in nsifeedresult result ); parameters result an nsifeedresult describing the feed at the point at which the first entry is found, but before processing it. ...
nsIHTMLEditor
noutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignor...
...reasefontsize(); parameters none. dodrag() transfers the relevant data (as appropriate) to a transferable so it can later be dropped. void dodrag( in nsidomevent aevent ); parameters aevent getalignment() returns what alignment is in the selection. void getalignment( out boolean amixed, out short aalign ); parameters amixed true if there is more than one type of list item, or if there is some list and non-list. aalign enum value for first encountered alignment (left/center/right) getbackgroundcolorstate() getfontcolorstate() returns what font face is in the selection. astring getbackgroundcolorstate( out boolean amixed ); parameters amixed true if there is more than one font color. return value color string. "" is returned for none. getelementorp...
...rty aattribute avalue afirst aany aall return value getlinkedobjects() find all the nodes in the document which contain references to outside uris (for example a href, img src, script src, and so on.) the objects in the array will be type nsiurirefobject. nsisupportsarray getlinkedobjects(); parameters none. return value anodelist the linked nodes found. getlistitemstate() getlistitemstate returns what list item type is in the selection. void getlistitemstate( out boolean amixed, out boolean ali, out boolean adt, out boolean add ); parameters amixed true if there is more than one type of list item, or if there is some list and non-list. ali true if "li" list items are selected. adt true if "dt" list items are selected. add true if "dd" ...
... getliststate() returns what list type is in the selection. void getliststate( out boolean amixed, out boolean aol, out boolean aul, out boolean adl ); parameters amixed true if there is more than one type of list, or if there is some list and non-list. aol the company that employs me. no, really, it is true if an "ol" list is selected. ...
nsINavHistoryQuery
asking for things that do have a given annotation is a little different. it also includes things that have never been visited. this allows place queries to be returned (which might include bookmark folders -- use the bookmark service's getfolderuri) as well as anything else that may have been tagged with an annotation. this will only work for results_as_uri since there will be no visits for these items. begintime prtime begin time range for results (inclusive). begintimereference long one of the constants time_relative_* which indicates how to interpret the corresponding begin time value. domain autf8string this is the host or domain name (controlled by domainishost). when domainishost, domain only does exact matching on host names. otherwise, it will return anything whose host name ends...
...er or not, the corresponding begin time is considered. hasdomain boolean read only: whether or not, domain exists. hasendtime boolean read only: whether or not, the corresponding end time is considered. hassearchterms boolean read only: whether or not, text search terms exists. hasuri boolean read only: whether or not, uri exists. maxvisits long set upper limits for how many times an item has been visited. the default value is "-1", and in that case all items are matched regardless of their visit count. minvisits long set lower limits for how many times an item has been visited. the default value is "-1", and in that case all items are matched regardless of their visit count. onlybookmarked boolean when set, returns only bookmarked items, when unset, returns anything. setti...
...ivariant a list of tags to use for filtering query results. this attribute must be an array of strings. duplicate tags may be specified, but when reading the list, only unique tags are returned. when called as a getter, this returns an array of strings sorted in ascending lexicographical (alphabetical) order. this array may be empty, in which case no filtering by tags is performed. to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistoryservice.executequeries(). tagsarenot boolean if true, the results include only items that are not tagged with the specified tags. if false, only tags in the tags list are included in the results. uri nsiuri this is a uri to match, to, for example, find out ever...
...olders. this optional parameter was required prior to gecko 2.0. folders the retrieved folders. setfolders() this method sets the folders with the given folder count. void setfolders( [const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount ); parameters count the count of the folders. folders the folders to be set. clone() this method creates a new query item with the same parameters of this one. nsinavhistoryquery clone(); parameters none. return value returns the newly created cloned query. gettransitions() get the transitions set for this query. void gettransitions( out unsigned long count, optional [retval,array,size_is(count)] out unsigned long transitions ); parameters count optional the number of transitions transitions missing descript...
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. ...
... 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. ...
...ntentview 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 getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the specified content item. long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index. return value...
...he element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the specified content item. long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index. return value a non-negative integer row index if the row was found within the tree. returns -1 if the item was not found. getitematindex() retrieve the content item associated with the specified index. nsidomelement getitematindex( in long index ); parameters index the 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 does not apply to trees with flags="dontbuildcontent". see also ...
nsIXULWindow
n in case it needs to quit. method overview void addchildwindow(in nsixulwindow achild); void applychromeflags(); native code only! void assumechromeflagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome. contextflags pruint32 contextflags are from nsiwindowcreator2. docshell nsidocshell the docshell owning the x...
...description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome. contextflags pruint32 contextflags are from nsiwindowcreator2. docshell nsidocshell the docshell owning the xul for this window. read only. intrinsicallysized boolean indicates if this window is instrinsically sized. primarycontentshell nsidocshelltreeitem the primary content shell. note: that this is a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. read only. xulbrowserwindow nsixulbrowserwindow provides access to the ...
...appshell the app shell passed to nsiappshellservice's createtoplevelwindow method. return value the newly minted window. in the case of a content window, the function creates a browser window and waits for it to load. you can then load a document into the window's primary content shell. getcontentshellbyid() the content shell specified by the supplied id. ...
...wser window and waits for it to load. you can then load a document into the window's primary content shell. getcontentshellbyid() the content shell specified by the supplied id. note: that this is a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element. return value the tree item corresponding to the given id, if any. removechildwindow() tell this window that it has lost a child xul window. note that xul window...
DOM Inspector FAQ - Firefox Developer Tools
plication use), then locate it in the inspect chrome document menu. why do some nodes in the document dom nodes viewer appear in red? these nodes are anonymous content nodes, meaning they are not in the dom generated by the original document. okay, what if i don't want to see those anonymous nodes? you can hide anonymous nodes in inspector by unchecking the view > show anonymous content menu item. i see a lot of empty #text nodes that i don't see in the original document. what are they, why are they there, and how can i get rid of them? those text nodes are actually the newlines and spacing between the elements. please see bug 26179 for a lengthy discussion of why they are there. the good news is, you can hide these whitespace nodes in inspector by unchecking the view > show whitespace...
...ot of empty #text nodes that i don't see in the original document. what are they, why are they there, and how can i get rid of them? those text nodes are actually the newlines and spacing between the elements. please see bug 26179 for a lengthy discussion of why they are there. the good news is, you can hide these whitespace nodes in inspector by unchecking the view > show whitespace nodes menu item. note that not all empty text nodes will be hidden. those nodes whose white-space css property value prevents the user-agent from collapsing sequences of whitespace will not be hidden. i'm having trouble finding a specific node in the dom tree. isn't there is a faster way to find it than navigating the tree? sure. you can do a search via the node's name, id, or an attribute/value pair. choose t...
...pty text nodes will be hidden. those nodes whose white-space css property value prevents the user-agent from collapsing sequences of whitespace will not be hidden. i'm having trouble finding a specific node in the dom tree. isn't there is a faster way to find it than navigating the tree? sure. you can do a search via the node's name, id, or an attribute/value pair. choose the find nodes... menu item from the edit menu in an inspector window that is inspecting the document you wish to search, and enter your search criteria there. the dom inspector's search uses javascript regexps to find nodes for tag and attribute searches, and will do partial matching. for example, if you search nodes' tags for "tab", you'll get matches for tabpanel and tabbox as well as tab. to restrict the search, you can...
...g-of-string and end-of-string markers; e.g., searching nodes for "^tab$" will return only nodes whose names are exactly "tab". or, if you do not know anything about the node, you can try to select it by clicking on it. scroll the node into view, choose the select-by-click toolbar button, and then click on the element you wish to inspect. the edit menu also includes a select element by click menu item. how do i inspect pseudo-classes and pseudo-elements in the css rules viewer? dom inspector allows you to force the :hover, :active, and :focus pseudo-classes to apply to a given node. from the dom nodes viewer, select the node and bring up the context menu. you should notice the set pseudo-classes menu item, which will allow you to set the content state for the aforementioned pseudo-classes. ...
Introduction to DOM Inspector - Firefox Developer Tools
dom inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own xulrunner app. dom inspector can serve as a sanity check to verify the state of the dom, or it can be used to manipulate the dom by hand, if desired. ...
...ly be already open and displayed in this list. the dom inspector keeps track of all the windows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist. inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url menuitem in the file menu, or by just entering a url into the dom inspector's address bar and clicking inspect or pressing enter. for example, you can enter http://www.mozilla.org in the address bar and see the dom structure of the mozilla.org home page. you should not use this approach to inspect chrome documents. instead, ensure that the document loads via normal means and use the inspect chrome docume...
...used in conjunction with the style sheets viewer, the css rules viewer lists all recognized rules from that style sheet in order. properties may be also be edited. rules applying to pseudo-elements do not appear. the javascript object viewer gives a hierarchical tree of the object pane's subject. the javascript object viewer also allows javascript to be evaluated by selecting the appropriate menuitem in the context menu. basic actions of the dom nodes viewer selecting elements by click another powerful interactive feature of the dom inspector is that when you have the dom inspector open and have enabled this functionality by choosing edit > select element by click or by clicking the little magnifying glass icon in the upper left portion of the dom inspector application, you can click anywh...
...ility the dom inspector gives you to dynamically update information reflected in the dom about web pages, user interface, and other elements. note that when the dom inspector displays information about a particular node or subtree, it presents individual nodes and their values (in the dom, attributes are subnodes of elements, typically) in an active list. you can perform actions on the individual items in this list from the context menu and the edit menu, both of which contain menutimes that allow you edit the values of those attributes. this interactivity allows you to shrink and grow element size, change icons, and do other layout-tweaking updates—all without actually changing the dom as it is defined in the file on disk. loving the inspector the dom inspector can take some figuring o...
UI Tour - Firefox Developer Tools
urces are organized by origin, and under that they're organized by the directory structure from which they are served. you can search for a file using ctrl + p (cmd + p on a mac). web extensions are listed in the source list pane using the extension's name. there are several context menu options available for individual files and folders or groups; typically viewed by right-clicking on the item. for files, the following context menu options are available: copy source uri copies the full identifier of the file to the clipboard. ignore source causes the debugger to skip the file when "stepping into" functions; this can be helpful for avoiding stepping into libraries used by your code. when a file is ignored, it has a small eye icon next to it in place of its regular icon. download...
...he file when "stepping into" functions; this can be helpful for avoiding stepping into libraries used by your code. when a file is ignored, it has a small eye icon next to it in place of its regular icon. download file opens a file dialog so you can save the file locally. for folders and groups, the following context menu options are available: collapse all collapses all subfolders of the item. expand all expands all subfolders of the item. set directory root changes the source list view so that only that item and its children are visible. the name of the selected directory is shown at the top of the source list pane; clicking this name reverts the pane to showing all source items. ignore (since firefox 76) ignore files in this directory causes all files within the selected di...
... and line number. clicking a line selects the corresponding line in the source pane. note: if you click step over (f10) after changing the selected line in the source pane, the debugger executes until reaching the line following the newly-selected line (disregarding whatever line the debugger originally stopped at). right-clicking in the call stack pane opens a context menu with the following items: restart frame restarts execution at the beginning of the current frame. enable framework grouping collects items belonging to a framework into a collapsible group (for example, jquery in the screenshot above). when grouping is enabled, the menu option changes to disable framework grouping. copy source uri copies the full identifier of the source file to the clipboard. ignore source causes...
...k grouping. copy source uri copies the full identifier of the source file to the clipboard. ignore source causes the debugger to skip the file when "stepping into" functions. any stack frames from the ignored source file are hidden in the call stack pane. (to remove this restriction, choose unignore source in the context menu of the sources list or the source pane.) copy stack trace copies all items in the call stack (including their uris and line number) to the clipboard. scopes in the right-hand pane you'll see a label "scopes" with a disclosure arrow next to it. when the debugger's paused, you'll be able to expand this section to see all objects that are in scope at this point in the program: objects are organized by scope: the most local appears first, and the global scope (window, ...
Using channel messaging - Web APIs
this saves the transferred port and register an onmessage handler that will be called each time a message is p...
...this saves the transferred port and register an onmessage handler that will be called each time a message is passed through our messagechannel. when a m...
...this saves the transferred port and register an onmessage handler that will be called each time a message is passed through our messagechannel. when a message is received from the main page we create a ...
...port2.postmessage('message received by iframe: "' + e.data + '"'); } when the initial message is received from the main page via the window.postmessage method, we run the initport function. this saves the transferred port and register an onmessage handler that will be called each time a message is passed through our messagechannel. when a message is received from the main page we create a list item and insert it in the unordered list, setting the textcontent of the list item equal to the event's data attribute (this contains the actual message). next, we post a confirmation message back to the main page via the message channel by calling messageport.postmessage on messagechannel.port2 that was initially transferred to the iframe. receiving the confirmation in the main page returning to ...
ChildNode.after() - Web APIs
Web › API › ChildNode › after
ethod is not scoped into the with statement. see symbol.unscopables for more information. ...
...ped into the with statement. see symbol.unscopables for more information. ...
...h(node) { after("foo"); } // referenceerror: after is not defined polyfill you can polyfill the after() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ? argitem : document.createtextnode(st...
...', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ? ...
ChildNode.before() - Web APIs
Web › API › ChildNode › before
is not scoped into the with statement. see symbol.unscopables for more information. ...
...nto the with statement. see symbol.unscopables for more information. ...
...) { before("foo"); } // referenceerror: before is not defined polyfill you can polyfill the before() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ? argitem : document.createtextnode(...
... living standard initial definition. ...
ContentIndex.getAll() - Web APIs
the getall() method of the contentindex interface returns a promise that resolves with an iterable list of content index entries. syntax var indexedcontent = contentindex.getall(); parameters this method receives no parameters. 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. url: a string containing the url of the corresponding html document. needs to be under the scope of the cu...
...y string, this is the 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. 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. async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const...
... un...
... unknown initial definition. ...
DataTransfer.mozGetDataAt() - Web APIs
the datatransfer.mozgetdataat() method is used to retrieve an item in the drag event's data transfer object, based on a given format and index. this method returns null if the specified item does not exist or if the index is not in the range from zero to the number of items minus one. note: this method is gecko-specific. syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. if the specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. function drop_handler(event) {...
...ta to retrieve from the drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. if the specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. ...
...he drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. if the specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. ...
...ata to retrieve. return value nsivariant the data item requested. if the specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. ...
DataTransfer.mozTypesAt() - Web APIs
the datatransfer.moztypesat() method returns a list of the format types that are stored for an item at the specified index. if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. note: this method is gecko-specific. syntax nsivariant datatransfer.moztypesat(index); arguments index a unsigned long that is the index of the data for which to retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
...of the data for which to retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
... to retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
... (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
Introduction to the DOM - Web APIs
uded together in this reference. in 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 re...
... there are also some common terminology considerations to keep in mind. ...
... there are also some common terminology considerations to keep in mind. ...
... 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 to an array of dom nodes as a nodelist. ...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
se the extra whitespace that does make it to the layout is helpful to separate the words in the sentence. it gets more interesting however when you start using inline-block elements. these elements behave like inline elements on the outside, and blocks on the inside, and are often used to display more complex pieces of ui than just text, side-by-side on the same line, for example navigation menu items. because they are blocks, many people expect that they will behave as such, but really they don’t. if there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words in text. consider this example (again, the whitespace characters in the html are marked so they are visible): .people-list { list-style-type: none; ...
...e to control any spacing yourself. the firefox devtools html inspector will highlight text nodes, and also show you exactly what area the elements are taking up — useful if you are wondering what is causing the problem, and are maybe thinking you've got some extra margin in there or something! there are a few ways of getting around this problem: use flexbox to create the horizontal list of items instead of trying an inline-block solution. this handles everything for you, and is definitely the preferred solution: ul { list-style-type: none; margin: 0; padding: 0; display: flex; } if you need to rely on inline-block, you could set the font-size of the list to 0. this only works if your blocks are not sized with ems (based on the font-size, so the block size would also end up bei...
...: flex; } if you need to rely on inline-block, you could set the font-size of the list to 0. this only works if your blocks are not sized with ems (based on the font-size, so the block size would also end up being 0). rems would be a good choice here: ul { font-size: 0; ... } li { display: inline-block; width: 2rem; height: 2rem; ... ...
...sed on the font-size, so the block size would also end up being 0). rems would be a good choice here: ul { font-size: 0; ... } li { display: inline-block; width: 2rem; height: 2rem; ... } or you could set negative margin on the list items: li { display: inline-block; width: 2rem; height: 2rem; margin-right: -0.25rem; } you can also solve this problem by putting your list items all on the same line in the source, which causes the whitespace nodes to not be created in the first place: <li></li><li></li><li></li><li></li><li></li> dom traversal and whitespace when trying to do dom manipulation in javascript, you can also encounter problems because of whitespace nodes. for example, if you have a reference to a parent node and want to affect its first element child usin...
Element: mouseenter event - Web APIs
when the mouse exits its content area), the mouseenter event acts in a very similar way to the css :hover pseudo-class. examples the mouseover documentation has an example illustrating the difference between mouseover and mouseenter. mouseenter the following trivial example uses the mouseenter event to change the border on the div when the mouse enters the space alloted to it. it then adds an item to the list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the div to make it more visible. #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid...
...mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a ne...
... working draft document object model (dom) level...
...usetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a new li element var newlistitem = document.createelement("li"); // add the text node to the li element newlistitem.appendchild(newtextnode); // add the newly created list item to list unorderedlist.appendchild(newlistitem); } result specifications specification status ui eventsthe definition of 'mouseenter' in that specification. working draft document object model (dom) level 3 events specificationthe definition of 'mouseenter' in that specification. obsolete...
Element: mouseleave event - Web APIs
epest element of the dom tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root. examples the mouseout documentation has an example illustrating the difference between mouseout and mouseleave. mouseleave the following trivial example uses the mouseenter event to change the border on the <div> when the mouse enters the space alloted to it. it then adds an item to the list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible. #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementby...
...mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a ne...
... working draft document object model (dom) level...
...usetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a new li element var newlistitem = document.createelement("li"); // add the text node to the li element newlistitem.appendchild(newtextnode); // add the newly created list item to list unorderedlist.appendchild(newlistitem); } result specifications specification status ui eventsthe definition of 'mouseleave' in that specification. working draft document object model (dom) level 3 events specificationthe definition of 'mouseleave' in that specification. obsolete...
Element: mouseover event - Web APIs
ement when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the element or one of its child elements. bubbles yes cancelable yes interface mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
...ing device (such as a mouse or trackpad) is used to move the cursor onto the element or one of its child elements. bubbles yes cancelable yes interface mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
...s a mouse or trackpad) is used to move the cursor onto the element or one of its child elements. bubbles yes cancelable yes interface mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
... workin...
IDBRequest: error event - Web APIs
: // open the database const dbopenrequest = window.indexeddb.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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', even...
...index('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); 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); 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 = w...
...deventlistener(): // 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db...
...bjectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('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'); 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); objectstorerequest.onerror = () => { console.log(`error adding new item: ${newitem.tasktitle}`); }; }; ...
IDBTransaction.commit() - Web APIs
e db transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...action transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...ransaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...= '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("myobjstore"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // 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>'; }; // force the changes to be committed to the database asap transaction.commit(); specification specification status comment indexed database api draftthe definition of 'idbtransaction.commit()' in that specification. recommenda...
IDBTransaction: complete event - Web APIs
deventlistener(): // 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db...
...nsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.addeventlistener('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 ...
...omplete 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db...
... dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.oncomplete = 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); }; ...
IDBTransaction: error event - Web APIs
n (this will occur if, for example, a record with the given 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
...teindex('month', 'month', { unique: false }); objectstore.createindex('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.addeventlistener('error', () => { console.log(`error adding 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.ope...
...tem); }; 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
...objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('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 = () => { console.log(`error adding 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); }; ...
Using IndexedDB - Web APIs
ransaction("customers").objectstore("customers"); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if (cursor) { console.log("name for ssn " + cursor.key + " is " + cursor.value.name); cursor.continue(); } else { console.log("no more entries!"); } }; the opencursor() function takes several arguments. first, you can limit the range of items that are retrieved by using a key range object that we'll get to in a minute. second, you can specify the direction that you want to iterate. in the above example, we're iterating over all objects in ascending order. the success callback for cursors is a little special. the cursor object itself is the result of the request (above we're using the shorthand, so it's event.target.result). then the ...
...wser at any time, this means that you cannot rely upon any particular transaction to complete, and on older browsers, you don't even get told when they don't complete. there are several implications of this behavior. first, you should take care to always leave your database in a consistent state at the end of every transaction. for example, suppose that you are using indexeddb to store a list of items that you allow the user to edit. you save the list after the edit by clearing the object store and then writing out the new list. if you clear the object store in one transaction and write the new list in another transaction, there is a danger that the browser will close after the clear but before the write, leaving you with an empty database. to avoid this, you should combine the clear and the ...
... var i = 0; req = store.opencursor(); req.onsuccess = function(evt) { var cursor = evt.target.result; // if the cursor is pointing at something, ask for the data if (cursor) { console.log("displaypublist cursor:", cursor); req = store.get(cursor.key); req.onsuccess = function (evt) { var value = evt.target.result; var list_item = $('<li>' + '[' + cursor.key + '] ' + '(biblioid: ' + value.biblioid + ') ' + value.title + '</li>'); if (value.year != null) list_item.append(' - ' + value.year); if (value.hasownproperty('blob') && typeof value.blob != 'undefined') { ...
...ist_item.append(' - ' + value.year); if (value.hasownproperty('blob') && typeof value.blob != 'undefined') { var link = $('<a href="' + cursor.key + '">file</a>'); link.on('click', function() { return false; }); link.on('mouseenter', function(evt) { setinviewer(evt.target.getattribute('href')); }); list_item.append(' / '); list_item.append(link); } else { list_item.append(" / no attached file"); } pub_list.append(list_item); }; // move on to the next object in store cursor.continue(); // this counter serves only to create distinct ids i++; } else { console.log("no more entries"); } ...
ParentNode.append() - Web APIs
Web › API › ParentNode › append
ol.unscopables for more information. ...
...or more information. ...
...{ append("foo") } // referenceerror: append is not defined polyfill you can polyfill the append() method in internet explorer 9 and higher with the following code: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ? argitem : document.createtextnode(...
... living standard initial definition. ...
ParentNode.prepend() - Web APIs
the with statement. see symbol.unscopables for more information. ...
...ent. see symbol.unscopables for more information. ...
...lement("div"); with(parent) { prepend("foo"); } // referenceerror: prepend is not defined polyfill you can polyfill the prepend() method if it's not available: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ? argitem : document.createtextnod...
... living standard initial definition. ...
Using the Payment Request API - Web APIs
this returns a promise that fulfills...
...this returns a promise that fulfills with a paymentresponse object if the pay...
... privacy settings. the website does not know whether they can make // a fast payment, so pick a generic title. checkoutbutton.innertext = "checkout with w3c"; }); } note: see our customizing the payment button demo for the full code. checking before all prices are known if the checkout flow needs to know whether paymentrequest.canmakepayment() will return true even before all line items and their prices are known, you can instantiate paymentrequest with dummy data and pre-query .canmakepayment(). if you call .canmakepayment() multiple times, keep in mind that the first parameter to the paymentrequest constructor should contain the same method names and data. // the page has loaded. should the page use paymentrequest? // if paymentrequest fails, should the page fallback to manu...
...ser may have turned off query ability in their privacy settings. // let's use paymentrequest by default and fallback to legacy // web form based checkout. shouldcallpaymentrequest = true; fallbacktolegacyonpaymentrequestfailure = true; }); // user has clicked on the checkout button. we know // what's in the cart, but we don't have a `checkout` object. function oncheckoutbuttonclicked(lineitems) { callservertoretrievecheckoutdetails(lineitems); } // the server has constructed the `checkout` object. now we know // all of the prices and shipping options. function onservercheckoutdetailsretrieved(checkoutobject) { if (shouldcallpaymentrequest) { const request = new paymentrequest(supportedpaymentmethods, checkoutobject); request.show().then(function(paymentresponse) { /...
Range.extractContents() - Web APIs
o cloned, which can lead to an invalid document if a partially-selected node is extracted and appended to the document. partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid. ...
...cument. partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid. syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. ...
... fragment valid. syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. select one or more item, and then click "swap" to move them to the opposite container. ...
...range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. select one or more item, and then click "swap" to move them to the opposite container. ...
TouchList.identifiedTouch() - Web APIs
specifications not part of any specification. ...
... specifications not part of any specification. ...
... specifications not part of any specification. ...
... specifications not part of any specification. ...
WebGLRenderingContext.getParameter() - Web APIs
when using the webgl_compressed_texture_s3tc extension: ext.compressed_rgb_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt3_ext ext.compressed_rgba_s3tc_dxt5_ext when using the webgl_...
...gl.cull_face_mode glenum gl.front, gl.back or gl.front_and_back. see also cullface gl.current_program webglprogram or null see useprogram. gl.depth_bits glint gl.depth_clear_value glfloat gl.depth_func glenum gl.depth_range float32array (with 2 elements) gl.depth_test glboolean gl.depth_writemask glboolean gl.dither glboolean gl.element_array_buffer_binding webglbuffer gl.framebuffer_binding webglframebuffer or null null corresponds to a binding to the default framebuffer. see also bindframebuffer. gl.front_face glenum gl.cw or gl.ccw. see also frontface. gl.generate_mipmap_hint glenum gl.fastest, gl.ni...
...cissor_test glboolean gl.shading_language_version domstring gl.stencil_back_fail glenum gl.stencil_back_func glenum gl.stencil_back_pass_depth_fail glenum gl.stencil_back_pass_depth_pass glenum gl.stencil_back_ref glint gl.stencil_back_value_mask gluint gl.stencil_back_writemask gluint gl.stencil_bits glint gl.stencil_clear_value glint gl.stencil_fail glenum gl.stencil_func glenum gl.stencil_pass_depth_fail glenum gl.stencil_pass_depth_pass glenum gl.stencil_ref glint gl.stencil_test glboolean gl.stencil_value_mask gluint ...
... gl.stencil_bits glint gl.stencil_clear_value glint gl.stencil_fail glenum gl.stencil_func glenum gl.stencil_pass_depth_fail glenum gl.stencil_pass_depth_pass glenum gl.stencil_ref glint gl.stencil_test glboolean gl.stencil_value_mask gluint gl.stencil_writemask gluint gl.subpixel_bits glint gl.texture_binding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean ...
WebGL constants - Web APIs
l_face_mode 0x0b45 passed to getparameter to get the current value of cullface. should return front, back, or front_and_back front_face 0x0b46 passed to getparameter to determine the current value of frontface. should return cw or ccw. depth_range 0x0b70 passed to getparameter to return a length-2 array of floats giving the current depth range. depth_writemask 0x0b72 passed to getparameter to determine if the depth write mask is enabled. depth_clear_value 0x0b73 passed to getparameter to determine the current depth clear value. depth_func 0x0b74 passed to getparameter to get the current depth function. returns never, always, less, equal, lequal, greater, gequal, or notequal. stencil_clear_value 0x0b91 ...
...decr_wrap. stencil_pass_depth_pass 0x0b96 passed to getparameter to get the current stencil fail function should the depth buffer test pass. should return keep, replace, incr, decr, invert, incr_wrap, or decr_wrap. stencil_ref 0x0b97 passed to getparameter to get the reference value used for stencil tests. ...
...ncil tests. stencil_value_mask 0x0b93 stencil_writemask 0x0b98 stencil_back_func 0x8800 stencil_back_fail 0x8801 stencil_back_pass_depth_fail 0x8802 stencil_back_pass_depth_pass 0x8803 stencil_back_ref 0x8ca3 stencil_back_value_mask 0x8ca4 stencil_back_writemask 0x8ca5 viewport 0x0ba2 returns an int32array with four elements for the current viewport dimensions. scissor_box 0x0c10 returns an int32array with four elements for the current scissor box dimensions. ...
...ck_ref 0x8ca3 stencil_back_value_mask 0x8ca4 stencil_back_writemask 0x8ca5 viewport 0x0ba2 returns an int32array with four elements for the current viewport dimensions. scissor_box 0x0c10 returns an int32array with four elements for the current scissor box dimensions. ...
Keyboard-navigable JavaScript widgets - Accessibility
stificationmenu" title="justication" tabindex="-1"> <li id="left" tabindex="-1">left</li> <li id="center" tabindex="-1">centered</li> <li id="right" tabindex="-1">right</li> <li id="justify" tabindex="-1">justify</li> </ul> </li> </ul> disabled controls when a custom control becomes disabled, remove it from the tab order by setting tabindex="-1". note that disabled items within a grouped widget (such as menu items in a menu) should remain navigable using arrow keys. managing focus inside groups when a user tabs away from a widget and returns, focus should return to the specific element that had focus, for example, the tree item or grid cell. there are two techniques for accomplishing this: roving tabindex: programmatically moving focus aria-activedescendan...
...urn to the specific element that had focus, for example, the tree item or grid cell. there are two techniques for accomplishing this: roving tabindex: programmatically moving focus aria-activedescendant: managing a 'virtual' focus technique 1: roving tabindex setting the tabindex of the focused element to "0" ensures that if the user tabs away from the widget and then returns, the selected item within the group retains focus. note that updating the tabindex to "0" requires also updating the previously selected item to tabindex="-1". this technique involves programmatically moving focus in response to key events and updating the tabindex to reflect the currently focused item. to do this: bind a key down handler to each element in the group, and when an arrow key is used to move to anoth...
...cendant to track a "virtual" focus. (for more information about aria, see this overview of accessible web applications and widgets.) the aria-activedescendant property identifies the id of the descendent element that currently has the virtual focus. the event handler on the container must respond to key and mouse events by updating the value of aria-activedescendant and ensuring that the current item is styled appropriately (for example, with a border or background color). see the source code of this aria radiogroup example for a direct illustration of how this works. general guidelines use onkeydown to trap key events, not onkeypress ie will not fire keypress events for non-alphanumeric keys. use onkeydown instead. ensure that keyboard and mouse produce the same experience to ensure tha...
...ure that the keyboard can be used to activate elements, any handlers bound to mouse events should also be bound to keyboard events. for example, to ensure that the enter key will activate an element, if you have an onclick="dosomething()", you should bind dosomething() to the key down event as well: onkeydown="return event.keycode != 13 || dosomething();". always draw the focus for tabindex="-1" items and elements that receive focus programatically ie will not automatically draw the focus outline for items that programatically receive focus. choose between changing the background color via something like this.style.backgroundcolor = "gray"; or add a dotted border via this.style.border = "1px dotted invert". in the dotted border case you will need to make sure those elements have an invisible...
:disabled - CSS: Cascading Style Sheets
Web › CSS › :disabled
living standard no chan...
... living standard no change. html5the definition of ':disabled' in that specification. recommendation defines the semantics of html and forms.
... living standard no change. html5the definition of ':disabled' in that specification. recommendation defines the semantics of html and forms. selectors level 4the d...
... // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html living standardthe definition of ':disabled' in that specification. living standard no change. html5the definition of ':disabled' in that specification. recommendation defines the semantics of html and forms. selectors level 4the definition of ':disabled' in ...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
ash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? ...
...te-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? ...
...</li> </ul> </main> <footer> <p>this is my footer paragraph</p> </footer> :-webkit-any(header, main, footer) p:hover { color: red; cursor: pointer; } :-moz-any(header, main, footer) p:hover { color: red; cursor: pointer; } :matches(header, main, footer) p:hover { color: red; cursor: pointer; } :is(header, main, footer) p:hover { color: red; cursor: pointer; } let matcheditems; try { matcheditems = document.queryselectorall(':is(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':matches(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-webkit-any(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, ma...
...all(':matches(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-webkit-any(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, main, footer) p'); } catch(e) { console.log('your browser doesn\'t support :is(), :matches(), or :any()'); } } } } matcheditems.foreach(applyhandler); function applyhandler(elem) { elem.addeventlistener('click', function(e) { alert('this paragraph is inside a ' + e.target.parentnode.nodename); }); } simplifying list selectors the :is() pseudo-class can greatly simplify your css selectors. for example, the following css: /* 3-deep (or more) unordered lists use a square */ ol ol ul, ol ul ul, ol menu ...
Introduction to formatting contexts - CSS: Cascading Style Sheets
formatting contexts. the basics of how they behave and how you can make use of these behaviors are also introduced. everything on a page is part of a formatting context, or an area which has been defined to lay out content in a particular way. a block formatting context (bfc) will lay child elements out according to block layout rules, a flex formatting context will lay its children out as flex items, etc. each formatting context has specific rules about how layout behaves when in that context. block formatting contexts the outermost element in a document that uses block layout rules establishes the first, or initial block formatting context. this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout.
...s (including position: fixed or position: sticky) elements with display: inline-block table cells or elements with display: table-cell, including anonymous table cells created when using the display: table-* properties table captions or elements with display: table-caption block elements where overflow has a value other than visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict flex items grid items multicol containers elements with column-span set to all this is useful because a new bfc will behave much like the outermost document in that it becomes a mini-layout inside the main layout. a bfc contains everything inside it, float and clear only apply to items inside the same formatting context, and margins only c...
...ed scrollbars or clipped shadows when you use this property purely to create a bfc. in addition, it is potentially not very readable for a future developer, as it may not be obvious why you used overflow for this purpose. if you do this, it would be a good idea to comment the code to explain. explicitly creating a bfc using display: flow-root using display: flow-root (or display: flow-root list-item) on the containing block will create a new bfc without any other potentially problematic side-effects. with display: flow-root on the <div>, everything inside that container participates in the block formatting context of that container, and floats will not poke out of the bottom of the element. the name of the flow-root keyword refers to the fact that you're creating something that serves, i...
...<html> does), given how the new context is created and its flow layout functions. inline formatting contexts inline formatting contexts exist inside other formatting contexts and can be thought of as the context of a paragraph. the paragraph creates an inline formatting context inside which such things as <strong>, <a>, or <span> elements are used on text. the box model does not fully apply to items participating in an inline formatting context. in a horizontal writing mode line, horizontal padding, borders and margin will be applied to the element and push the text away left and right. however, margins above and below the element will not be applied. vertical padding and borders will be applied but may overlap content above and below as, in the inline formatting context, the line boxes wil...
Overview of CSS Shapes - CSS: Cascading Style Sheets
if you then apply a circle shape, the text would then wrap round the line of the circle. there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them. ...
...if you then apply a circle shape, the text would then wrap round the line of the circle. there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them. ...
...if you then apply a circle shape, the text would then wrap round the line of the circle. there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them. ...
...ape-margin property the shape-margin property adds a margin to shape-outside. this will further shorten the line boxes of any content wrapping the shape, pushing it away from the shape itself. in the example below we have added a shape-margin to a basic shape. change the margin to push the text further away from the path the shape would take by default. using generated content as the floated item in the examples above we have used images or a visible element to define the shape, meaning that you can see the shape on the page. instead, you might simply want to cause some text to flow along a non-rectangular invisible line. you can do this with shapes, however you will still need a floated item, which you can then make invisible. that could be a redundant element inserted into the document...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
. using the display property we can switch between block and inline. for example to make a heading inline we would use the following css: h1 { display: inline; } more recently we have gained css grid layout and flexbox. to access these we also use values of the display property — display: grid and display: flex. only when the value of display is changed do the children become flex or grid items and begin to respond to the other properties in the grid or flexbox specifications. changing an element's display value changes the formatting context of its direct children. what grid and flexbox demonstrate, however, is that an element has both an outer and an inner display type. the outer display type describes whether the element is block-level or inline-level. the inner display type descri...
...in relationship to other boxes in the layout. it’s as if you had applied display: block to the span, however we also get the changed behavior of the children. the live example below has a <span> with display: flex applied. it has become a block-level box taking up all available space in the inline direction. you can now use justify-content: space-between; to put this space between the two flex items. we can create inline flex containers. if you create a flex container using the single value of inline-flex you will have an inline-level box with flex children. the children behave in the same way as the flex children of a block-level container. the only thing that has changed is that the parent is now an inline-level box. it therefore behaves like other inline-level things, and doesn't take...
... to a fairly recent single value; display: flow-root. this value's only purpose is to create a new block formatting context (bfc). a bfc ensures that everything inside your box stays inside it, and things from outside the box cannot intrude into it. the most obvious use-case for creating a new bfc is to contain floats, and avoid the need for clearfix hacks. in the example below we have a floated item inside a container. the float is contained by the bordered box, which wraps it and the text alongside. if you remove the line display: flow-root then the float will poke out of the bottom of the box. if you are using firefox you can replace it with the newer display: block flow-root, which will achieve the same as the single flow-root value. the flow-root value makes sense if you think about b...
...ot therefore makes a lot of sense. you are creating a block formatting context, with a block-level box and children participating in normal flow. what about the matched pair display: inline flow-root? this is the new way of describing display: inline-block. the value display: inline-block has been around since the early days of css. the reason we tend to use it is to allow padding to push inline items away from an element, when creating navigation items for example, or when wanting to add a background with padding to an inline element as in the example below. an element with display: inline-block however, will also contain floats. it contains everything inside the inline-level box. therefore display: inline-block does exactly what display: flow-root does, but with an inline-level, rather t...
flex-grow - CSS: Cascading Style Sheets
Web › CSS › flex-grow
the flex-grow css property sets the flex grow factor of a flex item main size. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). ...
...ues */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the ot...
...s have the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and normally defined using the flex shorthand to ensure all values are set. formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 . d and e are flex-grow:2 .</h5> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</di...
... candidate recommendation initial definition ...
Event reference
ical reasons or because the permission was denied. resize the document view has been resized. scroll the document view or an element has been scrolled. clipboard events event name fired when cut the selection has been cut and copied to the clipboard copy the selection has been copied to the clipboard paste the item from the clipboard has been pasted keyboard events event name fired when keydown any key is pressed keypress any key (except shift, fn, or capslock) is in a pressed position (fired continuously). keyup any key is released mouse events event name fired when auxclick a pointing device button (any non...
...tandard events abortable fetch events event name fired when abort a dom request is aborted, i.e. using abortcontroller.abort(). ...
...ortable fetch events event name fired when abort a dom request is aborted, i.e. using abortcontroller.abort(). ...
...ter. checkboxstatechange xul the state of a checkbox has been changed either by a user action or by a script (useful for accessibility). close xul the close button of the window has been clicked. command xul an element has been activated. commandupdate xul a command update occurred on a commandset element. dommenuitemactive xul a menu or menuitem has been hovered or highlighted. dommenuiteminactive xul a menu or menuitem is no longer hovered or highlighted. popuphidden popupevent xul a menupopup, panel, or tooltip has been hidden. popuphiding popupevent xul a menupopup, panel, or tooltip is about to be hidden. popupshowing popupevent ...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
th the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content, or any element that accepts flow content, but not other <a> elements. ...
...g and ending tag are mandatory. permitted parents any element that accepts phrasing content, or any element that accepts flow content, but not other <a> elements. ...
...andatory. permitted parents any element that accepts phrasing content, or any element that accepts flow content, but not other <a> elements. ...
...s phrasing content, or any element that accepts flow content, but not other <a> elements. ...
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
iew <div> stating that no files have been selected. if files have been selected, we loop through each one, printing information about it into the preview <div>. things to note here: we use the custom validfiletype() function to check whether the file is of the correct type (e.g. the image types specified in the accept attribute). ...
...t out its name and file size into a list item inside the previous <div> (obtained from file.name and file.size). the custom returnfilesize() function returns a nicely-formatted version of the size in bytes/kb/mb (by default the browser reports the size in absolute bytes). generate a thumbnail preview of the image by calling url.createobjecturl(curfiles[i]). then, insert the image into the list item too by creating a new <img> and setting its src to the thumbnail. if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type. function updateimagedisplay() { while(preview.firstchild) { preview.removechild(preview.firstchild); } const curfiles = input.files; if(curfiles.length === 0) { const para = ...
...ld) { preview.removechild(preview.firstchild); } const curfiles = input.files; if(curfiles.length === 0) { const para = document.createelement('p'); para.textcontent = 'no files currently selected for upload'; preview.appendchild(para); } else { const list = document.createelement('ol'); preview.appendchild(list); for(const file of curfiles) { const listitem = document.createelement('li'); const para = document.createelement('p'); if(validfiletype(file)) { para.textcontent = `file name ${file.name}, file size ${returnfilesize(file.size)}.`; const image = document.createelement('img'); image.src = url.createobjecturl(file); listitem.appendchild(image); listitem.appendchild(para); } else { ...
...)) { para.textcontent = `file name ${file.name}, file size ${returnfilesize(file.size)}.`; const image = document.createelement('img'); image.src = url.createobjecturl(file); listitem.appendchild(image); listitem.appendchild(para); } else { para.textcontent = `file name ${file.name}: not a valid file type. update your selection.`; listitem.appendchild(para); } list.appendchild(listitem); } } } the custom validfiletype() function takes a file object as a parameter, then uses array.prototype.includes() to check if any value in the filetypes matches the file's type property. if a match is found, the function returns true. if no match is found, it returns false. // https://developer.mozilla.org/docs/web/media/forma...
Microformats - HTML: Hypertext Markup Language
nonical url p-street-address street number + name p-locality city/town/village p-country-name country name nested h-card example <div class="h-card"> <a class="p-name u-url" href="http://blog.lizardwrangler.com/" >mitchell baker</a> (<a class="p-org h-card" href="http://mozilla.org/" >mozilla foundation</a>) </div> parsed json: { "items": [{ "type": ["h-card"], "properties": { "name": ["mitchell baker"], "url": ["http://blog.lizardwrangler.com/"], "org": [{ "value": "mozilla foundation", "type": ["h-card"], "properties": { "name": ["mozilla foundation"], "url": ["http://mozilla.org/"] } }] } }] } note: the nested h-card has implied 'name' and 'url' properties, just like any ...
...ey thanks for making this microformats resource</p> <p> <a href="https://quickthoughts.jgregorymcverry.com/profile/jgmac1106">greg mcverry</a> published this <a class="u-url url" href="https://quickthoughts.jgregorymcverry.com/2019/05/31/hey-thanks-for-making-this-microformats-resource"><time class="dt-published" datetime="2019-05-31t14:19:09+0000">31 may 2019</time></a></p> </div> { "items": [ { "type": [ "h-entry" ], "properties": { "in-reply-to": [ "/docs/web/html/microformats" ], "name": [ "hey thanks for making this microformats resource" ], "url": [ "https://quickthoughts.jgregorymcverry.com/2019/05/31/hey-thanks-for-making-this-microformats-resource" ], "published": [ "2019-05-31t14:19:09+0000" ], "content": [ ...
...h-event is often used with both event listings and individual event pages <div class="h-event"> <h1 class="p-name">microformats meetup</h1> <p>from <time class="dt-start" datetime="2013-06-30 12:00">30<sup>th</sup> june 2013, 12:00</time> to <time class="dt-end" datetime="2013-06-30 18:00">18:00</time> at <span cla...
...77"></data> </div> <div class="e-content">come join us </div> <div> <span class="p-author h-card"><a class="u-url p-name" href="https://aaronparecki.com">aaron parecki</a></span> published this <a href="https://aaronparecki.com/2019/06/29/1/" class="u-url">event </a>on <time class="dt published" datetime="2019-05-25t18:00:00-07:00">may 5th, 2019</time> </div> </div> { "items": [ { "type": [ "h-event" ], "properties": { "name": [ "indieweb summit" ], "url": [ "https://aaronparecki.com/2019/06/29/1/" ], "author": [ { "type": [ "h-card" ], "properties": { "name": [ "aaron parecki" ], "url": [ "https://aaronparecki.com"] }, "lang": "en", ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
ntax) 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; // 101 remember — the length of the array is one more than the highest index. if you query a non-existent array index, you'll get a value of undefined in return: typeof a[90]; // undefined if you take the above about [] and length into account, you can iterate over an array using the following...
...e, 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.tolocalestring() returns a string with the tolocalestring() of each element separated by commas. ...
...y 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.tolocalestring() returns a string with the tolocalestring() of each element separated by commas. a.concat(item1[, item2[, ...[, itemn]]]) returns a new array with the items added on to it. a.join(sep) converts the array to a string — with values delimited by the sep param a.pop() removes and returns the last item. a.push(item1, ..., itemn) appends items to the end of the array. ...
...ed by commas. a.concat(item1[, item2[, ...[, itemn]]]) returns a new array with the items added on to it. a.join(sep) converts the array to a string — with values delimited by the sep param a.pop() removes and returns the last item. a.push(item1, ..., itemn) appends items to the end of the array. a.shift() removes and returns the first item. a.unshift(item1[, item2[, ...[, itemn]]]) prepends items to the start of the array. a.slice(start[, end]) returns a sub-array. a.sort([cmpfn]) takes an optional comparison function. a.splice(start, delcount[, item1[, ...[, itemn]]]) lets you modify an array by deleting a section and replacing it with more items. a.reverse() reverses the...
JavaScript modules - JavaScript
it is also worth noting that: some tools may never support .mjs, such as typescript. the <script type="module"> attribute is used to denote when a module is being pointed to, as you'll see below. exporting module features the first thing you do to get access to module features is export them. this is done using the export statement. ...
... front of any items you want exported out of the module, for example: export const name = 'square'; export function draw(ctx, length, x, y, color) { ctx.fillstyle = color; ctx.fillrect(x, y, length, length); return { length: length, x: x, y: y, color: color }; } you can export functions, var, let, const, and — as we'll see later — classes. they need to be top-level items; you can't use export inside a function, for example. a more convenient way of exporting all the items you want to export is to use a single export statement at the end of your module file, followed by a comma-separated list of the features you want to export wrapped in curly braces. for example: export { name, draw, reportarea, reportperimeter }; importing features into your script once you...
...features in the script they are imported into, and you won't be able to access them from the javascript console, for example. you'll still get syntax errors shown in the devtools, but you'll not be able to use some of the debugging techniques you might have expected to use. default exports versus named exports the functionality we've exported so far has been comprised of named exports — each item (be it a function, const, etc.) has been referred to by its name upon export, and that name has been used to refer to it on import as well. there is also a type of export called the default export — this is designed to make it easy to have a default function provided by a module, and also helps javascript modules to interoperate with existing commonjs and amd module systems (as explained nicel...
...js file, we import the default function using this line: import randomsquare from './modules/square.js'; again, note the lack of curly braces. this is because there is only one default export allowed per module, and we know that randomsquare is it. the above line is basically shorthand for: import {default as randomsquare} from './modules/square.js'; note: the as syntax for renaming exported items is explained below in the renaming imports and exports section. avoiding naming conflicts so far, our canvas shape drawing modules seem to be working ok. but what happens if we try to add a module that deals with drawing another shape, like a circle or triangle? these shapes would probably have associated functions like draw(), reportarea(), etc. too; if we tried to import different functions...
Regular expression syntax cheatsheet - JavaScript
tches.groups.area. (?:x) non-capturing group: matches "x" but does not remember the match. the matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). ...
...m the predefined regexp object's properties ($1, ..., $9). quantifiers if you are looking to contribute to this document, please also edit the original article note: in the following, item refers not only to singular characters, but also includes character classes, unicode property escapes, groups and ranges. characters meaning x* matches the preceding item "x" 0 or more times. for example, /bo*/ matches "boooo" in "a ghost booooed" and "b" in "a bird warbled", but nothing in "a goat grunted". x+ matches the preceding item "x" 1 or more times. equivalent to {1,}. for example, /a+/ matches the "a" in "candy" and all the "a"'s in "caaaaaaandy". x? matches the preceding item "x" 0 or 1 times. for example, /e?le...
...mple, /e?le?/ matches the "el" in "angel" and the "le" in "angle." if used immediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as opposed to the default, which is greedy (matching the maximum number of times). x{n} where "n" is a positive integer, matches exactly "n" occurrences of the preceding item "x". for example, /a{2}/ doesn't match the "a" in "candy", but it matches all of the "a"'s in "caandy", and the first two "a"'s in "caaandy". x{n,} where "n" is a positive integer, matches at least "n" occurrences of the preceding item "x". for example, /a{2,}/ doesn't match the "a" in "candy", but matches all of the a's in "caandy" and in "caaaaaaandy". x{n,m} ...
...for example, /a{1,3}/ matches nothing in "cndy", the "a" in "candy", the two "a"'s in "caandy", and the first three "a"'s in "caaaaaaandy". notice that when matching "caaaaaaandy", the match is "aaa", even though the original string had more "a"s in it. ...
Array.prototype.flat() - JavaScript
note that depth control is hard/inefficient as we will need to tag each value with its own depth // also possible w/o reversing on shift/unshift, but array ops on the end tends to be faster function flatten(input) { const stack = [...input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array items, won't modify the original input stack.push(...next); } else { res.push(next); } } // reverse to restore input order return res.reverse(); } const arr = [1, 2, [3, 4, [5, 6]]]; flatten(arr); // [1, 2, 3, 4, 5, 6] use generator function function* flatten(array, depth) { if(depth === undefined) { depth = 1; } for(const item of array) { if(arr...
...for reference, please check: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/2...
...for reference, please check: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 examples flattening nested arrays cons...
...for reference, please check: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 examples flattening nested arrays const arr1 = [1, 2, [3, 4]]; arr1.flat(); // [1, 2, 3, ...
Array.prototype.sort() - JavaScript
with function expressions: var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); console.log(numbers); // [1, 2, 3, 4, 5] es2015 provides arrow function expressions with even shorter syntax. let numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b); console.log(numbers); // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...et numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b); console.log(numbers); // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...rs); // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...0 sorted without a compare function: 1,200,40,5,700,80,9 sorted with comparenumbers: 1,5,9,40,80,200,700 sorting non-ascii characters for sorting strings with non-ascii characters, i.e. strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than english, use string.localecompare. this function can compare those characters so they appear in the right order. var items = ['réservé', 'premier', 'communiqué', 'café', 'adieu', 'éclair']; items.sort(function (a, b) { return a.localecompare(b); }); // items is ['adieu', 'café', 'communiqué', 'éclair', 'premier', 'réservé'] sorting with map the comparefunction can be invoked multiple times per element within the array. depending on the comparefunction's nature, this may yield a high overhead. the mor...
Progressive loading - Progressive web apps (PWAs)
s will be loaded only when they appear in the viewport. intersection observer this is a progressive enhancement to the previously working example — intersection observer will load target images only when the user scrolls down, causing them to display in the viewport. ...
... they appear in the viewport. intersection observer this is a progressive enhancement to the previously working example — intersection observer will load target images only when the user scrolls down, causing them to display in the viewport. here's what the relevant code looks like: if('intersectionobserver' in window) { const observer = new intersectionobserver((items, observer) => { items.foreach((item) => { if(item.isintersecting) { loadimages(item.target); observer.unobserve(item.target); } }); }); imagestoload.foreach((img) => { observer.observe(img); }); } else { imagestoload.foreach((img) => { loadimages(img); }); } if the intersectionobserver object is supported, the app creates a new instance of it. the function passed as ...
...is appearing inside the viewport). we can iterate over each case and react accordingly — when an image is visible, we load the correct image and stop observing it as we no longer need to observe it. ...
...y assigned, or by wrapping <img> tags with <a> elements pointing at the target images, so the user can click and access them when desired. we won't do that because the app itself is dependent on javascript — without it, the list of games wouldn't even be loaded, and the service worker code wouldn't be executed. we could rewrite the loading process to load not only the images, but the complete items consisting of full descriptions and links. it would work like an infinite scroll — loading the items on the list only when the user scrolls the page down. that way the initial html structure would be minimal, loading time even smaller, and we would have even greater performance benefits. conclusion less files to load initially, smaller files split into modules, use of placeholders, and loadi...
XUL Migration Guide - Archive of obsolete content
n future releases to meet important use cases. user interface components xul-based add-ons typically implement a user interface using a combination of two techniques: xul overlays and xul windows. xul overlays xul overlays are used to modify existing windows such as the main browser window. in this way an extension can integrate its user interface into the browser: for example, adding menu items, buttons, and toolbars. because sdk-based extensions are restartless, they can't use xul overlays. to add user interface components to the browser, there are a few different options. in order of complexity, the main options are: the sdk includes modules that implement some basic user interface components including buttons, dialogs, and context menu items. there is a collection of co...
...fox toolbar (although users may relocate them by toolbar customization) because it makes for a better user experience for add-ons to expose their interfaces in a consistent way. in such cases it's worth considering changing your user interface to align with the sdk apis. some limitations only exist because we haven't yet implemented the relevant apis: for example, there's currently no way to add items to the browser's main menus using the sdk's supported apis. many add-ons will need to make some changes to their user interfaces if they are to use only the sdk's supported apis, and add-ons which make drastic changes to the browser chrome will very probably need more than the sdk's supported apis can offer. similarly, the supported apis expose only a small fraction of the full range of xpcom ...
...xtensible by design: developers can create new modules filling gaps in the sdk, and package them for distribution and reuse. add-on developers can install these packages and use the new modules. if you can find a third party package that does what you want, this is a great way to use features not supported in the sdk without having to use the low-level apis. see the guide to adding firefox menu items. some useful third party packages are collected in the jetpack wiki. note, though, that by using third party packages you're likely to lose the security and compatibility benefits of using the sdk. using the low-level apis in addition to the high-level apis, the sdk includes a number of low-level apis some of which, such xhr and window/utils, expose powerful browser capabilities. but note tha...
ui/sidebar - Archive of obsolete content
s a sidebar visible, the new window gets a sidebar, too. you can hide the sidebar by calling its hide() method. called with no arguments, show() and hide() will operate on the currently active window. from firefox 33 onwards you can pass a browserwindow into these methods, and they will then operate on the specified window. alternatively, the view->sidebar submenu in firefox will contain a new item which the user can use to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. to show what a sidebar looks like, here's a sidebar that displays the results of running the w3c validator on the current page: specifying sidebar content the co...
...r = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onattach: function (worker) { worker.port.on("ping", function() { console.log("add-on script got the message"); worker.port.emit("pong"); }); } }); try running the add-on, and showing the sidebar using the "view->sidebar->my sidebar" menu item. you should see console output like: console.log: add-on: add-on script got the message console.log: add-on: sidebar script got the reply using ready the ready event is emitted when the dom for the sidebar's content is ready. it is equivalent to the domcontentloaded event. at this point the sidebar script is initialized, so you can send messages to the sidebar script and be confident that th...
...idebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onready: function (worker) { worker.port.emit("ping"); worker.port.on("pong", function() { console.log("add-on script got the reply"); }); } }); try running the add-on, and showing the sidebar using the "view->sidebar->my sidebar" menu item. you should see console output like: console.log: add-on: sidebar script got the message console.log: add-on: add-on script got the reply globals constructors sidebar(options) creates a sidebar. var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onattach: function (worker) { console.log("...
HTML in XUL for rich tooltips - Archive of obsolete content
ple is what the final xul overlay could look like, assuming a javascript overlay titled overlay.js: <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip1" label="foo1" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> <menuitem id="htmltip2" label="foo2" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> </popup> <popupset id="mainpopupset"> <tooltip id="myhtmltip"> <html:div id="myhtmltipdiv" type="content"/> </toolti...
...xul overlay, xmlns:html is used to enable html tags to be used inside the xul. our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its privileges to being that content element, although it is an element of chrome. this is recommended for security reasons, especially if remote html is to be inserted. a number of menuitems have a tooltip attribute pointing to the same tooltip. that tooltip is empty now, but we will use the mouseover event to dynamically populate the tooltip (which is about to be shown) with a different message for each menuitem. this is done by calling the onmousetooltip function, which will take the tooltiphtml attribute of the element that is being hovered over and safely convert that into dom a...
...element that you wish to have a rich tooltip with. you should write the html straight into the xul. ...
Sidebar - Archive of obsolete content
web panels sidebar content such as web pages can be safely loaded as sidebar in the "viewwebpanelssidebar". bookmarks with "load this bookmark in sidebar" checked in the properties open in the "viewwebpanelssidebar". a web page can use window.sidebar to create bookmark with that property. to open a page in the "viewwebpanelssidebar" from chrome code (browser/addon/extension) such as from menuitem, it can call: openwebpanel(atitle, auri); accessing the sidebar from a browser.xul script the sidebar content is always in a document separate from the main browser document (the sidebar is actually implemented as a xul browser element). this means you can't directly access the sidebar content from a script referenced from a browser.xul overlay. to access your sidebar's window or document obj...
...ow section of working with windows in chrome code. ...
...rking with windows in chrome code. ...
Extension Packaging - Archive of obsolete content
t be named the same as the id of the add-on or theme. add-ons packaged in this way will not be visible to the user. register an extension location using the windows registry external installers, such as the java runtime, may wish to install application integration points as an extension, even if the application is not yet installed. this can be accomplished on windows using the registry. multi-item extension xpis in some cases, a single xpi file may wish to install multiple extensions/themes. a special kind of extension xpi, called the multiple item package, explains how to create this kind of package. (firefox 1.5/xulrunner 1.8 required.) from the release of firefox 53, multiple item extension packages are no longer supported and will not load. as a consequence, these packages are no lo...
...equence, these packages are no longer accepted by amo. ...
...ial references for toolkit api structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how to package themes multiple-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps ...
Extension Etiquette - Archive of obsolete content
this article describes best practices when making extensions, including how to be kind to your users. it assumes that you are already familiar with building an extension. user interface tools menu items using the tool menu option gives the author the maximum amount of choices. whether the extensions should go at the top, bottom, or somewhere in between on the tools menu, the author always has a choice. ideally, the location would be below the add-ons item, grouped with the other extension-related commands (menuitem:insertafter="javascriptconsole,devtoolsseparator"). sub-menus should be used for single extensions needing multiple menu items, and a tools menu item should not be created for options and preferences (for options and preferences, see the add-on manager). if possible, create a me...
...e. ideally, the location would be below the add-ons item, grouped with the other extension-related commands (menuitem:insertafter="javascriptconsole,devtoolsseparator"). sub-menus should be used for single extensions needing multiple menu items, and a tools menu item should not be created for options and preferences (for options and preferences, see the add-on manager). if possible, create a menu item in the menu where it is most applicable; for instance, a bookmark sharing extension should be called from the bookmarks menu. to maintain the default theme, avoid the use of an icon next to the menu items. ...
... tools menu item should not be created for options and preferences (for options and preferences, see the add-on manager). if possible, create a menu item in the menu where it is most applicable; for instance, a bookmark sharing extension should be called from the bookmarks menu. to maintain the default theme, avoid the use of an icon next to the menu items. other ui elements in general, toolbar items are very useful to end users because they can be removed or added to various toolbars as necessary. status bar items should only be added for extensions that need constant monitoring, such as ad blocking, page ranking, or cookie management. likewise, use context menu items sparingly — only for tasks that are done frequently or on specific elements of a web page. focus don't steal focus. it's...
Index of archived content - Archive of obsolete content
uuid window/utils release notes tools cfx cfx to jpm console jpm jpm-mobile jpmignore package.json tutorials add a context menu item add a menu item to firefox adding a button to the toolbar annotator creating annotations displaying annotations implementing the widget overview storing annotations chrome authority crea...
...reating a user interface firefox hub walkthrough initialization and cleanup prerequisites walkthrough webextensions for firefox for android listening to events in firefox extensions migrating from internal linkage to frozen linkage migrating raw components to add-ons multiple item extension packaging offering a context menu for form controls overlay extensions firefox addons developer guide appendix: what you should know about open-source software licenses chapter 1: introduction to extensions chapter 2: technologies used in developing extensions ...
... using the w3c dom using workers in extensions web standards choosing standards compliance over proprietary practices community correctly using titles with external stylesheets describing microformats in javascript displaying a graphic with audio samples fixing incorrectly sized list item markers fixing table inheritance in quirks mode issues arising from arbitrary-element hover mozilla's doctype sniffing parsing microformats in javascript popup window controls rdf in fifty words or less rdf in mozilla faq styling abbreviations and acronyms the business benefits of web standards usi...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the currently viewed message headers can dramatically improve user experience. implementing inner-browsing on top of html pages modern browsers have good support for the w3c dom and javascript allowing fine-grained control over page content. instead of forcing the reader to follow links to new pages, the javascript code can act as the mediator for information access. if the user clicks on a link item, the script will be responsible to load the information from the data source and to apply that into the current document. there are basically two steps in this process: data load: acquisition of information data acquisition can be implemented using javascript and remote procedure calls using soap-based rpc mechanism or using interfaces like xmlhttprequest (currently offered in netscape 7 and inte...
... ready, it copies the markup into the container element, which is a div element. the following code snippet shows a simplified version of the logic that happens in the actual sample: // doc is the dom to the document returned articles=doc.getelementsbytagname("article"); for(i=0;i<articles.length;i++) { // acquiring the data from the dom... articletitle=article.getelementsbytagname("article").item(0).firstchild.nodevalue; // inserting the content into the container.. document.getelementbyid("container").innerhtml+=articletitle+"<br />"; } source code for the sample <html> <head> <title>inner-browsing example, with xmlhttprequest and dom</title> <script type="text/javascript" language="javascript" src="xmlrequest.js"></script> <script> /* ***** begin license block ***** * version: mp...
...nner-browsing function here // function calldevedge(loaddata,ele) { var x = new xmlremoterequest(); doc=x.getremotedocument(loaddata); document.getelementbyid("container").innerhtml=""; if(doc!=null) { tagname="article"; // ie fix if(document.all) tagname="nde:"+tagname; articles=doc.getelementsbytagname(tagname); for(i=0;i<articles.length;i++) { article=articles.item(i); tagname="title"; // ie fix if(document.all) tagname="nde:"+tagname; valuee=article.getelementsbytagname(tagname).item(0).firstchild.nodevalue; tagname="summary"; // ie fix if(document.all) tagname="nde:"+tagname; paraa=article.getelementsbytagname(tagname).item(0).first...
Creating a Firefox sidebar extension - Archive of obsolete content
td"> <page id="sbemptysidebar" title="&emptysidebar.title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.title;" /> </vbox> </page> new extensions can be registered in the menus or popups, firefox uses overlays for extending menus. this is an separate xul file that specifies the location of menu items. the sidebar here is added to the view | sidebar menu. the overlay file is listed in example 4. example 4. chrome/content/firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <me...
... the sidebar here is added to the view | sidebar menu. the overlay file is listed in example 4. example 4. ...
...artitle="&emptysidebar.title;" oncommand="togglesidebar('viewemptysidebar');" /> </broadcasterset> </overlay> the overlay file consists of three entries, the menu definition, shortcut keys and the broadcaster. the broadcaster serves two purposes. the first is it indirectly provides the arguments for the togglesidebar function. the second is it provides attributes to the menuitem, some of which are changed automatically when togglesidebar is called. see code_snippets/sidebar for more information. if the sidebar is not going to have a command-key, one can remove the openemptysidebar.commandkey and openemptysidebar.modifierskey keys from the dtd, remove the <keyset> from the firefoxoverlay.xul file. one must then set the key attribute of the menuitem to "". the extension ...
Drag and Drop - Archive of obsolete content
his function is called, a drag has started. the function invokedragsession takes four parameters, as described below: invokedragsession(element, transferablearray, region, actions) element a reference to the element that is being dragged. this can be retrieved by getting the property event.target during the event handler. transferablearray an array of nsitransferable objects, one for each item being dragged. an array is used because you might want to drag several objects at once, such as a set of files. region a region used for feedback indication. this should usually be set to null. actions the actions that the drag uses. this should be set to one of the following constants, or several added together. the action can be changed during the drag depending on what is being dragged ove...
... for feedback indication. this should usually be set to null. actions the actions that the drag uses. this should be set to one of the following constants, or several added together. the action can be changed during the drag depending on what is being dragged over. nsidragservice.dragdrop_action_none used to indicate that no drag is valid. nsidragservice.dragdrop_action_copy the item being dragged should be copied to its dropped location. nsidragservice.dragdrop_action_move the item being dragged should be moved to its dropped location. nsidragservice.dragdrop_action_link a link (or shortcut or alias) to the item being dragged should be created in the dropped location. the interface nsidragservice also provides the function getcurrentsession which can be calle...
... can accept the object currently being dragged to be dropped on it. set the value to false if it doesn't make sense to drop the object on it. this should be changed in the ondragover and ondragenter event handlers. dragaction set to the current action to be performed, which should be one or more of the constants described earlier. this can be used to provide extra feedback to the user. numdropitems the number of items being dragged. for example, this will be set to 5 if five bookmarks are being dragged. getdata(transfer,index) get the data being dragged. the first argument should be an nsitransferable object to hold the data. the second argument, index, should be the index of the item to return. sourcedocument the document where the drag started. sourcenode the dom node where th...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
it implements the iappfilelocprovider interface, and tells xpcom where to find certain files a...
...it implements the iappfilelocprovider interface, and tells xpcom where to find certain files and directories. ...
...bedding failed } locationprovider is a class provided by the java application. it implements the iappfilelocprovider interface, and tells xpcom where to find certain files and directories. if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already registered the gre on your system: gre registration the initembedding method kicks off the embedding process, allowing the java application to work with xpcom and mozilla. once the java application is done using mozilla, it needs to terminate the embedding process: try { mozilla.termembedding(); } catch (xpcomexception e) { // this exception is thrown if termembedding failed } working with xpcom objects now that mozilla is embedded, the java app...
Java in Firefox Extensions - Archive of obsolete content
alert(e+'::'+e.linenumber); } } //get extension folder installation path... (this works in firefox 3.x, for firefox 4.x use addonmanager.getaddonbyid) var extensionpath = components.classes["@mozilla.org/extensions/manager;1"]. getservice(components.interfaces.nsiextensionmanager). getinstalllocation("test@yoursite"). ...
...need reflection. ...
...loader.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] = envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific arguments we wish to pass to it var arglist = reflect.array.newinstance(java.lang.object, 2); // 2nd argument should indicate the number of items in the following array var mydir = new java.io.file(dirurl); // a file url arglist[0] = mydir; var envconfig = envconfigclass.newinstance(); arglist[1] = envconfig; // call our constructor with our arguments var env = constructor.newinstance(arglist); be aware that liveconnect, while now actively supported by sun has only recently been reimplemented for use in mozilla, so there may still be som...
jspage - Archive of obsolete content
his[a],a,this); }}},getclean:function(){var b={};for(var a in this){if(this.hasownproperty(a)){b[a]=this[a];}}return b;},getlength:function(){var b=0;for(var a in this){if(this.hasownproperty(a)){b++; }}return b;}});hash.alias("foreach","each");array.implement({foreach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});array.alias("foreach","each"); function $a(b){if(b.item){var a=b.length,c=new array(a);while(a--){c[a]=b[a];}return c;}return array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; };}function $chk(a){return !!(a||a===0);}function $clear(a){cleartimeout(a);clearinterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); ((a=="arguments"||a=="collection"||a=="array")?ar...
...length;b<a; b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isfinite(a))?false:a.$family.name; }if(a.nodename){switch(a.nodetype){case 1:return"element";case 3:return(/\s/).test(a.nodevalue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; }else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); }break;case"hash":b=new hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var browser=$merge({engine:{name:"unknown",version:0},platform:{name:(window.orientation!=undefined)?"ipod":(navigator.p...
...;},getscrollheight:function(){return this.getscrollsize().y; },getscrollwidth:function(){return this.getscrollsize().x;},gettop:function(){return this.getposition().y;},getleft:function(){return this.getposition().x; }});native.implement([document,element],{getelements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=selectors.utils.search(this,a,e); if(d!=0&&f.item){f=$a(f);}c=(d==0)?f:(c.item)?$a(c).concat(f):c.concat(f);}return new elements(c,{ddup:(h.length>1),cash:!g});}});element.implement({match:function(b){if(!b||(b==this)){return true; }var d=selectors.utils.parsetagandid(b);var a=d[0],e=d[1];if(!selectors.filters.byid(this,e)||!selectors.filters.bytag(this,a)){return false;}var c=selectors.utils.parseselector(b); return(c)?selectors.utils.filter(th...
New Skin Notes - Archive of obsolete content
rence on the cavendish theme is negligible (to the point where i never noticed). direct external links have icons to differentiate them from internal links, so i think we'll just leave the internal/external links colours the same. ==dria you've got to be kidding me, the colors are clearly different (rgb(0,51,153) vs rgb(51,102,187)). --nickolay 09:19, 25 aug 2005 (pdt) (moving this to a new item) on the contrary, the list of categories current page belongs to, should be near the footer (see mdc:policies_and_guidelines page) (dria: fix catlinks style) the arrows that appear if you select "enhanced recent changes" in your preferences have an ugly border around them. --nickolay 04:43, 25 aug 2005 (pdt) the radio buttons on history page are jumping in a weird way because the selected row...
...tory page are jumping in a weird way because the selected row becomes bold. --nickolay 04:46, 25 aug 2005 (pdt) the sidebar overrides content on diff pages --nickolay turns out this was fixed for 1.5 already. --dria the buttons in the upper-right of the horizontal nav-bar don't really feel like buttons; maybe add a pseudo-class for onhover that gives them an underline? --beltzner the "+" item under the "views" menu of a discussion page looks really out of place. can we replace it with "add section" or something? --beltzner i'll look into it, but i think this is one of those "don't hold your breath" things because that's not managed by the skin. i could probably just eliminate it entirely. that'd work, too; you'd mentioned that it was very rarely used --beltzner the category temp...
.... -- gandalf unfortunately the category styling is very much embedded into the mediawiki code. there are some other changes i need to make, however, so i'll try to fix it up a bit while i'm digging around in there. --dria how about modifying style for the side-bar to have a :hover class added which modifies (to a slightly lighter shade) the background color of the link, this will help to make items "appear as links" to many users, possibly add a text-decoration: underline as well. --callek is it possible to remove the blank space on category pages, like category:dom?by the way, it looks like this skin has the same problem as previous - the edit box, category list on category pages, and others are always below the end of the sidebar. the major problem it caused in cavendish skin - that th...
Proxy UI - Archive of obsolete content
:" discussed in detail elsewhere... but should be noted that if you cut and paste from ie, the semi-colons are automatically converted to commas when you save changes (ff, tb, sm). automatic proxy configuration url supports a url (which is checked via urifixup) and a reload button. offline|online "plug" location status bar on the right side. ...
...selecting "proxy configuration..." opens the preferences panel to "advanced > proxies" (tbdescribed: changing the prefs values). unfiled bug: changing proxy mode does not update the menu. ...
...to discover) online (proxy: auto url) online (proxy: manual) --- proxy configuration... <h7 name="details">details</h7> the menu should display the current proxy mode with a dot. the modes that can have an empty configuration (auto url and manual) will be disabled if the prefs are blank. selecting an enabled item sets the menu selection and the proxy mode (network.proxy.type) selecting a disabled item is not allowed. selecting "proxy configuration..." opens the preferences panel to "advanced > proxies" (tbdescribed: changing the prefs values). unfiled bug: changing proxy mode does not update the menu. mouseover when online, the tooltip will include the current proxy mode: code http://mxr.mozilla.org/seamonkey/sou...ityoverlay.xul bugs bug 243624 reference network.proxy.type ...
Moving, Copying and Deleting Files - Archive of obsolete content
he file is renamed to 'destination.txt'. two file objects are created, the first is the file to copy, and the second is the directory in which to copy the file to. nsifile.copyto() of the former is called, passing the latter as the first argument to nsifile.copyto(). naturally, the destination must be a directory or an error will occur. in this case, we assume that 'source.txt' is a file. if the item to copy is a directory, it can be copied in the same manner as above without changes. this allows an entire directory and its contents to be copied from one location to another. you might use this to make a backup of a directory of files for instance. var file = io.newfile("home", "importantdata"); var destination = io.newfile("desktop", ""); destination.append("backups"); file.copyto(destinatio...
...e copied in the same manner as above without changes. this allows an entire directory and its contents to be copied from one location to another. you might use this to make a backup of a directory of files for instance. ...
...this will be the usual behaviour when copying to a different directory, but you would want to specify a filename when copying a file to another name within the same directory. in this latter situation, you may also omit the destination directory. ...
Introduction to XUL - Archive of obsolete content
w so it can punch them when necessary. broadcasters can broadcast any change of state, which can be tied to the value of any attribute in another xul widget. for more complete documentation, see broadcasters and observers. an example window below is a complete sample xul document that describes a window with a menu bar and an html content area. the menu bar has a menu, file, with a single menu item that dumps "hello world!" to the debug console when selected. the content area will display the contents of the file contentframe.html. this code introduces several concepts useful for creating real world windows not explicitly covered in this document. follow the links for details. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!doctype window> <wi...
...s not explicitly covered in this document. follow the links for details. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!doctype window> <window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu label="file"> <menupopup> <menuitem label="hello world!" onclick="alert('hello world!\n');"/> </menupopup> </menu> </menubar> <html:iframe id="content-frame" src="contentframe.html" flex="100%"/> </window> the beginning of this example, down through the window tag, is the standard preamble. notice that the example window tag has an id attached to it. strictly speaking, that is unnecessary for this example. however...
...ble for html elements. #main-window { display: block; width: 100%; height: 100%; } for example, the above style rule would apply to the main window and dictates that the window should consume the full width and height available to it in a content area. the next element in the example declares the menubar. the menubar contains a single menu called "file". this menu contains a single menu item that has a simple javascript onclick handler attached to it. this handler fires when the menu is selected by the user, and it dumps the text "hello world!" to the debug console. (see menu bars and menus for details.) finally there is an html iframe. note that the frame is qualified with the prefix html:, since it is an html object being used inside a default xul namespace. the frame also has a s...
contains - Archive of obsolete content
...
... ...
... ...
ensureIndexIsVisible - Archive of obsolete content
...
... ...
... ...
invertSelection - Archive of obsolete content
...
... ...
... ...
OpenClose - Archive of obsolete content
enu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'. note that the open property applies to the menu or button, not to the menupopup. here is a complete example which uses a button to open a menu: <button label="open menu" oncommand="document.getelementbyid('editmenu').open = true;"/> <menu id="editmenu" label="edit"> <menupopup> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </menu> this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see opening a popup below. as with other ways of opening a menu, the popupshowing event will be fired to pr...
... see the popupshown event for an example of how to do this. a menu in an unprivileged content window (such as a web page) can only open a popup while its window is focused, and it is in the currently active tab. that means that a document in a background tab cannot open a menu or popup. closing menus menus will close automatically once the user has made a selection from the menu. when an menu item is selected, it fires a command event so that code may be used to perform an action. the user may cancel selecting a command from a menu by pressing the escape key. this will close a single menu, but if this menu has a parent menu, the parent menu will remain open. a user may also cancel selecting from a menu by clicking outside the menu. in this case, not only will that menu close, but all paren...
...e with the left mouse button. there isn't a means of replicating this action with the keyboard, so you should always provide an alternate means of accessing the functionality of the menu. this can be done by either placing alternate commands elsewhere in the user interface, or by providing a keyboard shortcut to open the menu. once the menu is open, the keyboard can be used to navigate and select items as usual. popups attached using the context attribute are opened when the user performs an action that attempts to open a context menu. this action will vary on each platform, but it general it involves clicking on the element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the cont...
Popup Guide - Archive of obsolete content
are menus. menus a menu is used when you wish to have a series of commands that can be activated by the user, but don't want to use the extra space for a button for each command. a menu is normally hidden, and when activated, a popup appears containing the list of commands. the user may select a command and the menu disappears again. a menu is created using the menupopup element. it displays items in a list, can display submenus, and provides keyboard navigation between the items. a menu should only contain menu related elements. context menus a context menu is like a regular menu except that the commands it contains apply to what the user had clicked on to open the context menu. often, depending on what was clicked on, certain commands may be hidden if not applicable to that element. ...
...open to determine if a popup or menu is open, see determining if a popup is open. moving a popup popups may be moved using the moveto method. see moving a popup. resizing a popup the size of a popup may be adjusted using the sizeto method. see resizing a popup. attaching menus to a button to learn about how to open a menu when a button is pressed, see menu buttons. features of items on a menu to learn about the various features of items on a menu, see features of the menuitem element modifying the items on a menu to append, insert and remove elements from a menu, see modifying a menu. events when popups are opened or closed the popupshowing and popupshown events are fired when a menu or popup is opened. the popuphiding and the popuphidden events are fired when a ...
... handling keys within popups for information about how keys are handled within menus and panels, see handling keys within popups. platform specific menu considerations see special per-platform menu considerations for some notes about handling menus on certain platforms, for instance creating the application menu on a macintosh. using popups in extensions extensions may add additional menuitems either to a menu on the menu bar or to the context menu. in addition, an extension may add an entirely new menu. for example, an extension might wish to add a new command on the tools menu to open a dialog specific to the extension. another common task is to create an extension which adds an item to the browser's context menu. see using menus and popups in extensions for details. ...
selectedIndex - Archive of obsolete content
« xul reference selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. ...
... « xul reference selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. ...
... « xul reference selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. ...
Property - Archive of obsolete content
checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell documentcharsetinfo editable edi...
...button defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id ignoreblurwhilesearching image increment inputfield inverted is24hourclock ispm issearching iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobje...
...on 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 selectedindex 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 tabindex tabs tabscrolling tabpanels tag textlength textvalue timeou...
Containment Properties - Archive of obsolete content
ever, the simple query syntax may also iterate over a single predicate pointing out of a resource, rather than use the children. this allows you to iterate over a non-container. to do this, use the containment attribute on the root node, set to the predicate to iterate over. let's look back at the very first example again. ...
...to the predicate to iterate over. let's look back at the very first example again. it doesn't have any containers, but we may want to iterate over the relateditem predicate using the simple query syntax. we can add the containment attribute to do this. <vbox datasources="template-guide-ex1.rdf" ref="http://www.xulplanet.com/rdf/a" containment="http://www.xulplanet.com/rdf/relateditem"> <template> <rule> <label uri="rdf:*" value="rdf:*"/> </rule> </template> </vbox> instead of iterating over a container, this example iterates over a specific predicate. this attribute is useful when the rdf data is structured in such a way that an rdf container isn't used. the builder treats the predicate in the containment attribute as an indicator that an element is a conta...
... template syntax. that is, in addition to iterating over the children, it will iterate over the predicates listed in the containment attribute. for example, the following is equivalent to the previous example, except that the full query syntax is used. <vbox datasources="template-guide-ex3.rdf" ref="http://www.xulplanet.com/rdf/a" containment="http://www.xulplanet.com/rdf/relateditem"> <template> <query> <content uri="?start"/> <member container="?start" child="?child"/> </query> <action> <label uri="?child" value="?child"/> </action> </template> </vbox> try this example. what happens is that the builder generates additional possible values for the ?child variable, so it creates an additional result for each one. « previousnext »...
XML Templates - Archive of obsolete content
e"/> <person name="laura secord" gender="female"/> </people> xml query syntax the query syntax is fairly simple for xml datasources. just place an expr attribute on the query element containing an xpath expression returns the set of results to output. here is an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the expr attribute is a very simple xpath expression which simply retrieves the person elements from within the datasource. as there are five in the xml document, five results will be generated. the action element defines the content to generate for each result. the content of the action element will be generated and repeated for eac...
... </template> </listbox> the expr attribute is a very simple xpath expression which simply retrieves the person elements from within the datasource. as there are five in the xml document, five results will be generated. the action element defines the content to generate for each result. the content of the action element will be generated and repeated for each result, which in this case, is a listitem. the child of the action element has to have a uri attribute, although it does not have to be a direct child. the element with the uri attribute and its children will be copied once for each result. any elements between the action element and this element are only copied once. this is useful when recursive generation or multiple rules are used, and we'll see examples of why this is useful later.
...it refers to an element with that id (without the number sign) and uses that node as the source xml node instead of a separate file. otherwise the data included inline and the template are the same. note the only change is that the addit...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
.label;" tooltiptext="&toolbarbutton.tooltip;" onclick="myextension.onclick(event);"/> </toolbarpalette> onclick: function(event) { switch(event.button) { case 0: // left click break; case 1: // middle click break; case 2: // right click break; } } to add more buttons, put more <toolbarbutton> elements inside the <toolbarpalette> element. wrap elements other than <toolbarbutton> in <toolbaritem>. adding the button bootstrap style adding a button to the browserpalette on runtime in a bootstrap addon is a bit different because the browserpalette is indirectly reached. a simple document.getelementbyid('browsertoolbarpalette') will not work. this is the code to create and add it in. let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute...
...note that this is not recommended. there is another page on mdc with information about adding buttons to various windows in seamonkey. includes useful information about overlays for chatzilla. ...
...d - address book addressbooktoolbarpalette chrome://editor/content/editor.xul kompozer - main window nvutoolbarpalette chrome://calendar/content/calendar.xul sunbird - main window calendartoolbarpalette more information xulplanet.com references: <toolbarbutton>, <toolbaritem>. how to adjust toolbar button's label position a forum thread about adding an item to the toolbar (instead of just adding it to palette) right after an extension is installed. note that this is not recommended. there is another page on mdc with information about adding buttons to various windows in seamonkey. includes useful information about overlays for chatzilla. ...
Adding Event Handlers - Archive of obsolete content
fine some functions in the file and we can call them in event handlers. you can include multiple scripts in a xul file by using multiple script tags, each pointing to a different script. you may use relative or absolute urls. for example, you may use urls of the following form: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> this tutorial does not attempt to describe how to use javascript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this. by default the javascript console only shows errors from web content. to show errors in chrome javascript, it is necessary to change the preference javascript.options.showinconsole to t...
... all elements inside it, whereas an event attached to a button will only receive events pertaining to that button. this is useful if there are several elements you would like to handle using the same or similar code. the most common event used is the 'command' event. the command event is fired when a user activates an element, for example by pressing a button, changing a checkbox or selecting an item from a menu. the command event is a useful event since it automatically handles different ways of activating the element. for example, the command event will occur regardless of whether the user uses the mouse to click a button, or presses the enter key. there are two ways to attach an event listener to an element. first, by using an attribute with a script as its value. second, by calling an el...
...r find files example a command handler can be placed on the find and cancel buttons in the find files dialog. pressing the find button should start the search. because we aren't going to implement this part yet, we'll leave it out for now. however, pressing the cancel button should close the window. the code below shows how to do this. while we're at it, let's add the same code to the close menu item. <menuitem label="close" accesskey="c" oncommand="window.close();"/> ... <button id="cancel-button" label="cancel" oncommand="window.close();"/> two handlers have been added here. the oncommand attribute was added to the close menu item. by using this handler, the user will be able to close the window by clicking the menu item with the mouse or by selecting it with the keyboard. the onco...
Templates - Archive of obsolete content
section, we'll find out how to populate elements with data. populating elements xul provides a method in which we create elements from data supplied by rdf, either from an rdf file or from an internal datasource. numerous datasources are provided with mozilla such as bookmarks, history and mail messages. more details on these will be provided in the later section. usually, elements such as treeitems and menuitems will be populated with data. however, you can use other elements if you want although they are more useful for specialized cases. nevertheless, we'll start with these other elements because trees and menus require more code. to allow the creation of elements based on rdf data, you need to provide a simple template which will be duplicated for each element that is created. essentia...
...sts in the document tree. in addition, the id of each of the labels will be set to the rdf resource for that row. the content builder always starts at the place where uri="rdf:*" is specfied. if the uri attribute is placed on an element lower in the element tree, the elements outside are only created once. in the example below, one hbox will be created and it will be filled with a label for each item. <template> <hbox> <label uri="rdf:*" value="rdf:http://home.netscape.com/nc-rdf#name"/> </hbox> </template> if there is other content inside the element with the datasources attribute but outside the template, that content will also appear. this way, you can mix static content and dynamic content from a template. tree builder the tree builder, on the other hand, doesn't generate the...
...an element for every cell would be too costly. however, the tradeoff is that trees may only display text, and, since no elements are created, you can't use css properties to style tree cells in the same way. the tree builder is only used for trees. other elements use only the content builder. this isn't a problem though, since other elements such as menus wouldn't be expected to display too many items. it's also possible to use the content builder for trees as well, and a treeitem element and related elements will be created for each row. rules in the image of the earlier example, you may have noticed that the third button is simply a button with hyphens on it. this is a separator in the bookmark list. in the way that we have been using it, the rdf bookmarks datasource supplies the separato...
button - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed. normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to acce...
...ppearance of the different icons on some available platforms. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. orient type: one of the values below used to specify whether the children of the element are oriented hor...
caption - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label...
... tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. ...
... tabindex type: integer the tab order of the element. ...
checkbox - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. src type: uri set this to an uri pointing to an image to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable...
... normally preferred to use of the attribute, as it may need to update additional state. src type: uri set this to an uri pointing to an image to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. 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. 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. tabindex type: integer the tab order of the element. the tab o...
command - Archive of obsolete content
ent can be used to invoke an operation that can come from multiple sources. for example, a clipboard paste operation can be invoked from the edit menu, a context menu and by pressing a keyboard shortcut. you attach the code to the command using the oncommand attribute. it will be called no matter how it is invoked by the user. in addition, disabling the command will automatically disable the menu items and keyboard shortcuts. commands are identified by their id. if you include the script chrome://global/content/globaloverlay.js in your window, you can use the function godocommand function to invoke the command. using this function has the advantage that the command will be sent to the part of the ui which will respond to it. typically, this will be the currently focused element. like a broad...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. 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. oncommand type: script code this event handler i...
... reserved type: string this attribute applies to a command element. ...
iframe - Archive of obsolete content
an extension without security issues. more information is available in the xul tutorial. ...
...available in the xul tutorial. ...
... type, transparent properties accessibletype, contentdocument, contentwindow, docshell, webnavigation examples <iframe src="table.php" flex="2" id="browsertable" name="table_frame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: b...
listheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a single column in a listbox. attributes disabled properties acesssibletype examples <listbox> <listhead> <listheader label="name"/> <listheader label="occupation"/> </listhead> <listitem> <listcell label="george"/> <listcell label="house painter"/> </listitem> <listitem> <listcell label="mary ellen"/> <listcell label="candle maker"/> </listitem> <listitem> <listcell label="roger"/> <listcell label="swashbuckler"/> </listitem> </listbox> 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 ...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. 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. inherited from xul element align, allowevents, al...
...node, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listhead, listitem ...
popupset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for menupopup, panel and tooltip elements. this element is optional; the given elements need not appear in a popupset container. more information is available in the xul tutorial. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a container for menupopup, panel and tooltip elements. this element is optional; the given elements need not appear in a popupset container. more information is available in the xul tutorial. ...
... xul reference home [ examples | attributes | properties | methods | related ] a container for menupopup, panel and tooltip elements. this element is optional; the given elements need not appear in a popupset container. more information is available in the xul tutorial. ...
prefpane - Archive of obsolete content
e opened using the help viewer when the help button is pressed. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. onpaneload type: script code code defined here is called when the pane has been loaded, much like the load event for a window. selected type: boolean this attribute will be set to true for the currently selected prefpane. to change t...
...pe: dom nodelist holds a list of the ui elements in the pane that are attached to preferences. preferences type: dom nodelist holds a list of the preference elements in the pane. 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. src type: url gets and sets the value of the src attribute. methods domelement getpreferenceelement(in domelement startelement) preferenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached. void userchangedvalue(in domel...
...id userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget. for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a way that should cause the preference's value to change. (1) an example of a widget that has state changes tracked for it includes th...
<statusbarpanel> - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label t...
... properties 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. ...
... properties image type: image url gets and sets the value of the image attribute. ...
treerow - Archive of obsolete content
more information is available in the xul tutorial. attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element. for more information, see styling a tree. ...
... more information is available in the xul tutorial. attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element. for more information, see styling a tree. ...
... ...
2006-12-01 - Archive of obsolete content
meetings none for this week ...
... meetings none for this week ...
... meetings none for this week ...
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
his gap. ...
...ilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>i like root beer</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54321</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/article/54321</link> <wfw:commentrss>http://www.example.com/feed/rss/54321/comments</wfw:commentrss> </item> <item> <title>rain is wet</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54320</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>http://www.example.com/article/54320</link> <wfw:commentrss>http://www.example.com/feed/rss/54320/comments</wfw:commentrss> </item> <item> <title>huh?!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:543...
...4320</link> <wfw:commentrss>http://www.example.com/feed/rss/54320/comments</wfw:commentrss> </item> <item> <title>huh?!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54319</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/article/54319</link> <wfw:commentrss>http://www.example.com/feed/rss/54319/comments</wfw:commentrss> </item> </channel> </rss> the <wfw:commentrss> element is the reason that the well-formed web rss module is popular. this element lets you syndicate your comments. the uri in the <wfw:commentrss> element must point to an rss feed containing the comments for the <item> it is contained in. ...
title - Archive of obsolete content
the rsstitle element contain onlyplain text data. note: in userland's rss 0.91 there is a 100 character maximum limit. ...
...advogato</title> <link>http://www.advogato.org/article/</link> <description>recent advogato articles</description> <language>en-us</language> <image> <link>http://www.advogato.org/</link> <title>advogato</title> <url>http://www.advogato.org/image/tinyadvogato.png</url> </image> <item> <title>why can i not get any tang?!</title> <link>http://www.advogato.org/article/10101.html</link> <description>seriously. why can't i get any tang?</description> </item> </channel> </rss> attributes none sub-elements none parent elements the table below shows a list of rss elements that this element can ...
...th>0.93</td> <th>0.94</td> <th>1.0</td> <th>2.0</td> </tr> <tr> <td>rss channel element</td> <td><channel></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss image element</td> <td><image></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss item element</td> <td><item></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> <tr> <td>rss text input element</td> <td><textinput></td> <td>✔</td> <td>✔</td> <td>✔</td> <td>✔</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> <td>?</td> </tr> </table> </center> see also none rss element</td> <th colspan="9" ...
Debug - Archive of obsolete content
u must have a script debugger installed and the script must run in debug mode. internet explorer 8 and later versions include the javascript debugger. if the script is not being debugged, the debug methods and properties have no effect. constants async callback status codes contant description value debug.ms_async_callback_status_assign_delegate the synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 debug.ms_async_callback_status_join the synchronous work item satisfied part of a join asynchronous operation. 1 debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choice asynchronous operation. 2 debug.ms_async_callback_status_cancel the synchrono...
...d a callback or continuation to be run by an asynchronous operation. 0 debug.ms_async_callback_status_join the synchronous work item satisfied part of a join asynchronous operation. 1 debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choice asynchronous operation. 2 debug.ms_async_callback_status_cancel the synchronous work item was canceled. 3 debug.ms_async_callback_status_error the synchronous work item caused an error in an asynchronous operation. 4 async operation status codes contant description value debug.ms_async_op_status_success the asynchronous operation was successful. 1 debug.ms_async_op_status_canceled the asynchronous operation was cancel...
... debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation. debug.mstraceasyncoperationcompleted indicates that an asynchronous operation has completed. debug.mstraceasyncoperationstarting initiates a trace for an asynchronous operation. debug.msupdateasynccallbackrelation updates the relationship status between a synchronous work item and the associated asynchronous operation. debug.write sends strings to the script debugger. debug.writeln sends strings to the script debugger, followed by a newline character. examples print the value of a variable this example uses the write function to display the value of the variable. var counter = 42; debug.write("the value of counter is " + counter); requirements supported in t...
Enumerator - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension. it is supported in internet explorer only, not in windows 8.x store apps. the enumerator object enables enumeration of items in a collection. syntax enumobj = new enumerator([collection]) parameters enumobj the variable name to which the enumerator object is assigned. collection optional any collection object. remarks collections differ from arrays in that the members of a collection are not directly accessible. instead of using indexes, as you would with arrays, you can move the current item pointer only to the first or next element of a collection. the enumerator object provides a way to access any member of a collection and behaves similarly to the for...each statement in vbscript. example the following code s...
...er of a collection and behaves similarly to the for...each statement in vbscript. ...
... drivestring += totalgb.tofixed(3) + " gb"; } else{ drivestring += "not ready"; } drivestring += "<br />";; e.movenext(); } document.write(drivestring); // output: <drive information properties the enumerator object has no properties. methods enumerator.atend returns a boolean value indicating if the enumerator is at the end of the collection. enumerator.item returns the current item in the collection. enumerator.movefirst resets the current item in the collection to the first item. enumerator.movenext moves the current item to the next item in the collection. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
after the asset is retrieved and stored in a string, the proper namespaces are defined for this particular resource. the defa...
...ecomes important if we want to be able to access any data elements in the feed defined in these namespaces. the act of creating an e4x object is quite simple, in the case of listing 3, we do this through the line var x = new xml( str ); from here, the xml is accessible via dot notation. notice during the processing of the item element where we use the rdf and dc namespace to access the about attribute of the item element, and the date element respectively. the syntax for accessing e4x objects is actually quite natural and certainly easier than most methods. javascript engines such as rhino and spidermonkey on their own have proven to be a useful and powerful tool to the developer. however, taki...
...ld txt_message = new ext.form.textarea({ name: "message", fieldlabel: "message", width: 200 }); // create a button used to send the form details. btn_comments = new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel({ labelalign: "right", width: 400, title: "comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderto: "form-comments" }); }); </script> the code in listing 6 starts by hooking in the ext js library which is used to produce the ui elements of the form. next a script named validatecomments.js is hooked in with the runat attribute set to both. the function defined within this file checks th...
Grid Areas - MDN Web Docs Glossary: Definitions of Web-related terms
i have named these with the grid-area property and then laid them out on the grid using grid-template-areas. this creates two grid areas, one covering four grid cells, the other two. ...
...i have named these with the grid-area property and then laid them out on the grid using grid-template-areas. this creates two grid areas, one covering four grid cells, the other two. ...
....wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: 100px 100px; grid-template-areas: "a a b" "a a b"; } .item1 { grid-area: a; } .item2 { grid-area: b; } <div class="wrapper"> <div class="item1">item</div> <div class="item2">item</div> </div> learn more property reference grid-template-columns grid-template-rows grid-auto-rows grid-auto-columns grid-template-areas grid-area further reading css grid layout guide: basic concepts of grid layout css grid layout guide: grid tem...
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
he document and so in a right-to-left language for example, column line 1 will be on the right of the grid. the image below shows the line numbers of the grid, assuming the language is left-to-right. lines are also created in the implicit grid when implicit tracks are created to hold content positioned outside of the explicit grid, however these lines cannot be addressed by a number. placing items onto the grid by line number having created a grid, you can place items onto the grid by line number. in the following example the item is positioned from column line 1 to column line 3, and from row line 1 to row line 3. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns...
...er-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="item">item</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 100px 100px; } .item { grid-column-start: 1; grid-column-end: 3; grid-row-start: 1; grid-row-end: 3; } naming lines the lines created in the explicit grid can be named, by adding the name in square brackets before or after the track sizing information. when placing an item...
...er-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="item">item</div> </div> .wrapper { display: grid; grid-template-columns: [col1-start] 1fr [col2-start] 1fr [col3-start] 1fr [cols-end]; grid-template-rows: [row1-start] 100px [row2-start] 100px [rows-end]; } .item { grid-column-start: col1-start; grid-column-end: col3-start; grid-row-start: row1-start; grid-row-end: rows-end; } learn more property reference grid-template-colum...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
del-view-presenter), and mvw (model-view-whatever). the three parts of the mvc software-design pattern can be described as follows: model: manages data and business logic. view: handles layout and display. controller: routes commands to the model and view parts. model view controller example imagine a simple shopping list app. all we want is a list of the name, quantity and price of each item we need to buy this week. below we'll describe how we could implement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view). going back to our ...
...mplement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view). going back to our shopping list app, the model would specify what data the list items should contain — item, price, etc. — and what list items are already present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the ...
... app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the users of the app. so for example, our shopping list could have input forms and buttons that allow us to add or delete items. these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. you might however also want to just update the view to display the data in a different format, e.g., change the item order to alphabetical, or lowest to highest price. in this case the controller could handle this dir...
Cascade and inheritance - Learn web development
n — the immediate child <li>s, and those inside the first nested list. we have then added a class of special to the second nested list and applied a different color to it. this then inherits down through its children. things like widths (as mentioned above), margins, padding, and borders do not inherit. if a border were to be inherited by the children of our list, every single list and list item would gain a border — probably not an effect we would ever want! which properties are inherited by default and which aren't is largely down to common sense. controlling inheritance css provides four special universal property values for controlling inheritance. every css property accepts these values. inherit sets the property value applied to a selected element to be the same as that of...
... origin of css declarations in introducing the css cascade for more information on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { co...
...les not applying as expected. it could be a specificity issue. ...
Test your skills: Grid Layout - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. grid layout one in this task you should create a grid into which the four child elements will auto-place. ...
...ow tracks. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. grid layout two in this example we already have a grid defined. by editing the css rules for the two child elements, cause them to span over several grid tracks each; the second item should overlay the first as in the image below. try updating the live code below to recreate the finished example: additional questions: can you now cause the first item to display on top without changing the order of items in the source? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. grid layout ...
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. ...
What are browser developer tools? - Learn web development
efox: menu ➤ web developer ➤ toggle tools, or tools ➤ web developer ➤ toggle tools chrome: more tools ➤ developer tools safari: develop ➤ show web inspector. if you can't see the develop menu, go to safari ➤ preferences ➤ advanced, and check the show develop menu in menu bar checkbox. opera: developer ➤ developer tools context menu: press-and-hold/right-click an item on a webpage (ctrl-click on the mac), and choose inspect element from the context menu that appears. (an added bonus: this method straight-away highlights the code of the element you right-clicked.) the inspector: dom explorer and css editor the developer tools usually open by default to the inspector, which looks something like the following screenshot. this tool shows what the html on your...
... pane of the debugger. source code set breakpoints where you want to pause execution. in the following image, the highlight on the number 18 shows that the line has a breakpoint set. watch expressions and breakpoints the right-hand pane shows a list of the watch expressions you have added and breakpoints you have set. in the image, the first section, watch expressions, shows that the listitems variable has been added. you can expand the list to view the values in the array. the next section, breakpoints, lists the breakpoints set on the page. in example.js, a breakpoint has been set on the statement listitems.push(inputnewitem.value); the final two sections only appear when the code is running. the call stack section shows you what code was executed to get to the current line. you ...
... the call stack section shows you what code was executed to get to the current line. you can see that the code is in the function that handles a mouse click, and that the code is currently paused on the breakpoint. the final section, scopes, shows what values are visible from various points within your code. for example, in the image below, you can see the objects available to the code in the additemclick function. find out more find more out about the javascript debugger in different browsers: firefox javascript debugger microsoft edge debugger chrome debugger safari debugger the javascript console the javascript console is an incredibly useful tool for debugging javascript that isn't working as expected. it allows you to run lines of javascript against the page currently loaded...
Debugging HTML - Learn web development
elements: nesting elements properly is also very important for code behaving correctly. <strong>strong <em>strong emphasised?</strong> what is this?</em> <li>unclosed attributes: another common source of html problems. let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and list item elements have no closing tags. looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin. the first <strong> element has no closing tag. this is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text has bee...
...use your browser's developer tools, take a few minutes to review discover browser developer tools. in the dom inspector, you can see what the rendered markup looks like: using the dom inspector, let's explore our code in detail to see how the browser has tried to fix our html errors (we did the review in firefox; other modern browsers should give the same result): the paragraphs and list items have been given closing tags. it isn't clear where the first <strong> element should be closed, so the browser has wrapped each separate block of text with its own strong tag, right down to the bottom of the document! the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the...
... <strong> element should be closed, so the browser has wrapped each separate block of text with its own strong tag, right down to the bottom of the document! the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the missing double quote has been deleted altogether. the last list item looks like this: <li> <strong>unclosed attributes: another common source of html problems. let's look at an example: </strong> </li> html validation so you can see from the above example that you really want to make sure your html is well-formed! but how? in a small example like the one seen above, it is easy to search through the lines and find the errors, but what about a hu...
Document and website structure - Learn web development
it defines a specific header for that section (try not to confuse this with titles and headings). <nav> contains the main navigation functionality for the page. secondary links, etc., would not go in the navigation. <footer> represents a group of end content for a page. non-semantic wrappers sometimes you'll come across a situation where you can't find an ideal semantic element to group some items together or wrap some content. sometimes you might want to just group a set of elements together to affect them all as a single entity with some css or javascript. for cases like these, html provides the <div> and <span> elements. you should use these preferably with a suitable class attribute, to provide some kind of label for them so they can be easily targeted. <span> is an inline non-semant...
...ch page. note down what you want to have common to every page. next, draw a rough sketch of what you might want the structure of each page to look like (it might look like our simple website above). note what each block is going to be. now, brainstorm all the other (not common to every page) content you want to have on your website — write a big list down. next, try to sort all these content items into groups, to give you an idea of what parts might live together on different pages. this is very similar to a technique called card sorting. now try to sketch a rough sitemap — have a bubble for each page on your site, and draw lines to show the typical workflow between pages. the homepage will probably be in the center, and link to most if not all of the others; most of the pages in a sma...
...ble for each page on your site, and draw lines to show the typical workflow between pages. the homepage will probably be in the center, and link to most if not all of the others; most of the pages in a small site should be available from the main navigation, although there are exceptions. you might also want to include notes about how things might be presented. active learning: create your own sitemap try carrying out the above exercise for a website of your own creation. what would you like to make a site about? note: save your work somewhere; you might need it later on. test your skills! you've reached the end of this article, but can you remember the most important information? you can find a detailed assessment that tests these skills at the end of the module; see structuring a pag...
Test your skills: Arrays - Learn web development
section at the bottom of this page. note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version). arrays 1 let's start off with some basic array practice. in this task we'd like you to create an array of three items, stored inside a variable called myarray. the items can be anything you want — how about your favourite foods or bands? next, modify the first two items in the array using simple bracket notation and assignment. then add a new item to the beginning of the array. try updating the live code below to recreate the finished example: download the starting point for this task to work in your ow...
...tarting point for this task to work in your own editor or in an online editor. arrays 2 now let's move on to another task. here you are provided with a string to work with. we'd like you to: convert the string into an array, removing the + characters in the process. save the result in a variable called myarray. store the length of the array in a variable called arraylength. store the last item in the array in a variable called lastitem. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 3 for 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 tw...
...updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 3 for this final array task, we provide you with a starting array, and you will work in somewhat the opposite direction. you need to: remove the last item in the array. add two new names to the end of the array. go over each item in the array and add its index number after the name inside parentheses, for example ryu (0). note that we don't teach how to do this in the arrays article, so you'll have to do some research. finally, join the array items together in a single string called mystring, with a separator of " - ". try updating the live code below to recreate the finished example: download the starting point fo...
Working with JSON - Learn web development
secretidentity": "dan jukes", "powers": [ "radiation 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 val...
...a3 = document.createelement('p'); const mylist = document.createelement('ul'); myh2.textcontent = heroes[i].name; mypara1.textcontent = 'secret identity: ' + heroes[i].secretidentity; mypara2.textcontent = 'age: ' + heroes[i].age; mypara3.textcontent = 'superpowers:'; const superpowers = heroes[i].powers; for (let j = 0; j < superpowers.length; j++) { const listitem = document.createelement('li'); listitem.textcontent = superpowers[j]; mylist.appendchild(listitem); } myarticle.appendchild(myh2); myarticle.appendchild(mypara1); myarticle.appendchild(mypara2); myarticle.appendchild(mypara3); myarticle.appendchild(mylist); section.appendchild(myarticle); } } to start with, we store the members property of the javascr...
...eir secretidentity, age, and a line saying "superpowers:" to introduce the information in the list. store the powers property in another new constant called superpowers — this contains an array that lists the current hero's superpowers. use another for loop to loop through the current hero's superpowers — for each one we create an <li> element, put the superpower inside it, then put the listitem inside the <ul> element (mylist) using appendchild(). the very last thing we do is to append the <h2>, <p>s, and <ul> inside the <article> (myarticle), then append the <article> inside the <section>. the order in which things are appended is important, as this is the order they will be displayed inside the html. note: if you are having trouble getting the example to work, try referring to our...
Beginning our React todo list - Learn web development
oment. first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form. we have an array of buttons that will be used to filter our tasks. we have a heading that tells us how many tasks remain. we have our 3 tasks, arranged in an un-ordered list. each task is a list item (<li>), and has buttons to edit and delete it and a checkbox to check it off as done. the form will allow us to make tasks; the buttons will let us filter them; the heading and list are our way to read them. the ui for editing a task is conspicuously absent for now. that's okay – we'll write that later. accessibility features you may notice some unusual attributes here. for example: <butto...
...eck out scott o'hara’s article, “fixing lists”. the aria-labelledby attribute tells assistive technologies that we're treating our list heading as the label that describes the purpose of the list beneath it. making this association gives the list a more informative context, which could help screen reader users better understand the purpose of it. finally, the labels and inputs in our list items have some attributes unique to jsx: <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> the defaultchecked attribute in the <input/ > tag tells react to check this checkbox initially. if we were to use checked, as we would in regular html, react would log some warnings into our browser console relating to handling events o...
...: 2rem; border: 2px solid #000; } .input__lg:focus { border-color: #4d4d4d; box-shadow: inset 0 0 0 2px; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .filters { width: 100%; margin: unset auto; } /* todo item styles */ .todo { display: flex; flex-direction: row; flex-wrap: wrap; } .todo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* checkbox styles */ .c-cb { box-sizing: border-box; font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; ...
Starting our Svelte Todo list app - Learn web development
<span class="visually-hidden">show</span> <span>active</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" aria-pressed="false"> <span class="visually-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> <!-- todosstatus --> <h2 id="list-heading">2 out of 3 items completed</h2> <!-- todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> <!-- todo-1 (editing mode) --> <li class="todo"> <div class="stack-small"> <form class="stack-small"> <div class="form-group"> <label for="todo-1" class="todo-label"> new name for 'create a svelte starter app' </la...
...out again, and you'll see something like this: it's current not very nicely styled, and also functionally useless. but let's have a look at the markup and see how it relates to our desired features: a label and a text box for entering new tasks. three buttons to filter by task status. a label showing the total number of tasks and the completed tasks. an unordered list, which holds a list item for each task. when the task is being edited, the list item has an input and two button to cancel or save modifications. if the task is not being edited, there's a checkbox to set the completed status, and two buttons to edit or delete the task. finally there are two buttons to check/uncheck all task and to remove completed tasks. in subsequent articles we'll get all these features working, ...
...: 2rem; border: 2px solid #000; } .input__lg:focus { border-color: #4d4d4d; box-shadow: inset 0 0 0 2px; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .filters { width: 100%; margin: unset auto; } /* todo item styles */ .todo { display: flex; flex-direction: row; flex-wrap: wrap; } .todo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* checkbox styles */ .c-cb { box-sizing: border-box; font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; ...
Mozilla accessibility architecture
will not need to override the traversal methods. that is why we don't need to override these traversal methods for nsxulcomboboxaccessible (<menulist>). nsouterdocaccessible: used for elements such as <iframe>, <browser> and <editor>, which spawn an entire new document, but don't actually have any child nodes in their own dom. nsxultreeaccessible: which does not have a dom node for each tree item, a special interface is provided by the tree itself to get the text for each row, column in the tree. in all of these accessible implementations we override nsiaccessible::getaccchildcount(), ::getaccfirstchild() and ::getacclastchild(). in this way we avoid the normal nsaccessibletreewalker traversal methods and create whatever child accessibles we want. when there is no dom node for each acces...
...text for each row, column in the tree. in all of these accessible implementations we override nsiaccessible::getaccchildcount(), ::getaccfirstchild() and ::getacclastchild(). in this way we avoid the normal nsaccessibletreewalker traversal methods and create whatever child accessibles we want. when there is no dom node for each accessible, as is the case for nshtmlcomboboxaccessible and nsxultreeitemaccessible, we also need to override the shutdown() method, so that the children get removed from memory when the parent is shutdown. in that case we also override ::getaccnextsibling(), ::getaccprevioussibling() for the dom-less children; otherwise they do not know how to find each other. it is also useful to override these the child getters to return nothing, as we do in nsleafaccessible, nstext...
...ts on nodes within them, and consequently fire the appropriate accessible event. this happens in the handleevent() method. note: this chart is not complete, consult the handleevent() method to see the rest. ...
Chrome registration
e packages are marked with a special flag indicating that they are platform specific. some parts of content, skin, and locales may be different based on the platform being run. these packages contain three different sets of files, for windows and os/2, macintosh, and unix-like platforms. for example, the order of the "ok" and "cancel" buttons in a dialog is different, as well as the names of some items. the "platform" modifier is only parsed for content registration; it is not recognized for locale or skin registration. however, it applies to content, locale, and skin parts of the package, when specified. to indicate that a package is platform-specific, add the "platform" modifier to the "content" line after the path, for example: content global-platform jar:toolkit.jar!/toolkit/content/glo...
...smedberg. note that this page is included from the pages listed below. ...
...d below. ...
Displaying Places information using views
**the title column (and only the title column) automatically receives the favicon referenced by the nsinavhistoryresultnode property icon. you may specify as few or as many of these magic columns as you want, and your tree may of course contain other columns as well. in lieu of setting an id on a treecol, you may specify an anonid attribute. this is useful when you need the id for another p...
...w query will be called on this array of folder ids. optional. load() sets the queries that the view displays. this method may be used as an alternative to setting the tree's place property as described above. void load( array queries, nsinavhistoryqueryoptions options ); parameters queries an array of nsinavhistoryquery objects. options an nsinavhistoryqueryoptions object. selectitems() selects the first node in the tree that matches each given item id. it will open any parent nodes that it needs to in order to show the selected items. void selectitems( array aids, array aopencontainers ); parameters aids an array of item ids. aopencontainers if true or undefined, folders that are closed are also searched. they are not searched otherwise. optional. selectnode(...
...event, 'place:folder=bookmarks_menu');" </menupopup> </menu> the menu view is implemented in browser/components/places/content/menu.xml. see the menupopup and menu references and popup menus tutorial for general information about menus. toolbar view create a built-in toolbar view by setting the type attribute to "places" on an empty hbox element (which would be a child of some parent toolbaritem element, itself the child of a toolbar element): <toolbar> <toolbaritem> <hbox type="places" /> </toolbaritem> </toolbar> the place attribute or property should be set on the hbox as well. the toolbar view is implemented in browser/components/places/content/toolbar.xml. see the toolbaritem and toolbar references and toolbars tutorial for general information about toolbars. using a vi...
Performance best practices for Firefox front-end engineers
o strive for reflow to only occur in the one place (the layout step of the 16ms tick) as opposed to multiple times during the 16ms tick (which has a higher probability of running through the 16ms budget). how do i avoid triggering uninterruptible reflow? here's a list of things that javascript can ask for that can cause uninterruptible reflow, to help you think about the problem. note that some items in the list may be browser-specific or subject to change, and that an item not occurring explicitly in the list doesn't mean it doesn't cause reflow. for instance, at time of writing accessing event.rangeoffset triggers reflow in gecko, and does not occur in the earlier link. if you're unsure whether something causes reflow, check! note how abundant the properties in that first list are. this m...
...aphics team members are in the us eastern time zone (utc-5 or utc-4 during daylight saving time), so let that information guide your timing when you ask questions in the gfx room . adding nodes using documentfragments sometimes you need to add several dom nodes as part of an existing dom tree. for example, when using xul <xul:menupopup>s, you often have script which dynamically inserts <xul:menuitem>s. inserting items into the dom has a cost. if you're adding a number of children to a dom node in a loop, it's often more efficient to batch them into a single insertion by creating a documentfragment, adding the new nodes to that, then inserting the documentfragment as a child of the desired node. a documentfragment is maintained in memory outside the dom itself, so changes don't cause reflow.
...t.createelement() for example), and add each one to the fragment by calling documentfragment.appendchild(). once the fragment is populated, append the fragment to the dom by calling appendchild() on the parent element for the new elements. this example has been cribbed from davidwalsh’s blog post: // create the fragment var frag = document.createdocumentfragment(); // create numerous list items, add to fragment for(var x = 0; x < 10; x++) { var li = document.createelement("li"); li.innerhtml = "list item " + x; frag.appendchild(li); } // mass-add the fragment nodes to the list listnode.appendchild(frag); the above is strictly cheaper than individually adding each node to the dom. the gecko profiler add-on is your friend the gecko profiler is your best friend when dia...
Embedding Tips
e nsiwebbrowser::parenturicontentlistener attribute. watch for changes in nsiuricontentlistener::onstarturiopen(). you can abort the uri load at this point if you don't want it to proceed. if necessary you may also implement the nsiuricontentlistener::ispreferred(), returning pr_true to ensure you are always the preferred uri handler and are called no matter what the content type. how do i copy items to the clipboard? obtain the nsiclipboardcommands interface from the appropriate web browser object via nsiserviceprovider::getinterface (or the do_getinterface() helper method). how do i save a document or data to disk? query for the nsiwebbrowserpersist interface implemented on the web browser object and call the saveuri() or savedocument() methods on that. alternatively, create a standalo...
... "my_prop_name", "my_prop_contract_id", pr_true, pr_true, getter_copies(previous)); that way you will be able to do: var my_comp = new my_prop_name(); this was taken from weirdal's excellent "burning chrome" article. how do i specify alternate locations for profiles? specify a profile directory in your implementation of nsidirectoryserviceprovider passed to xre_initembedding. use xre_notifyprofile to make gecko actually use a profile location. how do i change the user agent string? the default useragent is set using the value from your application.ini/nsxreappdata. you can override this default using the "general.useragent.override" preference. how do i display my own message, alert and prompt boxes? you need to implement and register your own prompt servi...
...od will be called with the dom node that the context applies, the dom event plus some flag combinations that assist in determining what menu to display (document, link, image, selected text etc.) how do i implement tool tips? make your chrome object implement the nsitooltiplistener interface. methods to hide or show the tool tips will automatically be called upon it when the user hovers over an item with title text. the contract id is defined here. for an example, see browserimpl.cpp in mfcembed and its simple cbrowsertooltip class implemented in mfc. how do i disable drag/drop support? when setting up your browser add a hook to the command manager which points to your nsiwebbrowserchrome implementation. this implementation should also implement nsiclipboarddragdrophooks. deny the drop by...
Midas
e given type of heading. hilitecolor a color code this command will set the hilite color of the selection or at the insertion point. it only works with stylewithcss enabled. increasefontsize this command will add a <big> tag around selection or at insertion point. indent indent the block where the caret is located. if the caret is inside a list, that item becomes a sub-item one level deeper. insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag. inserthorizontalrule null/string (when string is the line's id) this command will insert a horizontal rule (line) at the insertion point. does it delete the selection? yes! inserthtm...
...f the current selection or at the caret location. the given string is the html to insert. insertimage a uri. this command will insert an image (referenced by the given url) at the insertion point. insertorderedlist depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and an ol. if the caret is inside a bulleted item, the bulleted item becomes a numbered item. insertunorderedlist depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and ul. if the caret is inside a numbered item, the numbered item becomes a bulleted item. insertparagraph inserts a new paragraph. italic if there is no selection, the insertion point w...
... center-aligns the current block. justifyfull fully-justifies the current block. justifyleft left-aligns the current block. justifyright right aligns the current block. outdent outdent the block where the caret is located. if the block is not indented prior to calling outdent, nothing will happen. if the caret is in a list item, the item will bump up a level in the list or break out of the list entirely. paste this command will paste the contents of the clipboard at the location of the caret. if there is a selection, it will be deleted prior to the insertion of the clipboard's contents. note: this command won't work without setting a pref or using signed js. user_pref("capability.policy.policynam...
Index
entations, especially when importing data from files. a recent development adds support for loading external pem files that contain private keys, in a software library called nss-pem, which is separately available, but should eventually become a core part of nss. looking at the code level, nss deals with blocks of raw data all the time. ...
...an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are tracked. ...
... 353 modutil-tasks.html no summary! ...
NSS API Guidelines
low.h, keytboth.h, keytlow.h, secpkcs5.h, pkcs11.h, pkcs11f.h, pkcs11p.h, pkcs11t.h, pkcs11u.h ssl provides an implementation of the ssl protocol using nss and nspr. ssl lib/ssl ssl.h, sslerr.h, sslproto.h, preenc.h secutil provides utility functions and data types used by other libraries. ...
... cvs id each file should include a cvs id string for identification. ...
... char *myname; }; the second task is to determine if individual data fields, within the data structure, are part of the api. one example may be the peercert field, in an ssl data structure. accessor functions, for these data elements, should be added to the api. there can be legitimate exceptions to this 'make everything opaque' rule. for example, in container structures, such as secitem, or maybe linked list data structures. these data structures need to be examined on a case by case basis, to determine if they are truly stable and will not change in future release it is necessary for the callers of the api to know the size of these structures, as they may allocate new ones and pass them down. memory allocation with arenas this section discusses memory allocation using ar...
NSS reference
encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. random number generation th...
... encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. random number generation this api consists of the...
... encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. random number generation this api consists of the two routine...
INT_FITS_IN_JSVAL
warning: the type of the argument i must be jsint, but the c/c++ compiler does not enforce type safety here. if i is an unsigned or 64-bit value, int_fits_in_jsval can silently give the wrong answer. ...
...s an unsigned or 64-bit value, int_fits_in_jsval can silently give the wrong answer. starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers. ...
.... starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers. ...
ROLE_ROW
« gecko roles page represents a row of cells within a table. also, see role_table. ...
... « gecko roles page represents a row of cells within a table. also, see role_table. ...
... « gecko roles page represents a row of cells within a table. also, see role_table. ...
Gecko states
tates by gecko. state constants are defined in nsiaccessiblestates. states list state_unavailable the object is unavailable, i.e. disabled. applied to: all roles. state_selected the object is selected, i.e. indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. applied to: role_menuitem, role_cell, role_outlineitem, xxx: continue events: event_state_change Сoncomitant state: state_selectable state_focused the object is focused applied to: events: concomitant state: state_focusable state_pressed the object is pressed. state_checked the object is checked state_mixed indicates that the state of a three-state check box or toolbar button is not determined. the check ...
...erefore in the third or mixed state. state_readonly the object is designated read-only. state_hottracked the object is hot-tracked by the mouse, which means that its appearance has changed to indicate that the mouse pointer is located over it. isn't used state_default this state represents the default button in a window. state_expanded children of this object that have the role_outlineitem role are displayed. state_collapsed children of this object that have the role_outlineitem role are hidden. state_busy the control cannot accept input at this time. state_floating children "owned" not "contained" by parent state_checkable indicates scrolling or moving text or graphics. state_animated the object's appearance changes rapidly or constantly. graphics that are occasionally a...
...nformation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the information about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items in the list to users. state_offscreen scrolled off state_sizeable the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable indicates that the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing the object...
Feed content access API
(components.interfaces.nsifeed); // open a new window var win = window.open("", "feedtest_window"); var doc = win.document.wrappedjsobject; doc.open(); // write the html header and page title doc.write("<html><head><title>feed: " + feed.title.text + "</title></head><body>"); doc.write("<h1>" + feed.title.text + "</h1><p>"); var itemarray = feed.items; var numitems = itemarray.length; // write the article information if (!numitems) { doc.write("<i>no news is good news!</i>"); } else { var i; var theentry; var theurl; var info; for (i=0; i<numitems; i++) { theentry = itemarray.queryelementat(i, components.interfac...
... nsifeed that contains all the feed data. to get the title of the feed, you look at the feed.title property. the title is an nsifeedtextconstruct that can represent the text in various formats; we get its text property to fetch the feed's title as html-encoded text. we could, alternatively, use its plaintext() method to get a copy of the title translated into plain text. we then scan the array of items in the feed by looking at the feed.items nsiarray. this array contains nsifeedentry objects that describe each feed item. we build the contents of the document by looking at the title, link, summary, and content properties for each item. the full url of the link is retrieved using the link's resolve() method. to initialize a fetch of the feed, we simply call fetch(url). this opens a new window c...
...ems nsiarray. this array contains nsifeedentry objects that describe each feed item. we build the contents of the document by looking at the title, link, summary, and content properties for each item. the full url of the link is retrieved using the link's resolve() method. to initialize a fetch of the feed, we simply call fetch(url). this opens a new window containing the feed contents, with each item's title a clickable link that takes you to the article itself. for details on each of the feed access interfaces, visit their respective reference pages. ...
XPCOM hashtable guide
this is the simplified version of the detailed xpcom hashtable guide. everything you need to know is probably on this page. also note that mfbt/hashtable.h now exists. it is a lot faster than the xpcom hashtables due to more inlining and templating, and the api is arguably better. what is a hashtable? a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, an...
...with keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted; cannot be iterated over in a sorted manner. inserting/removing: o(n): adding and removing items from a large array can be time-consuming o(1): adding and removing items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space. some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory. in their implementation, hashtables take the key and apply a mathem...
...randomize the key and then use the hash to find the location in the hashtable. good hashtable implementations will automatically resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed. hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. which hashtable should i use? the appropriate hashtable class to use depends solely on the data type. th...
nsIAccessibleStates
adonly 0x00000040 the object is designated read-only. state_hottracked 0x00000080 the object is hot-tracked by the mouse, which means that its appearance has changed to indicate that the mouse pointer is located over it. currently unused. state_default 0x00000100 this state represents the default button in a window. state_expanded 0x00000200 children of this object that have the role_outlineitem role are displayed. (see nsiaccessiblerole.constants). state_collapsed 0x00000400 children of this object that have the role_outlineitem role are hidden. (see nsiaccessiblerole.constants). state_busy 0x00000800 the control cannot accept input at this time. state_floating 0x00001000 children "owned" not "contained" by parent. state_marqueed 0x00002000 the object is scrolling or moving text...
...raphics. state_animated 0x00004000 the object's appearance changes rapidly or constantly. graphics that are occasionally animated are described as role_graphic (see nsiaccessiblerole.constants) with the state property set to state_animated. this state is used to indicate that the object's location is changing. state_invisible 0x00008000 the object is programmatically hidden. for example, menu items are programmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not communicate information about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the informat...
...nformation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the information about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items in the list to users. state_offscreen 0x00010000 scrolled off. state_sizeable 0x00020000 the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable 0x00040000 the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_sel...
nsIAccessibleTreeCache
wsers, its use is discouraged since it could be removed at any time. try to avoid using it. a private interface to operate with tree accessible. accessible/public/nsiaccessibletreecache.idlnot scriptable please add a summary to this article. ...
...in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview nsiaccessible getcachedtreeitemaccessible(in long arow, in nsitreecolumn acolumn); void invalidatecache(in long arow, in long acount); void treeviewchanged(); void treeviewinvalidated(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 ...
...ted 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 accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or removed (minus) treeviewchanged() invalidates children created for the previous tree view. void treeviewchanged(); parameters none. treeviewinv...
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 aitemindex ); 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 ...
...urrent 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 unsigned long sets the action (copy, move, link and so on) for the current drag. (see nsidragservice) numdropitems unsigned long get the number of items that were dropped. read only. onlychromedrop boolean indicates if the drop event should be dispatched only to chrome. this allows chrome to handle a drag that was refused by content. sourcedocument nsidomdocument the document where the drag was started, which will be null if the drag originated outside the application. us...
... 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 aitemindex ); parameters atransferable the transferable for the data to be put into. aitemindex 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. boo...
nsINavHistoryContainerResultNode
lt on the places service that describes a container (which is any kind of grouping, including 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 aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false. read only. childrenreadonly boolean false if the node's list...
...er is open or closed. when the container is closed, the result is an exact answer if the node can be populated easily (for example, for bookmark folders). if it can't be populated easily (for complex history queries, for example), the result is always true. when the container is open, the result is always accurate. this value is intended to be used to see if the "+" should be drawn next to a tree item, indicating that the item can be opened. read-only. remotecontainertype obsolete since gecko 1.9 autf8string a string representing the remote container service api that is responsible for this container. if there is no such api, this value is an empty string. read only. the container may be a result_type_remote_container node that has been dynamically generated by the remote container api, or ...
...escription state_closed 0 the container is closed. state_loading 1 the container has been opened asynchronously, but is still loading and is not all the way opened yet. state_opened 2 the container is open. methods findnodebydetails() returns a node matching specified details. nsinavhistoryresultnode findnodebydetails( in autf8string auristring, in prtime atime, in long long aitemid, in boolean recursive ); parameters auristring the uri attribute value to match on. atime the time attribute to match on. aitemid the item id to match on. arecursive if true, the search will recurse through all child containers of the current container; if false, only direct children of the container are searched. return value an nsinavhistoryresultnode of a node matching the specified det...
nsISHEntry
from: nsihistoryentry last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/browser/session-history-entry;1. ...
...ged in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/browser/session-history-entry;1. ...
...t viewer is marked "sticky" windowstate nsisupports saved state of the global window object. 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.
nsITransactionManager
this is commonly referred to as the number of levels of undo. a value of -1 means no limit. a value of zero means the transaction manager will execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a value greater than zero indicates the max number of transactions that ca...
...ill execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a value greater than zero indicates the max number of transactions that can exist at any time on both the undo and redo stacks. this method will prune the necessary number of transactions on the undo and redo stacks if the value specified is less than the number of items that exist on both the undo and redo stacks. numberofredoitems long the number of items on the redo stack. read only. numberofundoitems long the number of items on the undo stack. read only. methods addlistener() adds a listener to the transaction manager's notification list. listeners are notified whenever a transaction is done, undone, or redone. the listener's nsitransactionlistener.ad...
.... void dotransaction( in nsitransaction atransaction ); parameters atransaction the nsitransaction to do. endbatch() turns off the transaction manager's batch mode. void endbatch(); parameters none. getredolist() returns the list of nsitransaction on the redo stack. note that the transaction at the top of the redo stack will actually be at the index n-1 in the list, where n is the number of items in the list. nsitransactionlist getredolist(); parameters none. return value a list of nsitransaction on the redo stack. getundolist() returns the list of nsitransaction on the undo stack. note that the transaction at the top of the undo stack will actually be at the index n-1 in the list, where n is the number of items in the list. nsitransactionlist getundolist(); parameters none. return val...
nsITreeSelection
ng index); void selectall(); void timedselect(in long index, in long delay); void toggleselect(in long index); attributes attribute type description count long the number of rows currently selected in this tree. read only. currentcolumn nsitreecolumn the current column. currentindex long the current item (the one with focus). note: this property indicates only the index of the row with tree cursor around it. this is not a reliable method of determining the selected row, as the selection may include multiple rows, or the focused row may not even be selected. selecteventssuppressed boolean this attribute is a boolean indicating whether or not the "select" event should fire w...
...ribute is a boolean indicating whether or not the "select" event should fire when the selection is changed using one of our methods. a view can use this to temporarily suppress the selection while manipulating all of the indices, for example, on a sort. note: setting this attribute to false will fire a select event. shiftselectpivot long the selection "pivot". this is the first item the user selected as part of a ranged select. read only. single boolean this attribute is a boolean indicating single selection. read only. tree nsitreeboxobject the tree widget for this selection. methods adjustselection() called when the row count changes to adjust selection indices. void adjustselection( in long index, in long count ); parameters i...
...boolean isselected( in long index ); parameters index index of the row to check. return value rangedselect() select the range specified by the indices. void rangedselect( in long startindex, in long endindex, in boolean augment ); parameters startindex index to start selecting at. endindex index to stop selecting at. this parameter is inclusive; to select one item, set endindex == startindex. augment if true, the range is added to the selection without clearing out anything else. if false, everything is cleared except for the specified range. select() deselect all rows and select the row at the specified index. void select( in long index ); parameters index index of the row to select. selectall() selects all rows. void selectall(); p...
nsIWebNavigation
if there is none. this attribute never returns null except for unexpected error situations. read only. referringuri nsiuri the referring uri for the currently loaded uri or null. read only. sessionhistory nsishistory the session history object used by this web navigation instance. methods goback() tells the object to navigate to the previous 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 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 s...
... loaduri() loads a given uri. this will give priority to loading the requested uri in the object implementing this interface. ...
... 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 process of content loading. ...
nsIWinTaskbar
nsitaskbarprogress gettaskbarprogress( in nsidocshell shell ); parameters shell the nsidocshe...
...nsitaskbarprogress gettaskbarprogress( in nsidocshell shell ); parameters shell the nsidocshell used to find the toplevel window. return value an nsitaskbarprog...
...nsitaskbarprogress gettaskbarprogress( in nsidocshell shell ); parameters shell the nsidocshell used to find the toplevel window. return value an nsitaskbarprogress. gettaskbarwindowpreview() ...
XPCOM Interface Reference by grouping
grouping and category names were made by somewhat arbitrary decision by the author. ...
...ositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler ...
...taskbarpreviewcontroller nsitaskbarprogress nsitaskbartabpreview nsitaskbarwindowpreview nsiwintaskbar nsialertsservice nsiwebprogress nsiwebprogresslistener nsiwebprogresslistener2 update nsiupdate nsiupdatechecker nsiupdatechecklistener nsiupdateitem nsiupdatemanager nsiupdatepatch nsiupdateprompt nsiupdatetimermanager nsiprogramminglanguage thunderbird credentials nsimsgaccountmanagerextension element nsieditormailsupport message nsidbchangeannouncer nsidbchangelistener nsimessenger ...
Performance
y still be visible in the file. the way to work around this is to run the vacuum command to remove this space. vacuuming is very slow. the vacuum command is essentially the same as the command line sqlite3 olddb .dump | sqlite3 newdb; mv newdb olddb. on some networked drives, vacuuming a 10mb database has been timed at over one minute. therefore, you should avoid vacuuming whenever possible. some items in databases are privacy sensitive, such as deleted history items. users have the expectation that deleting items in their history will remove the traces of that from the database. as a result, mozilla enables the sqlite_secure_delete preprocessor flag in db/sqlite3/src/makefile.in. this flag causes deleted items to be filled with 0s on disk. this eliminates the need to vacuum except to reclaim ...
...this operation is not necessarily slow, but writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). ...
...this operation is not necessarily slow, but writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). shutdown times of more than 30 seconds were seen. ...
Using nsIDirectoryService
get locations are defined in two places. os and xpcom level nsdirectoryservicedefs.h these locations are provided by xpcom, are constant with the system, and and should not need customization. although you will not customize these locations, you may need to tell xpcom where its /bin directory is. this is done by passing a directory to ns_initxpcom or, for embedding, as the first parameter to ns_initembedding. the location of the components folder and the components registry, among other things, are relative to the /bin directory. if mozilla's components directory is not in the same directory as your process, you will need to set the /bin directory as described above. in this case you will also need to tell the system of the location of dlls that are linked against. this aspect of file location...
...ctoryservicedefs.h the first group listed is for locations that are relative to the application: for instance, the name and location of the chrome folder, or the default location of user profiles. the nsidirectoryserviceprovider which normally provides these locations is at mozilla/xpcom/io/. this provider is installed by seamonkey after initializing xpcom. it is also installed by default by ns_initembedding. the second group listed is for locations which are relative to the current user profile. in seamonkey, the profile service is an nsidirectoryserviceprovider and it provides these locations. there are some cases in embedding in which distinct user profiles are not needed; however, prefs and history and such are needed. in this case, the nsidirectoryserviceprovider implementation at mozilla...
...u can also install your own nsidirectoryserviceprovider to control them en masse. to do this for application-level locations, create a provider based on appfilelocprovider. this object has to implement the nsisupports and nsidirectoryserviceprovider interfaces. it does not need to be a component - it can be a static lib, a source file in your project - whatever. just construct it, pass it to ns_initembedding, and it will be installed. if you are not using ns_initembedding, you will have to construct it and register it yourself using nsidirectoryservice.registerprovider(). if you are registering it yourself it is very important to register it immediately after calling ns_initxpcom. there are things in the startup process that need these locations at a very early point - even before registering ...
Address Book examples
manipulating thunderbird address books. address book interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general description of the thunderbird user interface and related programmatic interfaces. how do i get all address books? use the address book manager to get an nsisimpleenumerator, then progress through the enumerator, looking for nsiabitem, nsiabcollection or nsiabdirectory interfaces as you require. let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.interfaces.nsiabmanager); let alladdressbooks = abmanager.directories; while (alladdressbooks.hasmoreelements()) { let addressbook = alladdressbooks.getnext() .queryinterface(components...
... } } how do i get one address book? address books are uniquely identified by a uri. this can be obtained via nsiabdirectory.uri. the code stores uris in various places (e.g. preferences, in address book trees etc). assuming you have the uri, then use the address book manager to get an nsiabdirectory representin...
...if you have it in its nsiabcard form, then you can delete it in the same way as per deleting a contact. if you have it in its nsiabd...
Browser Console - Firefox Developer Tools
then loads a new page. note: you can restart the browser with the command ctrl + alt + r (windows, linux) or cmd + alt + r (mac) this command restarts the browser with the same tabs open as before the restart. modifying the browser ui since the global window object is the browser's chrome window, you can also modify the browser's user interface. ...
...he global window object is the browser's chrome window, you can also modify the browser's user interface. ...
...l add a new item to the browser's main menu: var parent = window.document.getelementbyid("appmenuprimarypane"); var makethetea = gbrowser.ownerdocument.defaultview.document.createelementns("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); makethetea.setattribute("label", "a nice cup of tea?"); parent.appendchild(makethetea); on macos, this similar code will add a new item to the "tools" menu: var parent = window.document.getelementbyid("menu_toolspopup"); var makethetea = gbrowser.ownerdocument.defaultview.document.createelementns("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); makethetea.setattribute("label", "a nice cup of tea?"); parent.appendchild(makethetea); ...
Index - Firefox Developer Tools
8 dom inspector internals code, tools, internals, organisation, source there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). 9 introduction to dom inspector dom_inspector the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, or by using ctrl/cmd+shift+i in either application. dom inspector is standalone; it supports all toolkit ...
... 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, storage inspector, tools, l10n:priority when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table. 111 style editor css, stylesheets, tools, web development, web development:tools the style editor enables you to: 112 taking screenshots screenshot, tools you can use the developer tools to take a screenshot of the entire page, or of a single element in the page. 113 ...
..., to change the screen brightness or the volume. see this guide to using these keys as standard function keys. to use a remapped key as a standard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). 117 how to these articles describe how to use the debugger. 118 access debugging in add-ons the following items are accessible in the context of chrome://browser/content/debugger.xul (or, in version 23 beta, chrome://browser/content/devtools/debugger.xul): 119 breaking on exceptions when an exception occurs, the line where it occurs is highlighted in the source pane, with a squiggly red line under the problematic code. a tooltip describes the exception. starting in firefox 80, a disc...
Network request details - Firefox Developer Tools
ays a new pane in the right-hand side of the network monitor, which provides more detailed information about the request. the screenshots and descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. the tabs at the top of this pane enable you to switch between the following pages: headers messages (only for websocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g. a script called by another script). clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the list view. headers tab the headers tab has a toolbar, followed by three main sections. this includes: information ...
... headers http request headers each section has a disclosure triangle to expand the section to show more information. headers toolbar using the headers toolbar, you can: filter the headers in the response headers and request headers sections. block the domain involved in this request. the domain is added to the blocking sidebar. resend the request. the resend button opens a menu with two items: resend: simply resends the request. edit and resend: enables an editing mode, where you can modify the method, url, request headers, or request body of the request. click send to send the modified request, or cancel to cancel editing. request information the following information is shown only when the section is expanded: scheme: the scheme used in the url host: the server...
...iming section lists any information provided in the server-timing header — this is used to surface any backend server timing metrics you've recorded (e.g. database read/write, cpu time, file system access, etc.). the header takes a series of descriptions and durations, which can be anything you like. in the above screenshot for example, the highlighted request's server-timing header contains 4 items — data, markup, total, and miss. security tab if the site is being served over https, you get an extra tab labeled "security". this contains details about the secure connection used including the protocol, the cipher suite, and certificate details: the security tab shows a warning for security weaknesses. currently it warns you about two weaknesses: using sslv3 instead of tls using th...
Examine and edit HTML - Firefox Developer Tools
he source of its content. note: shadow dom inspection was implemented in firefox 61, but was hidden behind the dom.webcomponents.shadowdom.enabled pref until firefox 63. it is now turned on by default. element popup context menu you can perform certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. the menu contains the following items — click on the links to find the description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove attribute break on ... subtree modification attribute modification node removal use in console show dom properties show accessibilit...
...elete the element from the dom. attribute/add attribute add an attribute to the element. attribute/edit attribute (only when invoked on an attribute) edit the attribute. attribute/remove attribute (only when invoked on an attribute) remove the attribute. open link in new tab (only when invoked over a link, such as an href attribute) opens the linked item in a new tab. open file in debugger (only when invoked over a link to a js source) opens the linked source in the debugger. open file in style-editor (only when invoked over a link to a css source) opens the linked source in the style editor. copy link address (only when invoked over a url) copy the url. (change pseudo-class) hover set the :hover cs...
...drop by pressing the esc key. inserting new nodes there's a "+" icon at the top of the markup view: click this icon to insert an empty <div> into the document as the last child of the currently selected element. you can then edit the new node's content and styling just as you would any other node in the document. you can access the same functionality using the "create new node" popup menu item. note that this button is disabled if the selected element's type is such that adding a last-child would have no effect (for example, if is is an <html> or <iframe> element). however, it is enabled in places where it is not valid to insert a <div>, such as <style> or <link>. in these cases the element is added as text. ...
IndexedDB - Firefox Developer Tools
e 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? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. all items have a key and a value associated with them. you can delete an indexeddb database using the context menu in the storage tree: if the database cannot be deleted (most commonly because there are still active connections to the database), a warning message will be displayed in the storage inspector: you can use the context menu in the tab...
...re listed in the table. all items have a key and a value associated with them. ...
...ey and a value associated with them. ...
Body.json() - Web APIs
Web › API › Body › json
e anything that can be represented by json — an object, an array, a string, a number... example in our fetch json example (run fetch json live), we create a new request using the request() constructor, then use it to fetch a .json file. ...
...successful, we read and parse the data using json(), then read values out of the resulting objects as you'd expect and insert them into list items to display our product data. const mylist = document.queryselector('ul'); const myrequest = new request('products.json'); fetch(myrequest) .then(response => response.json()) .then(data => { for (const product of data.products) { let listitem = document.createelement('li'); listitem.appendchild( document.createelement('strong') ).textcontent = product.name; listitem.append( ` can be found in ${ product.location }. ...
...ts.json'); fetch(myrequest) .then(response => response.json()) .then(data => { for (const product of data.products) { let listitem = document.createelement('li'); listitem.appendchild( document.createelement('strong') ).textcontent = product.name; listitem.append( ` can be found in ${ product.location }. cost: ` ); listitem.appendchild( document.createelement('strong') ).textcontent = `£${product.price}`; mylist.appendchild(listitem); } }) .catch(console.error); specifications specification status comment fetchthe definition of 'body.json()' in that specification. living standard initial definition ...
ChildNode.remove() - Web APIs
Web › API › ChildNode › remove
method is not scoped into the with statement. see symbol.unscopables for more information. ...
...oped into the with statement. see symbol.unscopables for more information. ...
... li...
Clipboard.read() - Web APIs
Web › API › Clipboard › read
sions api if we have some kind of access to // the "clipboard-read" feature. navigator.permissions.query({name: "clipboard-read"}).then(result => { // if permission to read the clipboard is granted or if the user will // be prompted to allow it, we proceed. ...
...ss to // the "clipboard-read" feature. navigator.permissions.query({name: "clipboard-read"}).then(result => { // if permission to read the clipboard is granted or if the user will // be prompted to allow it, we proceed. ...
...s granted or if the user will // be prompted to allow it, we proceed. if (result.state == "granted" || result.state == "prompt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data. unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src = url.createobjecturl(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the permissions api to manage access to the api will not work. specifications specification status comment clipboard api and ...
Clipboard.write() - Web APIs
Web › API › Clipboard › write
e permissions api, is granted automatically to pages when they are in the active tab. note: browser support for the asynchronous clipboard apis is still in the process of being implemented. be sure to check the compatibility table as well as clipboard availability in clipboard for more information. syntax var promise = navigator.clipboard.write(data) parameters data an array of clipboarditem objects containing data to be written to the clipboard. return value a promise which is resolved when the data has been written to the clipboard. the promise is rejected if the clipboard is unable to complete the clipboard access. example this example function replaces the current contents of the clipboard with a specified string. function setclipboard(text) { let data = [new clipboardite...
...rd is unable to complete the clipboard access. example this example function replaces the current contents of the clipboard with a specified string. function setclipboard(text) { let data = [new clipboarditem({ "text/plain": text })]; navigator.clipboard.write(data).then(function() { /* success */ }, function() { /* failure */ }); } the code begins by creating a new clipboarditem object into which the text will be placed for sending to the clipboard. the key of the object passed to the clipboarditem constructor indicates the content type, the value indicates the content. the content could be a text or even a blob (e.g. for copying images to the clipboard). then write() is called, specifying both a fulfilment function and an error function. example of copying canvas conte...
...ntent type, the value indicates the content. the content could be a text or even a blob (e.g. for copying images to the clipboard). then write() is called, specifying both a fulfilment function and an error function. example of copying canvas contents to the clipboard function copycanvascontentstoclipboard(canvas, ondone, onerror) { canvas.toblob(function (blob) { let data = [new clipboarditem({ [blob.type]: blob })]; navigator.clipboard.write(data).then(function () { ondone(); }, function (err) { onerror(err); }) }); } note: you can only pass in one clipboard item at a time. specifications specification status comment clipboard api and eventsthe definition of 'write()' in that specification. working draft initial definition...
DeprecationReportBody - Web APIs
to display the report details. ...
...orts parameter as its parameter: function displayreports(reports) { const outputelem = document.queryselector('.output'); const list = document.createelement('ul'); outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); listitem.appendchild(innerlist); list.appendchild(listitem); for (let key in reports[i].body) { let innerlistitem = document.createelement('li'); let keyvalue = reports[i].body[key]; innerlistitem.textcontent = key + ': ' + keyvalue; innerlist.appendchild(innerlistitem); } } } the ...
... specifications specification status comment reporting apithe definition of 'deprecationreportbody' in that specification. ...
Element.getElementsByClassName() - Web APIs
however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed. var matches = element.getelementsbyclassname('colorbox'); for (var i=0; i<matches.length; i++) { matches[i].classlist.remove('colorbox'); match...
...method on the returned htmlcollection or standard array syntax to examine individual elements in the collection. however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed. ...
...cause "matches" will change as soon as any "colorbox" class is removed. var matches = element.getelementsbyclassname('colorbox'); for (var i=0; i<matches.length; i++) { matches[i].classlist.remove('colorbox'); matches.item(i).classlist.add('hueframe'); } instead, use another method, such as: var matches = element.getelementsbyclassname('colorbox'); while (matches.length > 0) { matches.item(0).classlist.add('hueframe'); matches[0].classlist.remove('colorbox'); } this code finds descendant elements with the "colorbox" class, adds the class "hueframe", by calling item(0), then removes "colorbox" (using array notation). another element (if any are left) will then become item(0). filtering the results using array methods we can also use methods of array.prototype on any htmlcollect...
HTMLCollection - Web APIs
the htmlcollection interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. note: this interface is called htmlcollection for historical reasons (before 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 ...
...matching by name is only done as a last resort, only in html, and only if the referenced element supports the name attribute. returns null if no node exists by the given name. ...
...ate 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 is an htmlcollection elem1 = document.forms[0]; elem2 = document.forms.item(0); alert(elem1 === elem2); // shows: "true" elem1 = document.forms.myform; elem2 = document.forms.nameditem("myform"); alert(elem1 === elem2); // shows: "true" elem1 = document.forms["named.item.with.periods"]; specifications specification status comment domthe definition of 'htmlcollection' in that specification. living standard ...
HTMLImageElement.loading - Web APIs
ght attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. ...
...an cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. example the addimagetolist() function shown below adds a photo thumbnail to a list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. ...
...worst, depending on the exact timing of the deferred loads and reflows. example the addimagetolist() function shown below adds a photo thumbnail to a list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. function addimagetolist(url) { const list = document.queryselector("div.photo-list"); let newitem = document.createelement("div"); newitem.classname = "photo-item"; let newimg = document.createelement("img"); newimg.loading = "lazy"; newimg.width = 320; newimg.height = 240; newimg.src = url; newitem.appendchild(newimg); list.appendchild(newitem); } specifications specification status comment html living standardthe definition of 'htmlimageelement.loading' in that specification. livin...
The HTML DOM API - Web APIs
barprop navigator window deprecated web app and browser integration interfaces external obsolete web app and browser integration interfaces...
...a interfaces the media interfaces provide html access to the contents of the media elements: <audio> and <video>. audiotrack audiotracklist mediaerror texttrack texttrackcue texttrackcuelist texttracklist timeranges trackevent videotrack videotracklist drag and drop interfaces these interfaces are used by the html_drag_and_drop_api to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process. datatransfer datatransferitem datatransferitemlist dragevent page history interfaces the history api interfaces let you access information about the browser's history, as well as to shift the browser's current tab forward and backward through that history. beforeunloadevent hashchangeevent history l...
...length of the current value of the input; if it's zero, then the "send" button is disabled if it's not already disabled. otherwise, the code ensures that the button is enabled. with this in place, the "send" button is always enabled whenever the user name input field has a value, and disabled when it's empty. html the html for the form looks like this: <p>please provide the information below. ...
File drag and drop - Web APIs
fine event handlers for the drop and dragover events. these steps are described below, including example code snippets. the full source code is available in mdn's drag-and-drop repository (pull requests and/or issues are welcome). note: html drag and drop defines two different apis to support dragging and dropping files. one api is the datatransfer interface and the second api is the datatransferitem and datatransferitemlist interfaces. this example illustrates the use of both apis (and does not use any gecko specific interfaces). define the drop zone the target element of the drop event needs an ondrop global event handler. the following code snippet shows how this is done with a <div> element: <div id="drop_zone" ondrop="drophandler(event);"> <p>drag one or more files to this drop zone...
...ne. in this example, the drop target element uses the following styling: #drop_zone { border: 5px solid blue; width: 200px; height: 100px; } note that dragstart and dragend events are not fired when dragging a file into the browser from the os. process the drop the drop event is fired when the user drops the file(s). in the following drop handler, if the browser supports datatransferitemlist interface, the getasfile() method is used to access each file; otherwise the datatransfer interface's files property is used to access each file. this example shows how to write the name of each dragged file to the console. in a real application, an application may want to process a file using the file api. note that in this example, any drag item that is not a file is ignored. function d...
...ple shows how to write the name of each dragged file to the console. in a real application, an application may want to process a file using the file api. note that in this example, any drag item that is not a file is ignored. function drophandler(ev) { console.log('file(s) dropped'); // prevent default behavior (prevent file from being opened) ev.preventdefault(); if (ev.datatransfer.items) { // use datatransferitemlist interface to access the file(s) for (var i = 0; i < ev.datatransfer.items.length; i++) { // if dropped items aren't files, reject them if (ev.datatransfer.items[i].kind === 'file') { var file = ev.datatransfer.items[i].getasfile(); console.log('... file[' + i + '].name = ' + file.name); } } } else { // use datatra...
Recommended Drag Types - Web APIs
etrieving the data, you must use the mozgetdataat() method. event.datatransfer.mozsetdataat("application/x-moz-file", file, 0); if possible, include the file url of the file using both the text/uri-list and text/plain types. these types should be added afterward so that the more specific application/x-moz-file type has higher priority. multiple files will be received during a drop as multiple items in the data transfer. see dragging and dropping multiple items for more details about this. the following example shows how to create an area for receiving dropped files: <listbox ondragenter="return checkdrag(event)" ondragover="return checkdrag(event)" ondrop="dodrop(event)"/> <script> function checkdrag(event) { return event.datatransfer.types.contains("application/x-mo...
...during the drop event, the data associated with the file type is retrieved, and the filename of the file is added to the listbox. note that the instanceof operator is used here as the mozgetdataat() method will return an nsisupports that needs to be checke...
... var file = cc['@mozilla.org/file/local;1'].createinstance(components.interfaces.nsilocalfile); file.initwithpath(dir.path); file.appendrelativepath(name); console.log("output final path is =" + file.path); // now you can write or copy the file yourself… } } } see also html drag and drop api (overview) drag operations dragging and dropping multiple items html5 living standard: drag and drop ...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
or.value.foo. ...
... recommendation ...
... recommendation indexed database api draftthe definition of 'advance()' in that specification. recommendation browse...
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
cursor object using cursor.value.foo. ...
... recommendation ...
... recommendation indexed database api draftthe definition of 'key' in that specification. recommendation ...
IDBCursor.primaryKey - Web APIs
cursor object using cursor.value.foo. ...
... recommendation...
... recommendation indexed database api draftthe definition of 'primarykey' in that specification. ...
IDBCursor.request - Web APIs
Web › API › IDBCursor › request
you what request object the cursor originated from. ...
...m. ...
... recommendation initial definition. browser compatibility the compatibility table on this page ...
IDBCursor.source - Web APIs
Web › API › IDBCursor › source
cursor object using cursor.value.foo. ...
... recommendation ...
... recommendation indexed database api draftthe definition of 'source' in that specification. recommenda...
IDBCursorWithValue.value - Web APIs
cursor object using cursor.value.foo. ...
... recommendation ...
... recommendation indexed database api draftthe definition of 'idbdatabase' in that specification. recomm...
IDBObjectStore.add() - Web APIs
st", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...tion, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
...s done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // make a request to add our newitem object to the 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 'add()' in that specification. recommendatio...
IDBObjectStore.autoIncrement - Web APIs
st", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...on, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
...vent) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.autoincrement); // make a request to add our newitem object to the 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 'autoincrement' in that specification. recommen...
IDBObjectStore.indexNames - Web APIs
n("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ion, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
...on(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.indexnames); // make a request to add our newitem object to the 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 'indexnames' in that specification. recommendat...
IDBObjectStore.keyPath - Web APIs
st", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...tion, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
...nction(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.keypath); // make a request to add our newitem object to the 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...
IDBObjectStore.name - Web APIs
st", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...tion, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
... function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.name); // make a request to add our newitem object to the 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 ...
IDBObjectStore.transaction - Web APIs
st", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...on, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything 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. ...
...(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.transaction); // make a request to add our newitem object to the 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 'transaction' in that specification. recommenda...
NavigatorPlugins.plugins - Web APIs
er plugin should query navigator.plugins or navigator.mimetypes by exact name instead of enumerating the navigator.plugins array and comparing every plugin's name. this privacy change does not disable any plugins; it just hides some plugin names from enumeration. ...
...lugins array and comparing every plugin's name. this privacy change does not disable any plugins; it just hides some plugin names from enumeration. syntax var plugins = navigator.plugins; plugins is pluginarray object used to access plugin objects either by name or as a list of items. the returned value is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods. ...
...in chrome) return flash.description.replace(/shockwave flash /,""); } } the following example displays information about the installed plugin(s). ...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. ...
...reviouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. ...
...iouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.nodetype) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/previouselementsibling/previouselementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('previouselementsibling')) { return; } object.defineproperty(item, 'previouselementsibling', { configurable: true, enumerable: true, get: function () { let el = this; while (el = el.previoussibling) { if (el.nodetype === 1) { return el; } } return null; }, set...
ReadableStream.ReadableStream() - Web APIs
s stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...treamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
... run, which reads the data back out of the stream. ...
ReadableStreamDefaultController.close() - Web APIs
s stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...treamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
... run, which reads the data back out of the stream. ...
ReadableStreamDefaultController.enqueue() - Web APIs
s stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...treamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
... run, which reads the data back out of the stream. ...
ReadableStreamDefaultController - Web APIs
s stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...treamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
... run, which reads the data back out of the stream. ...
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
/ result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...// done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...rue. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'readablestreamdefaultreader()' in that specification. living standard initial definition. ...
Report - Web APIs
Web › API › Report
to display the report details. ...
...orts parameter as its parameter: function displayreports(reports) { const outputelem = document.queryselector('.output'); const list = document.createelement('ul'); outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); listitem.appendchild(innerlist); list.appendchild(listitem); for (let key in reports[i].body) { let innerlistitem = document.createelement('li'); let keyvalue = reports[i].body[key]; innerlistitem.textcontent = key + ': ' + keyvalue; innerlist.appendchild(innerlistitem); } } } the ...
...ports[i].body[key]; innerlistitem.textcontent = key + ': ' + keyvalue; innerlist.appendchild(innerlistitem); } } } the reports parameter contains an array of all the reports in the observer's report queue. we loop over each report using a basic for loop, then iterate over each entry of in the report's body using a for...in structure, displaying each key/value pair inside a list item. specifications specification status comment reporting apithe definition of 'report' in that specification. editor's draft ...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
the webglrenderingcontext.stencilmaskseparate() method of the webgl api controls enabling and disabling of front and/or back writing of individual bits in the stencil planes. the webglrenderingcontext.stencilmask() method can set both, the front and back stencil writemasks to one value at the same time. syntax void gl.stencilmaskseparate(face, mask); parameters face a glenum specifying whether the front and/or back stencil writemask is updated. the possible values are: gl.front gl.back gl.front_and_back mask a gluint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. by default, the mask is all 1. return value none. examples gl.stencilmaskseparate(gl.front, 110101); to get the current stencil masks, query the stencil_writ...
... recommendation initial definition. ...
...ront gl.back gl.front_and_back mask a gluint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. by default, the mask is all 1. return value none. examples gl.stencilmaskseparate(gl.front, 110101); to get the current stencil masks, query the stencil_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the definition of 'stencilmaskseparate' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glstencilmaskseparate' in that specification. standard man p...
Window.localStorage - Web APIs
ecurityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. ...
...olates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem(). ...
... or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem(). localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for removing the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax for removing all the localstorage items is as follows: localstorage.clear(); note: please refer to the using the web storage api article for a full example. speci...
XRInputSourceArray - Web APIs
s 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 iterator you can use to walk the list of key/value pairs in the list. ...
...rce 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. ...
...ey/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 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 specificat...
msthumbnailclick - Web APIs
hed from a pinned site shortcut. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. ...
...r to an ihtmleventobj interface for the current event. ...
...he taskbar window.external.mssitemodeseticonoverlay(iconuri, tooltip); // removes an overlay icon window.external.mssitemodecleariconoverlay(); // pinned icons on your taskbar can be instructed to trigger specific events on your site from the taskbar // add an event handlerdocument.addeventlistener('msthumbnailclick', onbuttonclicked, false); // add the buttons var btnplay = window.external.mssitemodeaddthumbbarbutton(iconuri, tooltip); // refresh the taskbar window.external.mssitemodeshowthumbbar(); // call a javascript function when the button is pressed function onbuttonclicked(e) { switch (e.buttonid) { case btnplay: play(); break;} } see also microsoft api extensions ...
Using the aria-labelledby attribute - Accessibility
> <h1 id="foo">wild fires spread across the san diego hills</h1> strong winds expand fires ignited by high temperatures ... </div> example 3: radio groups in the example below, the container of a radiogroup is associated with its label using the aria-labelledby attribute: <div id="radio_label">my radio label</div> <ul role="radiogroup" aria-labelledby="radio_label"> <li role="radio">item #1</li> <li role="radio">item #2</li> <li role="radio">item #3</li> </ul> example 4: dialog label in the example below, the header element that labels the dialog is referred to by the aria-labelledby attribute: <div role="dialog" aria-labelledby="dialogheader"> <h2 id="dialogheader">choose a file</h2> ... dialog contents </div> example 5: inline definition in the example be...
... </div> ... </div> notes the most common accessibility api mapping for a label is the accessible name property used by aria roles all elements of the b...
...</dd> <dd role="definition" aria-labelledby="homily">a lecture or discourse on or of a moral theme</dd> </dl> example 7: menus in the example below, a popup menu is associated with its label using the aria-labelledby attribute: <div role="menubar"> <div role="menuitem" aria-haspopup="true" id="filemenu">file</div> <div role="menu" aria-labelledby="filemenu"> <div role="menuitem">open</div> <div role="menuitem">save</div> <div role="menuitem">save as ...</div> ... </div> ... </div> notes the most common accessibility api mapping for a label is the accessible name property used by aria roles all elements of the base markup related aria techniques using the aria-label attribute using the aria-describedby attribute compatibility...
Accessibility documentation index - Accessibility
k role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. these sections are frequently presented as sidebars or call-out boxes. if possible, use the html <aside> element instead. 44 aria: list role aria, aria role, aria list, accessibility, reference, rôle, list the aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list. 45 aria: listitem role aria, aria role, aria listitem, accessibility, reference, rôle, listitem the aria listitem role can be used to identify an item inside a list of items. it is normally used in conjunction with the list role, which is used to iden...
...rpretation techniques should be used. this role should only be used to define very dynamic and desktop-like web applications. 53 aria: article role aria, aria role, aria article role, article, article role, reference the article role indicates a section of a page that could easily stand on its own on a page, in a document, or on a website. it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page. 54 aria: banner role aria, accessibility, needscontent a banner role represents general and informative content frequently placed at the beginning of the page. this usually includes a logo, company name, search icon, photo related to the page, or slogan. 55 aria: button ...
...n be used to identify multiple elements inside page content that should be considered as a single image. these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner. 68 aria: listbox role aria, accessibility, needscontent the listbox role is used for lists from which a user may select one or more items which are static and, unlike html <select> elements, may contain images. 69 aria: row role aria, aria role, aria row, aria row role, accessibility, reference, row role an element with role="row" is a row of cells within a tabular structure. a row contains one or more cells, grid cells or column headers, and possibly a row header, within a grid, table or treegrid, and option...
CSS Display - CSS: Cascading Style Sheets
css display is a module of css that defines how the css formatting box tree is generated from the document element tree and defines properties controlling it. ...
... css data types <display-outside> <display-inside> <display-listitem> <display-box> <display-internal> <display-legacy> guides css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template ...
...andidate recommendation added run-in, flow, flow-root, contents and multi-keyword values. css level 2 (revision 1)the definition of 'display' in that specification. recommendation added the table model values and inline-block. css level 1the definition of 'display' in that specification. recommendation initial definition. basic values: none, block, inline and list-item. in addition to the css display specification level 3, further specifications define the behavior of various values of display. ...
Block and inline layout in normal flow - CSS: Cascading Style Sheets
es the inner display type, which dictates how boxes inside this element behave. we can see this very clearly when considering a flex layout. in the example below i have a <div>, which i have given display: flex. the flex container behaves like a block element: it displays on a new line and takes up all of the space it can in the inline direction. this is the outer display type of block. the flex items however are participating in a flex formatting context, because their parent is the element with display: flex, which has an inner display type of flex, establishing the flex formatting context for the direct children. therefore you can think of every box in css working in this way. the box itself has an outer display type, so it knows how to behave alongside other boxes. it then has an inner...
...nner display type of flex, establishing the flex formatting context for the direct children. therefore you can think of every box in css working in this way. the box itself has an outer display type, so it knows how to behave alongside other boxes. it then has an inner display type which changes the way its children behave. those children then have an outer and inner display type too. the flex items in the previous example become flex level boxes, so their outer display type is dictated by way of them being part of the flex formatting context. they have an inner display type of flow however, meaning that their children participate in normal flow. items nested inside our flex item lay themselves out as block and inline elements unless something changes their display type. this concept of th...
...changes their display type. this concept of the outer and inner display type is important as this tells us that a container using a layout method such as flexbox (display: flex) and grid layout (display: grid) is still participating in block and inline layout, due to the outer display type of those methods being block. changing the formatting context an element participates in browsers display items as part of a block or inline formatting context in terms of what normally makes sense for that element. for example, a <strong> element is used to highlight a word and displays bold in browsers. it would not generally make sense for that <strong> element to be displayed as a block level element, breaking onto a new line. if you did want all <strong> elements to display as block elements, you cou...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
properties and values specification introduces flow-relative mappings for many of the properties and values in css. this article introduces the specification, and explains flow relative properties and values. why do we need logical properties? css traditionally has sized things according to the physical dimensions of the screen. therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i have a ...
...perties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i have a layout using css grid, the grid container has a width applied and i am using the align-self and justify-self properties to align the items. these properties are flow relative — justify-self: start aligns the item to the start on the inline dimension, align-self: start does the same on the block dimension. if i now change the writing mode of this component to vertical-rl using the writing-mode property, the alignment continues to work in the same way. the inline dimension is now running vertically and the block dimension horizo...
...s for creative reasons, being able to relate to the flow of the content makes a lot of sense. block and inline dimensions a key concept of working with flow relative properties and values is the two dimensions of block and inline. as we saw above, newer css layout methods such as flexbox and grid layout use the concepts of block and inline rather than right and left/top and bottom when aligning items. the inline dimension is the dimension along which a line of text runs in the writing mode in use. therefore, in an english document with the text running horizontally left to right, or an arabic document with the text running horizontally right to left, the inline dimension is horizontal. switch to a vertical writing mode (e.g. a japanese document) and the inline dimension is now vertical, as ...
CSS values and units - CSS: Cascading Style Sheets
ist <custom-ident> | <string>, meaning quotes are optional, such as is the case with animation names: @keyframe validident { /* keyframes go here */ } @keyframe 'validstring' { /* keyframes go here */ } some text values are not valid if encompassed in quotes. ...
...re */ } @keyframe 'validstring' { /* keyframes go here */ } some text values are not valid if encompassed in quotes. for example, the value of grid-area can be a <custom-ident>, so if we had a grid area named content we would use it without quotes: .item { grid-area: content; } in comparison, a data type that is a <string>, such as a string value of the content property, must be quoted: .item::after { content: "this is my content."; } while you can generally create any name you want, including using emojis, the identifier can't be none, unset, initial, or inherit, start with a digit or two dashes, and generally you don't want it to be any other pre-defined css keyword. see the <custom-ident> and <string> reference pages for more details. pre-defined keyword values pre-defined ...
...e notation followed by a right parenthesis ). functions can take multiple arguments, which are formatted similarly to a css property value. white space is allowed, but optional inside the parentheses. (but see notes regarding whitespace within pages for min(), max() and clamp() functions.) some legacy functional notations such as rgba() use commas, but generally commas are only used to separate items in a list. if a comma is used to separate arguments, white space is optional before and after the comma. specifications specification status comment css values and units module level 4 editor's draft adds the vi, vb, ic, cap, lh and rlh units. adds the min(), max() and clamp() functional notation adds toggle() css values and units module level...
Grid wrapper - CSS: Cascading Style Sheets
recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to. ...
...along with left and right auto margins to center the content horizontally: .grid { max-width: 1200px; margin: 0 auto; // horizontally centers the container } /* remove the max-width and margins if the browser supports grid */ @supports (display: grid) { .grid { display: grid; /* other grid code goes here */ max-width: none; margin: 0; } } to “break out” a full-width item to the edge of the viewport you can then use this trick (courtesy of una kravets): .item { width: 100vw; margin-left: 50%; transform: translate3d(-50%, 0, 0); } this gives a good approximation of the layout, only without the benefit of being able to align items easily on an exact grid. accessibility concerns although grid enables us to position items anwhere (within reason), it is impor...
...e viewport you can then use this trick (courtesy of una kravets): .item { width: 100vw; margin-left: 50%; transform: translate3d(-50%, 0, 0); } this gives a good approximation of the layout, only without the benefit of being able to align items easily on an exact grid. accessibility concerns although grid enables us to position items anwhere (within reason), it is important when placing items using css grid that your underlying markup follows a logical order (see css grid layout and accessibility for more details). ...
Pagination - CSS: Cascading Style Sheets
typically, the pagination component will be centered horizontally underneath the content. ...
... typically, the pagination component will be centered horizontally underneath the content. ...
...he pagination component will be centered horizontally underneath the content. recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another. the <nav> element is designated a flex container in order that we can center the list inside using the justify-content property. the list itself also becomes a flex container to lay the items out as a row. to space the items out we will use a margin on the flex items. alternative methods once the column-gap property has implementation in browsers this could be used instead of margins to space out the items. .pagination { list-style: none; margin: 0; padding: 0; display: flex; column-gap: 2px; } accessibility concerns we want to ensure that a person using a screenreade...
Mozilla CSS extensions - CSS: Cascading Style Sheets
ixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmenuitem dialog groupbox listbox menuarrow menucheckbox menuimage menuitem menuitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-communications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximiz...
...z-win-browsertabbar-toolbox -moz-win-communications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximized -moz-window-button-close -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore -moz-window-titlebar -moz-window-titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomenuitem resizer resizerpanel scale-horizontal scalethumb-horizontal scalethumb-vertical scale-vertical scrollbarbutton-down scrollbarbutton-left scrollbarbutton-right scrollbarbutton-up scrollbar-small scrollbarthumb-horizontal scrollbarthumb-vertical scrollbartrack-horizontal scrollbartrack-vertical separator spinner spinner-downbutton spinner-textfield spinner-upbutton statusbar s...
... border-style and outline-style -moz-bg-insetobsole...
WebKit CSS extensions - CSS: Cascading Style Sheets
pearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below. ...
...bkit-grid-auto-rows -webkit-grid-column -webkit-grid-column-end -webkit-grid-column-gap -webkit-grid-column-start -webkit-grid-gap -webkit-grid-row -webkit-grid-row-end -webkit-grid-row-gap -webkit-grid-row-start -webkit-grid-template -webkit-grid-template-areas -webkit-grid-template-columns -webkit-grid-template-rows h-l -webkit-hyphens -webkit-justify-content -webkit-justify-items -webkit-justify-self -webkit-line-break m -webkit-mask -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-repeat -webkit-mask-size o-r -webkit-opacity -webkit-order -webkit-perspective -webkit-perspective-origin -webkit-ruby-position s -webkit-scroll-snap-type -webkit-shape-image-threshold -webkit-shape...
...th the -webkit- prefix in firefox. many of these are supported with no prefix as well: see formerly proprietary properties that are now standard above. note: due to the legacy code in a multitude of web sites that used -webkit- prefixed properties, edge and firefox redirect many -webkit- prefixed properties to -moz-, -ms-, and unprefixed equivalents. ...
background-position - CSS: Cascading Style Sheets
right 3em bottom 10px; background-position: bottom 10px right; background-position: top right 10px; /* global values */ background-position: inherit; background-position: initial; background-position: unset; the background-position property is specified as one or more <position> values, separated by commas. values <position> a <position>. a position defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. if two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword v...
...ertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). 1-value syntax: the value may be: the keyword value center, which centers the image. one of the keyword values top, left, bottom, right. this specifies an edge against which to place the item. the other dimension is then set to 50%, so the item is placed in the middle of the edge specified. a <length> or <percentage>. this specifies the x coordinate relative to the left edge, with the y coordinate set to 50%. 2-value syntax: one value defines x and the other defines y. each value may be: one of the keyword values top, left, bottom, right. if left or right are given here, th...
...e" will be zero. you will need to offset using absolute values. formal definition initial value0% 0%applies toall elements. ...
fit-content() - CSS: Cascading Style Sheets
e to the available space in the given axis. in grid properties it is relative to the inline size of the grid container in column tracks and to the block size of the grid container for row tracks. otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode. ...
... grid properties it is relative to the inline size of the grid container in column tracks and to the block size of the grid container for row tracks. otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode. examples sizing grid columns with fit-content html <div id="container"> <div>item as wide as the content.</div> <div> item with more text in it. ...
...ks. otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode. examples sizing grid columns with fit-content html <div id="container"> <div>item as wide as the content.</div> <div> item with more text in it. because the contents of it are wider than the maximum width, it is clamped at 300 pixels. ...
list-style-image - CSS: Cascading Style Sheets
the list-style-image css property sets an image to be used as the list item marker. it is often more convenient to use the shorthand list-style. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. syntax /* keyword values */ list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-styl...
...> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. ...
... values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. formal definition initial valuenoneapplies tolist itemsinheritedyescomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax <url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-image' in that specification. working draft extends support to any <image> data type. cs...
margin-left - CSS: Cascading Style Sheets
are both auto, the calculated space is evenly distributed. ...
...ive 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the element inside its parent. ...
... { margin-left: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-left' in that specification. working draft no significant change from css 2.1. css flexible box layout modulethe definition of 'margin-left' in that specification. candidate recommendation defines the behavior of margin-left on flex items. css level 2 (revision 1)the definition of 'margin-left' in that specification. recommendation like in css1, but removes its effect on inline elements. css level 1the definition of 'margin-left' in that specification. recommendation initial definition. ...
margin-right - CSS: Cascading Style Sheets
are both auto, the calculated space is evenly distributed. ...
...ive 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the element inside its parent. ...
...; } .logo { margin-right: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-right' in that specification. working draft no significant change css flexible box layout modulethe definition of 'margin-right' in that specification. candidate recommendation defines the behavior of margin-right on flex items. css level 2 (revision 1)the definition of 'margin-right' in that specification. recommendation removes its effect on inline elements. css level 1the definition of 'margin-right' in that specification. recommendation initial definition. ...
minmax() - CSS: Cascading Style Sheets
Web › CSS › minmax
o the size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage. <flex> a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. formal syntax minmax( [ <length> | <percentage> | min-content | max-content | aut...
... </div> </div> result specifications specification status comment css grid layoutthe definition of 'minmax()' in that specification. candidate recommendation initial definition ...
... display: grid; grid-template-columns: minmax(min-content, 300px) minmax(200px, 1fr) 150px; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%; background-color: #8cffa0; padding: 10px; } #container > div { background-color: #8ca0ff; padding: 5px; } html <div id="container"> <div> item as wide as the content, but at most 300 pixels. </div> <div> item with flexible width but a minimum of 200 pixels. </div> <div> inflexible item of 150 pixels width. </div> </div> result specifications specification status comment css grid layoutthe definition of 'minmax()' in that specification. candidate recommendation initial definition ...
order - CSS: Cascading Style Sheets
Web › CSS › order
the order css property sets the order to lay out an item in a flex or grid container. items in a container are sorted by ascending order value and then by their source code order. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order. order must not be used on non-visual media such as speech. values <integer> represents the ordinal group to be used by the item. accessibility concerns using the ord...
... a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> examples ordering items in a flex container this example uses css to create a classic two-sidebar layout surrounding a content block. the flexible box layout module automatically creates blocks of equal vertical size and uses as much horizontal space as avai...
...xt-align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification. candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
repeat() - CSS: Cascading Style Sheets
Web › CSS › repeat
o the size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage. <flex> a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. auto-fill if the grid container has a definite or maximal size in the relevant axi...
...nt. if any number of repetitions would overflow, then the repetition is 1. otherwise, if the grid container has a definite minimal size in the relevant axis, the number of repetitions is the smallest possible positive integer that fulfills that minimum requirement. otherwise, the specified track list repeats only once. auto-fit behaves the same as auto-fill, except that after placing the grid items any empty repeated tracks are collapsed. an empty track is one with no in-flow grid items placed into or spanning across it. (this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as having a single fixed track sizing function of 0px, and the gutters on either side of it collapse. for the purpose of finding the number of auto-repeated tracks, th...
...ollapsed track is treated as having a single fixed track sizing function of 0px, and the gutters on either side of it collapse. for the purpose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., 1px), to avoid division by zero. examples specifying grid columns using repeat() html <div id="container"> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> inflexible item of 100 pixels width. </div> </div> css #container { display: grid; grid-template-columns: repeat(2, 50px 1fr) 100px; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%;...
url() - CSS: Cascading Style Sheets
Web › CSS › url()
n, polyline, or rect -- using the shape's geometry as the path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. ...
...ct -- using the shape's geometry as the path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. ...
...ape's geometry as the path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
f the element. this border is a solid line, 6 pixels wide, in the color mediumturquoise. our two colored boxes share a number of properties in common, so next we establish a class, .box, that defines those shared properties: .box { width: 290px; height: 100px; margin: 0; padding: 4px 6px; font: 28px "marker felt", "zapfino", cursive; display: flex; justify-content: center; align-items: center; } in brief, .box establishes the size of each box, as well as the configuration of the font used within. we also take advantage of css flexbox to easily center the contents of each box. we enable flex mode using display: flex, and set both justify-content and align-items to center. then we can create a class for each of the two boxes that defines the properties that differ between the ...
...ng text-shadow. its color parameter is set to black. letting the user pick a color there are many situations in which your website may need to let the user select a color. perhaps you have a customizable user interface, or you're implementing a drawing app. maybe you have editable text and need to let the user choose the text color. or perhaps your app lets the user assign colors to folders or items. although historically it's been necessary to implement your own color picker, html now provides support for browsers to provide one for your use through the <input> element, by using "color" as the value of its type attribute. the <input> element represents a color only in the hexadecimal string notation covered above. example: picking a color let's look at a simple example, in which the use...
...place to start. there are plenty of ways to select a base color; a few ideas include: a color that is naturally associated with the topic of your content, such as the existing color identified with a product or idea or a color representative of the emotion you wish to convey. a color that comes from imagery associated with what your content is about. if you're creating a website about a given item or product, choose a color that's physically present on that item. browse websites that let you look at lots of existing color palettes and images to find inspiration. when trying to decide upon a base color, you may find that browser extensions that let you select colors from web content can be particularly handy. some of these are even specifically designed to help with this sort of work. fo...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
of a larger input. see representing keystrokes within an input below. nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. see echoed input, below, for an example. nesting a <samp> element inside a <kbd> element, on the other hand, represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. see the example under representing onscreen input options below. you can define a custom style to override the browser's default font selection for the <kbd> element, although the user's preferences may potentially override your css. examples basic example <p>use the command <kbd>help mycommand</kbd> to view documentation for the command "...
...o the user by the system. <p>if a syntax error occurs, the tool will output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. for example, you can explain how to choose the "new document" option in the "file" menu using html that looks like this: <p>to create a new file, choose the menu option <kbd><kbd><samp>file</samp></kbd>⇒<kbd><samp>new document</samp></kbd></kbd>.</p> <p>don't forget to click the <kbd><samp>ok</samp></kbd> button to confirm once you've entere...
... file, choose the menu option <kbd><kbd><samp>file</samp></kbd>⇒<kbd><samp>new document</samp></kbd></kbd>.</p> <p>don't forget to click the <kbd><samp>ok</samp></kbd> button to confirm once you've entered the name of the new file.</p> this does some interesting nesting. for the menu option description, the entire input is enclosed in a <kbd> element. then, inside that, both the menu and menu item names are contained within both <kbd> and <samp>, indicating an input which is selected from a screen widget. result specifications specification status comment html living standardthe definition of '<kbd>' in that specification. living standard html5the definition of '<kbd>' in that specification. recommendation expanded to include any user...
Quantifiers - JavaScript
quantifiers indicate numbers of characters or expressions to match. types the following table is also duplicated on this cheatsheet. do not forget to edit it as well, thanks! note: in the following, item refers not only to singular characters, but also includes character classes, unicode property escapes, groups and ranges. characters meaning x* matches the preceding item "x" 0 or more times. for example, /bo*/ matches "boooo" in "a ghost booooed" and "b" in "a bird warbled", but nothing in "a goat grunted". x+ matches the preceding item "x" 1 or more times. equivalent to {1,}. for example, /a+/ matches the "a" in "candy" and all the "a"'s in "caaaaaaandy". x? matches the preceding item "x" 0 or 1 times. for ex...
...mple, /e?le?/ matches the "el" in "angel" and the "le" in "angle." if used immediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as opposed to the default, which is greedy (matching the maximum number of times). x{n} where "n" is a positive integer, matches exactly "n" occurrences of the preceding item "x". for example, /a{2}/ doesn't match the "a" in "candy", but it matches all of the "a"'s in "caandy", and the first two "a"'s in "caaandy". x{n,} where "n" is a positive integer, matches at least "n" occurrences of the preceding item "x". for example, /a{2,}/ doesn't match the "a" in "candy", but matches all of the a's in "caandy" and in "caaaaaaandy". x{n,m} ...
...for example, /a{1,3}/ matches nothing in "cndy", the "a" in "candy", the two "a"'s in "caandy", and the first three "a"'s in "caaaaaaandy". notice that when matching "caaaaaaandy", the match is "aaa", even though the original string had more "a"s in it. ...
Array.prototype.reduce() - JavaScript
let initialvalue = 0 let sum = [{x: 1}, {x: 2}, {x: 3}].reduce(function (accumulator, currentvalue) { return accumulator + currentvalue.x }, initialvalue) console.log(sum) // logs 6 alternatively written with an arrow function: let initialvalue = 0 let sum = [{x: 1}, {x: 2}, {x: 3}].reduce( (accumulator, currentvalue) => accumulator + currentvalue.x ...
... let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.indexof(currentvalu...
..., ...currentvalue.books] }, ['alphabet']) // allbooks = [ // 'alphabet', 'bible', 'harry potter', 'war and peace', // 'romeo and juliet', 'the lord of the rings', // 'the shining' // ] remove duplicate items in an array note: if you are using an environment compatible with set and array.from(), you could use let orderedarray = array.from(new set(myarray)) to get an array where duplicate items have been removed. let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.indexof(currentvalue) === -1) { accumulator.push(currentvalue) } return accumulator }, []) console.log(myorderedarray) replace .filter().map() with .reduce() using array.filter() then array.map() tr...
Array.prototype.every() - JavaScript
sbigenough); // true using arrow functions arrow functions provide a shorter syntax for the same test. [12, 5, 8, 130, 44].every(x => x >= 10); // false [12, 54, 18, 130, 44].every(x => x >= 10); // true​ affecting initial array (modifying, appending, and deleting) the following examples tests the behaviour of the every method when the array is modified. ...
... --------------- let arr = [1, 2, 3, 4]; arr.every( (elem, index, arr) => { arr[index+1] -= 1 console.log(`[${arr}][${index}] -> ${elem}`) return elem < 2 }) // loop runs for 3 iterations, but would // have run 2 iterations without any modification // // 1st iteration: [1,1,3,4][0] -> 1 // 2nd iteration: [1,1,2,4][1] -> 1 // 3rd iteration: [1,1,2,3][2] -> 2 // --------------- // appending items // --------------- arr = [1, 2, 3]; arr.every( (elem, index, arr) => { arr.push('new') console.log(`[${arr}][${index}] -> ${elem}`) return elem < 4 }) // loop runs for 3 iterations, even after appending new items // // 1st iteration: [1, 2, 3, new][0] -> 1 // 2nd iteration: [1, 2, 3, new, new][1] -> 2 // 3rd iteration: [1, 2, 3, new, new, new][2] -> 3 // --------------- // deleting items...
...new items // // 1st iteration: [1, 2, 3, new][0] -> 1 // 2nd iteration: [1, 2, 3, new, new][1] -> 2 // 3rd iteration: [1, 2, 3, new, new, new][2] -> 3 // --------------- // deleting items // --------------- arr = [1, 2, 3, 4]; arr.every( (elem, index, arr) => { arr.pop() console.log(`[${arr}][${index}] -> ${elem}`) return elem < 4 }) // loop runs for 2 iterations only, as the remaining // items are `pop()`ed off // // 1st iteration: [1,2,3][0] -> 1 // 2nd iteration: [1,2][1] -> 2 specifications specification ecmascript (ecma-262)the definition of 'array.prototype.every' in that specification. ...
Content Scripts - Archive of obsolete content
ll work regardless of the context in which the content script was loaded. in the special case where the two content scripts are loaded into the same exact page, it is possible for the content scripts to communicate directly to each other using the dom postmessage() api or a customevent. the following add-on shows a content script added by page-mod receiving a customevent sent from a context-menu item when the context menu item is clicked. the page-mod script will then issue an alert with the url of the link on which the context menu was displayed. the url is passed to the page-mod script in the customevent. var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'function contextmenualert(href) {' + ' window.alert("the context m...
...mod.pagemod({ include: "*.mozilla.org", contentscript: 'function contextmenualert(href) {' + ' window.alert("the context menu was clicked on url:\\n" + href);' + '};' + 'window.addeventlistener("myaddonid-contextmenu-clicked",' + ' function(event){contextmenualert(event.detail);});' }); let cm = require("sdk/context-menu"); cm.item({ label: "alert url", context: [ cm.urlcontext(["*.mozilla.org"]), cm.selectorcontext("a[href]") ], contentscript: 'self.on("click", function (node, data) {' + ' var event = new customevent("myaddonid-contextmenu-clicked",' + ' {detail:node.href});' + ' window.dispatchevent(even...
l10n - Archive of obsolete content
thout localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. if you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a second integer parameter which indicates the number of items there are. you can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression:...
... translated string. you can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. parameters identifier : string a identifier for the localization of a particular string in the current locale. count : integer optional parameter. if you're supplying different localizations for a string for singular or plural forms, this parameter is the number of items there are in this case. var _ = require("sdk/l10n").get; console.log(_("child_id", 1)); console.log(_("child_id", 2)); see the tutorial on plural support for more information. note that if you use this parameter, you can't supply any placeholders. placeholder1...n : string optional parameters. if you do not include the count parameter, you can supply one or more placeholder strings that are...
places/history - Archive of obsolete content
bjects representing queries. each query object can take several properties, which are queried against the history database. each property is and'd together, meaning that bookmarks must match each property within a query object. multiple query objects are then or'd together. options : object optional options: name type count number the number of bookmark items to return. if left undefined, no limit is set. sort string a string specifying how the results should be sorted. possible options are 'title', 'date', 'url', 'visitcount', 'keyword', 'dateadded' and 'lastmodified'. descending boolean a boolean specifying whether the results should be in descending order. by default, results are in ascending order. ...
...placesemitter is not exposed in the module, but returned from the search functions. the placesemitter inherits from event/target, and emits data, error, and end. data events are emitted for every individual search result found, whereas end events are emitted as an aggregate of an entire search, passing in an array of all results into the handler. events data the data event is emitted for every item returned from a search. arguments object : this is an object representing a history entry. contains url, time, accesscount and title of the entry. error the error event is emitted whenever a search could not be completed. arguments string : a string indicating the error that occurred. end the end event is called when all search results have returned. arguments array : the value passed i...
Using XPCOM without chrome - Archive of obsolete content
lly, a bookmark observer would require chrome components and xpcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets). however, with the sdk module , we can remove this need. below is an example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. // this removes the need to import ci and the xpcomutils const { class } = require("sdk/core/heritage"); const { unknown } = require('sdk/platform/xpcom'); const { placesutils } = require("resource://gre/modules/placesutils.jsm"); let bmlistener = class({ extends: unknown, interfaces: [...
...the bookmarks service. // this removes the need to import ci and the xpcomutils const { class } = require("sdk/core/heritage"); const { unknown } = require('sdk/platform/xpcom'); const { placesutils } = require("resource://gre/modules/placesutils.jsm"); let bmlistener = class({ extends: unknown, interfaces: [ "nsinavbookmarkobserver" ], //this event most often handles all events onitemchanged: function(bid, prop, an, nv, lm, type, parentid, aguid, aparentguid) { console.log("onitemchanged", "bid: "+bid, "property: "+prop, "isanno: "+an, "new value: "+nv, "lastmod: "+lm, "type: "+type, "parentid:"+parentid, "aguid:"+aguid);0 // code to handle the event here } }); //we just have a class, but need an object. notice the small l var bmlistener = bmlistener(); placesutils.boo...
Localization - Archive of obsolete content
n 2..4 and n mod 100 not in 12..14; many → n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14; other → everything else plural rules for all languages can be found in the cldr language plural rules page (although this table is out of date compared to the cldr xml source). plural forms in the sdk in the code, you supply an extra parameter alongside the identifier, describing how many items there are: var _ = require("sdk/l10n").get; console.log(_("tomato_id")); console.log(_("tomato_id", 1)); console.log(_("tomato_id", 2)); console.log(_("tomato_id", 5)); console.log(_("tomato_id", .5)); in the .properties file for each language you can define a different localization for each plural form possible in that language, using the cldr keywords. so in english we could have two plural ...
... in your "fr.properties" file, include the french translation: monster_name_title= nom monster_name_description= quel est le nom du monstre ? now when the browser's locale is set to "en-us", users see this in the add-ons manager: when the browser's locale is set to "fr", they see this: the menulist and the...
Toolbar - Archive of obsolete content
* @param {string} toolbarid the id of the toolbar to install to. * @param {string} id the id of the button to install. * @param {string} afterid the id of the element to insert after. ...
...ument.getelementbyid(id)) { var toolbar = document.getelementbyid(toolbarid); // if no afterid is given, then append the item to the toolbar var before = null; if (afterid) { let elem = document.getelementbyid(afterid); if (elem && elem.parentnode == toolbar) before = elem.nextelementsibling; } toolbar.insertitem(id, before); toolbar.setattribute("currentset", toolbar.currentset); document.persist(toolbar.id, "currentset"); if (toolbarid == "addon-bar") toolbar.collapsed = false; } } if (firstrun) { installbutton("nav-bar", "my-extension-navbar-button"); // the "addon-bar" is available since firefox 4 installbutton("addon-bar", "my-extension-addon-bar-...
XPath - Archive of obsolete content
emo.xml',parsexml,'xml'); //ajax is a class written by javascript which return responsexml object to parsexml function function parsexml(obj)//obj is the returnxml object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return; } var fields = [];//store the results if(window.activexobject) { var tobj = obj.documentelement.selectnodes("/root/field/item"); for(var i=0;i<tobj.length; i++) { fields.push(tobj[i].text); } } else { var tobj = obj.evaluate("/root/field/item",obj.documentelement,null, xpathresult.any_type, null); var tmp = tobj.iteratenext(); while(tmp) { fields.push(tmp.textcontent); tmp = tobj.iteratenext(); } } alert(fields); } //here is the demo xml file for xpath <?xml version="1.0"?> <root> <f...
...(var i=0;i<tobj.length; i++) { fields.push(tobj[i].text); } } else { var tobj = obj.evaluate("/root/field/item",obj.documentelement,null, xpathresult.any_type, null); var tmp = tobj.iteratenext(); while(tmp) { fields.push(tmp.textcontent); tmp = tobj.iteratenext(); } } alert(fields); } //here is the demo xml file for xpath <?xml version="1.0"?> <root> <field> <item>art_id</item> <item>psection</item> <item>qkind</item> <item>qtitle</item> <item>question</item> <item>pic</item> <item>answer1</item> <item>answer2</item> <item>answer3</item> <item>answer4</item> </field> </root> //add by mooring 2008-11-15 16:16 china ...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
d. the simplest way to do this is to write some javascript and xul code. at this point, it would be very helpful to have a bit of experience writing "regular" extensions (i.e. without using custom c++ components). if you've never done this, i strongly recommend that you think of a cool idea for something simple that you've always wanted to tweak in firefox and write it. just displaying a new menu item that opens a "hello, world!" dialog box would be already be a great exercise to get warmed up with. assuming you know how to write xul/javascript extensions, you're aware that the most important stuff goes in the chrome/ directory of your extension. well, the fact that you're also using c++ components doesn't change that one whit. so now you need to create the normal content/, locale/ and ...
...te the normal content/, locale/ and skin/ directories in which to place your chrome files. personally i like placing these directly under the root directory of my module, but i don't suppose it makes any difference if you prefer putting them under a chrome/ subdirectory or whatever. let freedom reign! once you've written the necessary chrome files (for instance, an overlay that adds a menu item to instantiate and use one of your components), you need to package them up as part of your extension. this is accomplished through the use of a jar manifest. for our simple extension example, this file might look something like this: myextension.jar: % content myextension %content/ % locale myextension en-us %locale/ % skin myextension cl...
Extension Versioning, Update and Compatibility - Archive of obsolete content
5 has a regular http link with a hash to verify the file retrieved. it is important to get the initial rdf:description's about attribute correct. it varies depending on what type of add-on you are providing information for: for an extension or plugin bundle it must be urn:mozilla:extension:<id> for a theme it must be urn:mozilla:theme:<id> for any other type of add-on it must be urn:mozilla:item:<id> note: prior to gecko 2.0 (firefox 4.0), the ordering of the versions within the <rdf:seq> is significant. for later versions, the compatible add-on version with the greatest version string will be used by the client for automatic updates. the behavior depends on the version of the client application, of course. <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.or...
...le. you may also use the other substitution strings supported by updateurl, although those may be less useful. formatting prior to firefox 4 prior to firefox 4 you could only use the following tags, any other tags have themselves and their contents completely stripped: h1, h2 and h3 for general headings p for paragraphs ul and ol for lists. within lists use the usual li tag for each list item. within h1, h2, h3, p and li tags you may use: b or strong for bolder text i or em for italicized text formatting in firefox 4 and later from firefox 4 the restrictions are relaxed somewhat. the following tags are interpreted normally: h1, h2 and h3 for general headings p, div, pre and blockquote for block formatting ul, ol, li, dl, dt and dd for lists b, i, em, strong, u, q, sub, s...
Inline options - Archive of obsolete content
the title attribute is used as a label for the controls. to set a description, either use the desc attribute, or a text node as a child of the <setting> tag. settings are tied to actual preferences...
...e="color" title="color"/> <!-- file and directory examples --> <setting pref="extensions.myaddon.file" type="file" title="file"/> <setting pref="extensions.myaddon.directory" type="directory" title="directory"/> <!-- list example (this example would be stored as an integer) --> <setting pref="extensions.myaddon.options1" type="menulist" title="options 1"> <menulist> <menupopup> <menuitem value="500" label="small"/> <menuitem value="800" label="medium"/> <menuitem value="1200" label="large"/> </menupopup> </menulist> </setting> <!-- radio button example (this example would be stored as a boolean) --> <setting pref="extensions.myaddon.options2" type="radio" title="options 2"> <radiogroup> <radio value="false" label="disabled"/> <radio value="true" label...
Interaction between privileged and non-privileged pages - Archive of obsolete content
ght be easier to add the event listener to the top-level document directly as shown below (also see: accessing the elements of the top-level document from a child window). ...
...stener to the top-level document directly as shown below (also see: accessing the elements of the top-level document from a child window). var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.addeventlistener("myextensionevent", function(e) { myextension.mylistener(e); }, false, true); if you need to to pass lots of data, consider using cdata sections instead of the simple attributes on a custom element. note: if you...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
vascript debugger” from the tools menu. targeting javascript for debugging. when venkman first launches, it can only debug the file currently open in your web browser. this is because a lot of javascript files can slow down the browser down if they’re opened for debugging, but you’ll need to lift this restriction in order to develop extensions. uncheck the “exclude browser files” menu item under the debug menu (figure 1). fixme: figure 1: uncheck “exclude browser files.” set up quicknote for the purposes of this explanation, we’re going to use the file-storage mechanism in quicknote1 for our debugger. install quicknote from the following url and relaunch firefox. https://addons.mozilla.org/firefox/46/. after relaunching firefox, activate quicknote. then select tools:quick...
...ncalc. first we’ll sketch out a simple interface for it (listing 1). save this as a file called calc.js. listing 1: calc.js (stage 1) function rpncalc() { } rpncalc.prototype = { init: function() { }, push: function(val) { }, plus: function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case. first, select the menu item tools:mozlab:open mozunit runner to bring up the mozunit window. select the menu item file:new, and save test_calc.js in the same directory as the file that is the test target. next, click the edit button to set up the “2 1+” test case (listing 2). note that in this file, the method names serve as the test names. in junit and similar packages, methods containing tests that start with testhog...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
once the process is complete, you should close all streams. outputting binary files listing 14 shows the opposite operation, taking a string of bytes and outputting them as a binary file. here, we're outputting a te...
...once the process is complete, you should close all streams. outputting binary files listing 14 shows the opposite operation, taking a string of bytes and outputting them as a binary file. here, we're outputting a text file consist...
Extensions support in SeaMonkey 2 - Archive of obsolete content
bookmarks/bookmarkspanel.xul chrome://communicator/content/bookmarks/bm-panel.xul chrome://browser/content/places/places.xul chrome://communicator/content/bookma...rksmanager.xul thunderbird uses mostly the same chrome urls for overlaying as seamonkey. there are exceptions, but these are few and far between. seamonkey also uses different ids for the menu items. some important menu ids are listed below, menu ids are based on firefox 3 source code: menu id in firefox menu id in seamonkey 1.x and 2.0 seamonkey 2.1 overlays menu_filepopup menu_filepopup menu_filepopup file menu popup menu_editpopup menu_edit_popup menu_editpopup edit menu popup menu...
...ow menu popup menu_helppopup helppopup helppopup help menu popup urlbar icons to display a button with a menupopup in the urlbar-icons for both firefox and seamonkey 2.0, use this code: <hbox id="urlbar-icons"> <image popup="myext-menu"/> </hbox> <window id="main-window"> <menupopup id="myext-menu"> <menuitem label="menuitem"/> <menuitem label="menuitem"/> </menupopup> </window> instead of <hbox id="urlbar-icons"> <button type="menu"> <menupopup> <menuitem label="menuitem"/> <menuitem label="menuitem"/> <menuitem label="menuitem"/> </menupopup> </button> </hbox> technica...
Security best practices in extensions - Archive of obsolete content
this document is intended as a guide for developers to promote best practices in securing your extension. your goal is to keep your users safe. some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons. other items are recommendations. the difference will be clearly flagged. this is written from the perspective of a firefox extension, but most items apply to extensions for other mozilla-based applications such as thunderbird or seamonkey. web content handling in general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those privileges. a more detailed explanation of this process is in displaying web content in an extension without security issu...
... it provides users with a familiar interface for interacting with logins, via the firefox password manager. when users clear logins using the "clear recent history" option, it will include your extension's data. apis and other data handling web content is more than just pages, and more and more add-ons are interacting with web services via an application programming interface (api). many of the items talked about so far in this document apply in this sphere, but here are some additional tips: api providers should use the https protocol, which provides better protection for data passed over the network. json has become a popular data format for return formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed ...
CSS3 - Archive of obsolete content
perty. at risk: 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 ...
...ned to the next iteration of this module. several types definition, like <ident> and <custom-ident>, have been deferred to css values and units module level 4. css flexible box layout module candidate recommendation add a flexbox layout to the css display property and several new css properties to control it: flex, flex-align, flex-direction, flex-flow, flex-item-align, flex-line-pack, flex-order, flex-pack, and flex-wrap. css cascading and inheritance level 3 candidate recommendation adds: the initial, unset values for properties. the css all property. the scoping mechanism. clarifies: interaction of media-dependent @import statements and style sheet loading requirements. ...
Creating a status bar extension - Archive of obsolete content
this is accomplished by the following line of xml: <overlay id="status-bar-sample-1-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> once that's accomplished, we can describe...
...t the bottom of firefox browser windows. we do this by embedding inside the statusbar named "status-bar" -- which is the firefox browser window's status bar -- a new statusbarpanel object we call "status-bar-sample-1". we include properties to configure our new status bar panel the way we want, setting its text label to "hello world" and establishing a tool tip with the message "sample status bar item" in it. trying it out to test your extension, drop the folder into the extensions folder in your profile folder. then restart firefox, and you should see the extension in the status bar. next » ...
Install.js - Archive of obsolete content
mpleext.jar content\ sampleext\ locale\ (optional) en-us\ sampleext\ ... skin\ (optional) classic\ sampleext\ ... install.js install.rdf (optional -- see above) code // install.js // xpiinstaller // by pike (heavily inspired by code from henrik gemal and stephen clavering) var xpiinstaller = { // --- editable items begin --- extfullname: 'sample extension', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', extlocalenames: null, // e.g. ['en-us', 'en-gb'] extskinnames: null, // e.g. ['classic', 'modern'] extpostinstallmessage: null, // set to null for n...
...ion', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', extlocalenames: null, // e.g. ['en-us', 'en-gb'] extskinnames: null, // e.g. ...
How Mozilla finds its configuration files - Archive of obsolete content
%userprofile%/mozprofile) allowed. we chose to point this to the user's home directory (h:\mozilla). the configuration itself is stored in the specified directory, in a file named prefs.js. this is a readable file of javascript commands. all other files in that directory are dynamically created by mozilla on first start. the of the binary registry file is described here. ...
...mands. all other files in that directory are dynamically created by mozilla on first start. the of the binary registry file is described here. you may use the following items: a program to convert registry.dat file into a readable (and editable) xml file. usage: ./readmozprofile.pl < registry.dat >registry.xml a program to convert the xml file back into the binary registry.dat file. usage: ./writemozprofile.pl < registry.xml >registry.dat a ready-to-use registry.dat file pointing to h:\mozilla a registry.xml file pointing to h:\mozilla an example of a prefs.js file (to put into the user's h:\mozilla directory). if you use the userd system from the lll project, you can generate this automatically with the user's personal values by using this template file prefs.js.tmpl n.b. mozilla inclu...
Structure of an installable bundle - Archive of obsolete content
nes loaded later overwrite the earlier ones. ...
...ces for toolkit api structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how to package themes multiple-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps ...
Creating a Help Content Pack - Archive of obsolete content
s: nc:panelid specifies the name of the panel, which may be any one of glossary, search, toc, or index. the data source specified by toc will always be displayed, while the other data sources may only be available by searching through the loaded content pack. nc:datasources is a space-separated list of rdf datasources used in construction of the structure of referenced topics. generally, each item in the list will be a uri to an rdf file, but if you're more familiar with rdf you can also refer to a specific node within the rdf file using its rdf:id attribute. nc:platform (added in mozilla 1.8b2/firefox 1.1) when present specifies the platforms to which the information stored in the referenced data sources applies. this attribute is useful when some of your help contents only apply to one ...
...be an online, dynamically-generated list of added content stored on your web site. to have the help viewer search through these additional data sources, define another rdf:li element like so: <rdf:li> <rdf:description nc:panelid="search" nc:datasources="" nc:emptysearchtext="[no matching items found.]" nc:emptysearchlink="chrome://foo/locale/bar.html"/> </rdf:li> nc:panelid should be set to search. nc:datasources should be set as with table of contents, index, and glossary definitions. nc:platform (added in mozilla 1.8b2/firefox 1.1) may be used on search data sources as it's used on table of contents, index, and glossary defi...
RDF Datasource How-To - Archive of obsolete content
stantiate a tree control whose body is "rooted" to a resource (http://foo.bar.com/) that your datasource describes: <window xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/tr/wd-rdf-syntax#" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <tree datasources="rdf:my-datasource" ref="http://foo.bar.com/"> <template> <treechildren> <treeitem uri="..."> <treerow> <treecell> <text value="rdf:http://home.netscape.com/nc-rdf#name" /> </treecell> <treecell> <text value="rdf:http://home.netscape.com/nc-rdf#url" /> </treecell> </treerow> </treeitem> </treechildren> </template> <treehead> <treeitem> <treecell>n...
...this is a space-separated list that may include internal xpcom datasource "identifiers" (as described above) and uris for local or remote rdf/xml documents. each datasource that is listed will be loaded, and the ass...
Space Manager Detailed Design - Archive of obsolete content
algorithm 1: getbanddata getbanddata is used to provide information to clients about what space if available and unavailable in a band of space. the client provides a vertical offset, the yoffset, that corresponds to the band that is of interest. this will be the y offset of the frame that is being reflowed. the caller also provides a collection of banddata objects (an array) and the number of items that the collection can handle. if the collection is too small, then an error is returned and the count is updated to indicate the size required. the algorithm to provide the band data is as follows: get a vertical offset in world coordinates (instead of frame-relative coordinates) by adding the y-origin of the spacemanager to the y offset passed in if the (adjusted) y value passed in is grea...
...he reference band tna dht band being examined if there is no more room in the banddata collection, estimate the number of entries requires as the current count + twice the number of bands below the reference band, plus two. return an error code so the caller can reallocate the collection and try again. check the size of the collection again, if there is no room left then estimate the number of items requires as the current count + twice the number of bands below the band in question plus one. create a new trapezoid in the band collection that has a region corresponding to the reference band rect, marked as occupied by either a single or multiple frames. move to the next band after walking all of the band data, se if we have reached the rightedge of the band. if not, then check for spac...
Creating XPI Installer Modules - Archive of obsolete content
d here, mozilla users can download and install it in a single step. the barley package the barley package is a simple xul window with a couple of buttons and an image element. one of the buttons, labeled "show aphids", displays an alert dialog by calling a function defined in the javascript file barley.js. since we are not updating the mozilla ui to provide special access to this window (e.g., an item in the tasks menu or elsewhere), the measure of the success of the installation of the barley package is that the user can, as before, invoke our software by using a special startup option: mozilla -chrome chrome://barley/content this option tells mozilla to load a chrome other than the default, which is the main browser window. for this option to work, the designated chrome must have been insta...
...he most important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of. for a package such as this one with its own content but no special localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
crop - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › crop
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. ...
...lements will have set a maximum width so they will always appear cropped. ...
image - Archive of obsolete content
« xul reference home image type: uri the uri of the image to appear on the element. ...
... « xul reference home image type: uri the uri of the image to appear on the element. ...
label - Archive of obsolete content
« xul reference home 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. ...
... « xul reference home 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. ...
command - Archive of obsolete content
Archive › Mozilla › XUL › Events › command
event was fired. false otherwise. ...
...ead only boolean true if the shift key was down when the event was fired. false otherwise. ...
Menus - Archive of obsolete content
for more information about how to use an overlay to modify a menu, see using menus and popups in extensions the following tables list the ids of menus in firefox that are commonly overlaid upon. firefox menus element id description main-menubar the menubar element. menu_filepopup the menupopup associated with the 'file' menu. menu_editpopup the menupopup associated with the 'edit' menu. ...
... submenu on the 'view' menu. menuwebdeveloperpopup the menupopup for the 'web developer' submenu on the 'tools' menu. firefox context menu element id description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. editable text context-openlink opens a link in a new window links context-openlinkintab opens a link in a new tab links context-bookmarklink bookmarks a link links context-savelink saves a link links context-sendlink sends a link in an email links context-c...
How to implement a custom XUL query processor component - Archive of obsolete content
from the beginning of the name var name = avar.tostring().slice(1); return this._data[name]; }, // return an object instead of a string for convenient comparison purposes // or null to say just use string value getbindingob...
...le such as ?name getbindingfor: function(avar) { // strip off the ? from the beginning of the name var name = avar.tostring().slice(1); return this._data[name]; }, // return an object instead of a string for convenient comparison purposes // or null to say just use string value getbindingobjectfor: function(avar) { return null; }, // called when a rule matches this item. rulematched: function(aquery, arulenode) { }, // the output for a result has been removed 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([co...
How to Quit a XUL Application - Archive of obsolete content
hat. ...
...rtup.eforcequit : components.interfaces.nsiappstartup.eattemptquit; appstartup.quit(quitseverity); } </script> calling this function if there is an uncaught exception, to force the application to quit: <script> try { dosomething(); } catch (e) { quit(true); } </script> the "quit" menuitem should typically prompt the user if there is unsaved data: <menuitem label="quit" oncommand="quit(false);"/> ...
appendCustomToolbar - Archive of obsolete content
the method returns the dom element for the created toolbar. ...
...the method returns the dom element for the created toolbar. ...
clearSelection - Archive of obsolete content
...
... ...
ensureElementIsVisible - Archive of obsolete content
...
... ...
getResultValueAt - Archive of obsolete content
...
... ...
getSessionResultAt - Archive of obsolete content
...
... ...
removeNotification - Archive of obsolete content
...
... ...
Namespaces - Archive of obsolete content
in addition to this document, see namespaces crash course. xml namespaces provide a way to distinguish duplicate element and attribute names. duplicates element and attribute names can occur when an xml document contains elements and attributes from two or more different xml schemas (or dtds). to quote wikipedia: "in general, a namespace is an abstract container providing context for the items ... it holds and allows disambiguation of items having the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module importing, you are already familiar with the namespace concept. an xml namespace is identified by an unique name (called a uri, not a url, even though it can look like a url). an uri is any string, although most people choose a url-based uri becau...
...ttp://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally. even if they did accidentally choose it, they may not define the same elements as xul anyway (e.g., <textbox/>) in their schema/dtd. any element type or attribute name in an xml namespace can be uniquely identified by its xml namespace and its "local name". together, these two items define a qualified name, or qname. for example, <xul:textbox/> uses a namespace named "xul" and a local name "textbox". this distinguishes it from, for example, <foobar:textbox/> which might occur in the same document. the xul and foobar namespaces must be defined at the top of the xml document in which they are used, like so: <foobar:some-element xmlns:xul="http://www.mozilla.org/keymaste...
MoveResize - Archive of obsolete content
ll move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar. resizing a popup the size of a popup is determined automatically based on the content inside the popup. for instance, the size of a menu will be large enough to fit all of the items within the menu. sometimes, a menu will be larger than the available space on the screen; in this situation, the menu may be moved such that it will fit on screen. for instance, instead of appearing below the menu label, the menu popup might appear above the label. you can see this effect in a xul application by moving a window near the bottom of the screen and clicking a menu or button that has...
...n. for instance, instead of appearing below the menu label, the menu popup might appear above the label. you can see this effect in a xul application by moving a window near the bottom of the screen and clicking a menu or button that has a menu. if a popup is still too large, it will be resized to fit on the screen. arrows will appear on the ends of the menu to allow a user to scroll through the items. a popup can be resized manually using the popup's sizeto method. void sizeto(in long width, in long height); here is an example which resizes a popup to be 200 pixels wide and 300 pixels high: popup.sizeto(200, 300); ...
Printing from a XUL App - Archive of obsolete content
intutils, and the ways that xul applications can trigger print-related behaviors. ...
...-related behaviors. ...
accessibleType - Archive of obsolete content
xuldropmarker 1007 xulgroupbox 1008 xulimage 1009 xullink 100a xullistbox 100b xullistcell 1026 xullisthead 1024 xullistheader 1025 xullistitem 100c xulmenubar 100d xulmenuitem 100e xulmenupopup 100f xulmenuseparator 1010 xulpane 1011 xulprogressmeter 1012 xulscale 1013 xulstatusbar 1014 ...
... 1016 xultab 1017 xultabbox 1018 xultabs 1019 xultext 101a xultextbox 101b xulthumb 101c xultree 101d xultreecolumns 101e xultreecolumnitem 101f xultoolbar 1020 xultoolbarseparator 1021 xultooltip 1022 xultoolbarbutton 1023 ...
Additional Navigation - Archive of obsolete content
« previousnext » retrieving literals the triples used so far have all had variables in both the subject and object. however, a string value may be used instead. since the subject of an rdf arc is always a resource, the subject may be a resource uri. the object attribute may be a resource uri or a literal value. using a literal as the object of a triple is a common way to filter out specific items. for instance, if items were identified with a type, the data could be filtered to include only items of a particular type. here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> th...
...ng the graph arrows in the reverse direction. for instance, in the original example, we could start at node d and navigate upwards to a and c. the syntax for the triple is the same except that the known variable should be placed in the triple's object attribute and the unknown variable should be placed in the triple's subject variable. <query> <content uri="?start"/> <triple subject="?relateditem" predicate="http://www.xulplanet.com/rdf/relateditem" object="?start"/> </query> the triple is evaluated in the same manner except that the value of the object can be filled in with the value of the ?start variable. the rdf graph is examined for an arrow pointing in to the node instead of out. in the photos example, we might wish to categorize each photo into several catego...
Introduction - Archive of obsolete content
url of an xml file, which can be either the location of a web site or a file on the local file system, using its file or chrome url. this file will be loaded and the resulting xml document will be used as the datasource when the template builder generates results and creates content. for example: <listbox datasources="http://www.xulplanet.com/ds/sample.xml" querytype="xml"> <template> <listitem label="?name"/> </template> </listbox> this template uses an xml datasource to generate a listbox. although we'll look at the details of this later, the simple result here is that a listitem will be generated for each child node in the xml data, setting the label to the name attribute for each xml node. for sqlite datasources, the datasources attribute specifies the uri of a database file. onl...
...ta about those bookmarks. <vbox datasources="rdf:bookmarks http://www.xulplanet.com/ds/sample.rdf"> in addition, when using the rdf type for chrome xul (such as in extensions), the datasource rdf:local-store is always included in the composite. the local store is a datasource which is usually used to hold state information such as window sizes, which columns in a tree are showing, and which tree items are open. you can query for any data in the local store in a template though this is rarely done. sometimes, you will want to specify the datasource to be used later, possibly determined dynamically by a script. the special uri rdf:null is used to indicate that you intend no datasources, or an empty datasource. this special uri will also work even for non-rdf types, so feel free to use it when n...
RDF Modifications - Archive of obsolete content
displayed. assuming that the 'obelisk' photo doesn't have a description already, adding the triple listed above should cause a new result to be available for this photo. the builder scans through the query statements one by one. the content tag can safely be skipped at this part of the process, so the builder moves onto the member statement. this type of statement can only cause a change when an item is being added or removed from a container. since this is a new rdf triple that isn't an addition or removal from a container, this statement can be skipped. effectively, if the result generation process was to evaluate this member statement, the same output would be supplied for the ?photo variable whether the new data is there or not. thus, the member statement can be skipped. the next statemen...
....com/rdf/myphotos', so the ?start variable will be filled in with this value. now, the potential result so far is: (?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?description = 'one of the thirty or so egyptian obelisks', ?start = http://www.xulplanet.com/rdf/myphotos, ?title = 'obelisk') as you can see, the result looks to have all the information necessary to create a new item in the output. if a statement hadn't generated a result, for instance if the photo did not have a title, or it wasn't contained in a parent container, there would be no match and the builder could stop processing the new triple. for instance, we might have added a description for a new photo, but haven't added the photo to the container resource. once we do add it to the container with another rd...
Result Generation - Archive of obsolete content
on't be the case. templates provide a means of navigating around using only arrows with specific labels. here is one serialization of rdf/xml for this graph, though there are many others. ...
...g only arrows with specific labels. here is one serialization of rdf/xml for this graph, though there are many others. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://www.xulplanet.com/rdf/"> <rdf:description rdf:about="http://www.xulplanet.com/rdf/a"> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/b"/> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/c"/> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/d"/> </rdf:description> <rdf:description rdf:about="http://www.xulplanet.com/rdf/c"> <rel:relateditem rdf:resource="http://www.xulplanet.com/rdf/d"/> </rdf:description> </rdf:rdf> for a xul template query, you first need to select a starting point in the rdf graph. once you...
SQLite Templates - Archive of obsolete content
s typically used. the query for an sqlite datasource is just an sql select statement, as text inside the query element. this simple example shows how to display a listbox containing the values in one column in a database table. <listbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name from myfriends </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the query returns the list of values from the 'name' column in the table 'myfriends'. the action body, starting at the node with uri="?" is repeated for each result returned from the query. if the query returns six results, six listitems will be generated. the labels have the special value '?name'. the syntax with the question mark i...
...eter, you should also set the type attribute. <listbox id="friends" datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name, from myfriends where age >= :minage && age <= :maxage <param id="minage" name="minage" type="integer">30</param> <param id="maxage" name="maxage" type="integer">40</param> </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> here, the age is an integer number, so the type attribute is set to integer. integers are 32-bit values, but you can use the value int64 for 64-bit integers. you can also use the value double for double precision floating point values. if no type is specified, a string is assumed. we could later change the age to use in the query wit...
Accesskey display rules - Archive of obsolete content
habets but alphabets are used to accesskey. for coherence of the labels on such localized builds, the accesskey text is always appended even if the labels have their accesskey characters. e.g., when an accesskey of "ok" is 'o' and an accesskey of "キャンセル" (means "cancel") is 'c', the labels will be "ok(o)" and "キャンセル(c)" on japanese localized build. xul elements check "intl.menuitems.alwaysappendaccesskeys" pref value whether they should append accesskey text always. if the value is "true" (string), the accesskey text will be appended always. don't change the pref value from your xul applications. and also note that there are no spaces between the original labels and accesskey text in the above japanese example. because typically, japanese language doesn't use spaces as word...
...r they should append accesskey text always. if the value is "true" (string), the accesskey text will be appended always. don't change the pref value from your xul applications. and also note that there are no spaces between the original labels and accesskey text in the above japanese example. because typically, japanese language doesn't use spaces as word separator. this is controled by "intl.menuitems.insertseparatorbeforeaccesskeys" pref value. if the value is "true" (string), a spece will be inserted before accesskey text. don't change the pref value from your xul applications too. don't include accesskey text in labels xul applications should use dtd for localizable ui resource. at that time, accesskeys are specified by independent entity from their label. be aware, this is very important ...
Anonymous Content - Archive of obsolete content
nt both the xbl content and the content provided by the xul file to be displayed. you can do this by using the children element. the children added in the xul are added in place of the children element. this is handy when creating custom menu widgets. for example, a simplified version of an editable menulist element, might be created as follows: xul: <menu class="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> </menu> css: menu.dropbox { -moz-binding: url('chrome://example/skin/example.xml#dropbox'); } xbl: <binding id="dropbox"> <content> <children/> <xul:textbox flex="1"/> <xul:button src="chrome://global/skin/images/dropbox.jpg"/> </content> </binding> this example creates an input field with a button beside it. the...
... beside it. the menupopup will be added to the content in the location specified by the children element. note that to dom functions, the content will appear as it was in the xul file, so the menupopup will be a child of the menu. the xbl content is hidden away so the xul developer doesn't need to even know it is there. the resulting content would be: <menu class="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> <textbox flex="1"/> <button src="chrome://global/skin/images/dropbox.jpg"/> </menu> includes attribute in some cases, you may wish to only include specific types of content and not others. or, you may wish to place different types of content in different places. the includes attribute can be used to allow only certain elements to app...
Box Objects - Archive of obsolete content
or higher but after one with ordinal 1. the default value if the ordinal is not specified is 1. this means that if you want to change the displayed order of elements, you will often need to adjust the ordinals of several elements. adjusting the ordinal of an element is not commonly done as you would usually just place the elements in a different order in the source. it might be used to rearrange items later without adjusting the dom. the following example demonstrates this. example 4 : source view <hbox> <button label="one" oncommand="this.ordinal++;"/> <button label="two" oncommand="this.ordinal++;"/> <button label="three" oncommand="this.ordinal++;"/> </hbox> if you press the first button, its ordinal will increase by one, from 1 to 2. it will appear at the end of the row since the o...
...his.ordinal++;"/> <button label="two" oncommand="this.ordinal++;"/> <button label="three" oncommand="this.ordinal++;"/> </hbox> if you press the first button, its ordinal will increase by one, from 1 to 2. it will appear at the end of the row since the other buttons have an ordinal of 1. if you press the second button, its ordinal will increase by one and will be moved to the end of the row. items with the same ordinal value appear in the same order as in the source. if you then press the button labeled one again, its ordinal will increase to 3 and will move to the end. finally, pressing the button labeled three will increase its ordinal to 2 and it will appear in between the other two buttons. dir attribute the final box ordering attribute is the dir attribute, or the -moz-box-direction ...
Broadcasters and Observers - Archive of obsolete content
te forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state information. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface elements might need to update when the user switches from offline mode to online mode. the simplest broadcaster is shown below. you should always use an id attribute so that it can be referred to by other elements. <broadcasterset> <broad...
...he main reason for using broadcasters is to have attributes forwarded to multiple places. you should only use broadcasters when you need multiple elements that observe an attribute. below, some additional observers are defined: <broadcaster id="offline_command" label="offline" accesskey="f"/> <keyset> <key id="goonline_key" observes="offline_command" modifiers="accel" key="o"/> </keyset> <menuitem id="offline_menuitem" observes="offline_command"/> <toolbarbutton id="offline_toolbarbutton" observes="offline_command"/> in this example, both the label and the accesskey will be forwarded from the broadcaster to the key, menu item and the toolbar button. the key won't use any of the received attributes for anything, but it will be disabled when the broadcaster is disabled. you can use a broa...
Cross Package Overlays - Archive of obsolete content
in the examples in the previous section, the overlays were imported by the window. you can also go the other way and have the overlays specify which windows that they apply to. you specify this by modifying the contents.rdf file for your package. this is useful because the overlay can modify the user interface of another package without changing the other package. for example, you could add menu items or toolbars to the mozilla browser window. we'll use this feature to add a toolbar to the mozilla browser window. the mozilla mail application uses overlays to add content to the browser window. for example, if mail is not installed, there will be no new message command. however, if mail is installed, an overlay will be applied to the menu to add the new message command. below, we'll add a find ...
...ll be applied to the menu to add the new message command. below, we'll add a find files toolbar to the browser. it probably wouldn't be useful to have this feature, but we'll do it anyway. mozilla allows you to add a list of overlays to the contents.rdf file that you use to list chrome packages, skins and locales. once you have created an overlay, you can add it to the contents.rdf file. then add items, one for each window that you want the overlay to apply to. our find files example first, let's create a simple overlay. it will just have a few elements for entering a filename and directory to search. call the file foverlay.xul and add it to the findfile directory along with findfile.xul. our foverlay.xul example source <?xml version="1.0"?> <overlay xmlns="http://www.mozilla.o...
Custom Tree Views - Archive of obsolete content
« previousnext » the tree view holds the data to be displayed in the tree. creating a custom view so far, we have only been using the built-in content tree view. in this section, we will look at creating a custom view. this is necessary when the page has a lot of data or that data is highly nested. for instance, 5000 rows of treeitems would load too slowly. you might also implement a custom view when you want to perform computations on the data to be displayed. since the view can store and retrieve the data in the most suitable manner for the kind of data used, the tree can be used even when there are hundreds of thousands of rows to be displayed. note: the tree-related interfaces changed in gecko 1.8. see tree widget changes for details. to implement a custom view, you w...
.... note: the tree-related interfaces changed in gecko 1.8. see tree widget changes for details. to implement a custom view, you will need to create an object which implements the nsitreeview interface. you can create these objects in javascript, but you will need a separate object for each tree. naturally, since a custom tree view is being used, the content tree view will not be used, so the treeitem, treerow, and treecell elements will have no purpose since the custom view will get its data from elsewhere. thus, you can just leave the treechildren element empty. the following example shows this: <tree id="my-tree" flex="1"> <treecols> <treecol id="namecol" label="name" flex="1"/> <treecol id="datecol" label="date" flex="1"/> </treecols> <treechildren/> </tree> to assign data...
Document Object Model - Archive of obsolete content
ce to the next sibling in sequence previoussibling reference to the previous sibling in sequence these properties allow you to navigate through a document is various ways. for example, you might get the first child of an element using the firstchild property and then navigate through the children using the nextsibling property. or, you might accomplish the same thing by iterating through the items in the childnodes list. in mozilla, the latter method is more efficient. the following example shows how to iterate over the children of the root node: var childnodes = document.documentelement.childnodes; for (var i = 0; i < childnodes.length; i++) { var child = childnodes[i]; // do something with child } the childnodes variable will hold the children of the document root element. we th...
... efficient. the following example shows how to iterate over the children of the root node: var childnodes = document.documentelement.childnodes; for (var i = 0; i < childnodes.length; i++) { var child = childnodes[i]; // do something with child } the childnodes variable will hold the children of the document root element. we then use a for loop to iterate over the children, accessing each item using an array-like notation. find files example so far: source view see also a re-introduction to javascript javascript reference next we'll learn how to modify the dom. « previousnext » ...
More Button Features - Archive of obsolete content
fy the label attribute on the button, it will override any content placed inside the button. button with menupopup you can place a menupopup inside the button to cause a menu to drop down when the button is pressed, much like the menulist. however, in this case you must set the type attribute to the value menu. ...
...tton, it will override any content placed inside the button. button with menupopup you can place a menupopup inside the button to cause a menu to drop down when the button is pressed, much like the menulist. however, in this case you must set the type attribute to the value menu. example 5 : source view <button type="menu" label="device"> <menupopup> <menuitem label="printer"/> <menuitem label="mouse"/> <menuitem label="keyboard"/> </menupopup> </button> in this example, the user may click the button to pop up a menu containing three items. note that selecting one of these menu items does not change the label on the button, unlike a menulist. this type of button is intended to be used like a menu, with scripts attached to each item to perform a task. we'll see more on menu...
Scrolling Menus - Archive of obsolete content
if the available space is too small, arrows will appear on each end of the menu. if you move the mouse over the arrows, the menu will scroll up and down. ...
... if the available space is too small, arrows will appear on each end of the menu. if you move the mouse over the arrows, the menu will scroll up and down. ...
Skinning XUL Files by Hand - Archive of obsolete content
the parent-child relationship is more economical than the aforementioned contextual subgrouping, which searches the entire subtree of an element for the subelement. finally, mozilla provides some ...
...te can be used on multiple xul elements you want to pick up the specified style information. a toolbar elements defined as: <toolbar class="nav-bar" id="nav3"> <toolbarbutton label="click me" /> <toolbarbutton label="don't click me" /> ... </toolbar> will be styled with the css rules that appear in the block after the toolbar.nav-bar selector in the css example above. similarly, the next item uses the id selector to apply style information to a single xul element. since id attribute must be unique in a document, there can only be a single element with the id "navbar", and it will pick up the style information in the block. the third type of selector, thepseudo-class, is one you may have seen in the in-line style definitions for hyperlinks which commonly appear in html documents. the ...
Trees and Templates - Archive of obsolete content
template-built tree, in this case for the file system. example 1 : source <tree id="my-tree" flex="1" datasources="rdf:files" ref="nc:filesroot" flags="dont-build-content"> <treecols> <treecol id="name" label="name" primary="true" flex="1"/> <splitter/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <rule> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://home.netscape.com/nc-rdf#name"/> <treecell label="rdf:http://home.netscape.com/web-rdf#lastmodifieddate"/> </treerow> </treeitem> </treechildren> </rule> </template> </tree> here, a tree is created with two columns, for the name and date of a file. the tree should di...
...a list of the files in the root directory. only one rule is used, but you may add others if needed. like with other templates, the uri attribute on an element indicates where to start generating content. the two cells grab the name and date from the datasource and place the values in the cell labels. this example shows why the uri attribute becomes useful. notice how it has been placed on the treeitem in the example, even though it is not a direct descendant of the rule element. we need to put this attribute on only those elements that we want repeated for each resource. because we don't want multiple treechildren elements, we don't put it there. instead we put the uri attributes on the treeitem elements. effectively, the elements outside (or above) the element with the uri attribute are not d...
XUL Changes for Firefox 1.5 - Archive of obsolete content
this lists the most notable changes to xul in firefox 1.5 (gecko 1.8). for other changes you should be aware of, see adapting xul applications for firefox 1.5. <scrollcorner> a <scrollcorner> element is added which is used to create the small box in the intersection of the horizontal and vertical scrollbars. <richlistbox> and <richlistitem> the <richlistbox> and <richlistitem> elements are used for creating lists containing arbitrary content. this element works similarly to the <listbox> which is designed primarily for lists of textual items. the <richlistbox> supports much of the same api as the <listbox> and single items, created with the <richlistitem> element may be selected. see xul:richlistbox for more information. preferences system several elements have been added which m...
...n a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the description attribute to allow for extra descriptive text to appear beside an item's label. the menulist modification methods appenditem and insertitemat take an extra description argument when creating items this way. <listbox> the removeitemat method was sometime non zero-based due to a bug (bug 236068). this has been fixed in firefox 1.5 and all code depending on...
XUL Parser in Python/source - Archive of obsolete content
ely, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
...\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; background-color: lightgrey;}</style>') elements = el_list.keys() elements.sort() for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item]: w.write('<tr><td class="at">' + a + '</td>') w.write('</table></html>\n') w.close() ...
arrowscrollbox - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer the tab order of the element. the tab order is the ...
...scroll attribute and then to the toolkit.scrollbox.smoothscroll preference. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer gets and sets the value of the tabindex attribute. methods ensureelementisvisible( element ) return type: no return value if the specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. scrollbyindex( lines ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of lines. a line is a single element. use a positive value as the lines argument to scroll forward that many lines, or a negative value to scroll backward that many lines. ...
colorpicker - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. overview an onchange attribute is an event listener to the object for the event change. a change...
...property to change the selected color. overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e. window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" ...
commandset - Archive of obsolete content
more information is available in the xul tutorial. ...
... dispatcher. focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. undo: occurs when the undo buffer is changed. oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. properties inherited properties align, , allowev...
content - Archive of obsolete content
Éste elemento debería pertenecer a query ("consulta"). la pregunta en una regla debería enlazar a sólo a un elemento del contenido. los contenidos deberían tener al atributo uri . Ésto se utiliza para vincular una variable a un nodo de contenido cuando se emparejan. cuando use un árbol con los atributos flags ("banderas"), establezca dont-build-content, ("no almacenar contenido"), use treeitem en su lugar. para más información, se encuentra disponible el tutorial xul. propiedades tag, uri ejemplos (no son necesarios) atributos inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, ...
...piedades tag type: tag name this may be set to a tag name. if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag. for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag. thus, nested elements will not match because they are directly inside a treeitem. this attribute is useful to provide different rules for outer and inner elements. uri type: ? used to specify the variable name for the content. when a rule is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable specified in the uri attribute in turn. then, the other rules are evaluated for a match. ...
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
selectedindex, selectedpanel examples <deck selectedindex="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 selectedindex 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, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, positi...
... 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 selectedindex 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. assigning a value to this property w...
description - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the string attribute allows you to associate a data value wi...
elements - Archive of obsolete content
ding bindings box broadcaster broadcasterset button browser c checkbox caption colorpicker column columns commandset command conditions content d deck description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner separator spacer splitter stack statusbar...
... radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner separator spacer splitter stack statusbar statusbarpanel stringbundle stringbundleset t tab tabbrowser tabbox tabpanel tabpanels tabs template textnode textbox titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple v vbox w window wizard wizardpage ...
grid - Archive of obsolete content
Archive › Mozilla › XUL › grid
a grid. ...
...s big as the first column --> <groupbox> <caption label="details"/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="user name"/> <textbox id="user"/> </row> <row> <label value="group"/> <menulist> <menupopup> <menuitem label="accounts"/> <menuitem label="sales" selected="true"/> <menuitem label="support"/> </menupopup> </menulist> </row> </rows> </grid> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hid...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user...
...est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. href type: string defines a url to open when this element is clicked. requires the class attribute to include text-link. value type: string the text to be used for the label. properties accesskey type: character gets and sets the value of the accesskey attr...
listhead - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, ...
...de, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listheader, listitem ...
notificationbox - Archive of obsolete content
each notification will slide in and out as needed. ...
.... if no matching value is found, returns null. removeallnotifications( immediate ) return type: no return value remove all notifications. if immediate is true, the messages are removed immediately. if immediate is false, the notifications are removed using a slide transition. removecurrentnotification() return type: no return value remove the current notification. removenotification( item ) return type: element remove a notification, displaying the next one if the removed item is the current one. removetransientnotifications( ) return type: no return value remove only those notifications that have a persistence value of zero, and decrements by one the persistence value of those that have a non-zero value. related elements notification ...
preference - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. instantapply type: boolean if true, the preference will be changed as soon as the user interface is modified. inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element atta...
...preference browser.startup.homepage. overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e. window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" ...
tabpanels - Archive of obsolete content
e 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 selectedindex properties selectedindex, selectedpanel examples (example needed) attributes selectedindex 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, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, positi...
...ion, 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. selectedindex 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 modify the selected panel. a select event will be sent when the selected panel is ...
toolbarseparator - Archive of obsolete content
it is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
..., issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarspacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a space between toolbar items. properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties ...
...sequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarspring - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a flexible space between toolbar items. properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width pr...
..., issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessibleprovider ...
toolbox - Archive of obsolete content
(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name. you can supply a comma-separated list of toolbar item ids as the second argument to add some items by default. the method returns the dom element for the created toolbar. collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox. expandtoolbar( toolbar ) not in firefox return type: no return value expand the given toolbar which should be contained in the...
...e dom element for the created toolbar. ...
treecell - Archive of obsolete content
ls. when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. the tree and treecol must also be marked as editable in order for this to work. the tree must be a content tree for this to work on treecells. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. mode type: one of the values below for columns that are progress meters, this determines the type of progress meter to use. none no progress meter is displayed. the cell text is displayed instead. normal the cell uses its value attribute to determine the amount ...
... ...
Debugging a XULRunner Application - Archive of obsolete content
n from addons.mozilla.org (v0.9.87 at the time of writing). to download the package, right-click the install link and save the package locally. create a directory <application>/distribution/bundles/venkman. unzip the package into that directory. add <script src="chrome://venkman/content/venkman-overlay.js" /> to one of your xul windows. add ui to open venkman to your window (it could be a menu item or a toolbar button). make it call start_venkman() when activated. troubleshooting x-jsd is not a registered protocol if the message "x-jsd is not a registered protocol" appears when trying to open *.js files in venkman, then add an empty file called .autoreg in the same directory as your xulrunner binary. if .autoreg already exists, then edit it to force the last modified time to be updated.
...nwindowbytype is not defined" you may add the following function to your scripts (doesn't seem to be in the venkman overlay): function toopenwindowbytype(intype, uri) { var winopts = "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar"; window.open(uri, "_blank", winopts); } i can't see my pages, functions ... if your pages are not in the loaded script window, uncheck the menu item "debug\exclude browser files" and find them in open windows tab when opening a js file in venkman, the code is unformatted and i get the following error in the jsconsole... security error: content at x-jsd:source?location=chrome%3a%2f%2fvenkman%2fcontent%2fvenkman-overlay.js&instance=12 may not load or link to chrome://venkman/skin/venkman-source.css. note the "new in firefox 3" attribute "co...
Archived Mozilla and build documentation - Archive of obsolete content
endarview implementations are particularly well suited to xbl. there is, however, no practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. calicalendarviewcontroller a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. implementing a calicalendarviewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included. califiletype the califiletype interface provides information about a specific file type. chromeless [this project may not be active — check github https://github.c...
...k rel="microsummary"> elements in their <head> elements. generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. creating a mozilla extension a mozilla extension is an installable enhancement to the mozilla browser that provides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox...
2006-10-20 - Archive of obsolete content
there is a link provided might solve the stated problem. ...
... there is a link provided might solve the stated problem. ...
Extentsions FAQ - Archive of obsolete content
the problem with most js frameworks is that th...
... the problem with most js frameworks is that they bootstrap by dynami...
Proposal - Archive of obsolete content
t and trying to come up with a draft. those labeled with "draft exists" can be implemented, but be warned that they could radically change. name description status easy news topics easy news topics (ent) is intended to be a very simple standard for describing how topic information can be introduced into an rss2.0 news feed. draft exists icbm let's you add latitude and longitude info to an item. spec exists itunes rss itunes extension modules used for ipradio/podcasting. spec exists media rss rss extension module used for iptv and ipradio/podcasting. spec exists newsgator feed extension created to make rss feeds work better with newsgator software. lets you specify an image, up to 277x78 pixels. and lets you specifies a specific rendering transform (xslt) to be used when rendering...
... installed automatically. spec exists rss disposition hinting a proposal to make it so iptv and ipradio/podcasting works better with rss. uses an http "content-type" parameter to hint at an rss feeds disposition type -- to hint at what is being syndicated. in development rsshints a module that adds elements to a feed that help an aggregator process them. draft exists source guid when an rss item is posted in response to a previous item (called the source item) rss 2.0 offers the source element which allows the item to refer to the rss feed which contains the source item. the sguid specification provides a more granular approach by offering an sourceref element which can reference the guid permalink of the source. draft exists <title>proposals</title> ...
-ms-filter - Archive of obsolete content
applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 is the dissolve filter. filterfrom.filters.item(0).transition=12; imagefrom.style.visibility = "hidden"; filterto.style.visibility = ""; filterfrom.filters.item(0).play(14); } </script> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties> = [ <enabled> | <endcolor> | <endcolorstr> | <gradienttype> | <startcolor> | ...
E4X for templating - Archive of obsolete content
d}</row> <row><image src="chrome://myext/skin/images/fillerrow.jpg" /></row> </>)} sorting /* @param {xmllist} xmllist the xmllist to sort @param {function} h the sorting handler */ function sort (xmllist, h) { var k, arr=[], ret = <></>; for (k in xmllist) { if (xmllist.hasownproperty(k)) { arr.push(xmllist[k]); } } arr.sort(h).foreach(function (item) { if (typeof item === 'xml') { ret += item; } else if (typeof item === 'string') { ret += new xml(item); } else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fruits = <fruits> <item>pear</item> <item>banana</item> ...
...{ if (typeof item === 'xml') { ret += item; } else if (typeof item === 'string') { ret += new xml(item); } else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fruits = <fruits> <item>pear</item> <item>banana</item> <item>grapes</item> </fruits>; alert( // using a javascript 1.8 expression closure <output> {sort(fruits.*, function (a, b) a.text() > b.text() /* text() call may not be necessary */ )} </output>.toxmlstring() ); /* <output> <item>banana</item> <item>grapes</item> <item>pear</item> </output> */ the above utility also works if the input is an htmlcollection, an array of strings, an array o...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. ...
...this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. ...
Enumerator.atEnd - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the enumerator.atend method returns a boolean value indicating if the enumerator is at the end of the collection. syntax myenum.atend() remarks the required myenum reference is any enumerator object. the atend method returns true if the current item is the last one in the collection, the collection is empty, or the current item is undefined. otherwise, it returns false. example in following code, the atend method is used to determine if the end of a list of drives has been reached: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefi...
...e, it returns false. ...
XUL Parser in Python - Archive of obsolete content
re fed to the parser and parsed (using the win32 system's <tt>dir /s /b *.xul</tt> command), the dictionary of dictionaries is sorted and written into an html table. the xml namespace support in xmllib was resolving the xul and html namespaces in a very annoying way, so i have an additional function, strip(), that takes off the whole namespace that xmllib is trying to tack onto the front of each item it finds in the xml. some modifications to this script may suggest other uses. the parser provides the tag name itself as a string and the attributes and their values in a dictionary, "a". if you want to look for certain widgets within the xul files, you can get the filename from the calling method p.feed(data) and create a condition that only gets the elements specified in sys.argv[1]. or, sin...
...rgv[1]. or, since the dictionary is already storing the values of all the attributes it finds, you can write the values of a particular attribute (e.g., id) to the results file by checking the attribute in sys.argv[1]: for attr in a.keys(): if strip(attr) == sys.argv[1]: el_list[name][strip(attr)] = strip(a[attr]) and writing thevalues to the html results file instead of thekeys: for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a little, this is just a very basic demonstration of using python's xml parser with xul. but mozilla's upcoming support for...
Mobile touch controls - Game development
tting it back again will use the first available property, so pointer2 will be used again. you can quickly get the coordinates of the most recently active pointer via the this.game.input.x and this.game.input.y variables. input events instead of using the pointers directly it is also possible to listen for this.game.input events, like ondown, onup, ontap and onhold: this.game.input.ondown.add(itemtouched, this); function itemtouched(pointer) { // do something } the itemtouched() function will be executed when the ondown event is dispatched by touching the screen. the pointer variable will contain the information about the pointer that activated the event. this approach uses the generally available this.game.input object, but you can also detect the actions on any game objects like s...
... dispatched by touching the screen. the pointer variable will contain the information about the pointer that activated the event. this approach uses the generally available this.game.input object, but you can also detect the actions on any game objects like sprites or buttons by using oninputover, oninputout, oninputdown, oninputup, ondragstart, or ondragstop: this.button.events.oninputover.add(itemtouched, this); function itemtouched(button, pointer) { // do something } that way you'll be able to attach an event to any object in the game, like the player's ship, and react to the actions performed by the user. an additional advantage of using phaser is that the buttons you create will take any type of input, whether it's a touch on mobile or a click on desktop — the framework sorts ...
Main Axis - MDN Web Docs Glossary: Definitions of Web-related terms
irection property. there are four possible values for flex-direction. these are: row row-reverse column column-reverse should you choose row or row-reverse then your main axis will run along the row in the inline direction. choose column or column-reverse and your main axis will run top to bottom of the page in the block direction. on the main axis you can control the sizing of flex items by adding any available space to the items themselves, by way of flex properties on the items. or, you can control the space between and around items by using the justify-content property. learn more property reference flex-basis flex-direction flex-grow flex-shrink justify-content flex further reading css flexbox guide: basic concepts of flexbox css flexbox guide: aligning ite...
...x properties on the items. or, you can control the space between and around items by using the justify-content property. ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
cessarily reflect the standard behavior completely.) note also that if you wish to allow xml:base, you will need the xml:base function, and the line beginning var href = ... ...
... xpathresult.ordered_node_snapshot_type, null ); var a = []; for(var k = 0; k < xpathresult.snapshotlength; k++) { a[k] = xpathresult.snapshotitem(k); } responsenodes = a; } else { // otherwise, the response must be a single well-formed document response responsenodes = [response.documentelement]; // put in array so can be treated the same way as the above } ...
Advanced styling effects - Learn web development
the second length value is the vertical offset — the distance downwards that the shadow is offset from the original box (or upwards, if the value is negative). the third length value is the blur radi...
...ates. the button has a simple black box shadow set on it by default, plus a couple of inset shadows, one light and one dark, placed on opposite corners of the button to give it a nice shading effect. when the button is pressed in, the active state causes the first box shadow to be swapped for a very dark inset shadow, giving the appearance of the button being pressed in. note: there is another item that can be set in the box-shadow value — another length value can be optionally set just before the color value, which is a spread radius. if set, this causes the shadow to become bigger than the original box. it is not very commonly used, but worth mentioning. filters while you can't change the composure of an image using css, there are some creative things you can do. one very nice proper...
Overflowing content - Learn web development
lbars in both axes. to just scroll on the y axis, you could use the overflow-y property, setting overflow-y: scroll. you can also scroll on the x axis using overflow-x, although this is not a recommended way to accommodate long words! if you have a long word in a small box, you might consider using the word-break or overflow-wrap properties. in addition, some of the methods discussed in sizing items in css may help you create boxes that scale better with varying amounts of content. as with scroll, you get a scrollbar in the scrolling dimension whether or not there is enough content to cause a scrollbar. note: you can specify x and y scrolling using the overflow property, passing two values. if two keywords are specified, the first applies to overflow-x and the second applies to overflo...
...it does not accidentally cause problematic overflow. ...
Combinators - Learn web development
e'd do this: p ~ img in the example below we are selecting all <p> elements that come after the <h1>, and even though there is a <div> in the document as well, the <p> that comes after it is selected. using combinators you can combine any of the selectors that we discovered in previous lessons with combinators in order to pick out part of your document. for example if we want to select list items with a class of "a", which are direct children of a <ul>, i could use the following. ul > li[class="a"] { } take care however when creating big lists of selectors that select very specific parts of your document. it will be hard to reuse the css rules as you have made the selector very specific to the location of that element in the markup. it is often better to create a simple class and ap...
...another important part of css — the css box model. ...
Pseudo-classes and pseudo-elements - Learn web development
matches a stylable element appearing before the originating element's actual content. ::first-letter matches the first letter of the element. ::first-line matches the first line of the containing element. ::grammar-error matches a portion of the document containing a grammar error as flagged by the browser. ::marker matches the marker box of a list item, which typically contains a bullet or number. ::selection matches the portion of the document that has been selected. ::spelling-error matches a portion of the document containing a spelling error as flagged by the browser. previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors ...
...ng a spelling error as flagged by the browser. ...
Styling tables - Learn web development
ers collapse down into one, which looks much better: we've put a border around the whole table, which is needed because we'll be putting some borders round the table header and footer later on — it looks really odd and disjointed when you don't have a border round the whole outside of the table and end up with gaps. we've set some padding on the <th> and <td> elements — this gives the data items some space to breathe, making the table look a lot more legible. at this point, our table already looks a lot better: some simple typography now we'll get our text sorted out a bit. first of all, we've found a font on google fonts that is suitable for a table about punk bands. you can go there and find a different one if you like; you'll just have to replace our provided <link> element an...
...browser devtools to find solutions to your problems. ...
Test your skills: values and units - Learn web development
ed at in the lesson on css values and units. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. task one in this task, the first list item has been given a background color using hex color codes. your task is to complete the css using the same color in different formats, plus a final list item where you should make the background semi-opaque. the second list item should use rgb color. the third should use hsl color. the fourth should use rgb color but with the alpha channel set to .2. you can find conversions for the hex colo...
...channel set to .2. you can find conversions for the hex color at this link. you need to figure out how to use the values in css. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task two in this task you need to set the size of various items of text. the <h1> should be 50 pixels. the <h2> should be 2em. all <p> elements should be 16 pixels. a <p> element that is directly after an <h1> should be 120%. try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. ta...
CSS building blocks - Learn web development
is article and its sub-articles, we'll run through the different types in great detail, seeing how they work. the sub-articles are as follows: type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to align items with other items. in this lesson, we will take a proper look at the css box model, in order that you can move onto more complex layout tasks with an understanding of how it works and the terminology that relates to it. backgrounds and borders in this lesson we will take a look at some of the creative things you can do with css backgrounds and borders. from adding gradients, background images, ...
...oncept in css — overflow. overflow is what happens when there is too much content to be contained comfortably inside a box. in this guide, you will learn what it is and how to manage it. css values and units every property used in css has a value or set of values that are allowed for that property. in this lesson, we will take a look at some of the most common values and units in use. sizing items in css in the various lessons so far you have come across a number of ways to size items on a web page using css. understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. images, media, and form elements in this less...
Practical positioning examples - Learn web development
n augue. and now an ordered list: how exciting!</p> <ol> <li>dui neque eleifend lorem, a auctor libero turpis at sem.</li> <li>aliquam ut porttitor urna.</li> <li>nulla facilisi</li> </ol> </article> </div> </section> so here we've got a <section> element with a class of info-box, which contains a <ul> and a <div>. the unordered list contains three list items with links inside, which will become the actual tabs to click on for displaying our content panels. the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. the idea here is that we will style the tabs to look like a standard horizontal navigation menu, and style the panels to sit on top of one another...
...rdered list: .info-box ul { padding-left: 0; margin-top: 0; } note: we are using descendant selectors with .info-box at the start of the chain throughout this example — this is so that we can insert this feature into a page with other content already on it, without fear of interfering with the styles applied to other parts of the page. next, we'll style the horizontal tabs — the list items are all floated left to make them sit in a line together, their list-style-type is set to none to get rid of the bullets, and their width is set to 150px so they will comfortably fit across the info-box. the <a> elements are set to display inline-block so they will sit in a line but still be stylable, and they are styled appropriately for tab buttons, using a variety of other properties. add th...
Your first form - Learn web development
u'll need for simple cases. what are web forms? web forms are one of the main points of interaction between a user and a web site or application. forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a web form's html is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as html forms. the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <input> element, ...
...sg">message:</label> <textarea id="msg" name="user_message"></textarea> </li> ... in our example, the form will send 3 pieces of data named "user_name", "user_email", and "user_message". that data will be sent to the url "/my-handling-form-page" using the http post method. on the server side, the script at the url "/my-handling-form-page" will receive the data as a list of 3 key/value items contained in the http request. the way this script will handle that data is up to you. each server-side language (php, python, ruby, java, c#, etc.) has its own mechanism of handling form data. it's beyond the scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our sending form data article later on. summary congratulations, you'v...
Advanced text formatting - Learn web development
overed in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. the purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. let's look at an example of a set of terms and definitions: soliloquy in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts...
...the <sup> and <sub> elements handle this job. for example: <p>my birthday is on the 25<sup>th</sup> of may 2001.</p> <p>caffeine's chemical formula is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>.</p> <p>if x<sup>2</sup> is 9, x must equal 3 or -3.</p> the output of this code looks like so: ...
What’s in the head? Metadata in HTML - Learn web development
ther metadata (data about the html, such as the author, and important keywords that describe the document.) in this article we'll cover all of the above and more, in order to give you a good basis for working with markup. prerequisites: basic html familiarity, as covered in getting started with html. objective: to learn about the html head, its purpose, the most important items it can contain, and what effect it can have on the html document. what is the html head? let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the co...
...ove, add <link> and <script> elements to your html, so that your css and javascript are applied to your html. if done correctly, when you save your html and refresh your browser you should be able to see that things have changed: the javascript has added an empty list to the page. now when you click anywhere on the list, a dialog box will pop up asking you to enter some text for a new list item. when you press the ok button, a new list item will be added to the list containing the text. when you click on an existing list item, a dialog box will pop up allowing you to change the item's text. the css has caused the background to go green, and the text to become bigger. it has also styled some of the content that the javascript has added to the page (the red bar with the black border is t...
Graceful asynchronous programming with Promises - Learn web development
image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); save and refresh and you should see your ui components all loaded, albeit in a not particularly attractive way! ...
...ded, albeit in a not particularly attractive way! the code we provided here for displaying the items is fairly rudimentary but works as an explainer for now. note: if you get stuck, you can compare your version of the code to ours, to see what it is meant to look like — see it live, and see the source code. note: if you were improving this code, you might want to loop through a list of items to display, fetching and decoding each one, and then loop through the results inside promise.all(), running a different function to display each one depending on what the type of code was. this would make it work for any number of items, not just three. also, you could determine what the type of file is being fetched without needing an explicit type property. you could, for example, check the c...
Introduction to events - Learn web development
n an event occurs, and provides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs. for example, in an airport, when the runway is clear for take off, a signal is communicated to the pilot. as a result, the plane can safely takeoff. in the case of the web, events are fired inside the browser window, and tend to be attached to a specific item that resides in it — this might be a single element, set of elements, the html document loaded in the current tab, or the entire browser window. there are many different types of events that can occur. for example: the user selects a certain element or hovers the cursor over a certain element. the user chooses a key on the keyboard. the user resizes or closes the browser window. a web pag...
...of a large number of child elements, you can set the event listener on their parent and have events that happen on them bubble up to their parent rather than having to set the event listener on every child individually. remember, bubbling involves checking the element the event is fired on for an event handler first, then moving up to the element's parent, etc. a good example is a series of list items — if you want each one to pop up a message when selected, you can set the click event listener on the parent <ul>, and events will bubble from the list items to the <ul>. this concept is explained further on david walsh's blog, with multiple examples — see how javascript event delegation works. test your skills! you've reached the end of this article, but can you remember the most importa...
Making decisions in your code — conditionals - Learn web development
const select = document.queryselector('select'); const list = document.queryselector('ul'); const h1 = document.queryselector('h1'); select.onchange = function() { const choice = select.value; // add conditional here createcalendar(days, choice); } function createcalendar(days, choice) { list.innerhtml = ''; h1.textcontent = choice; for (let i = 1; i <= days; i++) { const listitem = document.createelement('li'); listitem.textcontent = i; list.appendchild(listitem); } } createcalendar(31,'january'); </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> .output * { box-sizing: border-box; } .output ul { padding-left: 0; } .output li { display: block;...
...const choice = select.value;\n let days = 31;\n if(choice === \'february\') {\n days = 28;\n } else if(choice === \'april\' || choice === \'june\' || choice === \'september\'|| choice === \'november\') {\n days = 30;\n }\n\n createcalendar(days, choice);\n}\n\nfunction createcalendar(days, choice) {\n list.innerhtml = \'\';\n h1.textcontent = choice;\n for(let i = 1; i <= days; i++) {\n const listitem = document.createelement(\'li\');\n listitem.textcontent = i;\n list.appendchild(listitem);\n }\n }\n\ncreatecalendar(31,\'january\');'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ i...
Aprender y obtener ayuda - Learn web development
te the html structure work out basic site typography work out a basic color scheme implement a high-level layout — header, horizontal navigation menu, main content area with main and side columns, and footer. implement a horizontal navigation menu etc. then you could break it down further, for example, "implement horizontal navigation menu" could be written out as: make a list of menu items sit horizontally in a line. remove unneeded defaults, like list spacing and bullet points. style hover/focus/active states of menu items appropriately. make the menu items equally spaced along the line. give the menu items enough vertical spacing. make sure the text is centered inside each menu item etc. each of these problems doesn't seem nearly as difficult to solve as the one big prob...
...s. once you have written out what you'll need to do to solve a specific problem, you can start to figure out what technology features to use to solve it. for example, professional web developers have created lots of horizontal navigation menus, so they'll immediately start thinking of a solution like this: a nav menu is usually created from a list of links, something like: <ul> <li>first menu item</li> <li>second menu item</li> <li>third menu item</li> <li>etc.</li> </ul> to make all the items sit horizontally on a line, the easiest modern way is to use flexbox: ul { display: flex; } to remove unneeded spacing and bullet points, we can do this: ul { list-style-type: none; padding: 0; } etc. if you are a complete beginner to web development, you'll have to do some study a...
Server-side web frameworks - Learn web development
e snippet below shows how this 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. #best/templates/best/index.html <!doctype html> <html lang="en"> <body> {% if youngest_teams %} <ul> {% for team in youngest_teams %} <li>{{ team.team_name }}</li> {% endfor %} </ul> {% else %} <p>no teams are available.</p> {% endif %} </body> </html> how to select a web framework numerous web frameworks exist for almost every programming language you might w...
...t to use (for example, database access and support for users and sessions are provided through independent libraries). there are many excellent independent components, but sometimes it can be hard to work out which is the best for a particular purpose! many popular server-side and full stack frameworks (comprising both server and client-side frameworks) are based on express, including feathers, itemsapi, keystonejs, kraken, loopback, mean, and sails. a lot of high profile companies use express, including: uber, accenture, ibm, etc. (a list is provided here). deno (javascript) deno is a simple, modern, and secure javascript/typescript runtime and framework built on top of chrome v8 and rust. deno is powered by tokio — a rust-based asynchronous runtime which lets it serve web pages faste...
Command line crash course - Learn web development
lorer/finder window to see where a directory is, relative to where you currently are. for example, if you wanted to go to a directory called src, located inside a directory called project, located on the desktop, you could type these three commands to get there from your home folder: cd desktop cd project cd src but this a waste of time — instead, you can type one command, with the different items in the path separated by forward slashes, just like you do when specifying paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your path makes the path absolute, for example /users/your-user-name/desktop. omitting the leading slash like we’ve done above makes the path relative to the your present working directory. t...
...rt for list), which lists the contents of the directory you’re currently in. note that this won’t work if you’re using the default windows command prompt (cmd) — the equivalent there is dir. try running this now in your terminal: ls this gives you a list of the files and directories in your present working directory, but the information is really basic — you only get the name of each item present, not whether it is a file or a directory, or anything else. fortunately, a small change to the command usage can give you a lot more information. introducing command options most terminal commands have options — these are modifiers that you add onto the end of a command, which make it behave in a slightly different way. these usually consist of a space after the command name, followed...
Debugging on Mac OS X
ext. name the project and click next. create/select a temporary directory to contain the project and then click create. before going any further, close the project (file > close project) and open finder. find the *.xcodejproj directory in the temporary directory, move it into your mozilla source tree, and then double-click on it to reopen it. in the left-hand pane in xcode you should see a tree item where the root item has the project name. if the temporary directory that you originally created the xcode project in is under that, right click it and delete it. now, right click on the root item, select 'add files to "<project-name>"', select all the files and directories in your source directory, untick "copy items if needed", then click add. (these will then be progressively added under the r...
...note that subdirectories may initially appear to be empty, but they too will progressively be populated as xcode processes the sourse files. once done, you should be able to open any file quickly by hitting cmd-shift-o and typing in the name of a file.) in the product menu, select scheme > new scheme and name your scheme (for example, "debug"). ...
The Firefox codebase: CSS Guidelines
e style of existing or related code. other tips assume ="true" in attribute selectors. example: use option[checked], not option[checked="true"]. avoid id selectors unless it is really the wanted goal, since ids have higher specificity and therefore are harder to override. using descendant selectors is good practice for performance when possible: for example: .autocomplete-item[selected] > .autocomplete-item-title would be more efficient than .autocomplete-item[selected] .autocomplete-item-title overriding css before overriding any css rules, check whether overriding is really needed. sometimes, when copy-pasting older code, it happens that the code in question contains unnecessary overrides. this could be because the css that it was overriding got removed in t...
...t windows themes or linux. in general, the following colors are used: -moz-field: textbox or field background colors, also used as the background color of listboxes or trees. -moz-fieldtext: textbox or field text colors, also used as the text color of listboxes or trees. -moz-dialog: window or dialog background color. -moz-dialogtext: window or dialog text color. graytext: used on disabled items as text color. do not use it on text that is not disabled to desemphsize text, because it does not guarantee a sufficient contrast ratio for non-disabled text. threedshadow: used as border on elements. threedlightshadow: used as light border on elements. using the background/text pairs is especially important to ensure the contrast is respected in all situations. never mix custom text colors...
Roll your own browser: An embedding how-to
t. other initialization must be done to start up event queues and load some string bundles. all of this is somewhat generic and has been isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static library (on windows) called baseembed_s.lib is built. just link this library to your application. there are two functions that are needed: nsresult ns_initembedding(const char *apath); nsresult ns_termembedding(); pretty self-explanatory. the apath parameter will be passed to ns_initxpcom. ns_initembedding() must be called from the main thread of your application, otherwise it won't work. do you have any simple examples of embedding mozilla? there are many examples of products already using gecko for embedding. here's a partial list. the sections ...
...ng a best-of-breed browser on the mac os x platform. camino uses cocoazilla, a variant of fizzilla that consists of a unix back end wed to a cocoa front end. java examples java webclient: provides a browser-neutral java api that enables generic web browsing capability. browserg!: a java application that uses webclient for html rendering and surfing capabilities. if you find any missing item, please send me an email. original document information author(s): doug turner original document: , , and last updated date: december 8, 2004 copyright information: copyright (c) doug turner ...
How to implement a custom autocomplete search component
() { 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 defaultindex() { return this._defaultindex; }, /** * @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; }, /** * @return {...
...t searchstring() { return this._searchstring; }, /** * 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; }, /** * index of the default item that should be entered if none is selected */ get defaultindex() { return this._defaultindex; }, /** * a string describing the cause of a search failure */ get errordescription() { return this._errordescription; }, /** * the number of matches */ get matchcount() { return this._results.length; }, /** * get the value of the result at the given inde...
Localization content best practices
different inflection, for example {{theirmichean na seirbheise}}. so if the localizer is left unsure as to which string goes into which placeholder, this may lead to bad translations. don't reuse strings in different contexts this is particularly important for mobile, where different context often means different font and available space for the string. for example, if you're adding a new menu item in settings on android, don't use the same string for the menu item and the following screen header. another example, some locales use nouns for titles, and verbs for actions (for example button labels). sometimes they coincide with english, but they rarely do in other languages. take bookmark: it can be both a noun and a verb in english. a developer could be tempted to reuse the same string "bo...
...s it is also vital info for localizers. menu and control labels the labels on controls and menu titles, menu option strings, and so forth should not end in periods (in english). these are generally not complete sentences, but instead, phrases that convey the idea of a concept or action. therefore, for both correctness and consistency within en-us, please leave out the trailing periods for these items. this also helps with localization. developer tools key shortcuts when translating firefox strings from /devtools/ folder, you may see some keys like this: inspector.searchhtml.key=cmdorctrl+f the first part of the string `cmdorctrl` should not be translated. you may only translate the letter to better match your locale. this key shortcut definition matches the electron key shortcut definiti...
Mozilla DOM Hacking Guide
talking about the "scriptable flags". the nsixpcscriptable interface, implemented by the nsdomclassinfo class (see section) defines several flags, one of which is the want_getproperty flag. when set, it allows us to define a getproperty() function on nshistorysh (the helper class for the history object), which will handle the array behavior. indeed, it will forward the call history[1] to history.item(1), which is defined in the idl and easily coded. the relevant code is at nsdomclassinfo.cpp, around line 4520. these two examples demonstrate the power of the dom combined with xpconnect and the javascript engine. the possibilities are endless. "what do you want to code today?" ;-) all the dom classes are listed in an enum defined in nsidomclassinfo.h, nsdomclassinfoid. there are classes for t...
...fo.h, nsdomclassinfoid. there are classes for the dom0, core dom, html, xml, xul, xbl, range, css, events, etc... the array sclassinfodata, defined in nsdomclassinfo.cpp, maps each dom class to its helper class and to the interfaces that are exposed to javascript. it is an array of type nsdomclassinfodata, which is a structure defined in nsidomclassinfo.h. the array uses two macros to define its items: ns_define_classinfo_data and ns_define_classinfo_data_with_name. the first one calls the second one. the first argument passed to ns_define_classinfo_data_with_name, _class, is used for debug purposes. the second argument, _name, is the name that should appear in javascript. the third argument, _helper, is the name of the helper class for this dom class. helper classes are detailed in section 1...
An overview of NSS Internals
entations, especially when importing data from files. a recent development adds support for loading external pem files that contain private keys, in a software library called nss-pem, which is separately available, but should eventually become a core part of nss. looking at the code level, nss deals with blocks of raw data all the time. ...
...an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are tracked. ...
PKCS 7 functions
and later sec_pkcs7createcertsonly mxr 3.3 and later sec_pkcs7createdata mxr 3.2 and later sec_pkcs7createencrypteddata mxr 3.2 and later sec_pkcs7createenvelopeddata mxr 3.2 and later sec_pkcs7createsigneddata mxr 3.2 and later sec_pkcs7decodeitem mxr 3.2 and later sec_pkcs7decoderabort mxr 3.9 and later sec_pkcs7decoderfinish mxr 3.2 and later sec_pkcs7decoderstart mxr 3.2 and later sec_pkcs7decoderupdate mxr 3.2 and later sec_pkcs7decryptcontents mxr 3.2 and later sec_pkcs...
... mxr 3.2 and later sec_pkcs7decoderstart mxr 3.2 and later sec_pkcs7decoderupdate mxr 3.2 and later sec_pkcs7decryptcontents mxr 3.2 and later sec_pkcs7destroycontentinfo mxr 3.2 and later sec_pkcs7encode mxr 3.3 and later sec_pkcs7encodeitem mxr 3.9.3 and later sec_pkcs7encoderabort mxr 3.9 and later sec_pkcs7encoderfinish mxr 3.2 and later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificatelist mxr 3.2 and later sec...
sslfnc.html
ccessful, secfailure. use pr_geterror to obtain the error code. description the ssl_securitystatus function fills in values only if you supply pointers to values of the appropriate type. pointers passed can be null, in which case the function does not supply values. when you are finished with them, you should free all the returned values using pr_free. ssl_getsessionid returns a secitem structure containing the ssl session id associated with a file descriptor. syntax #include "ssl.h" secitem *ssl_getsessionid(prfiledesc *fd); parameter this function has the following parameter: fd a pointer to the file descriptor for the ssl socket. returns the function returns one of these values: if unsuccessful, null. descripti...
...sion id associated with a file descriptor. syntax #include "ssl.h" secitem *ssl_getsessionid(prfiledesc *fd); parameter this function has the following parameter: fd a pointer to the file descriptor for the ssl socket. returns the function returns one of these values: if unsuccessful, null. description this function returns a secitem structure containing the ssl session id associated with the file descriptor fd. when the application is finished with the secitem structure returned by this function, it should free the structure by calling secitem_freeitem(item, pr_true). ssl_setsockpeerid associates a peer id with a socket to facilitate looking up the ssl session when it is tunneling through a proxy. syntax #includ...
Index
perty searches an object, obj, and its prototype chain, for a property with the specified name. it behaves like the javascript expression name in obj. js_hasucproperty is the corresponding unicode api. js_haspropertybyid is the same but takes a js::handleid for the property name. 353 js_idarrayget jsapi reference, reference, référence(2), spidermonkey js_idarrayget gets the item in the specified index of the id array pointed to by ida. 354 js_idarraylength jsapi reference, reference, référence(2), spidermonkey js_idarraylength gets the length of the id array pointed to by ida. 355 js_idtoprotokey jsapi reference, reference, référence(2), spidermonkey js_idtoprotokey converts a specified js id, id, to a prototype key. on succe...
...r function, ctor, to prototype object, proto with jsprop_permanent | jsprop_readonly flags, and sets the constructor property of proto to ctor with no flag. 386 js_lock jsapi reference, spidermonkey lock the js run-time environment. 387 js_lockgcthing jsapi reference, obsolete, spidermonkey js_lockgcthing is a deprecated function that protects a specified item, thing, associated with an executable script context, cx, from garbage collection. thing is a pointer to a jsdouble, jsstring, or jsobject. 388 js_lookupelement jsapi reference, obsolete, spidermonkey js_lookupelement examines a specified javascript object, obj, for a numeric property numbered index. 389 js_lookupproperty jsapi reference, obsolete, spidermonkey...
JS_LockGCThing
obsolete since jsapi 22this 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. protect a specified js item from garbage collection. syntax jsbool js_lockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_unlockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_lockgcthingrt(jsruntime *rt, void *thing); jsbool js_unlockgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * a runtime. thing void * pointer to the item to protect. descriptio...
...ckgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * a runtime. thing void * pointer to the item to protect. description js_lockgcthing is a deprecated function that protects a specified item, thing, associated with an executable script context, cx, from garbage collection. thing is a pointer to a jsdouble, jsstring, or jsobject. js_unlockgcthing removes a lock from a specified item, thing, allowing it to be garbage collected when the javascript engine determines it is unreachable. js_lockgcthing and js_unlockgcthing are available only for backward compatibility with existing applicat...
TPS Tests
evices. troubleshooting and debugging tips for writing and running tps tests tps evaluates the whole file in every phase, so any syntax error(s) in the file will get reported in phase 1, even though the error may not be in phase 1 itself. inspect tps.log. when a tps test fails, the log is dumped to tps.log in the virtualenv. inspect about:sync-log. every sync should have a log and every item synced should have a record. run runtps with --debug. this will enable much more verbose logging in all engines. check the tps.log file written out after tps runs. it will include log output written by the python driver, which includes information about where the temporary profiles it uses are stored. run test_sync.js. this test generally validates your tps setup and does a light test of a few...
...junction with aboutsync is 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" p...
Web Replay
e a few ways to start recording a tab: record current tab open the developer tools and click the button indicated below. this will refresh the tab and start recording. the button will be colored blue when the tab is being recorded. it can be clicked again to stop recording. open a new tab in recording mode click the 'tools -> web developer -> web replay -> reload and record tab' menu item. this has the same effect as above but can be used when the developer tools are not open. open a saved recording in a new tab click the 'tools -> web developer -> web replay -> open new recording tab' menu item to open a new blank tab that is recorded. live rewinding at any time while recording, the tab can be rewound to replay earlier behavior, all the way back to when the tab was opened o...
...loper tool, press the pause button and then the rewind button. while replaying old behavior, the tab can't be interacted with. to resume recording and interacting with the tab, press the pause button and then the play button to run forward to the end of the recording. save recording and replay on the same machine clicking the 'tools -> web developer -> web replay -> save recording' menu item when a recording tab is open will allow the entire recording to be saved to a file. clicking the 'tools -> web developer -> web replay -> load recording in new tab' menu item will start a new tab which replays the recording to the end. the developer tools can be used to interact with this tab in the same way as a recording tab, though playing forward to the end will pause the tab instead of all...
Gecko events
n object's help has changed. is supported: no event_defaction_change an object's default action has changed. is supported: no event_action_change an object's action has changed. is supported: no event_accelerator_change an object's keyboard shortcut has changed. is supported: no event_selection the selection within a container object has changed. is supported: yes event_selection_add an item within a container object has been added to the selection. is supported: yes event_selection_remove an item within a container object has been removed from the selection. is supported: yes event_selection_within numerous selection changes have occurred within a container object. is supported: yes event_alert an alert has been generated. server applications send this event when a user needs ...
...ection. is supported: yes event_selection_within numerous selection changes have occurred within a container object. is supported: yes event_alert an alert has been generated. server applications send this event when a user needs to know that a user interface element has changed. is supported: yes event_foreground the foreground window has changed. is supported: no event_menu_start a menu item on the menu bar has been selected. is supported: yes event_menu_end a menu from the menu bar has been closed. is supported: yes event_menupopup_start a pop-up menu has been displayed. is supported: yes event_menupopup_end a pop-up menu has been closed. is supported: yes event_capture_start a window has received mouse capture. is supported: no event_capture_end a window has lost mouse ca...
Using the Places livemark service
initiating the livemark service before using the livemark service, you need to obtain an instance: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); creating a new livemark the nsilivemarkservice.createlivemark() method creates a new livemark. ...
...s 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/browser/nav-bookmarks-service;1"]. ...
extISessionStorage
method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage item exists with the given name. boolean has(in astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise. set() sets the value of a storage item with the given name. void set(in astring aname, in nsivariant avalue) parameters aname the name of an item return value get() gets the value of a storage item with th...
...astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise. set() sets the value of a storage item with the given name. void set(in astring aname, in nsivariant avalue) parameters aname the name of an item return value get() gets the value of a storage item with the given name. returns a default value if the item does not exist. nsivariant get(in astring aname, in nsivariant adefaultvalue) parameters aname the name of an item return value value of the item or the given default value if no item exists with the given name. see also fuel (firefox), steel (thunderbird) and smile (seamonkey) ...
Fun With XBL and XPConnect
face the next thing i needed to do was to implement an interface on the widget which i could then pass into the auto complete session. i wanted the auto complete session to call back into the widget with search results. ...
...face on the widget which i could then pass into the auto complete session. i wanted the auto complete session to call back into the widget with search results. i could apply a trick similar to what i did for the xpcom object: <property name="autocompletelistener"> <![cdata[ ({ onautocompleteresult: function(aitem, aoriginalstring, amatch) { if ( aitem ) { anonymouscontent[0].value = amatch; } } }) ]]> </property> as long as the js for the value of autocompletelistener evaluates to an object (and wrapping the expression with a set of parens like i did, does this), then the value of autocompletelistener is an object that implements my interface. now i can pass the result of aut...
IAccessible2
firefox 3) method overview [propget] hresult attributes([out] 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)] bs...
...ayconsideration "special consideration when using arrays" for more details. extendedstates this array is allocated by the server. free it with cotaskmemfree. nextendedstates the number of extended states returned; the size of the returned array. return value s_false if there are no states, [out] values are null and 0 respectively. s_ok. groupposition() returns grouping information. used for tree items, list items, tab panel labels, radio buttons, and so on. also used 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. positioningrou...
imgIContainer
imagecontainer getimagecontainer(); native code only! nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 gettype(); violates the xpcom interface guidelines void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void restoredatadone(); native code only! obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code only! obsolete since gecko 2.0 ...
...le for the image to be undecoded if decode-on-draw() is enabled and the image was never drawn. upon instantiation images have a lock count of zero. void lockimage(); parameters none. exceptions thrown missing exception missing description removeframe() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) void removeframe( in gfxiimageframe item ); parameters item missing description exceptions thrown missing exception missing description requestdecode() void requestdecode(); parameters none. exceptions thrown missing exception missing description requestdiscard() if this image is unlocked, discard its decoded data. if the image is locked or has already been discarded, do nothing. void requestdiscard(); p...
nsIAccessible
right, top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action index supported by accessible. 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 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 ...
...ent for this node. widgets that use role attribute can force a value using the valuenow attribute. description accessible description -- long text associated with this node. keyboardshortcut provides localized string of accesskey name, such as alt+d. the modifier may be affected by user and platform preferences. usually alt+letter, or just the letter alone for menu items. defaultkeybinding provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file. role enumerated accessible role for the associated element. help help text associated with node. focusedchild focused accessible child of node. attributes attributes of accessible. re...
nsIAccessibleEvent
ject's help has changed. event_defaction_change 0x000f 0x000c an object's default action has changed. event_action_change 0x0010 0x000d an object's action has changed. event_accelerator_change 0x0011 0x000e an object's keyboard shortcut has changed. event_selection 0x8006 0x0012 0x000f the selection within a container object has changed. event_selection_add 0x8007 0x0013 0x0010 an item within a container object has been added to the selection. event_selection_remove 0x8008 0x0014 0x0011 an item within a container object has been removed from the selection. event_selection_within 0x8009 0x0015 0x0012 numerous selection changes have occurred within a container object. event_alert 0x0002 0x0016 0x0013 an alert has been generated. server applications send this event when a us...
... event_selection_within 0x8009 0x0015 0x0012 numerous selection changes have occurred within a container object. event_alert 0x0002 0x0016 0x0013 an alert has been generated. server applications send this event when a user needs to know that a user interface element has changed. event_foreground 0x0003 0x0017 0x0014 the foreground window has changed. event_menu_start 0x0018 0x0015 a menu item on the menu bar has been selected. event_menu_end 0x0019 0x0016 a menu from the menu bar has been closed. event_menupopup_start 0x001a 0x0017 a pop-up menu has been displayed. event_menupopup_end 0x001b 0x0018 a pop-up menu has been closed. event_capture_start 0x001c 0x0019 a window has received mouse capture. event_capture_end 0x001d 0x001a a window has lost mouse capture. ...
nsIBlocklistService
of the application we are checking in the blocklist. if this parameter is null, the version of the running application is used. toolkitversion optional the version of the toolkit we are checking in the blocklist. if this parameter is null, the version of the running toolkit is used. return value the blocklist state of the plugin, one of the constants. isaddonblocklisted() determine if an item is blocklisted. boolean isaddonblocklisted( in jsval addon, in astring appversion, optional from gecko 1.9.1 in astring toolkitversion optional from gecko 1.9.1 ); parameters addon the addon object to be checked. appversion optional from gecko 1.9.1 the version of the application we are checking in the blocklist. if this parameter is null, the version of the running applic...
...hecked. appversion optional from gecko 1.9.1 the version of the application we are checking in the blocklist. if this parameter is null, the version of the running application is used. toolkitversion optional from gecko 1.9.1 the version of the toolkit we are checking in the blocklist. if this parameter is null, the version of the running toolkit is used. return value true if the item is blocklisted, otherwise false. ...
nsICategoryManager
ame.get()); } return ns_ok; } this snippet shows how to print out a list of all categories in javascript. var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); var enumerator = categorymanager.enumeratecategories(); var categories = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var category = item.queryinterface(components.interfaces.nsisupportscstring) categories.push(category.tostring()); } categories.sort(); var categoriesstring = categories.join("\n"); dump(categoriesstring + "\n"); print out a list of app-startup entries this example prints out a list of entries of "app-startup" category. var categorymanager = components.classes[...
... out a list of app-startup entries this example prints out a list of entries of "app-startup" category. var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); var enumerator = categorymanager.enumeratecategory("app-startup"); var entries = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var entry = item.queryinterface(components.interfaces.nsisupportscstring) entries.push(entry.tostring()); } entries.sort(); var entriesstring = entries.join("\n"); dump(entriesstring + "\n"); disable currently loaded plugins by type this snippet here shows how to disable plugins that are currently loaded for the file type of pdf. the second portion of this snipp...
nsICrashReporter
functionality. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_initialized if crash reporting is not initialized. serverurl ...
..._invalid_arg if data contains invalid characters. the only invalid character is '\0'. ns_error_not_initialized if crash reporting not initialized. native code only!appendobjcexceptioninfotoappnotes append note containing an obj-c exception's info. void appendobjcexceptioninfotoappnotes( in voidptr aexception ); parameters aexception nsexception object to append note for. native code only!writeminidumpforexception write a minidump immediately, with the user-supplied exception information. this is implemented on windows only, because seh (structured exception handling) exists on windows only. void writeminidumpforexception( in voidptr aexceptioninfo ); parameters aexceptioninfo exception_info* provided by window's seh. ...
nsIDOMWindowUtils
this interface is 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. ...
...oved with loadsheet()/removesheet(). see css2 specification for details. user_sheet 1 a possible type of a style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. author_sheet 2 a possible type of a style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. methods 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() compar...
nsIDOMXPathResult
read only. ...
...nt that matches the expression used in the evaluator. first_ordered_node_type 9 type is the first node in the document that matches the expression used in the evaluator. methods iteratenext() iterates through the available nodes of an unordered_node_iterator_type or ordered_node_iterator_type result. nsidomnode iteratenext(); parameters none. return value a dom node. snapshotitem() returns the specified node from what is essentially an array of resulting dom nodes. is only available if the result type is unordered_node_snapshot_type or ordered_node_snapshot_type. nsidomnode snapshotitem( in unsigned long index ); parameters index the index of the dom node to return. return value a dom node. see also introduction to using xpath in javascript document object...
nsIDocShell
void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only! void fireunloadnotification(); native code only! ...
...it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. notify the associated content viewer and all child docshells that they are about to be unloaded. void fireunloadnotification(); parameters none. getdocshellenumerator() get an enumerator over this docshell and its children. nsisimpleenumerator getdocshellenumerator( in long aitemtype, in long adirection ); parameters aitemtype only include docshells of this type, or if typeall, include all child shells. uses types from nsidocshelltreeitem. adirection whether to enumerate forwards or backwards. return value an enumerator over this docshell and its children. getsessionstorageforprincipal() retrieves the session storage object for the supplied principal.
nsIFeed
toolkit/components/feeds/public/nsifeed.idlscriptable this interface represents a single atom or rss (really simple syndication) news feed. it includes attributes that provide information about the feed, as well as access to the items or entries in the feed. 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgene...
...ntify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgenerator describes the software that produced a feed. image nsiwritablepropertybag2 provides an image url and metadata, as defined by rss 2. items nsiarray specifies an array of the items or entries on the feed. skipdays nsiarray an array of days of the week on which the feed should not be fetched. each entry in the array is the name of one day of the week to skip. for example, to skip fetching on mondays, a feed that does not want to be fetched on mondays would specify "monday" in this array. note: this fiel...
nsIMessenger
as a email). void loadurl(in nsidomwindow awin, in acstring aurl); parameters awin a window. as far as i can tell this isn't used or checked. aurl the url to open. launchexternalurl() launches the nsiexternalprotocolservice and sends it the url. void launchexternalurl(in acstring aurl); parameters aurl the url to open. canundo() queries if there are any undo items in the transaction manager. boolean canundo(); return value boolean representing whether undo is available. canredo() queries if there are any redo items in the transaction manager. boolean canredo(); return value boolean representing whether redo is available. getundotransactiontype() gets the type of the next undo transaction. unsigned long getundotransactiontype(); ret...
... ahistory an array of strings containing information about each entry in the history. ...
nsINavHistoryResultTreeViewer
ject and attach it to a result without attaching it to a tree, then forget about it, it will leak. method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether 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 will then appear because they will be separated (unless you clicked reload a bunch of times in a row). if you know you'll only ever want one entry per site, you should ask for uris back instead of visits so it will be more efficient. default = tr...
...you sort by date, the multiple entries will then appear because they will be separated (unless you clicked reload a bunch of times in a row). if you know you'll only ever want one entry per site, you should ask for uris back instead of visits so it will be more efficient. default = true. changing this value is somewhat heavyweight since it will force a tree refresh. obsolete since gecko 1.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. obsolete since gecko 1.9 constants constant value description index_invisib...
nsIPlacesView
read only. place string theuri (as a string) of the root place that the view displays. this may be modified dynamically to update the view. see displaying places information using views for examples. selectednode nsinavhistoryre...
...read only. ...
nsIPromptService
parent 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"] .g...
...ord:", password, null, check); // result is true if ok was pressed, false if cancel was pressed. password.value is // set if ok was pressed. the checkbox is not displayed. select example select displays a dialog with a listbox of choices. var prompts = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); var items = ["hello", "welcome", "howdy", "hi", ":)"]; // list items var selected = {}; var result = prompts.select(null, "title", "what greeting do you want?", items.length, items, selected); // result is true if ok was pressed, false if cancel. selected is the index of the item array // that was selected. get the item using items[selected.value]. see also nsiprompt wor...
nsISessionStore
n the window. getclosedtabdata() returns a list of closed tabs for a specified window. astring getclosedtabdata( in nsidomwindow awindow ); parameters awindow the browser window whose closed tab list is to be retrieved. return value a json string representing the list of closed tabs for the window specified by awindow. the list is in last in/first out (lifo) order, so that the first item in the list is the last tab that was closed. getclosedwindowcount() returns the number of restorable windows. unsigned long getclosedwindowcount(); parameters none. return value the number of restorable windows. getclosedwindowdata() returns a list of closed windows. astring getclosedwindowdata(); parameters none. return value a json string representing the list of closed windows.
...t() returns the number of restorable windows. unsigned long getclosedwindowcount(); parameters none. return value the number of restorable windows. getclosedwindowdata() returns a list of closed windows. astring getclosedwindowdata(); parameters none. return value a json string representing the list of closed windows. the list is in last in/first out (lifo) order, so that the first item in the list is the last window that was closed. gettabstate() returns the state of the specified tab. astring gettabstate( in nsidomnode atab ); parameters atab the tab whose state is to be returned. return value a json string representing the state of the specified tab. note: the returned string does not include cookies. if you need to retrieve cookies as well, you should use getw...
nsISound
event_confirm_dialog_open 2 a confirm dialog is opened. event_prompt_dialog_open 3 a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. event_select_dialog_open 4 a select dialog (one that contains a list box) is opened. event_menu_execute 5 a menu item is executed. event_menu_popup 6 a popup menu is shown. event_editor_max_len 7 more characters than the maximum allowed are typed into a text field. methods beep() plays a beep sound. void beep(); parameters none. init() not strictly necessary, but avoids a delay before the first sound. other methods will call init if they need t...
...rm dialog is opened. _moz_promptdialog the system sound when a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. _moz_selectdialog the system sound when a select dialog (one that contains a list box) is opened. _moz_menucommand the system sound when a menu item is executed. _moz_menupopup the system sound when a popup menu is shown. ...
nsITreeBoxObject
invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, 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 getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); boolean iscellcropped(in long row, in nsitreecolumn col); void rowcountchanged(in long index, in long count); void beginupdatebatch(); void endupdatebatch(); void clearstyleandimagecaches(); attributes attribute type de...
...e units are css pixels. void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); parameters x the x coordinate y the y coordinate returns row the row index at the coordinates col the nsitreecolumn hit. childelt the pseudoelement hit: this can have values of "cell", "twisty", "image", and "text". getcoordsforcellitem() find the coordinates of an element within a specific cell. void getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); parameters row the index of the row col the nsitreecolumn element the pseudoelement. this can have values of "cell", "twisty", "image", and "te...
nsIZipEntry
content/base/public/nsidomserializer.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description compression unsigned short the type of compression used for the item. the possible values and their meanings are defined in the zip file specification at zip application note support. read only. crc32 unsigned long the crc-32 hash of the file in the entry. read only. isdirectory boolean true if the name of the entry ends with '/' and false otherwise. read only. issynthetic boolean use this attribute to determine whether this item is an actual zip entry or is one synthesized for part of a real entry's path. a synth...
...orresponding entry within the zip file. for example, the entry for the directory foo/ in a zip containing exactly one entry for foo/bar.txt is synthetic. if the zip file contains an actual entry for a directory, this attribute will be false for the nsizipentry for that directory. it is impossible for a file to be synthetic. read only. lastmodifiedtime prtime the time at which this item was last modified. read only. name string read only. obsolete since gecko 1.9 realsize unsigned long the uncompressed size of the data in the item. read only. size unsigned long the compressed size of the data in the item. read only. see also nsizipreader ...
nsIZipWriter
parameter is null. ns_error_file_not_found the specified file was not found and the flags didn't permit creating it. or the directory for the file does not exist. ns_error_file_corrupted the specified file is not a recognizable zip file. other errors may be thrown upon failing to open the file, such as if the file is corrupt or in an unsupported format. ...
... void processqueue( in nsirequestobserver aobserver, in nsisupports acontext ); parameters aobserver the observer to receive notifications from the queue. acontext the context to pass to the observer. ...
nsIAbCard/Thunderbird3
ny _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint32(in string name); [noscript] boolean getpropertyasbool(in string name); void setproperty(in a...
... deleted, an error may be thrown when the card is modified at the database level. void deleteproperty(in autf8string name); parameters name the case-sensitive name of the property to set. translateto() translates a card into a specific format. the following types are supported: base64xml xml vcard autf8string translateto(in autf8string atype); parameters atype the type of item to translate the card into. return value a string containing the translated card. exceptions thrown ns_error_illegal_value type not recognized. copy() this function will copy all values from one card to another. void copy(in nsiabcard srccard) parameters srccard the source card to copy values from. equals() returns true if this card is equal to the other card. the default imp...
Main Windows
y.xul shown in blue above (where?), this overlay consists of three boxes. two are stacked showing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. messagewindow.xul messagewindow.xul is shown when a message is opened. its almost exactly the same as messenger.xul in terms of overlays, but just lacks the folder and threadpanes normally shown. menus, toolbar buttons, and headers are all taken from exactly the same overlays listed above though. mailwindowoverlay.xul this is the red sections shown in the interface ab...
...iewoverlay.xul shown in blue above, this overlay consists of three boxes. two are stacked showing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. customizetoolbar.xul and customizetoolbarsheet.xul these are two old files from when the original customizable toolbars were ported from firefox (phoenix at the time) to thunderbird (minotaur at the time). customizetoolbar.xul looks and acts a whole lot like the toolkit's customizetoolbar.xul. items have the same id’s, and contain the same structure. a few odd pieces are...
Building a Thunderbird extension 5: XUL
merge point" for a xul overlay. xul overlays are a way of attaching other ui widgets to a xul document at run time. a xul overlay is a .xul file that specifies xul fragments to insert at specific merge points within a "master" document. these fragments can specify widgets to be inserted, removed or modified. in this example you are adding a line to the indented statusbar. therefore it becomes an item owned by the id called "status-bar". this shows how the thunderbird architecture allows extensions to modify the user experience without modifying the installation files. this also enables version independence between thunderbird and thunderbird extensions. example xul overlay document create a new file called myhelloworld.xul within the content folder you created earlier with the following con...
...="my-panel" label="date"/> </statusbar> </overlay> the <statusbar> widget named status-bar specifies the merge point within the application window that we want to attach to. when parsing our overlay file, the xul engine will take all child elements of the <statusbar> tag and merge them with the original xul document's <statusbar> tag. in the example above we have defined a new <statusbarpanel> item (that can be referred to as my-panel) which will create a new instance of this widget type and add it at the end of the statusbar. in thunderbird it will appear as a label at the right side of thunderbird's statusbar and display "date". we have also added a <script> tag that contains a reference to the javascript file overlay.js. in the next section you will learn how to use javascript to modify...
Add Option to Context Menu
assuming this on chrome.manifest: overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myext/content/thunderbird-overlay.xul add the next in thunderbird-overlay.xul. ...
...upopup id="messagepanecontext"> <menuitem id="my_option" label="my option concise and cool label" oncommand="alert('hi')"/> </menupopup> </overlay> for thunderbird 3 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <popup id="mailcontext"> <menuitem id="my_option" label="my option concise and cool label" oncommand="alert('hi')"/> </popup> </overlay> for thunderbird 2 and 3 in the same xpi if our extension needs to support thunderbird 2 and 3 we need to make custom overlays for each version. this can be reached by adding these lines to the chrome.manifest file: overlay chrome://messenger/content/mailwindowover...
Theme Packaging
smedberg. note that this page is included from the pages listed below. ...
...d below. ...
Using js-ctypes
i type */ ctypes.int16_t, /* return type */ ctypes.int16_t, /* alert type */ ctypes.char.ptr, /* primary text */ ctypes.char.ptr, /* secondary text */ ctypes.uint32_t, /* alert param */ ctypes.int16_t); /* item hit */ var hit = 0; var msgerr = makestr("carbon says..."); var msgexp = makestr("we just called the standardalert carbon function from javascript!"); var err = stdalert(1, msgerr, msgexp, 0, hit); carbon.close(); the makestr() function is a utility routine that takes as input a standard javascript string and returns a carbon-style "pascal" string, which is a length byte followed by the chara...
... carbon library is loaded from the system's carbon framework. line 11 declares the stdalert() function, which will call the carbon standardalert routine. it uses the default abi, returns a 16-bit integer (which is a carbon oserr value), and accepts an integer (the alert type), two strings, a pointer to a parameter block, which we aren't using, and another integer, which is used to return the hit item. see apple's documentation for standardalert for details. after that, we simply set up our parameters by using makestr() to generate the two str255 strings we need, then call stdalert(), which produces the following alert window: the last thing we do is call carbon.close() to close the library when we're done using it. standard alert in 64bit os x carbon is not available in 64bit versions o...
DOM Property Viewer - Firefox Developer Tools
d shortcut. the toolbox will appear at the bottom of the browser window, with the dom property viewer activated. it's just called "dom" in the toolbox. dom property viewer user interface dom tree the different properties of the dom are displayed as an expandable tree. the left-hand side shows the property's name, and the right-hand side shows its value. up to three properties of an object and items of an array are displayed. if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. a lock icon indicates that a property is not writable. refreshing the display if the dom changes you can hit the refresh button to update the display: filtering there is a search box within the toolbar: this filters the list to...
...ay are displayed. if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. a lock icon indicates that a property is not writable. refreshing the display if the dom changes you can hit the refresh button to update the display: filtering there is a search box within the toolbar: this filters the list to show only items which match the search term. items match the search term if their name contains the search term. matching is case-sensitive. ...
Debugger.Memory - Firefox Developer Tools
debugger.memory the debugger api can help tools observe the debuggee’s memory use in various ways: it can mark each new object with the javascript call stack at which it was allocated. it can log all object allocations, yielding a stream of javascript call stacks at which allocations have occurred. it can compute a census of items belonging to the debuggee, categorizing items in various ways, and yielding item counts. ifdbg is a debugger instance, then the methods and accessor properties of dbg.memory control howdbg observes its debuggees’ memory use. the dbg.memory object is an instance of debugger.memory; its inherited accesors and methods are described below. allocation site tracking the javascript engine marks each new object with the call stack at which it wa...
...ugger instance, and dbg.memory.trackingallocationsites is set to true, then the javascript engine logs each object allocated bydbg’s debuggee code. you can retrieve the current log by calling dbg.memory.drainallocationslog. you can control the limit on the log’s size by setting dbg.memory.maxallocationsloglength. censuses a census is a complete traversal of the graph of all reachable memory items belonging to a particular debugger‘s debuggees. it produces a count of those items, broken down by various criteria. ifdbg is a debugger instance, you can call dbg.memory.takecensus to conduct a census of its debuggees’ possessions. accessor properties of the debugger.memory.prototype object ifdbg is a debugger instance, then <i>dbg</i>.memory is a debugger.memory instance, which inherits ...
Console messages - Firefox Developer Tools
tion is available, a disclosure triangle lets you display it, in an embedded panel that is identical to the network monitor request details. uri the target uri. summary the http version, response code, and time taken to complete. clicking the response code takes you to the reference page for that code. the context menu for network messages includes a few extra items in addition the globally-available ones: copy link location acts as you would expect, copying the url into the clipboard open in network panel switches context to the network tab, selects the request and shows you the details resend request sends the network request again. open url in new tab opens the url in a new browser tab. if the resource is an image, the image will be opened in...
...t". for example, if you entered the string img into the text box, you would have a list something like this: a small "x" icon appears at the right end of the text box when you have entered a string on which to filter the output. click the "x" icon to clear the filter and show the entire list again. you can negate a text search by prefixing it with the - character. for example, -img shows only items that do not contain the string img. filtering with regular expressions you can also use a valid regular expression to filter the console output. for example, the following video shows the results when filtering on two simple regular expressions: /(cool|rad)/ and /(cool)/. you can negate a regular expression search by prefixing it with the - character. for example, -/(cool|rad)/ shows only i...
The JavaScript input interpreter - Firefox Developer Tools
s are case-insensitive. the console suggests completions from the scope of the currently executing stack frame. this means that if you've hit a breakpoint in a function you get autocomplete for objects local to the function. you get autocomplete suggestions for array elements, as well: you can enable or disable autocompletion via the settings ("gear") menu in the web console toolbar. the menuitem enable autocompletion has a checkmark next to it when the feature is enabled, which is missing when it is disabled. select the menuitem to change the state. instant evaluation this feature is available in firefox nightly, in versions labeled 74 and later. when the "instant evaluation" feature is enabled, the interpreter displays results of expressions as you're typing them in single-line mod...
...ightly, in versions labeled 74 and later. when the "instant evaluation" feature is enabled, the interpreter displays results of expressions as you're typing them in single-line mode. note that the result might be an error message. expressions that have side effects are not evaluated. you can enable or disable instant evaluation via the settings ("gear") menu in the web console toolbar. the menuitem instant evaluation has a checkmark next to it when the feature is enabled, which is missing when it is disabled. select the menuitem to change the state. execution context code that you have executed becomes part of the execution context, regardless of what editing mode you were in when you executed it. for example, if you type a function definition in the multi-line editor, and click run, you ...
AddressErrors - Web APIs
ymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object. let supportedhandlers = [ { supportedmethods: "basic-card", data: { supportednetworks: ["visa", "mastercard", "amex", "discover"], supportedtypes: ["credit", "debit"] } } ]; let defaultpaymentdetails = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; supportedhandlers describes the supported payment handlers and the details for those. in this example, only the basic card ...
...upported payment handlers and the details for those. in this example, only the basic card handler is supported, and it's configured to permit both debit and credit cards from visa, master card, american express, and discover. defaultpaymentdetails describes the payment being requested. a description of the total amount being requested (including a label and the currency used), a list of the line items (in this case only one, "original donation amount"), and a list of shipping options available; in this case only one. process the payment the main payment processing code is found in the process() method, up next. let request; function process() { let options = {requestshipping: true}; try { request = new paymentrequest(supportedhandlers, defaultpaymentdetails, options); // add ...
AnalyserNode.getFloatFrequencyData() - Web APIs
if you need higher performance and don't care about precision, you can use analysernode.getbytefrequencydata() instead, which works on a uint8array. ...
... if you need higher performance and don't care about precision, you can use analysernode.getbytefrequencydata() instead, which works on a uint8array. ...
BasicCardRequest - Web APIs
ortednetworks list. those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the payment (e.g., a shipping address). the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { sup...
... property that has to conform to the structure defined by the basiccardrequest dictionary. ...
BasicCardResponse - Web APIs
gaddress read only secure context optional contains the billing address of the card used to make the payment. examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', ...
...ucture defined by the basiccardrequest dictionary. ...
BiquadFilterNode.getFrequencyResponse() - Web APIs
-readable list at the bottom of the page: var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ... ...
...r biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ... function calcfrequencyresponse() { biquadfilter.getfrequencyresponse(myfrequencyarray,magresponseoutput,phaseresponseoutput); for(i = 0; i <= myfrequencyarray.length-1;i++){ var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + myfrequencyarray[i] + 'hz</strong>: magnitude ' + magresponseoutput[i] + ', phase ' + phaseresponseoutput[i] + ' radians.'; freqresponseoutput.appendchild(listitem); } } calcfrequencyresponse(); specifications specification status comment web audio apithe definition of 'getfrequencyresponse()' in that specification. working draft ...
CSSPositionValue - Web APIs
methods none. ...
... methods none. ...
CSSStyleDeclaration - Web APIs
a cssstyledeclaration object on the first css rule in the document's first stylesheet. via window.getcomputedstyle(), which exposes the cssstyledeclaration object as a read-only interface. attributes cssstyledeclaration.csstext textual representation of the declaration block. setting this attribute changes the style. cssstyledeclaration.lengthread only the number of properties. see the item() method below. cssstyledeclaration.parentruleread only the containing cssrule. css properties cssstyledeclaration.cssfloat special alias for the float css property. cssstyledeclaration named properties dashed and camel-cased attributes for all supported css properties. methods cssstyledeclaration.getpropertypriority() returns the optional priority, "important". cssstyledeclarat...
...rties cssstyledeclaration.cssfloat special alias for the float css property. cssstyledeclaration named properties dashed and camel-cased attributes for all supported css properties. methods cssstyledeclaration.getpropertypriority() returns the optional priority, "important". cssstyledeclaration.getpropertyvalue() returns the property value given a property name. cssstyledeclaration.item() returns a css property name by its index, or the empty string if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. cssstyledeclaration.removeproperty() removes a property from the css declaration block. cssstyledeclaration.setproperty() modifies an exi...
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"...
...font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" 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 'cssvalues...
ContentIndex.delete() - Web APIs
we receive a reference to the current serviceworkerregistration, which allows us to access the index property and thus access the delete method. ...
...we receive a reference to the current serviceworkerregistration, which allows us to access the index property and thus access the delete method. ...
Document.cookie - Web APIs
Web › API › Document › cookie
31 dec 9999 23:59:59 gmt"; } } <button onclick="doonce()">only do something once</button> example #4: reset the previous cookie function resetonce() { document.cookie = "dosomethingonlyonce=; expires=thu, 01 jan 1970 00:00:00 gmt"; } <button onclick="resetonce()">reset only once cookie</button> example #5: check a cookie existence //es5 if (document.cookie.split(';').some(function(item) { return item.trim().indexof('reader=') == 0 })) { console.log('the cookie "reader" exists (es5)') } //es2016 if (document.cookie.split(';').some((item) => item.trim().startswith('reader='))) { console.log('the cookie "reader" exists (es6)') } example #6: check that a cookie has a specific value //es5 if (document.cookie.split(';').some(function(item) { return item.indexof(...
...ment.cookie.split(';').some((item) => item.trim().startswith('reader='))) { console.log('the cookie "reader" exists (es6)') } example #6: check that a cookie has a specific value //es5 if (document.cookie.split(';').some(function(item) { return item.indexof('reader=1') >= 0 })) { console.log('the cookie "reader" has "1" for value') } //es2016 if (document.cookie.split(';').some((item) => item.includes('reader=1'))) { console.log('the cookie "reader" has "1" for value') } security it is important to note that the path attribute does not protect against unauthorized reading of the cookie from a different path. it can be easily bypassed using the dom, for example by creating a hidden <iframe> element with the path of the cookie, then accessing this iframe's contentdocumen...
Document.getElementsByTagNameNS() - Web APIs
ee. namespace is the namespace uri of elements to look for (see element.namespaceuri). name is either the local name of elements to look for or the special value *, which matches all elements (see element.localname). note: while the w3c specification says elements is a nodelist, this method returns a htmlcollection both in gecko and internet explorer. opera returns a nodelist, but with a nameditem method implemented, which makes it similar to a htmlcollection. as of january 2012, only in webkit browsers is the returned value a pure nodelist. see bug 14869 for details. note: currently parameters in this method are case-sensitive, but they were case-insensitive in firefox 3.5 and before. see the note in browser compatibility section in element.getelementsbytagnamens for details. example i...
... living standard ...
Document.querySelectorAll() - Web APIs
ose id is test. var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then n...
...eryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested <div> blocks. <div class="outer"> <div class="select"> <div class="inner"> </div> ...
Example - Web APIs
<html> <head> <title>my document</title> <script type="text/javascript"> function change() { // document.getelementsbytagname("h1") returns a nodelist of the h1 // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h1").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document". ...
... // document.getelementsbytagname("h1") returns a nodelist of the h1 // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h1").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document". ...
Element.classList - Web APIs
Web › API › Element › classList
element('style')).stylesheet.csstext=( '_*{x-uclp:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' + // ie6 '[class]{x-uclp/**/:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' //ie7-8 ); } })(window); // 3. ...
...heet.csstext=( '_*{x-uclp:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' + // ie6 '[class]{x-uclp/**/:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' //ie7-8 ); } })(window); // 3. ...
Element.querySelectorAll() - Web APIs
e id is "test". var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the iframe elements in the document that contain an attribute named "data-src": var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is "userlist" which have a "data-active" attribute whose value is "1": var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), ...
...eryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc. to convert it into an array, try array.from(nodelist). user notes queryselectorall() behaves differently than most common javascript dom libraries, which migh...
Using files from web applications - Web APIs
ist object passed to handlefiles() is null, we simply set the inner html of the block to display "no files selected!". otherwise, we start building our file list, as follows: a new unordered list (<ul>) element is created. the new list element is inserted into the <div> block by calling its node.appendchild() method. for each file in the filelist represented by files: create a new list item (<li>) element and insert it into the list. create a new image (<img>) element. set the image's source to a new object url representing the file, using url.createobjecturl() to create the blob url. set the image's height to 60 pixels. set up the image's load event handler to release the object url since it's no longer needed once the image has been loaded. this is done by calling the ...
... new object url representing the file, using url.createobjecturl() to create the blob url. set the image's height to 60 pixels. set up the image's load event handler to release the object url since it's no longer needed once the image has been loaded. this is done by calling the url.revokeobjecturl() method and passing in the object url string as specified by img.src. append the new list item to the list. here is a live demo of the code above: example: uploading a user-selected file another thing you might want to do is let the user upload the selected file or files (such as the images selected using the previous example) to a server. this can be done asynchronously very easily. creating the upload tasks continuing with the code that built the thumbnails in the previous e...
FileSystemEntry.copyTo() - Web APIs
filesystemdirectoryentry object specifying the destination directory for the copy operation. newname optional if this parameter is provided, the copy is given this string as its new file or directory name. successcallback optional a function which is called when the copy operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the copied item's new details. errorcallback optional an optional callback which is executed if an error occurs while copying the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, o...
... fileerror.quota_exceeded_err the operation exceeded the user's storage quota, or there isn't enough storage space left to complete the operation. ...
FileSystemEntry.moveTo() - Web APIs
mdirectoryentry object specifying the destination directory for the move operation. newname optional if this parameter is provided, the entry is renamed to have this string as its new file or directory name. successcallback optional a function which is called when the move operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the moved item's new details. errorcallback optional an optional callback which is executed if an error occurs while moving the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or...
... fileerror.quota_exceeded_err the operation exceeded the user's storage quota, or there isn't enough storage space left to complete the operation. ...
HTMLDetailsElement: toggle event - Web APIs
to take away. </details> <details id="ch3"> <summary>chapter iii</summary> boethius falls back upon his present sense of misery. philosophy reminds him of the brilliancy of his former fortunes. ...
.../details> <details id="ch3"> <summary>chapter iii</summary> boethius falls back upon his present sense of misery. philosophy reminds him of the brilliancy of his former fortunes. </details> </section> css body { display: flex; flex-direction: row-reverse; } #log { flex-shrink: 0; padding-left: 3em; } #summaries { flex-grow: 1; } javascript function logitem(e) { const item = document.queryselector(`[data-id=${e.target.id}]`); item.toggleattribute('hidden'); } const chapters = document.queryselectorall('details'); chapters.foreach((chapter) => { chapter.addeventlistener('toggle', logitem); }); result specifications specification status comment html living standardthe definition of 'toggle event' in that specification. living ...
HTMLElement - Web APIs
ough the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text selection. htmlelement.innertext represents the "rendered" text content of a node and its descendants. as a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard. htmlelement.itemscope is a boolean representing the item scope. htmlelement.itemtype read only returns a domsettabletokenlist… htmlelement.itemid is a domstring representing the item id. htmlelement.itemref read only returns a domsettabletokenlist… htmlelement.itemprop read only returns a domsettabletokenlist… htmlelement.itemvalue returns a object representing the item value. htmlel...
...ation status comment css object model (cssom) view modulethe definition of 'htmlelement' in that specification. working draft added the following properties: offsetparent, offsettop, offsetleft, offsetwidth, and offsetheight. html living standardthe definition of 'htmlelement' in that specification. living standard added the following 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, tabindex, accesskey, accesskeylabel, ...
HTMLImageElement.alt - Web APIs
re. ...
...ted as a diagram, chart, graph, or map, the alt text should provide the same information, at least in summary form. this is true whether the /me image is in a bitmapped format such as png or jpeg or in a vector format like svg. for a map, the alt text could be directions to the place indicated by the map, similarly to how you would explain it verbally. for a chart, the text could describe the items in the chart and their values. for a diagram, the text could be an explanation of the concept presented by the diagram. keep in mind that any text included in diagrams and charts presented in svg format may be read by screen readers. this may impact the decisions you make shen writing the alt text for the diagram. icons or logos logos (such as corporate or brand logos) and informational ico...
HTMLInputElement.webkitdirectory - Web APIs
the selected file system entries can be obtained using the webkitentries property. ...
...ctory hierarchies is generated and displayed. html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath; output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe definition of 'webkitdirectory' in that specification. draft initial specification. this api has no official w3c or whatwg specification. ...
HTMLInputElement - Web APIs
. ignored if the value of the type attribute is hidden, checkbox, radio, file, or a button type (button, submit, reset, image). possible values are: on: the browser can autocomplete the value using previously stored value off: the user must explicity enter a value max string: returns / sets the element's max attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value. maxlength long: returns / sets the element's maxlength attribute, containing the maximum number of characters (in unicode code points) that the value can have. (if you set this to a negative number, an exception will be thrown.) min string: returns / sets the element's min attribute, containing the minimum (nu...
...inimum (min attribute) value. maxlength long: returns / sets the element's maxlength attribute, containing the maximum number of characters (in unicode code points) that the value can have. (if you set this to a negative number, an exception will be thrown.) min string: returns / sets the element's min attribute, containing the minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value. minlength long: returns / sets the element's minlength attribute, containing the minimum number of characters (in unicode code points) that the value can have. (if you set this to a negative number, an exception will be thrown.) pattern string: returns / sets the element's pattern attribute, containing a re...
HTMLSelectElement.add() - Web APIs
the htmlselectelement.add() method adds an element to the collection of option elements for this select element. syntax collection.add(item[, before]); parameters item is an htmloptionelement or htmloptgroupelement before is optional and an element of the collection, or an index of type long, representing the item item should be inserted before. if this parameter is null (or the index does not exist), the new element is appended to the end of the collection. exceptions a domerror of the type hierarchyrequesterror if the item passed to the method is an ancestor of the htmlselectelement. examples creating elements from scratch var sel = document.createelement("select"); var opt1 = document.createelement("option"); var opt2 = document.createelement("option"); opt1.value = "1";...
... comment html living standardthe definition of 'htmlselectelement.add()' in that specification. living standard html5the definition of 'htmlselectelement.add()' in that specification. recommendation is a snapshot of html living standard. the value of before can now be a long and is optional. it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found. document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.add()' in that specification. obsolete the method now throws an not_found_err exception if the item of the before parameter is not a child of this element. document object model (dom) l...
IDBCursor.continue() - Web APIs
if no key is specified, the cursor advances to the immediate next position, based on its direction. note: this feature is available in web workers. syntax cursor.continue(key); parameters key optional the key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. ...
... cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('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. r...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
ist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. ...
...nction(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. even power windows is better.'); }; } else { var listitem = document.createelement('li'); 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 'delete()' in that specification. recommendation ...
IDBCursor.direction - Web APIs
o. ...
...sor example (view example live.) function backwards() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor(null,'prev').onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</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...
IDBCursor - Web APIs
Web › API › IDBCursor
terated or has iterated outside its range, this is set to undefined. the cursor's primary key can be any data type. 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 id...
... cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('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 'cursor' in that specification. recommenda...
IDBDatabase: abort event - Web APIs
adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...ort(); }; the same example, but assigning the event handler to the onabort property: // 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
IDBDatabase: close event - Web APIs
nerror examples this example opens a database and 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const...
... }); }; 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const...
IDBDatabase: versionchange event - Web APIs
ples this example opens a database and, on success, adds 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event...
...ged'); }); }); 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db...
IDBOpenDBRequest: blocked event - Web APIs
ventlistener(): // 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let...
...ocked 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let...
IDBOpenDBRequest: upgradeneeded event - Web APIs
to the object store. ...
...upgradeneeded event handler property. ...
IDBRequest: success event - Web APIs
addeventlistener(): // 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event)...
...t 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; openrequest.onsuccess = (event) => { console.
IDBTransaction: abort event - Web APIs
rigger the event. ...
...onabort 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.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db...
IDBTransaction.error - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...action.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // 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 s...
IDBTransaction.onabort - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...saction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // 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>'; }; transaction.onabort = function() { // r...
IDBTransaction.oncomplete - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...saction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification ...
IDBTransaction.onerror - Web APIs
dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...action.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // 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 s...
IIRFilterNode.getFrequencyResponse() - Web APIs
var feedforwardcoefficients = [0.1, 0.2, 0.3, 0.4, 0.5]; var feedbackcoefficients = [0.5, 0.4, 0.3, 0.2, 0.1]; var iirfilter = audioctx.createiirfilter(feedforwardcoefficients, feedbackcoefficients); ... ...
..., 0.4, 0.5]; var feedbackcoefficients = [0.5, 0.4, 0.3, 0.2, 0.1]; var iirfilter = audioctx.createiirfilter(feedforwardcoefficients, feedbackcoefficients); ... function calcfrequencyresponse() { iirfilter.getfrequencyresponse(myfrequencyarray, magresponseoutput, phaseresponseoutput); for(i = 0; i <= myfrequencyarray.length-1;i++){ var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + myfrequencyarray[i] + 'hz</strong>: magnitude ' + magresponseoutput[i] + ', phase ' + phaseresponseoutput[i] + ' radians.'; freqresponseoutput.appendchild(listitem); } } calcfrequencyresponse(); specifications specification status comment web audio apithe definition of 'getfrequencyresponse()' in that specification. working draft ...
Intersection Observer API - Web APIs
would specify the array [0, 0.25, 0.5, 0.75, 1]. the default is 0 (meaning as soon as even one pixel is visible, the callback will be run). a value of 1.0 means that the threshold isn't considered passed until every pixel is visible. targeting an element to be observed once you have created the observer, you need to give it a target element to watch: let target = document.queryselector('#listitem'); observer.observe(target); // the callback we setup for the observer will be executed now for the first time // it waits until we assign a target to our observer (even if the target is currently not visible) whenever the target meets a threshold specified for the intersectionobserver, the callback is invoked. the callback receives a list of intersectionobserverentry objects and the observer:...
...out the element and establishes that the background-color and border attributes can participate in css transitions, which we'll use to affect the changes to the element as it becomes more or less obscured. #box { background-color: rgba(40, 40, 190, 255); border: 4px solid rgb(20, 20, 120); transition: background-color 1s, border 1s; width: 350px; height: 350px; display: flex; align-items: center; justify-content: center; padding: 20px; } .vertical { color: white; font: 32px "arial"; } .extra { width: 350px; height: 350px; margin-top: 10px; border: 4px solid rgb(20, 20, 120); text-align: center; padding: 20px; } javascript finally, let's take a look at the javascript code that uses the intersection observer api to make things happen. setting up first, we...
MutationObserverInit.attributeFilter - Web APIs
note the use of mutationrecord.oldvalue to get the previou...
... userlistelement = document.queryselector("#userlist"); var observer = new mutationobserver(callback); observer.observe(userlistelement, { attributefilter: [ "status", "username" ], attributeoldvalue: true, subtree: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), we use the attribute's name, obtained using mutationrecord.attributename, to identify the type of change that occurred and then dispatch to the appropriate handler function. note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that i...
MutationObserverInit.attributeOldValue - Web APIs
when observe() is c...
...ion.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attr...
MutationObserverInit.attributes - Web APIs
when observe() is c...
...ion.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attr...
NodeList.length - Web APIs
Web › API › NodeList › length
the nodelist.length property returns the number of items in a nodelist. syntax numitems = nodelist.length numitems is an integer value representing the number of items in a nodelist. example the length property is often useful in dom programming. it's often used to test the length of a list, to see if it exists at all. it's also commonly used as the iterator in a for loop, as in this example. ...
...of items in a nodelist. syntax numitems = nodelist.length numitems is an integer value representing the number of items in a nodelist. example the length property is often useful in dom programming. it's often used to test the length of a list, to see if it exists at all. it's also commonly used as the iterator in a for loop, as in this example. // all the paragraphs in the document var items = document.getelementsbytagname("p"); // for each item in the list, // append the entire element as a string of html var gross = ""; for (var i = 0; i < items.length; i++) { gross += items[i].innerhtml; } // gross is now all the html for the paragraphs specifications specification status comment domthe definition of 'nodelist: length' in that specification. ...
NodeList - Web APIs
Web › API › NodeList
"2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3" static nodelists in other cases, the nodelist is static, where any changes in the dom does not affect the content of the collection. the ubiquitous document.queryselectorall() method returns a static nodelist. it's good to keep this distinction in mind when you choose how to iterate over the items in the nodelist, and whether you should cache the list's length. properties nodelist.length the number of nodes in the nodelist. methods nodelist.item() returns an item in the list by its index, or null if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom impleme...
... as an argument to the function. nodelist.keys() returns an iterator, allowing code to go through all the keys of the key/value pairs contained in the collection. (in this case, the keys are numbers starting from 0.) nodelist.values() returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection. example it's possible to loop over the items in a nodelist using a for loop: for (let i = 0; i < mynodelist.length; i++) { let item = mynodelist[i]; } don't use for...in to enumerate the items in nodelists, since they will also enumerate its length and item properties and cause errors if your script assumes it only has to deal with element objects. also, for..in is not guaranteed to visit the properties in any particular order. for..
PaymentAddress - Web APIs
s.tojson() a standard serializer that returns a json representation of the paymentaddress object's properties. examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { total: { label: "donation", amount: { cu...
...nal object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
PaymentCurrencyAmount - Web APIs
properties all properties are required. currency a string containing a valid 3-letter iso 4217 currency identifier (iso 4217) indicating the currency used for the payment value. ...
... properties all properties are required. currency a string containing a valid 3-letter iso 4217 currency identifier (iso 4217) indicating the currency used for the payment value. ...
PaymentDetailsUpdate - Web APIs
by using the paymentrequest.show() method's detailspromise parameter to provide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time. properties the paymentdetailsupdate dictionary is based on the paymentdetailsbase dictionary, and inherits its properties, which are included in the list below. displayitems optional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message. for address field specific err...
...mount based on the selected payment method ("5% cash discount!"). shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due changes. this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged. specifications specification stat...
PaymentRequestUpdateEvent.updateWith() - Web APIs
the updatewith() method of the paymentrequestupdateevent interface updates the details of an existing paymentrequest. syntax paymentrequestupdateevent.updatewith(details); parameters details a paymentdetailsupdate object specifying the changes applied to the payment request: displayitems optional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message. for address field specific errors, use shippingaddresserrors. modifiers optional an array of paymentdetailsmodifier objects, each d...
...mount based on the selected payment method ("5% cash discount!"). shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due changes. this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged. return value undefined. specifications ...
Range.compareNode() - Web APIs
Web › API › Range › compareNode
specifications this method is not standard and therefore not part of any specification. ...
...fore && nodeisafter) return 1; if (nodeisbefore && nodeisafter) return 2; return 3; } syntax returnvalue = range.comparenode( referencenode ); parameters referencenode the node to compare with the range. example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); returnvalue = range.comparenode(document.getelementsbytagname("p").item(0)); notes this method is obsolete; you should use the w3c dom range.compareboundarypoints() method. specifications this method is not standard and therefore not part of any specification. ...
Range.getBoundingClientRect() - Web APIs
hind the contents of a range. the range's content <b>starts here</b> and continues on until it <b>ends here</b>. ...
...b> and continues on until it <b>ends here</b>. ...
ReadableStream.getReader() - Web APIs
// result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
... // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = value; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'getreader()' in that specification. living stand...
ReadableStreamDefaultReader.cancel() - Web APIs
n two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); reader.cancel(); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'cancel()' in that specification. living standard...
ReadableStreamDefaultReader.read() - Web APIs
/ result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...// done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } example 2 - handling text line by line this example shows how you might fetch a text file and handle it as a stream of text lines. it deals with ...
SVGAnimationElement: endEvent event - Web APIs
<hr> <button>stop animation</button> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); let btn = document.queryselector('button'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('endevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'endevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 're...
...endchild(listitem); }) animateelem.addeventlistener('endevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'endevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) btn.addeventlistener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications ...
Using Service Workers - Web APIs
lowing ways: in the original, we only passed in a url to an image we wanted to load. in this version, we pass in a json fragment containing all the data for a single image (see what they look like in image-list.js). this is because all the data for each promise resolve has to be passed in with the promise, as it is asynchronous. ...
...ny pages. each time a page within your scope is loaded, the service worker is installed against that page and operates on it. bear in mind therefore that you need to be careful with global variables in the service worker script: each page doesn’t get its own unique worker. note: your service worker functions like a proxy server, allowing you to modify requests and responses, replace them with items from its own cache, and more. note: one great thing about service workers is that if you use feature detection like we’ve shown above, browsers that don’t support service workers can just use your app online in the normal expected fashion. furthermore, if you use appcache and sw on a page, browsers that don’t support sw but do support appcache will use that, and browsers that support bo...
Touch.radiusX - Web APIs
Web › API › Touch › radiusX
this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var xradius = touchitem.radiusx; return value xradius the x radius of the ellipse that most closely circumscribes the area of contact with the touch surface. example this example illustrates using the touch interface's touch.radiusx, touch.radiusx and touch.rotationangle properties. the touch.radiusx property is the radius of the ellipse which most closely circumscribes the touching area (e.g. finger, stylus) a...
...l be calculate based on the touch point's radiusx and radiusy values and the element will then be rotated using the touch point's rotationangle. <div id="src"> ... </div> var src = document.getelementbyid("src"); src.addeventlistener('touchstart', rotate); src.addeventlistener('touchmove', rotate); src.addeventlistener('touchend', rotate); function rotate (e) { var touch = e.changedtouches.item(0); // turn off default event handling e.preventdefault(); // rotate element 'src'. src.style.width = touch.radiusx * 2 + 'px'; src.style.height = touch.radiusy * 2 + 'px'; src.style.transform = "rotate(" + touch.rotationangle + "deg)"; }; specifications specification status comment touch events – level 2 draft non-stable version. ...
TouchList.length - Web APIs
Web › API › TouchList › length
the length read-only property indicates the number of items (touch points) in a given touchlist. syntax var numtouches = touchlist.length; return value numtouches the number of touch points in touchlist. example this code example illustrates the use of the touchlist interface's item method and the length property. ...
...mtouches = touchlist.length; return value numtouches the number of touch points in touchlist. example this code example illustrates the use of the touchlist interface's item method and the length property. target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation ...
Using Touch Events - Web APIs
a touch point's properties include a unique identifier, the touch point's target element as well as the x and y coordinates of the touch point's position relative to the viewport, page, and screen. the touchlist interface represents a list of contact points with a touch surface, one touch point per contact. thus, if the user activated the touch surface with one finger, the list would contain one item, and if the user touched the surface with three fingers, the list length would be three. the touchevent interface represents an event sent when the state of contacts with a touch-sensitive surface changes. the state changes are starting contact with a touch surface, moving a touch point while maintaining contact with the surface, releasing a touch point and canceling a touch event. this interfac...
...tact with the surface, releasing a touch point and canceling a touch event. this interface's attributes include the state of several modifier keys (for example the shift key) and the following touch lists: touches - a list of all of the touch points currently on the screen. targettouches - a list of the touch points on the target dom element. changedtouches - a list of the touch points whose items depends on the associated event type: for the touchstart event, it is a list of the touch points that became active with the current event. for the touchmove event, it is a list of the touch points that have changed since the last event. for the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to ...
WebGLRenderingContext.stencilMask() - Web APIs
the webglrenderingcontext.stencilmask() method of the webgl api controls enabling and disabling of both the front and back writing of individual bits in the stencil planes. the webglrenderingcontext.stencilmaskseparate() method can set front and back stencil writemasks to different values. syntax void gl.stencilmask(mask); parameters mask a gluint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. by default, the mask is all 1. return value none. ...
...ext.stencilmaskseparate() method can set front and back stencil writemasks to different values. syntax void gl.stencilmask(mask); parameters mask a gluint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. by default, the mask is all 1. return value none. examples gl.stencilmask(110101); to get the current stencil masks, query the stencil_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the definition of 'stencilmask' in that specification. recommendation initial definition. opengl es 2.0the...
Signaling and video calling - Web APIs
o the left of the chat panel. this function receives a message object whose users property is an array of strings specifying the user names of every connected user. function handleuserlistmsg(msg) { var i; var listelem = document.queryselector(".userlistbox"); while (listelem.firstchild) { listelem.removechild(listelem.firstchild); } msg.users.foreach(function(username) { var item = document.createelement("li"); item.appendchild(document.createtextnode(username)); item.addeventlistener("click", invite, false); listelem.appendchild(item); }); } after getting a reference to the <ul> which contains the list of user names into the variable listelem, we empty the list by removing each of its child elements. note: obviously, it would be more efficient to update...
...ilding the whole list every time it changes, but this is good enough for the purposes of this example. then we iterate over the array of user names using foreach(). for each name, we create a new <li> element, then create a new text node containing the user name using createtextnode(). that text node is added as a child of the <li> element. next, we set a handler for the click event on the list item, that clicking on a user name calls our invite() method, which we'll look at in the next section. finally, we append the new item to the <ul> that contains all of the user names. starting a call when the user clicks on a username they want to call, the invite() function is invoked as the event handler for that click event: var mediaconstraints = { audio: true, // we want an audio track vi...
Web Storage API - Web APIs
the three. these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties hang off) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved and removed. a different storage object is used for the sessionstorage and localstorage for each origin — they function and are controlled separately. note: from firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10mb. this has been done to avoid memory issues caused by excessive usage of web storage. note: access...
..., retrieve and remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the current domain's session and local storage objects respectively, and a window.onstorage event handler that fires when a storage area changes (e.g. a new item is stored.) storageevent the storage event is fired on a document's window object when a storage area changes. examples to illustrate some typical web storage usage, we have created a simple example, imaginatively called web storage demo. the landing page provides controls that can be used to customize the colour, font and decorative image. when you choose different options, the page is inst...
Privileged features - Web APIs
ommands (in ff 1.0 and in ns 7.0x, the command system menu is not identified with the firefox/ns 7.0x icon on the left end of the titlebar: that's probably a bug. you can access the command system menu with a right-click on the titlebar). dialog windows are windows which have no minimize system command icon and no maximize/restore down system command icon on the titlebar nor in correspondent menu item in the command system menu. they are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. on mac systems, dialog windows have a different window border and they may get turned into a sheet. modal if on, the new window is said to be modal. the user cannot return to the main window until the modal window is closed. a typical modal window is cre...
...command icon and no restore/maximize system command. alwaysontop if on, the new window will always be displayed on top of all other windows (browser windows and otherwise), regardless of whether it is active or not. this was added in firefox 66 (see bug 1519893). z-lock same as alwayslowered. close when set to no or 0, this feature removes the system close command icon and system close menu item. it will only work for dialog windows (dialog feature set). close=no will override minimizable=yes. mozilla and firefox users can force new windows to always have a close button by setting dom.disable_window_open_feature.close to true in about:config or in their user.js file. ...
Window.sessionStorage - Web APIs
est violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. example the following snippet accesses the current origin's session storage object and adds data to it with storage.setitem(). sessionstorage.setitem('mycat', 'tom'); the following example autosaves the contents of a text field, and if the browser is refreshed, restores the text field content so that no writing is lost. // get the text field that we're going to track let field = document.getelementbyid("field"); // see if we have an autosave value // (this will only happen if the page is accidentally refreshed) if...
...setitem('mycat', 'tom'); the following example autosaves the contents of a text field, and if the browser is refreshed, restores the text field content so that no writing is lost. // get the text field that we're going to track let field = document.getelementbyid("field"); // see if we have an autosave value // (this will only happen if the page is accidentally refreshed) if (sessionstorage.getitem("autosave")) { // restore the contents of the text field field.value = sessionstorage.getitem("autosave"); } // listen for changes in the text field field.addeventlistener("change", function() { // and save the results into the session storage object sessionstorage.setitem("autosave", field.value); }); note: please refer to the using the web storage api article for a full example. sp...
Window: storage event - Web APIs
the storage event of the window interface fires when a storage area (localstorage) has been modified in the context of another document. bubbles no cancelable no interface storageevent event handler property onstorage examples log the samplelist item to the console when the storage event fires: window.addeventlistener('storage', () => { // when local storage changes, dump the list to // the console. ...
...f another document. bubbles no cancelable no interface storageevent event handler property onstorage examples log the samplelist item to the console when the storage event fires: window.addeventlistener('storage', () => { // when local storage changes, dump the list to // the console. console.log(json.parse(window.localstorage.getitem('samplelist'))); }); the same action can be achieved using the onstorage event handler property: window.onstorage = () => { // when local storage changes, dump the list to // the console. console.log(json.parse(window.localstorage.getitem('samplelist'))); }; specifications specification status html living standardthe definition of 'storage' in that specification. ...
Window - Web APIs
Web › API › Window
document.defaultview property. a global variable, window, representing the window in which the script is running, is exposed to javascript code. the window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window. however, the window interface is a suitable place to include these items that need to be globally available. many of these are documented in the javascript reference and the dom reference. in a tabbed browser, each tab is represented by its own window object; the global window seen by javascript code running within a given tab always represents the tab in which the code is running. that said, even in a tabbed browser, some properties and methods still apply to the o...
...ocus() sets focus on the current window. window.getcomputedstyle() gets computed style for the specified element. computed style indicates the computed values of all css properties of the element. window.getdefaultcomputedstyle() gets default computed style for the specified element, ignoring author stylesheets. window.getselection() returns the selection object representing the selected item(s). window.matchmedia() returns a mediaquerylist object representing the specified media query string. window.maximize() fixme: needscontents window.minimize() (top-level xul windows only) minimizes the window. window.moveby() moves the current window by a specified amount. window.moveto() moves the window to the specified coordinates. window.open() opens a new window. window.postmes...
ARIA Screen Reader Implementors Guide - Accessibility
text to speech and a braille display), then two queues can be maintained to allow for parallel presentation. the channels could be user configured for presenting live regions based on role or politeness. busy regions: any changes in a region marked with aria-busy="true" should not be added to the queue until that attribute is cleared. politeness (aria-live or from role) takes first precedence,: items should be added to the queue based on their politeness level from the aria-live property or inherited from the role (e.g. role="log" is polite by default). assertive items are first then politeness level. alternatively, implementations may choose to have a policy of clearing more polite items, e.g. assertive items clear any polite items from the queue. time takes second precedence: prioritize i...
... atomic (aria-atomic="true") regions with multiple changes should not be presented twice with the same content. as a new event for an atomic region is added to the queue remove an earlier event for the same region. ...
Using ARIA: Roles, states, and properties - Accessibility
uthors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element). addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom. roles widget roles button checkbox gridcell link menuitem menuitemcheckbox menuitemradio option progressbar radio scrollbar searchbox separator (when focusable) slider spinbutton switch tab tabpanel textbox treeitem composite roles the techniques below describe each composite role as well as their required and optional child roles. combobox grid (including row, gridcell, rowheader, columnheader roles) listbox (including option ...
...required and optional child roles. ...
ARIA: article role - Accessibility
<div role="article"> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ... controls to interact with the article, share it, etc. ... </div> <div role="article"> ... </div> this example shows two articles side by side on one page that could be structured similarly and are related. ...
...sed. user agents translate this to the appropriate accessibility information just like the article role. using the <article> element also helps search engines better discover the structure of a page. examples of appropriate uses of the role="article", or preferably <article>, include blog posts, forum posts, a comment to a forum or blog post, a comment to a comment to a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1. aria-setsize in the context of a feed, indicates how many article items there are within that feed. keyboard interactions this role does not support any specific keyboard inte...
HTML To MSAA - Accessibility
egend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented n/a if @usemap attribute is used then image accessible has children for each map item input @type=button, submit, reset role_system_ pushbutton from @value attribute, @alt attribute, default label, @src attribute, @data attribute n/a state_system_ default if @type attribute has value "submit" n/a "press" n/a input @type=text, textarea role_system_ text n/a value property of input dom element state_system_ readonly if @readonly attribute is used n/a "activate" n/a input ...
...tton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_ statictext from child nodes n/a n/a n/a n/a n/a legend role_system_ statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a li and others role_system_ listitem n/a n/a state_system_ readonly n/a n/a n/a contains child accessible for list bullet ol, ul and others role_system_ list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_ listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectionwithin event_object_ s...
Operable - Accessibility
element currently has focus. this is usually a dotted or blue outline by default (depending on browser, platform, etc.), but this can be overidden by css. see using native keyboard accessibility. 2.4.8 location within site (aaa) when on a page inside a complex site or set of steps, the user should be given an indicator of where they are in the site, for example a breadcrumb trail, sitemap or text such as "form page 2 of 10". 2.4.9 link purpose (link only) (aaa) this criterion builds on 2.4.4, stating that to conform to aaa, the purpose/destination of a link should be determinable from the link text alone, even if out of context. see meaningful text labels. also note that you should minimize instances where multiple copies of the same text are linked to differe...
...by a) device motion (like shaking, tilting) or b) user gestures detected by device sensors (including a camera) that both of the following are true: 1) motion actuation can be disabled, and 2) the functionality can be operated without using device motion or user gestures. exceptions exist. understanding motion actuation 2.5.5 target size (aaa) added in 2.1 the size of an actionable item's touch target must be at least 44 css pixels in both width and height. exceptions exist. understanding target size 2.5.6 concurrent input mechanisms (aaa) added in 2.1 make sure people can use and switch between different modes of input when interacting with digital content including touchscreen, keyboard, mouse, voice commands, or alternative input devices. an essential excepti...
Text labels and names - Accessibility
he element is showing. figures with optional captions should be labeled for best accessibility, include a <figcaption> within a <figure> element, even though doing so is technically optional. the caption is in addition to any alternative text on images within the figure. the caption describes the purpose of the figure in the document, which may be different from a simple description of a visual item, as provided by the alternative text. example the following example shows code for a figure with a caption. the alt attribute of the <img> describes the appearance of the image; the <figcaption> describes it from a functional perspective (in this case, the latin name of the flower in the image). <figure> <img src="milkweed.jgp" alt="black and white close-up photo of milkweed flowers"> ...
...label><br/> <input type="radio" id="mothman" name="monster"> <label for="mothman">mothman</label> </fieldset> </form> you can see a live, interactive version of this example on the <fieldset> reference page. see also <fieldset> <legend> form elements must be labeled all elements within a form must have a <label> that identifies its purpose. this applies to all types of <input> items, as well as <button>, <output>, <select>, <textarea>, <progress> and <meter> elements, as well as any element with the switch aria role. the form element can be placed inside the <label>, in which case the association between the form element and the label is obvious from the structure. or, you can create an association between a <label> and a form element by specifying the form element's id va...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
ption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
...ter; 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 specification status co...
Spanning and Balancing Columns - CSS: Cascading Style Sheets
in this guide we look at how to make elements span across columns inside the multicol container and how to control how the columns are filled. note the spanning and balancing functionality covered in this guide is not as well supported across browsers as the functionality covered in the previous two sections in this guide. spanning the columns to cause an item to span across columns use the property column-span with a value of all. this will cause the element to span all of the columns. any descendant element of the multicol container may become a spanner including both direct and indirect children. for example, a heading nested directly inside the container could become a spanner, as could a heading nested inside a section nested inside the multicol container. in the example below, th...
...pans the content as expected. when a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column boxes. the content does not jump over a spanning element. limitations of column-span in the current level 1 specification there are only two allowable values for column-span. the value none is the initial value and means the item does not span, remaining within a column. the value all means the item spans all of the columns. you cannot cause an item to span two out of three columns for example. things to watch out for if the spanning element is inside another element which has margins, padding and a border or a background color, it is possible to end up with the top of the box appearing above the spanner and the rest di...
Using CSS counters - CSS: Cascading Style Sheets
} li::before { counter-increment: section; /* increments only this instance of the section counter */ content: counters(section, ".") " "; /* combines the values of all instances of the section counter, separated by a period */ } html <ol> <li>item</li> <!-- 1 --> <li>item <!-- 2 --> <ol> <li>item</li> <!-- 2.1 --> <li>item</li> <!-- 2.2 --> <li>item <!-- 2.3 --> <ol> <li>item</li> <!-- 2.3.1 --> <li>item</li> <!-- 2.3.2 --> </ol> <ol> <li>item</li> <!-- 2.3.1 --> <li>item</li> <!-- 2.3.2 --> ...
... <!-- 1 --> <li>item <!-- 2 --> <ol> <li>item</li> <!-- 2.1 --> <li>item</li> <!-- 2.2 --> <li>item <!-- 2.3 --> <ol> <li>item</li> <!-- 2.3.1 --> <li>item</li> <!-- 2.3.2 --> </ol> <ol> <li>item</li> <!-- 2.3.1 --> <li>item</li> <!-- 2.3.2 --> <li>item</li> <!-- 2.3.3 --> </ol> </li> <li>item</li> <!-- 2.4 --> </ol> </li> <li>item</li> <!-- 3 --> <li>item</li> <!-- 4 --> </ol> <ol> <li>item</li> <!-- 1 --> <li>item</li> <!-- 2 --> </ol> result specifications specification status comment css lists module level 3the defin...
Logical properties for sizing - CSS: Cascading Style Sheets
left and right). while these flow relative mappings may well become the default for many of us, in a design you may well use both physical and logical sizing. ...
...irst example, to see the effect it has. i am using min-height in the first example and min-block-size in the second. max-width and max-height example finally you can use max-inline-size and max-block-size as logical replacements for max-width and max-height. try playing with the below example in the same way as before. logical keywords for resize the resize property sets whether or not an item can be resized and has physical values of horizontal and vertical. the resize property also has logical keyword values. using resize: inline allows resizing in the inline dimension and resize: block allow resizing in the block dimension. the keyword value of both for the resize property works whether you are thinking physically or logically. it sets both dimensions at once. try playing with the ...
Basic Shapes - CSS: Cascading Style Sheets
d in reference to other shapes which extend past the margin box will have the shape clipped to the margin box. we will see this in the following examples of basic shapes. for an excellent description of references boxes as they apply to css shapes see understanding reference boxes for css shapes. inset() the inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it. however the inset() types enables the definition of offsets, thus pulling the content in over the shape. therefore inset() takes four values for the top, right, bottom and left values plus a final value for border-radius. the below css creates a rectangular shape inset from the reference box of the floated element 20 pixels from the top and bottom and...
...ument is a position. if omitted this will be set to center. however you can use any valid position here to indicate the position of the centre of the circle. our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. this gives a total width for the reference box of 140 pixels. i have given a value of 50% for the shape-radius value which means that our radius is 70px. i have then set the position value to 30%. in the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, moving the circle aro...
Descendant combinator - CSS: Cascading Style Sheets
the descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector. selectors that utilize a descendant combinator are called descendant selectors. /* list items that are descendants of the "my-things" list */ ul.my-things li { margin: 2em; } the descendant combinator is technically one or more css white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is...
...form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is comprised may contain any number of css comments. syntax selector1 selector2 { /* property declarations */ } examples css li { list-style-type: disc; } li li { list-style-type: circle; } html <ul> <li> <div>item 1</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> <li> <div>item 2</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> </ul> result specifications specification status comment selectors level 4the definition of 'descendant combinator' in that specification. working draft selec...
List group with badges - CSS: Cascading Style Sheets
in this recipe we will create a list group pattern with badges that indicate a count. requirements our list items should be displayed with the badges lined up on the right, no matter how much content the item has. the badge should always be centered vertically whether there is a single line of content, or more than one. recipe download this example choices made flexbox makes this particular pattern straightforward and also makes it easy to make changes to the layout. to ensure the text and badge line up correctly i use the justify-content property with a value of space-between. this places any extra space between the items. in the live example, if you remove this property and you will see the badge move to the end of the text on items with text shorter than the one line. to alig...
... easy to make changes to the layout. to ensure the text and badge line up correctly i use the justify-content property with a value of space-between. this places any extra space between the items. in the live example, if you remove this property and you will see the badge move to the end of the text on items with text shorter than the one line. to align the content horizontally, i use the align-items property to align the text and badge on the cross axis. if instead, you want the badge to align to the top of the content, change this to align-items: flex-start. ...
Split Navigation - CSS: Cascading Style Sheets
a navigation pattern where one or more elements are separated from the rest of the navigation items. requirements a common navigation pattern is to have one element pushed away from the others. we can use flexbox to achieve this, without needing to make the two sets of items into two separate flex containers. recipe download this example choices made this pattern combines auto margins with flexbox to split the items. an auto margin absorbs all available space in the direction it is applied. this is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. in this case the left auto margin takes up any available space and pushes the item over to the right. you could app...
...ems. an auto margin absorbs all available space in the direction it is applied. this is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. in this case the left auto margin takes up any available space and pushes the item over to the right. you could apply the class push to any item in the list. ...
CSS Layout cookbook - CSS: Cascading Style Sheets
recipe description layout methods media objects a two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet. css grid, float fallback, fit-content() sizing columns when to choose multi-column layout, flexbox or grid for your columns. css grid, multicol, flexbox center an element how to center an item horizontally and vertically. flexbox, box alignment sticky footers creating a footer which sits at the bottom of the container or viewport when the content is shorter. css grid, flexbox split navigation a navigation pattern where some links are visually separated from the others. flexbox, margin breadcrumb navigation creating a list of links to allow ...
...he bottom of the container or viewport when the content is shorter. css grid, flexbox split navigation a navigation pattern where some links are visually separated from the others. flexbox, margin breadcrumb navigation creating a list of links to allow the visitor to navigate back up through the page hierarchy. flexbox list group with badges a list of items with a badge to display a count. flexbox, box alignment pagination links to pages of content (such as search results). flexbox, box alignment card a card component, which displays in a grid of cards. grid layout grid wrapper for aligning grid content within a central wrapper, while also allowing items to break out. css grid contribute a reci...
Shorthand properties - CSS: Cascading Style Sheets
origin of css declarations in introducing the css cascade for more information on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { co...
...lue syntax, shorthand properties and replaced elements. ...
background-repeat - CSS: Cascading Style Sheets
no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. formal definition initial valuerepeatapplies toall elements. ...
... specifications specification status comment css backgrounds and borders module level 3the definition of 'background-repeat' in that specification. candidate recommendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and vertic...
cursor - CSS: Cascading Style Sheets
Web › CSS › cursor
the text can be selected. typically the shape of an i-beam. vertical-text the vertical text can be selected. typically the shape of a sideways i-beam. drag & drop alias an alias or shortcut is to be created. copy something is to be copied. move something is to be moved. no-drop an item may not be dropped at the current location. bug 275173: on windows and mac os x, no-drop is the same as not-allowed. not-allowed the requested action will not be carried out. grab something can be grabbed (dragged to be moved). grabbing something is being grabbed (dragged to be moved). resizing & scrolling all-scr...
...uested action will not be carried out. grab something can be grabbed (dragged to be moved). grabbing something is being grabbed (dragged to be moved). resizing & scrolling all-scroll something can be scrolled in any direction (panned). bug 275174: on windows, all-scroll is the same as move. col-resize the item/column can be resized horizontally. often rendered as arrows pointing left and right with a vertical bar separating them. row-resize the item/row can be resized vertically. often rendered as arrows pointing up and down with a horizontal bar separating them. n-resize some edge is to be moved. for example, the se-resize cursor is used when the movement star...
flex-shrink - CSS: Cascading Style Sheets
in use, flex-shrink is used alongside the other flex properties flex-grow and flex-basis, and normally defined using the flex shorthand. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...b.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1. formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. d and e have flex-shrink:2 set</p> <p>the width of d and e is less than the others.</p> <div id="content"> <di...
flex-wrap - CSS: Cascading Style Sheets
Web › CSS › flex-wrap
if wrapping is allowed, it sets the direction that lines are stacked. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. ...
...st. see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. values the following values are accepted: nowrap the flex items are laid out in a single line which may cause the flex container to overflow. the cross-start is either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start...
grid-template-columns - CSS: Cascading Style Sheets
percentage. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets...
... or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater th...
grid-template-rows - CSS: Cascading Style Sheets
he percentage. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range, greater than or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value se...
...or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater th...
image() - CSS: Cascading Style Sheets
which means you can add a fall back color should a transparent png/gif/webp not load. ...
...arrow on the left</li> <li dir="rtl">bullet is the same arrow, flipped to point left.</li> </ul> ul { list-style-image: image(ltr 'https://mdn.mozillademos.org/files/16412/rightarrow.png'); } in the left-to-right list items — those with dir="ltr" set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is. list items with dir="rtl" set on the <li> or inheriting the right-to-left directionality from an ancestor, such as documents set to arabic or hebrew, will have the bullet display on the right, horizontally flippled, as if transform: scalex(-1) had been set. the text will also be displayed left-to-right. displaying a section of the background image <div class="box">hover over me. what cursor do you see?
visibility - CSS: Cascading Style Sheets
ey would have occupied is removed (as if display: none were applied to the column/row of the table). however, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. this value allows for the fast removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table. collapsed flex items are hidden, and the space they would have occupied is removed. for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect. for other elements, collapse is treated the same as hidden. accessibility concerns using a visibility value of hidden on an element will remove it from the accessi...
... css level 2 (revision 1)the definition of 'visibility' in that specification. recommendation initial definition. ...
Getting Started - Developer guides
ter on. the document (test.xml) contains the following: <?xml version="1.0" ?> <root> i'm a test. </root> in the script we only need to change the request line to: ... onclick="makerequest('test.xml')"> ... then in alertcontents(), we need to replace the line alert(httprequest.responsetext); with: var xmldoc = httprequest.responsexml; var root_node = xmldoc.getelementsbytagname('root').item(0); alert(root_node.firstchild.data); this code takes the xmldocument object given by responsexml and uses dom methods to access some of the data contained in the xml document. you can see the test.xml here and the updated test script here. step 5 – working with data finally, let's send some data to the server and receive a response. our javascript will request a dynamic page this time, tes...
... $computedstring]; echo json_encode($array); for more on dom methods, be sure to check out document object model (dom). simple timed xhr example another simple example follows — here we are loading a text file via xhr, the structure of which is assumed to be like this: time: 312.05 time: 312.07 time: 312.10 time: 312.12 time: 312.14 time: 312.15 once the text file is loaded, we split() the items into an array at each newline character (\n — basically where each line break is in the text file), and then print the complete list of timestamps, and the last timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be use...
Challenge solutions - Developer guides
uschia, or burlywood. see css color value for a complete list as well as other ways of specifying colors. how css works dom inspector challenge in domi, click on a strong node. use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal text. solution in the menu above the right-hand pane, choose css rules. you see two items listed, one that references an internal resource and one that references your stylesheet file. the internal resource defines the font-weight property as bolder; your stylesheet defines the color property as red. cascading and inheritance inherited styles challenge change your stylesheet so that only the red letters are underlined. solution move the declaration for underlining from the r...
...lue */ } content add an image challenge add a one rule to your stylesheet so that it displays the image at the start of each line. solution add this rule to your stylesheet: p:before{ content: url("yellow-pin.png"); } lists lower roman numerals challenge add a rule to your stylesheet, to number the oceans using roman numerals from i to v. solution define a rule for list items to use the lower-roman list style: li { list-style: lower-roman; } capital letters challenge change your stylesheet to identify the headings with capital letters in parentheses. solution add a rule to the body element (parent of the headings) to reset a new counter, and one to display and increment the counter on the headings: /* numbered headings */ body {counter-reset: headnum;}...
Content categories - Developer guides
>, <ol>, <output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr> and text. a few other elements belong to this category, but only if a specific condition is fulfilled: <area>, if it is a descendant of a <map> element <link>, if the itemprop attribute is present <meta>, if the itemprop attribute is present <style>, if the scoped attribute is present sectioning content elements belonging to the sectioning content model create a section in the current outline that defines the scope of <header> elements, <footer> elements, and heading content. elements belonging to this category are <article>, <aside>, <nav> and <section>. ...
...extarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters). a few other elements belong to this category, but only if a specific condition is fulfilled: <a>, if it contains only phrasing content <area>, if it is a descendant of a <map> element <del>, if it contains only phrasing content <ins>, if it contains only phrasing content <link>, if the itemprop attribute is present <map>, if it contains only phrasing content <meta>, if the itemprop attribute is present embedded content embedded content imports another resource or inserts content from another mark-up language or namespace into the document. elements that belong to this category include: <audio>, <canvas>, <embed>, <iframe>, <img>, <math>, <object>, <picture>, <svg>, <video>. in...
HTML attribute reference - HTML: Hypertext Markup Language
rea>, contenteditable provides a hint as to the type of data that might be entered by the user while editing the element or its contents. the attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute). ismap <img> indicates that the image is part of a server-side image map. itemprop global attribute keytype <keygen> specifies the type of key generated. kind <track> specifies the kind of text track. label <optgroup>, <option>, <track> specifies a user-readable title of the element. lang global attribute defines the language used in the element. language <script> defines the script language u...
...fines restrictions on the allowed values of boolean attributes: if the attribute is present, its value must either be the empty string (equivalently, the attribute may have an unassigned value), or a value that is an ascii case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace. the following examples are valid ways to mark up a boolean attribute: <div itemscope> this is valid html but invalid xml. </div> <div itemscope=itemscope> this is also valid html but invalid xml. </div> <div itemscope=""> this is valid html and also valid xml. </div> <div itemscope="itemscope"> this is also valid html and xml, but perhaps a bit verbose. </div> to be clear, the values "true" and "false" are not allowed on boolean attributes. to represent a false value, the a...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
this event is triggered once the downloaded data is all available. it begins by creating a new <canvas> element that we'll use to convert the image into a data url, and by...
...image(). the canvas is then inserted into the document so the image is visible. now it's time to actually save the image locally. to do this, we use the web storage api's local storage mechanism, which is accessed through the localstorage global. the canvas method todataurl() is used to convert the image into a data:// url representing a png image, which is then saved into local storage using setitem(). you can try out or remix this example on glitch. ...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
eventdefault(); }, false); try this example out and see how there's never more than one result for the contact group. additional attributes in addition to the common attributes shared by all <input> elements, radio inputs support the following attributes: attribute description checked a boolean indicating whether or not this radio button is the currently-selected item in the group value the string to use as the value of the radio when submitting the form, if the radio is currently toggled on checked a boolean attribute which, if present, indicates that this radio button is the currently selected one in the group. unlike other browsers, firefox by default persists the dynamic checked state of an <input> across page loads. use the autocomple...
...l</label> </div> <div> <button type="submit">submit</button> </div> </fieldset> </form> there's not much new to note here except for the addition of <fieldset> and <legend> elements, which help to group the functionality nicely and in a semantic way. ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
ome, opera, etc.). mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. orient sets the orientation of the range slider. firefox only. results the maximum number of items that should be displayed in the drop-down list of previous search queries. safari only. webkitdirectory a boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present) autocorrect a safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the...
... attribute: combobox type=text with no list attribute: textbox with list attribute: combobox type=url with no list attribute: textbox with list attribute: combobox type=color|date|datetime-local|file|hidden|month|password|time|week: no corresponding role permitted aria roles type=button: link, menuitem, menuitemcheckbox, menuitemradio, option, radio, switch, tab type=checkbox: button when used with aria-pressed, menuitemcheckbox, option, switch type=image: link, menuitem, menuitemcheckbox, menuitemradio, radio, switch type=radio: menuitemradio type=text with no list attribute: combobox, searchbox, spinbutton type=color|date|datetime|datetime-local|email|file|hidden|month|num...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
quest. to link an external stylesheet, you'd include a <link> element inside your <head> like this: <link href="main.css" rel="stylesheet"> this simple example provides the path to the stylesheet inside an href attribute, and a rel attribute with a value of stylesheet. the rel stands for "relationship", and is probably one of the key features of the <link> element — the value denotes how the item being linked to is related to the containing document. as you'll see from our link types reference, there are many different kinds of relationship. there are a number of other common types you'll come across. for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various ...
...sheet.css" id="my-stylesheet"> note: the load event fires once the stylesheet and all of its imported content has been loaded and parsed, and immediately before the styles start being applied to the content. preload examples you can find a number of <link rel="preload"> examples in preloading content with rel="preload". technical summary content categories metadata content. if itemprop is present: flow content and phrasing content. permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present permitted parents any element that accepts metadata elements. if itemprop is present: any element that accepts phrasing content. implicit aria role ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
Web › HTML › Element › meta
permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present. permitted parents <meta charset>, <meta http-equiv>: a <head> element. ...
...s set, the meta element provides document-level metadata, applying to the whole page. if the http-equiv attribute is set, the meta element is a pragma directive, providing information equivalent to what can be given by a similarly-named http header. if the charset attribute is set, the meta element is a charset declaration, giving the character encoding in which the document is encoded. if the itemprop attribute is set, the meta element provides user-defined metadata. attributes this element includes the global attributes. note: the attribute name has a specific meaning for the <meta> element, and the itemprop attribute must not be set on the same <meta> element that has any existing name, http-equiv or charset attributes. charset this attribute declares the document's character e...
<select>: The HTML Select element - HTML: Hypertext Markup Language
Web › HTML › Element › select
usage notes selecting multiple options on a desktop computer, there are a number of ways to select multiple options in a <select> element with a multiple attribute: mouse users can hold the ctrl, command, or shift keys (depending on what makes sense for your operating system) and then click multiple options to select/deselect them. warning: the mechanism for selecting multiple non-contiguous items via the keyboard described below currently only seems to work in firefox. also note: on macos, the ctrl + up and ctrl + down shortcuts conflict with the os default shortcuts for mission control and application windows, so you'll have to turn these off before it will work. keyboard users can select multiple contiguous items by: focusing on the <select> element (e.g. using tab). selecting a...
...via the keyboard described below currently only seems to work in firefox. also note: on macos, the ctrl + up and ctrl + down shortcuts conflict with the os default shortcuts for mission control and application windows, so you'll have to turn these off before it will work. keyboard users can select multiple contiguous items by: focusing on the <select> element (e.g. using tab). selecting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options. holding down the shift key and then using the up and down cursor keys to increase or decrease the range of items selected. keyboard users can select multiple non-contiguous items by: focusing on the <select> element (e.g. using tab). holding down the ctrl key then using th...
Want-Digest - HTTP
um and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <q-value> the quality value to apply to that option. ...
...on the sender provides a list of digests which it is prepared to accept, and the server uses one of them: request: get /item want-digest: sha-256;q=0.3, sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= the server does not support any of the requested digest algorithms, so responds with a 400 error and includes another want-digest header, listing the algorithms that it does support: request: get /item want-digest: sha;q=1 response: http/1.1 400 bad request want-digest:...
X-DNS-Prefetch-Control - HTTP
this reduces latency when the user clicks a link. ...
...this reduces latency when the user clicks a link. ...
Iterators and generators - JavaScript
javascript provides a number of ways of iterating over a collection, from simple for loops to map() and filter(). iterators and generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops. for details, see also: iteration_protocols for...of function* and generator yield and yield* iterators in javascript an iterator is an object which defines a sequence and potentially a return value upon its termination. ...
...n once, or only once. it is up to the programmer to know which is the case. iterables which can iterate only once (such as generators) customarily return this from their @@iterator method, whereas iterables which can be iterated many times must return a new iterator on each invocation of @@iterator. function* makeiterator() { yield 1; yield 2; } const it = makeiterator(); for (const ititem of it) { console.log(ititem); } console.log(it[symbol.iterator]() === it) // true; // this example show us generator(iterator) is iterable object, // which has the @@iterator method return the it (itself), // and consequently, the it object can iterate only _once_. // if we change it's @@iterator method to a function/generator // which returns a new iterator/generator object, (it) // can ...
The arguments object - JavaScript
the number of arguments that were passed to the function. arguments[@@iterator] returns a new array iterator object that contains the values for each index in arguments. examples defining a function that concatenates several strings this example defines a function that concatenates several strings. the function's only formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function. it returns a string list using each argument in the list: // returns "red, orange, blue" myconcat(', ', 'red', 'orange', 'blue'); // returns "elephant; giraffe; lion; cheetah" myconcat('; ', 'elepha...
...(bulleted), or "o" if the list is to be ordered (numbered). the function is defined as follows: function list(type) { var html = '<' + type + 'l><li>'; var args = array.prototype.slice.call(arguments, 1); html += args.join('</li><li>'); html += '</li></' + type + 'l>'; // end list return html; } you can pass any number of arguments to this function, and it adds each argument as a list item to a list of the type indicated. for example: let listhtml = list('u', 'one', 'two', 'three'); /* listhtml is: "<ul><li>one</li><li>two</li><li>three</li></ul>" */ rest, default, and destructured parameters the arguments object can be used in conjunction with rest, default, and destructured parameters. function foo(...args) { return args; } foo(1, 2, 3); // [1, 2, 3] while the presence...
Array.prototype.flatMap() - JavaScript
better showcases the use of flatmap. let's generate a list of words from a list of sentences. let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length. ...
...from a list of sentences. let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length. for adding and removing items during a map() flatmap can be used as a way to add and remove items (modify the number of items) during a map. in other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. in this sense, it works like the opposite of filter. simply return a 1-element array to keep the item, a multiple-element array to add items, or a 0-element array to remove the item. // let's say we want to remove all t...
Array.prototype.forEach() - JavaScript
or uninitialized values (sparse arrays) const arraysparse = [1,3,,7] let numcallbackruns = 0 arraysparse.foreach((element) => { console.log(element) numcallbackruns++ }) console.log("numcallbackruns: ", numcallbackruns) // 1 // 3 // 7 // numcallbackruns: 3 // comment: as you can see the missing value between 3 and 7 didn't invoke callback function. converting a for loop to foreach const items = ['item1', 'item2', 'item3'] const copyitems = [] // before for (let i = 0; i < items.length; i++) { copyitems.push(items[i]) } // after items.foreach(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 examp...
... 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 = 0 } counter.prototype.add = function(array) { array.foreach((entry) => { this.sum += entry ++this.count ...
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by removing or replacing 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. syntax let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the index at which to start changing the array. if greater than the length of the array, start will be set to the length of the array. in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. if negative, it will begin that many elements from the e...
...y.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all the elements from start to the end of the array will be deleted. note: in ie8, it won't delete all when deletecount is omitted. if deletecount is 0 or negative, no elements are removed. in this case, you should specify at least one new element (see below). item1, item2, ... optional the elements to add to the array, beginning from start. if you do not specify any elements, splice() will only remove elements from the array. return value an array containing the deleted elements. if only one element is removed, an array of one element is returned. if no elements are removed, an empty array is returned. description if the specified number of element...
Set - JavaScript
'.tolowercase()) // true myset.has(o) // true myset.size // 5 myset.delete(5) // removes 5 from the set myset.has(5) // false, 5 has been removed myset.size // 4, since we just removed one value console.log(myset) // logs set(4) [ 1, "some text", {…}, {…} ] in firefox // logs set(4) { 1, "some text", {…}, {…} } in chrome iterating sets // iterate over items in set // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.keys()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.values()) console.log(item...
...s the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.keys()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.values()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} // (key and value are the same here) for (let [key, value] of myset.entries()) console.log(key) // convert set object to an array object, with array.from let myarr = array.from(myset) // [1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2}] // the following will also work if run in an html document myset.add(document.body) myset.h...
Optional chaining (?.) - JavaScript
the result is therefore undefined. let mymap = new map(); mymap.set("foo", {name: "baz", desc: "inga"}); let namebar = mymap.get("bar")?.name; short-circuiting evaluation when using optional chaining...
...the result is therefore undefined. let mymap = new map(); mymap.set("foo", {name: "baz", desc: "inga"}); let namebar = mymap.get("bar")?.name; short-circuiting evaluation when using optional chaining with expressions, if the left operand is nul...
Spread syntax (...) - JavaScript
nd spread syntax.) const a = [[1], [2], [3]]; const b = [...a]; b.shift().shift(); // 1 // oh no! now array 'a' is affected as well: a // [[], [2], [3]] a better way to concatenate arrays array.prototype.concat() is often used to concatenate an array to the end of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array. without spread syntax, ...
...let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // prepend all items from arr2 onto arr1 array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] with spread syntax, this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] note: unlike unshift(), this creates a new arr1, and does not modify the original arr1 array in-place. spread in object literals the rest/spread proper...
label - JavaScript
"loop2" if (i === 1 && j === 1) { continue loop1; } console.log('i = ' + i + ', j = ' + j); } } // output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // "i = 2, j = 0" // "i = 2, j = 1" // "i = 2, j = 2" // notice how it skips both "i = 1, j = 1" and "i = 1, j = 2" using a labeled continue statement given an array of items and an array of tests, this example counts the number of items that passes all the tests. var itemspassed = 0; var i, j; top: for (i = 0; i < items.length; i++) { for (j = 0; j < tests.length; j++) { if (!tests[j].pass(items[i])) { continue top; } } itemspassed++; } using a labeled break with for loops var i, j; loop1: for (i = 0; i < 3; i++) { //the first for stat...
... for (j = 0; j < 3; j++) { //the second for statement is labeled "loop2" if (i === 1 && j === 1) { break loop1; } console.log('i = ' + i + ', j = ' + j); } } // output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // notice the difference with the previous continue example using a labeled break statement given an array of items and an array of tests, this example determines whether all items pass all tests. var allpass = true; var i, j; top: for (i = 0; items.length; i++) for (j = 0; j < tests.length; i++) if (!tests[j].pass(items[i])) { allpass = false; break top; } using a labeled block with break you can use labels within simple blocks, but only break statements can make use of non-loop lab...
Template literals (Template strings) - JavaScript
es in certain cases, nesting a template is the easiest (and perhaps more readable) way to have configurable strings. within a backticked template, it is simple to allow inner backticks simply by using them inside a placeholder ${ } within the template. for instance, if condition a is true, then return this templated literal. ...
...ner backticks simply by using them inside a placeholder ${ } within the template. for instance, if condition a is true, then return this templated literal. in es5: let classes = 'header'; classes += (islargescreen() ? '' : item.iscollapsed ? ' icon-expander' : ' icon-collapser'); in es2015 with template literals and without nesting: const classes = `header ${ islargescreen() ? '' : (item.iscollapsed ? 'icon-expander' : 'icon-collapser') }`; in es2015 with nested template literals: const classes = `header ${ islargescreen() ? '' : `icon-${item.iscollapsed ? 'expander' : 'collapser'}` }`; tagged templates a more advanced form of template literals are tagged templates. tags allow you to parse template literals with a function. the first argument of a tag function contains an ...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
accepted, the permission works for both notifications and push. ...
...ication the example app creates a notification out of the available data — a game is picked at random, and the chosen one feeds the notification with the content: it sets the game's name as the title, mentioning the author in the body, and showing the image as an icon: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } a new random notification is created every 30 seconds until it becomes too annoying and is ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
s a random notification. ...
...); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if (result === 'granted') { randomnotification(); } }); }); the randomnotification() function follows, rounding out the last of the code in the file: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we'll briefly look at here is the service worker, which is found in the fi...
display - SVG: Scalable Vector Graphics
Web › SVG › Attribute › display
t x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not displayed --> <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="140" y="20" width="60" height="60" fill="yellow" display="none"></rect> </svg> usage notes default value inline value [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<display-listitem> = <display-outside>? && [ flow | flow-root ]? && list-item<display-internal> = table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-capti...
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'display' in that specification. ...
SVG element reference - SVG: Scalable Vector Graphics
Web › SVG › Element
nts <a>, <circle>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <unknown>, <use> shape elements <circle>, <ellipse>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect> structural elements <defs>, <g>, <svg>, <symbol>, <use> text content elements <altglyph>, <altglyphdef>, <altglyphitem>, <glyph>, <glyphref>, <textpath>, <text>, <tref>, <tspan> text content child elements <altglyph>, <textpath>, <tref>, <tspan> uncategorized elements <clippath>, <color-profile>, <cursor>, <filter>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <script>, <style>, <view> obsolete and deprecated elements warning: these are old svg elements which are deprecated and should not be used.
...er>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <script>, <style>, <view> obsolete and deprecated elements warning: these are old svg elements which are deprecated and should not be used. ...
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
the to attribute indicates the final value of the attribute that will be modified during the animation. 223 transform svg, svg attribute the transform attribute defines a list of transform definitions that are applied to an element and the element's children. 224 transform-origin svg, svg attribute the transform-origin svg attribute sets the origin for an item’s transformations. 225 type needscompattable, needsexample, svg, svg attribute, filter the type attribute is a generic attribute and it has different meaning based on the context in which it's used. 226 u1 deprecated, svg, svg attribute the u1 attribute specifies list of unicode characters (refer to the description of the unicode attribute of the <glyph...
... <altglyph> deprecated, element, reference, svg, svg text content the <altglyph> svg element allows sophisticated selection of the glyphs used to render its child character data. 296 <altglyphdef> deprecated, element, needsexample, reference, svg, svg text content the <altglyphdef> svg element defines a substitution representation for glyphs. 297 <altglyphitem> deprecated, element, needsexample, reference, svg, svg text content the <altglyphitem> element provides a set of candidates for glyph substitution by the <altglyph> element. 298 <animate> element, svg, svg animation the svg <animate> element provides a way to animate an attribute of an element over time. 299 <animatecolor> deprecated, element, svg, s...
Understanding WebAssembly text format - WebAssembly
ature, locals are listed with their type, for example (local i32). parameters are basically just locals that are initialized with the value of the corresponding argument passed by the caller. getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions. the local.get/local.set commands refer to the item to be got/set by its numeric index: parameters are referred to first, in order of their declaration, followed by 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...
... 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 here — using numeric indices to refer to items can be confusing and annoying, so the text format allows you to name parameters, locals, and most other items simply by including a name prefixed by a dollar symbol ($) just before the type declaration. thus you could rewrite our previous signature like so: (func (param $p1 i32) (param $p2 f32) (local $loc f64) …) and then could write local.get $p1 instead of local.get 0, etc. (note that w...
Module structure of the SDK - Archive of obsolete content
rd-dialog"); var hash = require("../secrets/hash"); external modules as well as using the sdk's modules and writing your own, you can use modules that have been developed outside the sdk and made available to other add-on authors. there's a list of these "community-developed modules" in the sdk's github wiki, and to learn how to use them, see the tutorial on using external modules to add menu items to firefox. to import external modules, treat them like local modules: copy them somewhere under your add-ons "lib" directory and reference them with a path relative to the importing module. for example, this add-on places external modules in a "dependencies" directory: my-addon lib main.js dependencies geolocation.js it can ...
private-browsing - Archive of obsolete content
the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to private browser windows any panel objects will not be shown if the active window is a private browser window the selection module will not include any selections made in private browser windows ...
ui - Archive of obsolete content
you initialize a sidebar with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate wi...
High-Level APIs - Archive of obsolete content
eracting with the browser. unless the documentation explicitly says otherwise, all these modules are "stable": we'll avoid making incompatible changes to them. addon-page create a page that does not contain navigational elements. base64 data encoding and decoding using base64 algorithms. clipboard interact with the system clipboard, setting and getting its contents. context-menu adds items, submenus, and menu separators to the page's context menu. hotkeys assign hotkey combinations to functions in your add-on. indexed-db exposes the indexeddb api to add-ons. l10n localize strings appearing in the add-on's javascript code. notifications display transient, toaster-style desktop messages to the user. page-mod run scripts in the context of web pages whose url matches a given...
core/promise - Archive of obsolete content
eturned by an original function if it were called with fulfillment values of given arguments. this technique is so powerful that it can replace most of the promise utility functions provided by other promise libraries. for example grouping promises to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the initial array. this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core...
io/file - Archive of obsolete content
he file to remove. rmdir(path) removes a directory from the file system. if the directory is not empty, an exception is thrown. parameters path : string the path of the directory to remove. isfile(path) returns true only if this path specifies a file. const fileio = require("sdk/io/file"); let path = "/users/work/"; let list = fileio.list(path); for (i = 0; i < list.length; i++) { let item = fileio.join(path, list[i]); if (fileio.isfile(item)) { console.log(item + " is a file"); } else { console.log(item + " is a directory"); } } parameters path : string the path of the object. ...
test/assert - Archive of obsolete content
using !=: assert.notequal(1, 2, "test that one is not two"); parameters actual : object the actual result. expected : object the expected result. message : string optional message to log, providing extra information about the test. deepequal(actual, expected, message) tests that two objects have a deep equality relation. deep equality is defined in the commonjs specification for assert, item 7, which is quoted here: all identical values are equivalent, as determined by ===. if the expected value is a date object, the actual value is equivalent if it is also a date object that refers to the same time. other pairs that do not both pass typeof value == "object", equivalence is determined by ==. for all other object pairs, including array objects, equivalence is determined by havi...
Displaying annotations - Archive of obsolete content
els.panel({ width: 200, height: 180, contenturl: data.url('annotation/annotation.html'), contentscriptfile: [data.url('jquery-1.4.2.min.js'), data.url('annotation/annotation.js')], onshow: function() { this.postmessage(this.content); } }); execute cfx run one last time. activate the annotator and enter an annotation. you should see a yellow border around the item you annotated: when you move your mouse over the item, the annotation should appear: obviously this add-on isn't complete yet. it could do with more beautiful styling, it certainly needs a way to delete annotations, it should deal with overquota more reliably, and the matcher could be made to match more reliably. but we hope this gives you an idea of the things that are possible with the modul...
Creating Reusable Modules - Archive of obsolete content
...
Getting Started (jpm) - Archive of obsolete content
build an xpi, just execute the command jpm xpi from the add-on's directory: jpm xpi you should see a message like: jpm info successfully created xpi at /path/to/my-addon/@my-addon-0.0.1.xpi to test that this worked, try installing the xpi file in your own firefox installation. you can do this by pressing the ctrl+o key combination (cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog: navigate to the "@my-addon.xpi" file, open it and follow the prompts to install the add-on. note that firefox by default requires add-ons, even locally developed ones, to be signed. after installation they'll show up disabled in the list of installed add-ons, noting the missing signature. during development, or if you don't ...
Getting started (cfx) - Archive of obsolete content
ers can download and install them. to build an xpi, just execute the command cfx xpi from the add-on's directory: cfx xpi you should see a message like: exporting extension to my-addon.xpi. to test that this worked, try installing the xpi file in your own firefox installation. you can do this by pressing the ctrl+o key combination (cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog; navigate to the "my-addon.xpi" file, open it and follow the prompts to install the add-on. summary in this tutorial we've built and packaged an add-on using three commands: cfx init to initialize an empty add-on template cfx run to run a new instance of firefox with the add-on installed, so we can try it out cfx xpi to...
Tutorials - Archive of obsolete content
getting started installation how to install the jpm tool, which you will use for developing add-ons. troubleshooting some pointers for fixing common problems and getting more help. getting started walkthrough of creating a simple add-on with the sdk, using jpm. create user interfaces add a toolbar button attach a button to the firefox add-on toolbar. add a menu item to firefox add items to firefox's main menus. display a popup display a popup dialog implemented with html and javascript. add a context menu item add items to firefox's context menu. interact with the browser open a web page open a web page in a new browser tab or window using the tabs module, and access its content. listen for page load use the tabs module to get not...
Add-on SDK - Archive of obsolete content
test, and package add-ons. interact with the browser open web pages, listen for pages loading and list open pages. development techniques learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. create user interface components create user interface components such as toolbar buttons, context menus, menu items, and dialogs. modify web pages modify pages matching a url pattern or dynamically modify a particular tab. putting it together walkthrough of the annotator example add-on. guides contributor's guide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes.
Drag & Drop - Archive of obsolete content
rvice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var _ios = components.classes['@mozilla.org/network/io-service;1'].getservice(components.interfaces.nsiioservice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = {}, data = {}, len...
Forms related code snippets - Archive of obsolete content
ace(rbgnandend, "")]; othiscal.target.value = (this.innerhtml / 100).tofixed(2).substr(-2) + "\/" + (othiscal.current.getmonth() + 1) + "\/" + othiscal.current.getfullyear(); othiscal.container.parentnode.removechild(othiscal.container); return false; } function buildcalendars () { const afields = document.getelementsbyclassname(sdpclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sdpclass = "date-picker", smonthsnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /* internal usage */ ainstances = [], amonthlengths = [31...
Miscellaneous - Archive of obsolete content
page javascript). var focusedcontrol; window.addeventlistener("load", function(e) { onwindowload(e); }, false); function onwindowload() { gbrowser.addeventlistener("load", onpageload, true); } function onpageload() { pagedoc = document.commanddispatcher.focusedwindow.document; var inputlist = pagedoc.getelementsbytagname('input'); for (var i=1; i<inputlist.length; i++) { inputlist.item(i). addeventlistener("focus", function(e) {onfocusinput(e);}, false); inputlist.item(i). addeventlistener("blur", function(e) {onblurinput(e);}, false); } } function onfocusinput(focusevent) { focusedcontrol = focusevent.originaltarget; } function onblurinput(blurevent) { focusedcontrol = null; } or var element = document.commanddispatcher.focusedelement; inserting text a...
Preferences - Archive of obsolete content
the reason why you should usually pass strings ending with a dot to getbranch(), like prefs.getbranch("accessibility."). another caveat you should be aware of is that nsiprefbranch.getchildlist("",{}) returns an array of preference names that start with that branch's root, for example var branch = prefs.getbranch("accessibility."); var children = branch.getchildlist("", {}); will return these items (for the example tree above): "typeaheadfind.autostart", "typeaheadfind.enablesound", and "usebrailledisplay", not just direct children ("typeaheadfind" and "usebrailledisplay"), as you might have expected. using preference observers changes a user makes to your extension's preferences, such as through an options dialog, may not take effect until the browser is restarted (e.g., if you have ini...
StringView - Archive of obsolete content
world" into italian... */ swhelloworld.rawdata.set((new stringview("ciao mondo!!", "ascii")).rawdata); /* download the new executable file... */ location.assign(url.createobjecturl(new blob([swhelloworld.buffer], { "type": "application\/x-executable" }))); note: the executable above has been compiled with gnu gcc 4.8.1 running on a 64-bit machine with arch gnu/linux. glossary element an item of the backing array (whether uint8array, uint16array, uint32array, etc.) codepoint an unique number for each unicode character. it is rappresented by a collection of 1-6 uint8 elements for utf-8, 1-2 uint16 elements for utf-16, 1 uint32 element for ucs4, 1 uint8 element for ascii, or something else. byte a collection of 8 bits. null codepoint the character whose codepoint is equal to 0 ('\...
Tabbox - Archive of obsolete content
examples: .tabs-closebutton { list-style-image: url(http://mozilla.org/favicon.ico); } .tab...
Common Pitfalls - Archive of obsolete content
it's important to create the uri correctly, and then check that it's secure to load. ...
Deploying a Plugin as an Extension - Archive of obsolete content
ith firefox 1.5, you can use the built-in extension mechanism to make a plugin available to your users. this allows the plugin to be treated like other firefox extensions; it can be upgraded, disabled, or uninstalled using the firefox user interface. in this article, we will create an extension for the rhapsody player engine. normally, this plugin is installed in a local directory, and a registry item is used to let firefox know about the plugin. first, let's take a look at the structure of the xpi file used for a browser plugin. rhapsodyplayerengine_inst_win.xpi install.rdf plugins/ license.rtf nprhapengine.dll the important file here is the install.rdf file. this contains information about our extension; all extensions have one. here's what a basic install.rdf file looks like: <...
Extension Theming Guidelines - Archive of obsolete content
your extension while leaving it open for styling by custom themes. skin packages just as extension code should exist in chrome content packages, all of the styling for an extension including css and images should exist in a chrome skin package. custom themes may then register a replacement for your skin package allowing them to provide their own styles for all of your content. branding certain items of your extensions style, in particular logos and icons can be kept in the chrome content package such that they are not replaceable by custom themes stylesheets guidelines include stylesheets for every new window that your extension adds and for every window that your extension overlays content into be sure to add a stylesheet from your chrome skin package. while it may be tempting to use the ...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
ation dialog, a hash of the xpi file contents (to protect against corrupted downloads), and a tostring function which will allow this code to work with versions of firefox 0.8 and earlier. you could also use the old style parameter block ({ "foo": aevent.target.href }) if you wanted - and didn't have an icon to use for the confirmation dialog. installtrigger.install is then called to install the item with the parameter block. return false; this last part is the most important - the install function must return false so that when the link is clicked, only the script is run, and the link href is not navigated to. if you omit this step, the user may see two installation dialogs—since you've effectively invoked two install requests, one from the installtrigger, one from trying to load the xp...
Adding windows and dialogs - Archive of obsolete content
y the keyboard is an accessibility requirement. you can do this in most firefox windows by pressing the tab key. each tab key press moves you to the next control in the window, giving it focus. in general, there's nothing you need to do in order to have good keyboard focus management. firefox will automatically focus the first input control in your window, and tab focus advances in the order the items are found in the xul document. if you have a very complex layout, or need customized tabbing behavior, you can set the tabindex attribute in the controls. you can also use the focus function to focus an element depending on events such as window load. you should do this carefully, to avoid having inaccessible controls. you can also use the -moz-user-focus css property to enable focusing of elem...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
native: proxy if you cannot override objects or properties easily, e.g. because the object is frozen or sealed, then creating a proxy around the object might be a viable approach. triggering event handlers sometimes scripts might want to manually trigger an event handler that is defined directly in the xul document. consider the following xul fragment throughout the rest of this section. <menuitem id="mymenu" oncommand="executesomething(); executesomethingelse();"/> <label id="mylabel" onclick="executesomething(); executesomethingelse();"/> add-on authors commonly use eval to trigger the handlers. // do not use eval(document.getelementbyid("mymenu").getattribute("oncommand")); eval(document.getelementbyid("mylabel").getattribute("onclick")); alternative: dispatch real events dispatch...
Connecting to Remote Content - Archive of obsolete content
at, though, and then use templates to generate xul and display the data. http debugging when you start debugging http requests, you may find it hard to know exactly what data was sent, especially with post data. we recommend you to use extensions like tamper data. they help you to track http/https requests and responses occurring in firefox. after installation, you can find a tamper data menu item in the menu bar: tools > tamper data or view > sidebar > tamper data once you open the tamper data view, all requests and responses will begin to appear in it. you can discover some interesting things about firefox like this, such as the automatic update urls for extensions, and the behavior of web applications such as gmail. if you click on the "start tamper" button, for every request mad...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
nt.appendchild( jsontodom(["xul:hbox", {}, ["div", {}, ["a", { href: href, key: "link", onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, "stuff"]]], document, nodes)); alert(nodes.link); function addentrytopopup(menupopup, doc, chromewindow) { var newitem = doc.createelement("menuitem"); newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptex...
Getting Started with Firefox Extensions - Archive of obsolete content
npapi plugins, add-ons sdk extensions and bootstrapped extensions. this is an important point to keep in mind if you're building an extension that manipulates other extensions or themes. after installing, look at the main firefox window and see if you notice anything different. did you see it? there's a new menu on the main menu, labeled "hello world!". if you open the menu and then the menu item below, you'll see a nice alert message (for some definitions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-platform installer, because the same installer file can work on all ...
Handling Preferences - Archive of obsolete content
opening a preferences window is to open the add-ons manager, select the add-on, and then click on the preferences button. in order to have this button enabled in your extension you need to add the following line to install.rdf: <em:optionsurl>chrome://xulschoolhello/content/preferenceswindow.xul</em:optionsurl> if you want to open this window from a different place in the ui, such as a menu item or a button in a toolbar, you need to take into account that the opening behavior of a preferences window is different depending on the operating system. this is how we do it: openpreferences : function() { if (null == this._preferenceswindow || this._preferenceswindow.closed) { let instantapply = application.prefs.get("browser.preferences.instantapply"); let features = "...
Setting Up a Development Environment - Archive of obsolete content
e instance of firefox you use to browse normally. make any modifications you want to the xul school project, run make install and restart firefox to see the extension work with your changes. install dom inspector. use it to locate the menu you created. hint: you can search for an element by id. inspect the css rules firefox applies to it by default. look at the final, computed style for the menu items. browse around the rest of the firefox dom, and try to figure out what the nodes correspond to in the firefox ui. install the firebug extension. open the firebug window and go to an ajax-heavy page such as gmail or facebook. open and enable the net tab. try to identify what is going on with some of the requests being sent. now that you know how to quickly monitor your project and test changes...
The Box Model - Archive of obsolete content
tml"> then you can have an html:p (paragraph) element where you insert the result of parsing the property string. you can easily parse xml using the domparser object. since xul documents are strict xml, you can only use strict xhtml in xul, and not the more loosely-formatted forms of html. exercise use the dom inspector extension to look into the firefox chrome. select toolbar buttons, menu items, textboxes, etc. and look into the box model, css style rules and computed style views. look into the computed width and height values, and how the paddings and margins affect the dimensions of xul nodes. modify the hello world extension so that it changes the appearance of firefox drastically using only css. play with changing the dimensions and appearance of buttons, changing the background c...
Firefox addons developer guide - Archive of obsolete content
pported). there are a few things that could be done to make this fit the site better, and for general cleaning up: tables should use the "standard-table" css class so they're styled the same as those on the rest of mdc. there should be some introductory text on the table of contents page at https://developer.mozilla.org/en/firefox_addons_developer_guide obviously there are a number of fixme items in the content that need dealing with, but those are already known. these should use the previous, next, and prevnext templates to add quick routes to get from chapter to chapter. see the xul reference, for example. each chapter should be tagged appropriately, based on content, and every chapter should include the tag "firefox addons developer guide". instead of using footnotes, we should inl...
Add-ons - Archive of obsolete content
including on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of firefox itself. security best practices in extensions this document is intended as a guide for developers to promote best practices in securing your extension. your goal is to keep your users safe. some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons. other items are recommendations. the difference will be clearly flagged. setting up an extension development environment this article provides suggestions for how to set up your mozilla application for extension development. these details apply to firefox, thunderbir...
XML data - Archive of obsolete content
the most common values for the display property are: block displayed like html's div (for headings, paragraphs) inline displayed like html's span (for emphasis within text) add your own style rules that specify the font, spacing and other details in the same way as for html. more details other values of display display the element like a list item, or like a component of a table. for the full list of display types, see the display property in the css specification. using css alone, the structure of the display must be the same as the structure of the document. other technologies can modify the structure of the display—for example, xbl can add content, and javascript can modify the dom. for more information about xml in mozill...
Localizing an extension - Archive of obsolete content
escribes how to do it. note that the urls of the dtd files don't actually include the name of the localization to use. the chrome registry resolves the uris based on the user's current locale setting and the data you provide in your chrome manifest. then we simply replace each text string in our xul files with the corresponding entity. for example, in stockwatcher2.xul, we change this line: <menuitem label="refresh now" oncommand="stockwatcher.refreshinformation()"/> to <menuitem label="&menu_refresh_now.label;" oncommand="stockwatcher.refreshinformation()"/> do this for every string used in each xul file. update the chrome manifest to let firefox know about the locale files, we need to make a revision to our chrome.manifest file, adding one line for each localization: locale stockwatcher...
No Proxy For configuration - Archive of obsolete content
the relevant code lives in nsprotocolproxyservice.cpp. nsprotocolproxyservice::prefschanged - loads preferences nsprotocolproxyservice::loadfilters - parses filters nsprotocolproxyservice::examineforproxy - decides to check filters if configuration is "manual" nsprotocolproxyservice::canuseproxy - performs url vs. ...
Source code directories overview - Archive of obsolete content
ains the c interfaces and code for the layout engine. the layout engine decides how to divide up the "window real estate" among all the pieces of content. it resizes and aligns pieces of content according to the css1 and css2 (cascading style sheets), alignment styles and the content itself. it does not actually render the content; it just assigns different pieces of the window to various content items. this is known as "reflowing" the content. this code is also known by the names, "nglayout" and "gecko." lib contains c code used for reference by developers in programming the mac. it is not used. it shows how to embed the mozilla browser in a mac application as well as some sample file-handling code from apple. mailnews contains c interfaces and code for the mail and news component (i.e. mes...
Using content preferences - Archive of obsolete content
ting" preference. var value = prefservice.getpref(uri, "devmo.somesetting"); built-in site-specific preferences preference name menu equivalent values notes browser.content.full-zoom view / zoom example: "1.10000002384186" (rounding variant of "1.1") related about:config preferences: browser.zoom.full boolean, set by the menu item view / zoom / zoom text only. despite the confusion in names, this preference is not site-specific. browser.zoom.sitespecific toolkit.zoommanager.zoomvalues zoom.maxpercent and zoom.minpercent browser.download.lastdir path of a filesystem directory related about:config preferences: browser.download.lastd...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
ave a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the comma - matches are whole-word only) and value 0x5, the assert would automatically be ignored. if you also had a dword named "3173", it would have no effect here because the handler stops comparing values at the first match. note that double quotes which delimit an item (") are ignored in value names and the assertion string, so "silly" and silly will both be matched by a value named silly. "silly", will only be matched by a value named "silly", since the quotes are internal to the string. ...
Finding the file to modify - Archive of obsolete content
status icon to mozilla, we need to find the xul file that defines the structure of the browser window. the best way to find a xul file for a window is to use the dom inspector. the dom inspector is a tool bundled with mozilla that allows you to examine the dom of web pages and xul windows. to access it, go to the "tools" menu, select the "web development" submenu, then select the "dom inspector" item. the dom inspector will load in a new window. in the dom inspector window, go to the file menu, select the inspect a window submenu, then select the mozilla browser window item (named after the page currently loaded in the browser). the dom inspector will display the url of the xul file that defines the mozilla browser window, which is chrome://navigator/content/navigator.xul. a chrome url is a...
Creating a Mozilla Extension - Archive of obsolete content
ut of date. this tutorial describes how to create an extension for the old versions of mozilla suite (currently seamonkey). see building an extension for an up-to-date tutorial (it focuses on firefox, but is also applicable to other new applications). a mozilla extension is an installable enhancement to the mozilla browser that provides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox, mozilla.org's we...
Devmo 1.0 Launch Roadmap - Archive of obsolete content
comments, ideas, questions and other discussion should be added on the devmo talk:1.0 launch roadmap page. further details on smaller tasks being done are available at user:dria:todo page. see also current events. design document items things that need to happen prior to a devmo 1.0 launch... timeline currently undetermined. ...
Drag and Drop Example - Archive of obsolete content
the user can click on one of several xul elements on the palette and drag it onto a stack element to create an element of a particular type. ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
d dropped onto a directory, the file flavor will be used. if the file is dropped onto a textbox, the text name flavor will be used. the text is therefore used to insert the name of the file when files can't be dropped directly. a flavor object has a name, which is a formatted like a mime type, such as 'text/unicode'. within the ondragstart function, you specify what flavours are available for the item being dragged. to do this, add data and flavours to the transferdata object, which is the second argument to ondragstart. an example should help here. the ondragstart function adds data to the transferdata object. var textobserver = { ondragstart: function (event, transferdata, action) { var htmltext = "<strong>cabbage</strong>"; var plaintext = "cabbage"; transferdata.data = new t...
Editor Embedding Guide - Archive of obsolete content
makes ordered list from selection or inserts new list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_removelist cmd_ul makes unordered list from selection or inserts new list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_removelist cmd_dt inserts list item (dt element). getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_removelist cmd_dd inserts list item (dd element). getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_removelist cmd_removelist removes list from selection. getcommandstate ??? docommand no parameters cmd_indent indents current selection. ...
Layout FAQ - Archive of obsolete content
show the view until afterwards, but if none are pending, show the view immediately? what is the best way to determine whether there are any pending changes? on the reflow branch you could check the dirty and dirty_children framestate flags. that won't help with pending style changes, but it'll work to detect cases when the popup or something in it needs to be reflown. ...
Layout System Overview - Archive of obsolete content
be too slow, at least on low-end machines. thus the html editor and text controls put considerable performance requirements on the layout system's handling of dynamic content manipulation. the fundamentals of frames: block and line there are many types of frames that are designed to model various formatting requirements of different html and xml elements. css2 defines several (block, inline, list-item, marker, run-in, compact, and various table types) and the standard html form controls require their own special frame types to be formatted as expected. the most essential frame types are block and inline, and these correspond to the most important layout concepts, the block and line. a block is a rectangular region that is composed of one or more lines. a line is a single row of text or other p...
Simple Storage - Archive of obsolete content
on");jetpack.future.import("storage.simple");// create the persistent notes array if it doesn't already exist.jetpack.storage.simple.notes = jetpack.storage.simple.notes || [];var notes = jetpack.storage.simple.notes;// updates the jetpack menu with the current notes. we'll add a notes menu with// a submenu, which lists all the notes. if there are no notes, we'll show a// disabled "(empty)" menuitem.function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ? notes : [{ label: "(empty)", disabled: true }]) });}// modify the page's context menu by sneaking in before it's shown. if there's// a selection, add a note menuitem that makes a new note. otherwise, don't// modify the menu at al...
Simple Storage - Archive of obsolete content
pack.future.import("storage.simple"); // create the persistent notes array if it doesn't already exist. jetpack.storage.simple.notes = jetpack.storage.simple.notes || []; var notes = jetpack.storage.simple.notes; // updates the jetpack menu with the current notes. we'll add a notes menu with // a submenu, which lists all the notes. if there are no notes, we'll show a // disabled "(empty)" menuitem. function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ? notes : [{ label: "(empty)", disabled: true }]) }); } // modify the page's context menu by sneaking in before it's shown. if there's // a selection, add a note menuitem that makes a new note. otherwise, don't // modify th...
statusBar - Archive of obsolete content
the class statusbar contains functions to add and control the statusbar of the browser. you can find the complete sourcecode in the status-bar-panel.js file in your jetpack repository. namespace: jetpack.statusbar methods copybackground embediframe append the append methods adds a new item to the statusbar. many of the options are optional. syntax jetpack.statusbar.append(options); possible options are: url width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended. its acutally not implemented in the current version. onready (event) occurs when the item was loaded onunload (event) triggers when the item was removed. example jetpack.statusbar.append({ html: 'hello <i>...
Mozilla Application Framework in Detail - Archive of obsolete content
very powerful since you could make improvements to the underlying application logic without having to rewrite the higher level code. our platform also can take advantage of other internet standards such as xslt and rdf. rdf, a core element to the framework, allows you to define dynamic elements in your ui (elements that may change after you have completed the application, such as a "history" menu item). xslt could be used to translate information from web services, rss, soap, or other xml-based languages and convert them into a form that you might display in your user interface. the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices. this innovation in browser tech...
Prism - Archive of obsolete content
ir and google gears. operating-system integration: binary components provided access to os-specific features like shortcut creation and dock/tray icons. we intend to propose these extensions for inclusion in future versions of xulrunner. firefox extension: a firefox extension, code-named "refractor", can be used to spin out new prism apps from inside the web browser. refractor adds a new menu item to call up the shortcut creation dialog for inside firefox. web apps can also point to a complete web app bundle or some elements of a web app (like higher resolution icons). refractor automatically takes this information into account. documentation frequently asked questions bundles ...
Frequently Asked Questions - Archive of obsolete content
can't do either of these things you should still feel free to ask us friendly questions and give us constructive feedback. who's currently working on what? other than reviewing patches and fixing the occassional bug, alex is currently taking a break from active svg development to concentrate on 'real work' and cool stuff like xtf and jssh. tim is working on implementing <filter> and working on items that need to be done before turning on svg by default. after recently implementing gradients, scooter is working on fixing some issues that remain outstanding and fixing <switch>. jonathan is working on various bugs, especially those that need to be fixed before svg can be enabled in the official builds. david continues to create svg enabled nightlies and answer build related questions as he has...
Supporting per-window private browsing - Archive of obsolete content
her they should be classed as private or not (for example, whether the uri being persisted by saveuri should be added to the permanent download history). to do this, import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.getprivacycontextfromwindow(win), passing a window object that is related to the content in question. as an example, if an add-on adds a context menu item that accesses an api that requires an nsiloadcontext, the most relevant window is the one that owns the element being targeted by the context menu (element.ownerdocument.defaultview). if some action triggered by a chrome element (such as a button) requires an api that takes a privacy context, the most relevant window is the one that contains the chrome element. in some cases, there is no logical ...
Elements - Archive of obsolete content
racteristics of an existing element. for example, use the value 'xul:button' to create an element that is displayed like a button. the part before the colon is a namespace prefix so you must declare the xul namespace as well. not all tags have a unique display type. the following xul display types may be used: browser, button, checkbox, description, editor, grippy, iframe, image, label, menu, menuitem, menubar, progressmeter, radio, resizer, scrollbar, scrollbox, spacer, splitter, titlebar, treechildren and treecol. you may also use a number of html, mathml and svg tags. the 'display' attribute does not work unless the extends attribute is set, see bug bug 119389. in that case, put the value of the display attribute into the extends attribute. inheritstyle - the inheritstyle attribute indicat...
Using XPInstall to Install Plugins - Archive of obsolete content
i packages, like zip files, "contain" other files, typically: the software component to be installed. in our case, this is the plugin software. a javascript file called install.js, which is the install logic that drives the installation. this includes instructions on where to install the software, and what messages to feed to the user. you can create an xpinstall file by first zipping all the items you want installed with winzip (create a zip archive) and then renaming it with the xpi file extension instead of the zip file extension. unlike native code installers (for example, files called setup.exe), the programming language for install operations in xpi is javascript. since the file format that contains the software and the install.js javascript file is a cross-platform file (zip) and si...
accesskey - Archive of obsolete content
this should be one of the characters that appears in the label attribute for the element. on non-macintosh platforms, the character on the element's label matching the accesskey is underlined. for example, when a menu labeled 'file' has an accesskey of 'f', the generated label will be 'file'. ...
allowevents - Archive of obsolete content
« xul reference home allowevents type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. on listitem and titlebar elements, mouse events normally do not get sent to their children; instead they are retargeted to the listitem and titlebar element itself. this means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list. by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements. for menu, menuseparator, menuitem and treecol elements, as well as menu buttons, and the popup datepicker, mouse events are also retargeted to the element itself. however, the ...
autofill - Archive of obsolete content
...
closemenu - Archive of obsolete content
« xul reference home closemenu type: one of the values below indicates if the menu closes when the menuitem is activated. auto this, the default value if the closemenu attribute is not specified, closes up the menu and all parent menus. single the menu the item is contained within is closed, but the parent menus remain open. none no menus are closed. ...
current - Archive of obsolete content
« xul reference home current type: boolean this attribute will be set to true if the listitem is the current item. this is typically used by a theme to customize the focus ring. to change the currently selected item in a listbox, use the listbox property selecteditem. ...
currentset - Archive of obsolete content
« xul reference home 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". this isn't necessary the *current* set, i.e. it might not be equal the value of the currentset property which is computed from the actual dom ...
defaultset - Archive of obsolete content
« xul reference home defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar. this should be set to a comma-separated list of item ids from the toolbarpalette. for example, back-button,forward-button,print-button. ...
disableKeyNavigation - Archive of obsolete content
« xul reference home disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. ...
disableautoselect - Archive of obsolete content
« xul reference home disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is false, the selection is never updated to match the text box. this attribute applies only to editable menulists. ...
disabled - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by removing the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this a...
droppedLinkHandler - Archive of obsolete content
tion this function is called when links are dropped to the browser element, with the following arguments. droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface ...
forcecomplete - Archive of obsolete content
...
ignorekeys - Archive of obsolete content
...
keytext - Archive of obsolete content
« xul reference home keytext type: string a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. ...
listcell.type - Archive of obsolete content
...
maxrows - Archive of obsolete content
...
menuactive - Archive of obsolete content
« xul reference home menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over. typcially, the theme will use this to highlight the item. a dommenuitemactive event will be sent to the item when the item is hovered over, and a dommenuiteminactive event will be sent to the item when the selection moves away. ...
minresultsforpopup - Archive of obsolete content
...
name - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › name
« xul reference home see also menuitem.name preference.name query.name ...
onchange - Archive of obsolete content
« xul reference home overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e. window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="hori...
oncommand - Archive of obsolete content
« xul reference home oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. example 1: in-line code <button label="click me" oncommand="alert('hi')"/> example 2: function with source argument <button label="click me" oncommand="dosomeprocessing(event.target)"/> and here is the definition of the function: function dosomeprocessing(source) { alert("source: " + source); return true; } see also command element ...
oncommandupdate - Archive of obsolete content
...
selected - Archive of obsolete content
« xul reference home selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. see also visuallyselected ...
selectedIndex - Archive of obsolete content
...
statedatasource - Archive of obsolete content
« xul reference home statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information. this is used to hold which tree items are open and which items are collapsed. this information will be remembered for the next time the xul file is opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). ...
statusbar - Archive of obsolete content
...
statustext - Archive of obsolete content
« xul reference home statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. example <!-- sets the status message when mouse is over buttons --> <button label="connect" statustext="connect to remote server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <button label="ping" statustext="ping the server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <statusbar> <statusbarpanel id="mystatuspanel" label="" flex="1"/> <spacer flex="1"/> ...
suppressonselect - Archive of obsolete content
if set to true, the select event is never fired. ...
textbox.autoFill - Archive of obsolete content
as of gecko 1.9.1, this attribute is now always specified in lower case. ...
textbox.forceComplete - Archive of obsolete content
as of gecko 1.9.1, this attribute is now always specified in lower case. ...
textbox.minResultsForPopup - Archive of obsolete content
as of gecko 1.9.1, this attribute is now always specified in lower case. ...
tree.onselect - Archive of obsolete content
see the tree selection page on the tutorial for more information. ...
type - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › type
see button.type browser.type colorpicker.type datepicker.type editor.type listcell.type listitem.type menuitem.type notification.type prefwindow.type query.type script.type textbox.type toolbarbutton.type treecol.type ...
visuallyselected - Archive of obsolete content
type: boolean new in firefox 40. indicates that a tab is selected. the visuallyselected attribute is set asynchronously, once the browser has switched to the selected tab. if your code needs to apply some styling to the currently selected tab, this is the attribute you should use from firefox 40 onwards. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. ...
Building accessible custom components in XUL - Archive of obsolete content
chnologies could only see the generic html markup used to build the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a treeview). by implementing dhtml accessibility techniques, web developers can declare that generic html elements are really acting as specific gui controls (such as a treeitem within a treeview). firefox 1.5 is the first browser to support dhtml accessibility; it maps the declarations within the html page to the underlying accessibility architecture so that assistive technologies can "read" a web page and know how to present these complex controls to the end user. this has all been well-documented for some time. however, it is less well-known that the same dhtml access...
Deprecated and defunct markup - Archive of obsolete content
like <label> or <description> but does not wrap; like <label crop="end">; had been used in menus/toolbars) <textfield> (like <textbox>) <thumb> (<button> with deprecated <gripper>; implements sliding box in center of scrolbar) <title> (to add a caption on a <titledbox> <titledbox> (box with a frame) <titledbutton> (attempt to combine text and images before <button>) <toolbarpaletteitem> required to embed non-buttons in customisable toolbars --neil 03 march 2011 <treebody> (old/experimental and unsupported xul tags) lives on as the internal name for the ancestor <treechildren> element --neil 03 march 2011 <treecaption> (old/experimental and unsupported xul tags) <treecolgroup> (former name for <treecols> <treecolpicker> (internal use only; part of xbl for <tree>) ...
ensureSelectedElementIsVisible - Archive of obsolete content
...
getIndexOfFirstVisibleRow - Archive of obsolete content
« xul reference home getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. ...
goDown - Archive of obsolete content
Archive › Mozilla › XUL › Method › goDown
...
goUp - Archive of obsolete content
Archive › Mozilla › XUL › Method › goUp
...
moveByOffset - Archive of obsolete content
« xul reference home movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items. if offset is negative, adjusts the focused item backward by that many items. if isselecting is true, then the selection is also adjusted. if isselectingrange is also true, then the new item is selected in addition to any currently selected items. if isselectingrange is false, any existing selection is cleared. items that are hidden are skipped. ...
openPopup - Archive of obsolete content
osition by some number, measured in css pixels. an unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the ev...
selectAll - Archive of obsolete content
a select event is sent after the selection is made. ...
timedSelect - Archive of obsolete content
« xul reference home timedselect( item, timeout ) return type: no return value selects the item specified by the argument item after the number of milliseconds given by the timeout argument. all other items are deselected. ...
children - Archive of obsolete content
...
control - Archive of obsolete content
« xul reference control type: element id gets and sets the value of the control attribute. see also menuitem.control radio.control tab.control ...
controllers - Archive of obsolete content
ller-example" title="controller example" onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function init() { var list = document.getelementbyid("thelist"); var listcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_delete"); }, iscommandenabled : function(cmd){ if (cmd == "cmd_delete") return (list.selecteditem != null); return false; }, docommand : function(cmd){ list.removeitemat(list.selectedindex); }, onevent : function(evt){ } }; list.controllers.appendcontroller(listcontroller); } </script> <listbox id="thelist"> <listitem label="ocean"/> <listitem label="desert"/> <listitem label="jungle"/> <listitem label="swamp"/> </listbox> </window> ...
currentIndex - Archive of obsolete content
var tree = document.getelementbyid("my-tree"); var selection = tree.view.selection; var celltext = tree.view.getcelltext(tree.currentindex, tree.columns.getcolumnat(0)); alert(celltext); } </script> <tree id="my-tree" seltype="single" onselect="treerowclicked()"> <treecols> <treecol label="title" flex="1"/><treecol label="url" flex="1"/> </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.currentindex ...
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar. for spacers, separators, and flexible spacers the following strings are used instead of ids: "spacer", "separator", "spring". an empty toolbar has a currentset value of "__empty". you may change the current set of items by setting this property. be careful, as setting this property doesn't automatically update the currentset attribute. ...
description - Archive of obsolete content
...
firstPermanentChild - Archive of obsolete content
« xul reference firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar. a permanent child is one that is not customizable and remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. ...
label - Archive of obsolete content
Archive › Mozilla › XUL › Property › label
« xul reference label type: string gets and sets the value of the label attribute. see also richlistitem.label textbox.label ...
lastPermanentChild - Archive of obsolete content
« xul reference lastpermanentchild not in seamonkey 1.x type: element the last permanent child of the toolbar. a permanent child is one that is not customizable and remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. ...
listbox.currentIndex - Archive of obsolete content
(or, on some platforms, typeof(listboxcurrentindex) will be undefined) in a single selection list, the current index will always be the same as the selected index. ...
menulist.image - Archive of obsolete content
...
selected - Archive of obsolete content
...
selectedCount - Archive of obsolete content
...
selstyle - Archive of obsolete content
« xul reference selstyle type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected. otherwise, the entire row will be highlighted. to see the difference, compare the selection style in the folder list and the message list in mozilla mail. ...
tag - Archive of obsolete content
Archive › Mozilla › XUL › Property › tag
reference tag type: tag name this may be set to a tag name. if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag. for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag. thus, nested elements will not match because they are directly inside a treeitem. this attribute is useful to provide different rules for outer and inner elements. ...
view - Archive of obsolete content
Archive › Mozilla › XUL › Property › view
« xul reference view type: nsitreeview the view for the tree, which is the object which generates the data to be displayed. you can assign an object which implements nsitreeview to this property. trees built from rdf or those which use treeitems directly will already have a view. functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others. for a complete list of view functions, see the nsitreeview interface. ...
Style classes - Archive of obsolete content
Archive › Mozilla › XUL › Style
« xul reference home alert-icon chromeclass-toolbar error-icon groove header indent listcell-iconic listitem-iconic menuitem-iconic menuitem-non-iconic message-icon monospace plain question-icon small-margin statusbarpanel-iconic statusbarpanel-iconic-text statusbarpanel-menu-iconic text-link thin tree-splitter treecol-image ...
Additional Template Attributes - Archive of obsolete content
ariables are determined by the template builder automatically. the container or starting node variable is specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body. it is also possible to be explicit about the two variables by using two attributes on the <template> element. <template container="?first" member="?item"> the container and member attributes can be used to specify the container and member variables. this isn't particularly useful although there is a very slight optimization since the builder does not need to scan the action body looking for the member variable when compiling the queries and rules. you might also use these attributes just to make the code clearer when using very complex queries. ...
Bindings - Archive of obsolete content
t it wasn't filled in by the user. <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"/> dc:description="view from the top of the tower looking east of the doges palace"/> if you try a full example based on this data, you will notice that only one result has been generated. this is because only one item has a description. here is the data after the first <triple> has been evaluated. (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?title = 'canal') (?start = http://www.xulplanet.com/rdf/myph...
Multiple Queries - Archive of obsolete content
sk.jpg) so four possible results are available, one from the first query and three from the second. however, the example shows that only content for three results are generated. what happened to the fourth result? this is where the useful aspect of multiple queries comes in. note that two of the results above are actually for the same photo (canal.jpg). the template builder removes any duplicate items before generating content. it does this by only allowing the match for the earliest query. that is, the canal.jpg generated by the second query is removed, since an earlier query (the first query) already generated a match for that result. one important distinction is that the determination of duplicates is only based on the member variable, in this case the ?photo variable. it doesn't matter wh...
Namespaces - Archive of obsolete content
<listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <rule ns:gender="male"> <label uri="?" ...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
on="8"/> </hbox> </toolbar> <!-- mail, message --> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="15"/> </hbox> <!-- composer --> <toolbar id="edittoolbar"> <toolbarbutton id="custom-button-1" position="18"/> </toolbar> <!-- chat --> <menubar id="mainmenu"> <menu id="custom-menu" position="4" label="custom" accesskey="c"> <menupopup> <menuitem id="custom-item-1" label="custom item 1" accesskey="1" tooltiptext="my custom menu item" oncommand="custombutton[1]()" /> </menupopup> </menu> </menubar> <!-- calendar --> <toolbar id="calendar-bar"> <toolbarbutton id="custom-button-1" position="10"/> </toolbar> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" ...
Toolbar customization events - Archive of obsolete content
s contain any data; if you need details, you'll need to look at the toolbar. beforecustomization this event is delivered when the user starts the toolbar customization process; for example, by right-clicking on a toolbar and choosing "customize". customizationchange this event is delivered when the user makes a change to a toolbar while editing the toolbars, either by dragging an item to the toolbar or by dragging an item out of it. aftercustomization this event is delivered when the user closes the toolbar customization panel. in all cases, the event.target is the toolbox being customized. you can look at the contents of that element and its children to determine what changes were made. example in this example, we watch for toolbar changes. window.addeventlistener("b...
Adding Properties to XBL-defined Elements - Archive of obsolete content
d the dom provide access to get and set the properties of elements. with xbl, you can define your own properties for the elements you create. you can also add methods that can be called. that way, all you need is to get a reference to the element (using document.getelementbyid or a similar function) and then get or set the additional properties and call the methods on it. there are three types of items you can add. fields are used to hold a simple value. properties can also be used to hold a value but may have code execute when an attempt is made to retrieve or modify the value. methods are functions which may be executed. all three are defined within an implementation element, which should be a child of the binding element. within the implementation, you define individual field, property...
Creating a Skin - Archive of obsolete content
-image: url("chrome://global/skin/icons/images/close-button.jpg"); } button:hover { color: #000066; } we add some images to the buttons and make the find button have bold text to indicate that it is the default button. the last rule applies to buttons when the mouse is hovering over them. we set the text color to dark blue in this case. finally, some minor changes to the spacing around the items, by setting margins: tabbox { margin: 4px; } toolbarbutton { margin-left: 3px; margin-right: 3px; } after those changes, the find files dialog now looks like the image. as you can see, some simple changes to the style rules has resulted in quite a different appearance to the find files dialog. we could continue by changing the menus, the grippies on the toolbar and the input and che...
Creating a Window - Archive of obsolete content
by scripts. you will usually put an id attribute on all elements. the name can be anything you want although it should be something relevant. title="find files" the title attribute describes the text that would appear on the title bar of the window when it is displayed. in this case the text 'find files' will appear. orient="horizontal" the orient attribute specifies the arrangement of the items in the window. the value horizontal indicates that items should be placed horizontally across the window. you may also use the value vertical, which means that the items are placed in a column. this is the default value, so you may leave the attribute off entirely if you wish to have vertical orientation. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this line declare...
Creating a Wizard - Archive of obsolete content
t href="chrome://global/skin/" type="text/css"?> <wizard id="example-window" title="select a dog wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <wizardpage> <description> this wizard will help you select the type of dog that is best for you." </description> <label value="why do you want a dog?"/> <menulist> <menupopup> <menuitem label="to scare people away"/> <menuitem label="to get rid of a cat"/> <menuitem label="i need a best friend"/> </menupopup> </menulist> </wizardpage> <wizardpage description="dog details"> <label value="provide additional details about the dog you would like:"/> <radiogroup> <caption label="size"/> <radio value="small" label="small"/> <rad...
Modifying the Default Skin - Archive of obsolete content
ns that the browser menu bar, the bookmarks menu bar and even the find files menu bar will be red. skin packages to have the change affect only one window, change the style sheet associated with that xul file. for example, to add a red border around the menu commands in the bookmarks manager window, add the following to bookmarksmanager.css in the classic.jar or your favorite skin archive. menuitem { border: 1px solid red; } if you look in one of the skin archives, you will notice that each contain a number of style sheets and a number of images. the style sheets refer to the images. you should avoid putting references to images directly in xul files if you want your content to be skinnable. this is because a particular skin's design might not use images and it may need some more comple...
More Event Handlers - Archive of obsolete content
' event is sent to a popup just before it is displayed. the default action is to display the popup. if the default action is prevented, the popup will not be displayed. the default action can be prevented with the event object's preventdefault method, as in the example below. example 3 : source view <button label="types" type="menu"> <menupopup onpopupshowing="event.preventdefault();"> <menuitem label="glass"/> <menuitem label="plastic"/> </menupopup> </button> alternatively, for attribute event listeners, you can just return false from the code. note that preventing the default action is not the same as stopping event propagation with the stoppropagation method. even if the default action has been prevented, the event will still continue to propagate. similarly, calling the stopp...
Stack Positioning - Archive of obsolete content
placement of stack children normally, the child elements of a stack stretch to fit the size of the stack. however, you may also place the children at specific coordinates. for example, if a stack has two buttons as children, one may be placed 20 pixels from the left edge and 50 pixels from the top edge. the second button can be placed at 100 pixels from the left edge and 5 pixels from the top edge. the position of a child element may be specified by placing two attributes on the element. for the horizontal position, use the left attribute and for the vertical position, use the top attribute. ...
Toolbars - Archive of obsolete content
arbutton label="back"/> <toolbarbutton label="forward"/> </toolbar> </toolbox> this has created a toolbar containing two buttons, a back button and a forward button. the one toolbar has been placed inside the toolbox. this has involved four new tags, which are described here. toolbox a box that contains toolbars. toolbar a single toolbar that contains toolbar items such as buttons. toolbarbutton a button on a toolbar, which has all the same features of a regular button but is usually drawn differently. the toolbar is the main element that creates the actual toolbar. inside it are placed the individual toolbar items, usually buttons, but they can be other elements. in the example above, only one toolbar was created. multiple toolbars can be...
Urlbar-icons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. (the url bar is also known as the address bar and the navigation bar.) example the default contents of browser.xul: <hbox id="urlbar-icons"> <button be="" chromedir="ltr" class="urlbar-icon" click="" for="" id="safebrowsing-urlbar-icon" img="" level="safe" might="" onclick="godocommand('safebrowsing-show-warning');" page="" style="-moz-user-focus:" tooltiptext="this" type="menu"> <img class="urlbar-icon" id="star-button" onclick="placesstarbutton.onclick(event);" /> <img address="" chromedir="ltr" class="urlbar-icon" id="go-button" in="" location=""...
Using Visual Studio as your XUL IDE - Archive of obsolete content
tab. you should be able to use the schema in other ide's too. there is also project that provides xml schema for install manifest files (install.rdf) - installrdfschema.codeplex.com - from the same author as a xul schema. the codeplex-page provides some instructions for installing the schema, but there is an easier way. if you already have a xml or xul file opened, visual studio will add the menu item xml to the main menu. just use xml > schemas... to add the xul.xsd from the package that you have downloaded. the other xsd files will be added automatically. visual studio will use the schema based on the namespace, so make sure your window element uses the correct xul namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul. 3. xbl if you are writing your own elements in xbl, yo...
Using the Editor from XUL - Archive of obsolete content
. nseditorshellmouselistener this is an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor. note: this is ugly, and should probably be redesigned to work on callbacks out of the editor, or moved entirely to javascript. the nseditorshellmouselistener essentially calls nseditorshell::handlemouseclickonelement to show property dialogs for items that you double-click on. the path of a key press so what happens to a key press once it's got to the nstexteditorkeylistener? how does that end up in the document? let's trace through. nstexteditorkeylistener::keypress() gets the key press event. for normal character keys, that falls into nshtmleditor::editorkeypress(). nshtmleditor::editorkeypress() gets the character code from t...
XUL Accesskey FAQ and Policies - Archive of obsolete content
es. if not, try the first letter of the first word in the prompt. next, try the first letter of another word in the prompt. finally, use any non-silent letter in an action word (do these after the rest of the dialog has accesskeys chosen). common elements that don't get accesskeys ok buttons. cancel buttons. close buttons. tab panel labels. toolbar buttons tree items list items column headers are there any crucial bugs i should know about? bug 143065 - scope of accesskeys is not limited to the current tab panel. where do accesskeys need to be added? look for dependencies of bug 129179 (the xul accesskey hookup meta bug), or look for bugs with "accesskey" or "mnemonic" in the summary, or look for dialogs where there are no elements with underli...
XUL element attributes - Archive of obsolete content
the uri of an rdf predicate that serves as a secondary key for sorted content. statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. style type: css inline style css style rules to be applied to the element. syntax is as in the html style attribute. it is preferred to put style rules in style sheets. template type: id for template generated elements, this attribute may optionally be placed on the root node (the element with the datasources attribute) to refer to a template that exists else...
broadcaster - Archive of obsolete content
you want elements to respond to a state change. any elements that are observing the broadcaster will share the attributes placed on the broadcaster. for instance, if the broadcaster has a label attribute, the observers will use that label. if the label changes, the labels of the observers will update automatically. an onbroadcast event will be sent to the observers when a change is made. for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead. more information is available in the broadcasters and observers xul tutorial. examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment...
browser - Archive of obsolete content
tion this function is called when links are dropped to the browser element, with the following arguments. droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface homepage type: url this attribute allows you to set a homepage for the browser element. it does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page. you can switch to this home page using the gohome method. showcaret type: boolean whether or not to cause a typing caret to be visi...
datepicker - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. firstdayofweek type: integer 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 ...
dialogheader - Archive of obsolete content
side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title. title type: string the text to appear in the title bar of the window. properties inherited properties align, , allowevents, , boxobject,...
keyset - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, ,...
notification - Archive of obsolete content
mples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the 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. persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them. this may be used to close a set of notifications as a group without affecting other notifications. priorit...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. min type: integer the minimum value the control'...
tabbox - Archive of obsolete content
stener is set up. the initial value for this property is determined by the value of the eventnode attribute. handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute. handlectrltab type: boolean gets and sets the value of the handlectrltab attibute. selectedindex type: integer returns the index of the currently selected item. you may select an 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 modify the selected panel. a select event will be sent when the selected panel is ...
textbox - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. focused type: boolean this attribute is true if the element is focused. emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but...
timepicker - Archive of obsolete content
est you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed 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. hideseconds type: boolean indicates whether to show the seconds field. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. increment type: integer in...
toolbargrippy - Archive of obsolete content
tnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarset - Archive of obsolete content
, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarspacer, toolbox ...
treechildren - Archive of obsolete content
ll(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata example <tree flex="1"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="subject" label="subject" flex="2"/> </treecols> <treechildren> <treeitem> <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> related elements tree, treecols, treecol, treeitem, treerow, treecell an...
treecols - Archive of obsolete content
interfaces nsiaccessibleprovider ...
treeseparator - Archive of obsolete content
...
wizardpage - Archive of obsolete content
laced inside the wizardpage element. more information is available in the xul tutorial. attributes description, label, next, pageid properties next, pageid attributes description type: string descriptive text to appear in addition to the dialog title. 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. next type: id set to the pageid of the next wizardpage after this one. when set, the page with this pageid is displayed when the next button is pressed. this can be used to create wizards that do not have a linear sequence. if one of the pages has a next attribute, all of the ...
MacFAQ - Archive of obsolete content
g your application for ordinary work, you can just navigate via finder to /applications/(vendor)/(name).app and open the application. for command-line work, you would call on: /applications/(vendor)/(name).app/contents/macos/xulrunner ui notes menus to enable your application quit command to work with the application menu (the one to the right of the blue apple), you need to give your quit menu item an id of "menu_filequititem". to enable the mac "about" menu make sure that you use "aboutname" as the id for your menu item to enable the mac "preferences" menu make sure that you use "menu_preferences" as the id for your options/preferences menu item toolbars mac windows have a small "jelly bean" button in the top right corner. this button is used to show/hide the toolbar. the toolkit will a...
XULRunner tips - Archive of obsolete content
keep them in source control to be sure i can maintain compatibility) component viewer need custom build, first of all. what else? extension developer's extension extension developer's extension is a useful tool, featuring live xul editor and javascript shell. to install the extension into your application you'll need to hack its install.rdf (see above). you'll probably also want to create menuitems that let you open the js shell and other tools provided by the extension. branding branding is a chrome package containing product-specific information (e.g. the product name, vendor, and logo). some xulrunner components (in particular, the extension manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/l...
Using Crash Reporting in a XULRunner Application - Archive of obsolete content
xulrunner application authors who wish to use crash reporting must run a crash reporting server. please see the socorro project for more information. to enable crash reporting on the client, set the following items in application.ini: [crash reporter] enabled=true serverurl=https://your.server.url/submit note: because crash reports can contain private data including passwords, in production environments they should only be sent via https. ...
What XULRunner Provides - Archive of obsolete content
apis and user interface for installing, uninstalling, and upgrading xul applications. see the wikimo:xul:installation story. ...
XUL Application Packaging - Archive of obsolete content
application. optional - default value is any xulrunner less than xulrunner 2 example: maxversion=1.8.0.* the [xre] section the xre section specifies various features of xulrunner startup that can be enabled enableextensionmanager specifies whether to enable extensions and extension management. legal values are 1 and 0. optional - default is 0 note: this option does not add menu items that make the extension/theme manager available in the ui; that is the responsibility of the application author. example: enableextensionmanager=1 enableprofilemigrator specifies whether, when the application is launched for the first time and there are no profiles, to enable profile migration code through the nsiprofilemigrator interface. legal values are 1 and 0. optional - default...
ant script to assemble an extension - Archive of obsolete content
this ant script helps to package an extension <?xml version="1.0"?> this build file was written by régis décamps <decamps@users.sf.net> <project name="blogmark" default="createxpi"> <property name="version" value="1.3-rc1"/> <property name="description" value="new context-menu item to add the current page in your blogmarks"/> xpi file is created after "chrome/blogmark.jar" is created, which is then stuffed into "blogmark.xpi" <target name="createxpi" depends="createjar" description="assemble the final build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zipfi...
nsIContentPolicy - Archive of obsolete content
properties). query any dom properties that depend on style (e.g., computed style). query any dom properties that depend on the current state of the dom outside the "context" node (e.g., lengths of node lists). [javascript implementations only] access properties of any sort on any object without using xpcnativewrapper (either explicitly or implicitly). due to various dom0 things, this leads to item 4. if you do any of these things in your shouldload() implementation, expect unpredictable behavior, possibly including crashes, content not showing up, content showing up doubled, etc. if you need to do any of the things above, do them off timeout or event. note: when multiple content policies are used (for example through several extensions), if one of them rejects a request, the rest of th...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
one testing mozilla products with vista. a wiki and irc channel have been created to track their progress. discussions firefox trunk and rc1 slowdown using tabs discussion regarding certain theme components (specifically alpha-transparency) creating a high cpu load on os/2. title case capitalization rules in firefox discussion regarding rules for capitalizing the first letter of firefox menu items in the ff ui. engineering student project - industry coach paul betts from ohio state university is looking for someone from mozilla to be his "industry coach" for engineering 494 - how great ideas turn into great products. mozilla is a great product afterall. reload vs. reload from cache discussion regarding the lack of user understanding regarding reloading and reloading from the cache and h...
2006-10-06 - Archive of obsolete content
one testing mozilla products with vista. a wiki and irc channel have been created to track their progress. discussions firefox trunk and rc1 slowdown using tabs discussion regarding certain theme components (specifically alpha-transparency) creating a high cpu load on os/2. title case capitalization rules in firefox discussion regarding rules for capitalizing the first letter of firefox menu items in the ff ui. engineering student project - industry coach paul betts from ohio state university is looking for someone from mozilla to be his "industry coach" for engineering 494 - how great ideas turn into great products. mozilla is a great product afterall. reload vs. reload from cache discussion regarding the lack of user understanding regarding reloading and reloading from the cache and h...
2006-11-03 - Archive of obsolete content
tb storage-idea tb is planning to change from mbox-format storage to database-based storage. however, user wonder both storage method could exist in tb at the same time without crashing. suggestion made for e-mail popup it suggested that the e-mail popup duration should depends on number of messages and examples of this idea is provided. ...
2006-11-17 - Archive of obsolete content
ggestion from others. a few suggestion is posted. what file format is tb's address book using? tb's address book uses mork (file format). there are also some perl code provided in this link. how to get review for work-in-progress patch? answer: cc whoever you need review from, but don't post a formal review. steps for posting a formal review is provided also. how to access xyz.properties items more detail and code examples are provided in the posting. how to create top-level folders in inbox with an imap account on courier server. solution is provided by jay lee should there be an additional options for account configuration that just delete the messages from the server whenever they are deleted in tb? some discussion is posted. however, david bienvenu stated that the options a...
2006-12-01 - Archive of obsolete content
triage meetings until gecko 1.9a1 ships (nov 28th). watch #grandparadiso for updates. discussion november 29th gecko 1.9/gran paradiso status meeting other than annoucing the meeting, this thread discusses where else can info about what happens at the meetings be found (since the agenda often seems bare). m.d.planning and dev news blog are suggested. bon echo project status: remaining "to-do" items beltzner starts a discussion on when to offer 1.5.0.8+ users the chance to upgrade to ff2.x (now or when ff2.0.0.1 is released). also discussed is the the mozilla_1_8_branch's npotb (not part of the build) checkin policy. this newsgroup or "governance"? mitchell baker asks where should topics about organization and governance, moz.dev.planning or moz.governance? mozilla.org staff, project dr...
2006-11-17 - Archive of obsolete content
- november 17, 2006 announcements no meeting for this week. discussions itip and imip new designs for sending invitations available for comment discussion about the new interface designs for itip. view performance discussion about tests on view performance. webdav server a discussion related to remote calendar modifications. calendar xpcom component discussion about a debug error of additem function from calicalendar. meetings no meetings were scheduled this week. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
Content - Archive of obsolete content
but doing this in more efficient ways. ...
Well-Formed Web - Archive of obsolete content
documentation selected articles why well-formed web rss module is popular - syndicating your comments charles iliya krempeaux talks about the rss well-formed web module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
Element - Archive of obsolete content
ud element) <comments> (rss comments element) <copyright> (rss copyright element) d <day> (rss day element) <description> (rss description element) <docs> (rss docs element) e <enclosure> (rss enclosure element) f g <generator> (rss generator element) <guid> (rss guid element) h <height> (rss height element) <hour> (rss hour element) i <image> (rss image element) <item> (rss item element) j k l <language> (rss language element) <lastbuilddate> (rss last build date element) <link> (rss link element) m <managingeditor> (rss managing editor element) n <name> (rss name element) o p <pubdate> (rss published date element) q r <rating> (rss rating element) <rss> (rss's root "rss" element) s <skipdays> (rss skip days element) <skip...
Digital Signatures - Archive of obsolete content
matically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.the encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature. figure 1 shows a simplified view of the way a digital signature can be used to validate the integrity of signed data. figure 1 shows two items transferred to the recipient of some signed data: the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer's private key. to validate the integrity of the data, the receiving software first uses the signer's public key to decrypt the hash. it then uses the same hashing algorithm that generated the original hash ...
Introduction to Public-Key Cryptography - Archive of obsolete content
ser to each new server it encounters. existing authorization mechanisms based on the authenticated user identity are not affected. uses for certificates certificates have a purpose: to establish trust. their usage varies depending on the kind of trust they are used to ensure. some kinds of certificates are used to verify the identity of the presenter; others are used to verify that an object or item has not been tampered with. ssl protocol signed and encrypted email single sign-on object signing ssl protocol the secure sockets layer (ssl) protocol is a set of rules governing server authentication, client authentication, and encrypted communication between servers and clients. ssl is widely used on the internet, especially for interactions that involve exchanging confidential informa...
Making sure your theme works with RTL locales - Archive of obsolete content
...
Summary of Changes - Archive of obsolete content
this section outlines all of the element and practice updates described in this article. for a complete discussion of these items, see the sections in which they are described. proprietary or deprecated feature w3c feature or recommended replacement deprecated font html 4.01 span plus css1 color: ; font-family: ; font-size: ; deprecated center or align="center" css1 text-align: center; for in-line elements like text or image deprecated center or align="center" css1 margin-left: auto; margin-right: auto; for block-level elements deprecated bgcolor css1 background-color: ; non-standard embed html 4.01 object deprecated applet html 4.01 object non-standard marquee html 4.01 div plus scripting...
Browser Detection and Cross Browser Support - Archive of obsolete content
ing and frames. use these natural abilities of html to extend the range of browsers your content supports. using noframes to support non-frames capable browsers <html> <head> <title>frames</title> </head> <frameset rows="30,*"> <frame src="foo.html"> <frame src="bar.html"> <noframes> <body> <p> this page requires frames. see <a href="noframes.html">sitemap</a>. </p> </body> </noframes> </frameset> </html> using noscript to support non-scriptable browsers some browsers may not support scripting while some users may have scripting support turned off in their browser. use the noscript tag to provide these users with alternative unscripted versions of your pages or to at least notify them of the need to use scripting in order t...
-ms-accelerator - Archive of obsolete content
> <body> <label for="oname"><u style="-ms-accelerator: true; accelerator: true">n</u>ame: </label> <input type="text" id="oname" size="25" accesskey="n" value="your name here" /> </body> </html> specifications not part of any specification. remarks this property is supported by windows 2000 and later. it enables users to hide navigation indicators for menu items and controls until the alt key is pressed. an access key is a single character used as a keyboard shortcut for selecting an object. the user presses the alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object. in internet explorer 8 (ie8) the -ms-accelerator attribute is an extension to css, and can be used...
Processing XML with E4X - Archive of obsolete content
the number of contained elements: alert(languages.lang.length()); note that unlike javascript arrays length is a method, not a property, and must be called using length(). we can iterate through the matching elements like so: for (var i = 0; i < languages.lang.length(); i++) { alert(languages.lang[i].tostring()); } here we are using identical syntax to that used to access numbered items in an array. despite these similarities to regular arrays, xmllist does not support array methods such as foreach, and array generics such as array.foreach() are not compatible with xmllist objects. we can also use the for each...in statement introduced in javascript 1.6 as part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also ...
Iterator - Archive of obsolete content
ce returns [property_name, property_value] array for each iteration if keyonly is falsy, otherwise, if keyonly is truthy, it returns property_name for each iteration. if object is the iterator instance or generator instance, it returns object itself. properties iterator.prototype[@@iterator] returns a function that returns iterator object. methods iterator.prototype.next returns next item in the [property_name, property_value] format or property_name only. it throws stopiteration if there are no more items. examples iterating over properties of an object var a = { x: 10, y: 20, }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration iterating over properties of an object wi...
Array comprehensions - Archive of obsolete content
r as a way of combining the two. the following comprehension takes an array of numbers and creates a new array of the double of each of those numbers. var numbers = [1, 2, 3, 4]; var doubled = [for (i of numbers) i * 2]; console.log(doubled); // logs 2,4,6,8 this is equivalent to the following map() operation: var doubled = numbers.map(i => i * 2); comprehensions can also be used to select items that match a particular expression. here is a comprehension which selects only even numbers: var numbers = [1, 2, 3, 21, 22, 30]; var evens = [for (i of numbers) if (i % 2 === 0) i]; console.log(evens); // logs 2,22,30 filter() can be used for the same purpose: var evens = numbers.filter(i => i % 2 === 0); map() and filter() style operations can be combined into a single array comprehensio...
Generator comprehensions - Archive of obsolete content
gnificant drawback of array comprehensions is that they cause an entire new array to be constructed in memory. when the input to the comprehension is itself a small array the overhead involved is insignificant — but when the input is a large array or an expensive (or indeed infinite) generator the creation of a new array can be problematic. generators enable lazy computation of sequences, with items calculated on-demand as they are needed. generator comprehensions are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as short hand syntax for creating generators. suppose we have an iterator it which iterates over a large sequence of integ...
VBArray - Archive of obsolete content
var a = new vbarray(vbarray); var b = a.toarray(); var i; for (i = 0; i < 9; i++) { document.writeln(b[i]); } } --> </script> </head> <body> <script type="text/javascript"> <!-- vbarraytest(createvbarray()); --> </script> </body> properties the vbarray object has no properties. methods vbarray.dimensions returns the number of dimensions in a vbarray. vbarray.getitem returns the item at the specified location. vbarray.lbound returns the lowest index value used in the specified dimension of a vbarray. vbarray.toarray returns a standard javascript array converted from a vbarray. vbarray.ubound returns the highest index value used in the specified dimension of the vbarray. requirements supported in the following document modes: quirks, internet explore...
for each...in - Archive of obsolete content
-in methods of objects, e.g. string's indexof method. however, all user-defined properties are iterated over. examples using for each...in warning: never use a loop like this on arrays. only use it on objects. see for...in for more details. the following snippet iterates over an object's properties, calculating their sum: var sum = 0; var obj = {prop1: 5, prop2: 13, prop3: 8}; for each (var item in obj) { sum += item; } console.log(sum); // logs "26", which is 5+13+8 specifications not part of any standard. ...
XForms Custom Controls - Archive of obsolete content
80x64.gif</img> </data> </xf:instance> </xf:model> <style type="text/css"> @namespace xf url(http://www.w3.org/2002/xforms); xf|output[mediatype="image/*"] { -moz-binding: url('#output-image'); } </style> </head> <body> <h1>custom control sample</h1> <xf:select1 ref="curimg"> <xf:label>select image to display: </xf:label> <xf:itemset nodeset="../img"> <xf:label ref="@label"/> <xf:value ref="."/> </xf:itemset> </xf:select1> <xf:output ref="curimg" mediatype="image/*"/> </body> </html> ...
Mozilla XForms Specials - Archive of obsolete content
ion. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in bug 271724) opt...
XForms Group Element - Archive of obsolete content
introduction the group element is used as a container for defining a hierarchy of form controls. groups can be nested to create complex hierarchies. attributes single-node binding type restrictions the group element can be bound to a node containing data of any type. actually, the group element doesn't interact with the data in the bound node. however, having a relevant model item property on the bound node has an effect on a group. all content elements (e.g. core form controls, groups, switches, repeats and host language content) within a non-relevant group are handled as non-relevant. if a group is non-relevant, then the rendering approach used to signify non-relevance is applied to the entire content of the group. representations the group element doesn't have visual presentatio...
XForms Submit Element - Archive of obsolete content
trol. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special submission - required reference to element submission. type restrictions the submit element can be bound to a node containing data of any type. actually, the submit element doesn't interact with the data in the bound node. however, the relevant model item property on the bound node has an effect on a submit. if the bound node is irrelevant, then the submit will be hidden. representations the xforms submit element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is...
XForms Switch Module - Archive of obsolete content
the toggle element is an action that when triggered will make a case selected and visible and thereby hiding all other case elements contained by the same switch. attributes single-node binding type restrictions the switch element can be bound to a node containing data of any type. actually, the switch element doesn't interact with the data in the bound node. however, having a relevant model item property on the bound node has an effect on a switch. binding a switch to a data node will also set a context that the expressions contained inside the case elements can build upon. representations the switch element doesn't have a visual representation. case element this element (see the spec) encloses markup to be conditionally rendered. the content elements (e.g. form controls, groups, switche...
XForms Trigger Element - Archive of obsolete content
int to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. if the bound node is irrelevant, then the trigger will be hidden. representations the xforms trigger element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a bu...
Mozilla XForms User Interface - Archive of obsolete content
sage to the user when the specified event occurs (see the spec). xforms user interface these elements are mainly used to organize and manage the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any of their child nodes happen to use relative xpath expressions. binding these elements to instance data is also a way to apply model item properties (for example, relevancy) to the elements. elements in this section do not have any behaviors that are dependent on the host language. group this element is used to logically group xforms elements together (see the spec). switch this element is used in conjunction with case and toggle elements (see the spec). the switch element contains case elements which in turn contain markup. only t...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
standards that accountants and project managers must follow, the above-mentioned standards organizations provide focus and direction for the development engineering community. by following the guidelines that have been put into place, organizations like aol can enhance user experience, interoperability, code reuse, shared resources, and goodwill while reducing costs. i will discuss each of these items in the following paragraphs. interoperability the key to interoperability is settling on a standard that has a potential for long-term use. an organization must have the assurance that the standard they choose to incorporate into their development process will be relevant in the future. in other words, there must be long-term potential. a fundamental mistake that many organizations make is to ...
The Business Benefits of Web Standards - Archive of obsolete content
a framework and a process for content contributors to post articles, to upload videos, sound or any other media. a web site is only a vehicle for carrying, navigating and displaying that content. content management systems attempt with some success to supply that level of functionality. they act as a very good example of real separation not only of style and content but the process by which those items - which are very different - are implemented. the process is therefore one of three stages:- the creation of content, applying the markup, and adding the style. looked at in that light it may seem surprising how clean, elegant and simple the web development process really is. in a multi headed and possibly commercial environment such as a web development agency, this approach also lends itself ...
Game monetization - Game development
branding, or do it yourself. in the first case it's almost like non-exclusive licensing, but the client will usually buy rights for the code and implement their own graphics. in the second case it's like a freelance deal, but you're reusing the code and adding graphics provided by the client, sometimes implementing them as they instruct you. as an example if you've got a game where a player taps items of food, you could change the food to the client's products to give them advertising. prices in this model vary greatly depending on the brand, client, and amount of work you put in. other non-game focused monetization strategies there are other ways you can earn money when building html5 games, and it doesn't even have to be game-related. selling resources if you're a graphic designer, you ...
Building up a basic demo with Three.js - Game development
three.js, as with any other 3d library, provides built-in helper functions to help you implement common 3d functionality more quickly. in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo. note: we chose three because it is one of the most popular webgl libraries, and it is easy to get started with. ...
Visual typescript game engine - Game development
xperiment.com/licence - base physics based on : original source: matter.js https://github.com/liabru/matter-js matter.ts used because typescript orientation. https://www.npmjs.com/package/@types/matter-js crypto icons downloaded from https://www.behance.net/junikstudio todo list for 2019 i'm still far away from the project objective : make visual nodes for editor mode in gameplay. item's selling for crypto values. create examples demos in minimum 20 gameplay variants (table games, actions, platformers, basic demo throw the api doc etc.). implementing ar and webgl2. live demo platformer ...
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
text ‘read more’ will have ‘read more’ as its name (more on how names are computed in the accessible name and description computation spec). description how do we describe this element, if we want to add anything to the name? the description of a table could explain what kind of info that table offers. role what kind of thing is it? for example, is it a button, a nav bar, or a list of items? state does it have a state? think checked/unchecked for checkboxes, or collapsed/expanded for the <summary> element. additionally, the accessibility tree often contains information on what can be done with an element: a link can be followed, a text input can be typed into, etc. ...
API - MDN Web Docs Glossary: Definitions of Web-related terms
in web development, an api is generally a set of code features (e.g. ...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
lign-content, the writing mode of the box is also used. the definition of the alignment subject depends on the layout mode being used. block containers (including table cells) the entire content of the block as a single unit. multicol containers the column boxes, with any spacing inserted between column boxes added to the relevant column gaps. flex containers for justify-content, the flex items in each flex line. for align-content, the flex lines. note, this only has an effect on multi-line flex containers. grid containers the grid tracks in the appropriate axis, with any spacing inserted between tracks added to the relevant gutters. collapsed gutters are treated as a single opportunity for space insertion. learn more css box alignment ...
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge card sorting on wikipedia ...
Element - MDN Web Docs Glossary: Definitions of Web-related terms
a typical element includes an opening tag with some attributes, enclosed text content, and a closing tag. elements and tags are not the same things. ...
Grid - MDN Web Docs Glossary: Definitions of Web-related terms
ue of the display property; you can define columns and rows on your grid using the grid-template-rows and grid-template-columns properties. the grid that you define using these properties is described as an explicit grid. if you place content outside of this explicit grid, or if you are relying on auto-placement and the grid algorithm needs to create additional row or column tracks to hold grid items, then extra tracks will be created in the implicit grid. the implicit grid is the grid created automatically due to content being added outside of the tracks defined. in the example below i have created an explicit grid of three columns and two rows. the third row on the grid is an implicit grid row track, formed due to their being more than the six items which fill the explicit tracks. * {b...
Grid Axis - MDN Web Docs Glossary: Definitions of Web-related terms
in css the block or column axis is the axis used when laying out blocks of text. if you have two paragraphs and are working in a right to left, top to bottom language they lay out one below the other, on the block axis. ...
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
in a css grid layout, a grid cell is the smallest unit you can have on your css grid. it is the space between four intersecting grid lines and conceptually much like a table cell. if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm. additional row or column tracks will be created to create enough cells to hold all items. in the example we have created a three column track grid. the five items are placed into grid cells working along an initial row of three grid cells, then creating a new row for the remaining two. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrap...
Grid Column - MDN Web Docs Glossary: Definitions of Web-related terms
these columns will be auto-sized by default, or can have a size specified with the grid-auto-columns property. ...
Grid container - MDN Web Docs Glossary: Definitions of Web-related terms
using the value grid or inline-grid on an element turns it into a grid container using css grid layout, and any direct children of this element become grid items. when an element becomes a grid container it establishes a grid formatting context. the direct children can now lay themselves out on any explicit grid defined using grid-template-columns and grid-template-rows, or on the implicit grid created when an item is placed outside of the explicit grid. learn more property reference grid-template-columns grid-template-rows grid-auto-columns grid-auto-rows grid grid-template further reading css grid layout guide: basic concepts of grid layout ...
Grid Row - MDN Web Docs Glossary: Definitions of Web-related terms
these rows will be auto sized by default, or can have a size specified with the grid-auto-rows property. ...
Grid Tracks - MDN Web Docs Glossary: Definitions of Web-related terms
the image below shows the first row track on a grid. ...
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
grid-auto-rows: 45%; grid-column-gap: 20px; grid-row-gap: 20px; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> in terms of grid sizing, gaps act as if they were a regular grid track however nothing can be placed into the gap. the gap acts as if the grid line at that location has gained extra size, so any grid item placed after that line begins at the end of the gap. the grid-gap properties are not the only thing that can cause tracks to space out. margins, padding or the use of the space distribution properties in box alignment can all contribute to the visible gap – therefore the grid-gap properties should not be seen as equal to “the gutter size” unless you know that your design has not introduced...
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page). ...
Pseudocode - MDN Web Docs Glossary: Definitions of Web-related terms
it won't work if you try to run it as code. learn more general knowledge pseudocode on wikipedia. ...
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
er, and returns an <li> element with that string as its textcontent. would you need to look at the code to understand what the function did if it was called build('peach'), or createliwithcontent('peach')? semantics in css in css, consider styling a list with li elements representing different types of fruits. ...
Site map - MDN Web Docs Glossary: Definitions of Web-related terms
structured listings of a site's page help with search engine optimization, providing a link for web crawlers such as search engines to follow. site maps also help users with site navigation by providing an overview of a site's content in a single glance. ...
Array - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, arrays start at index zero and can be manipulated with various methods. ...
Loop - MDN Web Docs Glossary: Definitions of Web-related terms
examples for loop syntax: for (statement 1; statement 2; statement 3){ execute code block } statement 1 is executed once before the code block is run. statement 2 defines the condition needed to execute the code block. statement 3 is executed every time the code block is run. ...
MDN Web Docs Glossary: Definitions of Web-related terms
fallback alignment falsy favicon fetch directive fetch metadata request header firefox os firewall first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint first-class function flex flex container flex item flexbox forbidden header name forbidden response header name fork fragmentainer frame rate (fps) ftp ftu function fuzz testing g gaia garbage collection gecko general header gif gij git global object global scope...
Backgrounds and borders - Learn web development
pens when the text does not flow from left to right? ...
Debugging CSS - Learn web development
meone else will usually result in a fix being found. ...
Handling different text directions - Learn web development
module we will take a good look at overflow in css. ...
Test your skills: Selectors - Learn web development
d of white. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors four in this task try the following: make any paragraph that directly follows an h2 element red. remove the bullets and add a 1px grey bottom border only to list items that are a direct child of the ul with a class of list. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors five in this final task add css using attribute selectors to do the following: target the <a> element with a title at...
Type, class, and ID selectors - Learn web development
ploring selectors by looking at attribute selectors. ...
CSS selectors - Learn web development
h1 + p adjacent sibling general sibling combinator h1 ~ p general sibling in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Test your skills: sizing - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. task one in this task, you have two boxes. ...
Test Your Skills: Fundamental layout comprehension - Learn web development
d by the browser in normal flow. if you don't want to work locally then using a tool such as codepen or jsfiddle will work as well. you will need to upload the images using their assets functionality and replace the value in the src attribute to point to the new image location. your tasks you now need to implement your layout. the tasks you need to achieve are: to display the navigation items in a row, with an equal amount of space between the items. the navigation bar should scroll with the content and then become stuck at the top of the viewport when it reaches it. the image that is inside the article should have text wrapped around it. the <article> and <aside> elements should display as a two column layout. the columns should be a flexible size so that if the browser window sh...
Test your skills: position - Learn web development
erial you have just covered. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. positioning one in this task you need to position the item with a class of target to the top and right of the container, which has the 5px grey border. try updating the live code below to recreate the finished example: as an extra challenge, can you change the target to display underneath the text? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. position two ...
Positioning - Learn web development
bsolute positioning fixes an element in place relative to its nearest positioned ancestor (the initial containing block if there isn't one), fixed positioning usually fixes an element in place relative to the visible portion of the viewport, except if one of its ascendants is a fixed containing block due to its transform property being different from none. this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to remove the position: relative; declaration and add a fixed height, like so: body { width: 500px; ...
CSS layout - Learn web development
— such as different display values — and introduce some of the concepts we'll be covering throughout this module. normal flow elements on webpages lay themselves out according to normal flow - until we do something to change that. this article explains the basics of normal flow as a grounding for learning how to change it. flexbox flexbox is a one-dimensional layout method for laying out items in rows or columns. items flex to fill additional space and shrink to fit into smaller spaces. this article explains all the fundamentals. after studying this guide you can test your flexbox skills to check your understanding before moving on. grids css grid layout is a two-dimensional layout system for the web. it lets you lay content out in rows and columns, and has many features that make b...
How CSS works - Learn web development
a dom node in the tree structure. the nodes are defined by their relationship to other dom nodes. some elements are parents of child nodes, and child nodes have siblings. understanding the dom helps you design, debug and maintain your css because the dom is where your css and the document's content meet up. when you start working with browser devtools you will be navigating the dom as you select items in order to see which rules apply. a real dom representation rather than a long, boring explanation, let's look at an example to see how a real html snippet is converted into a dom. take the following html code: <p> let's use: <span>cascading</span> <span>style</span> <span>sheets</span> </p> in the dom, the node corresponding to our <p> element is a parent. its children are a text...
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
instances of ignored style rules are listed below. html elements hierarchy the way css styles are applied to html elements depends also on the elements hierarchy. it is important to remember that a rule applied to a descendent overrides the style of the parent, in spite of any specificity or priority of css rules. .news { color: black; } .corpname { font-weight: bold; color: red; } <!-- news item text is black, but corporate name is red and in bold --> <div class="news"> (reuters) <span class="corpname">general electric</span> (ge.nys) announced on thursday... </div> in case of complex html hierarchies, if a rule seems to be ignored, check if the element is inside another element with a different style. explicitly re-defined style rule in css stylesheets, order is important. if you...
Typesetting a community school homepage - Learn web development
but when you hover or focus them, the underline disappears. remove the default focus outline from all the links on the page. give the active state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design. make it so that external links have the external link icon inserted next to them. lists: make sure the spacing of your lists and list items works well with the styling of the overall page. each list item should have the same line-height as a paragraph line, and each list should have the same spacing at its top and bottom as you have between paragraphs. give your list items a nice bullet, appropriate for the design of the page. it is up to you whether you choose a custom bullet image or something else. navigation menu: style yo...
Web fonts - Learn web development
ckbox labeled "yes, the fonts i'm uploading are legally eligible for web embedding." click download your kit. after the generator has finished processing, you should get a zip file to download — save it in the same directory as your html and css. implementing the code in your demo at this point, unzip the webfont kit you just generated. inside the unzipped directory you'll see three useful items: multiple versions of each font: (for example .ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requirements change). as mentioned above, multiple fonts are needed for cross browser support — this is fontsquirrel's way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the f...
How do I start to design my website? - Learn web development
shipping find a way to handle payment make a mechanism on your site for people to place orders teach music through videos record video lessons prepare video files viewable online (again, could you do this with existing web services?) give people access to your videos on some part of your website two things to notice. first, some of these items are not web-related (e.g., record music, write articles). often those offline activities matter even more than the web side of the project. in sales, for instance, it's far more important and time-consuming to handle supply, payment, and shipment than to build a website where people can place orders. second, setting out actionable steps leads to new questions you'll need to answer. usually ther...
HTML forms in legacy browsers - Learn web development
an be unpredictable. so don't. as you can see from the complexity of the property compatibility table for form widgets article, it's very difficult. even if it's still possible to do a few adjustments on text elements (such as sizing or font color), there are always side effects. the best approach remains to not style html form widgets at all. but you can still apply styles to all the surrounding items. and, if you must alter the default styles of your form widgets, define a style guide to ensure consistency among all your form controls so user experience is not destroyed. you can also investigate some hard techniques such as rebuilding widgets with javascript. but in that case, do not hesitate to charge your client for such foolishness. feature detection and polyfills css and javascript are...
How to build custom form controls - Learn web development
adding: 0 4px; margin: 0 -4px 0 4px; } .styledselect:focus-within { border: .2em solid #000; border-radius: .4em; box-shadow: 0 .1em .2em rgba(0,0,0,.45); } .styledselect:focus-within input:checked + label { background-color: #333; color: #fff; width: 100%; } with no javascript, and just a little bit of css, we are able to style the list of radio buttons to display only the checked item. when the focus is within the <ul> in the <fieldset>, the list opens up, and the up and down (and left and right) arrows work to select the previous and next items. try it out: this works, to some extent, without javascript. we've created a similar control to our custom control, that works even if the javascript fails. looks like a great solution, right? well, not 100%. it does work with the k...
Test your skills: Basic controls - Learn web development
sessment or further help section at the bottom of this page. basic controls 1 this task starts you off nice and gently by asking you to create two <input> elements, for a user's id and password, along with a submit button. create appropriate inputs for user id and password. you should also associate them with their text labels semantically. create a submit button inside the remaining list item, with button text of "log in". 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. basic controls 2 the next task requires you to create working sets of checkboxes and radio buttons, from the provided text labels. turn the first <fieldset>'s contents into a set of radio buttons ...
UI pseudo-classes - Learn web development
ed some javascript to toggle the disabling of the billing address fields: // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').addeventlistener('change', togglebilling); }, false); function togglebilling() { // select the billing text fields let billingitems = document.queryselectorall('#billing input[type="text"]'); // select the billing text labels let billinglabels = document.queryselectorall('.billing-label'); // toggle the billing text fields and labels for (let i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; if(billinglabels[i].getattribute('class') === 'billing-label disabled-labe...
HTML basics - Learn web development
ple text (you should have it from what should your website look like?) into one or a few paragraphs, placed directly below your <img> element. lists a lot of the web's content is lists and html has special elements for these. marking up lists always consist of at least 2 elements. the most common list types are ordered and unordered lists: unordered lists are for lists where the order of the items doesn't matter, such as a shopping list. these are wrapped in a <ul> element. ordered lists are for lists where the order of the items does matter, such as a recipe. these are wrapped in an <ol> element. each item inside the lists is put inside an <li> (list item) element. for example, if we wanted to turn the part of the following paragraph fragment into a list <p>at mozilla, we’re a glo...
What will your website look like? - Learn web development
u presenting on the subject? write a title and a few paragraphs and think of an image you'd like to show on your page. what does your website look like, in simple high-level terms? what's the background color? what kind of font is appropriate: formal, cartoony, bold and loud, subtle? note: complex projects need detailed guidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style, and so on. this is sometimes called a design guide, design system, or brand book, and you can see an example at the firefox photon design system. sketching out your design next, grab pen and paper and sketch out roughly how you want your site to look. for your first simple webpage, there's not much to sketch out, but you should get in the habit of doing t...
Use HTML to solve common problems - Learn web development
Learn › HTML › Howto
hould start with this. how to create a basic html document how to divide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in providing semantic information for a document, so html answers many questions you might have about how to get your message across best in your document. ...
Structuring a page of content - Learn web development
k is to take the content for the homepage of a bird watching website and add structural elements to it so it can have a page layout applied to it. it needs to have: a header spanning the full width of the site containing the main title for the page, the site logo, and the navigation menu. the title and logo appear side by side once styling is applied, and the navigation appears below those two items. a main content area containing two columns — a main block to contain the welcome text, and a sidebar to contain image thumbnails. a footer containing copyright information and credits. you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by addi...
From object to iframe — other embedding technologies - Learn web development
o embed pdfs, svg, and even flash — a technology that is on the way out, but which you'll still see semi-regularly. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and the previous articles in this module. objective: to learn how to embed items into web pages using <object>, <embed>, and <iframe>, like flash movies and other webpages. a short history of embedding a long time ago on the web, it was popular to use frames to create websites — small parts of a website stored in individual html pages. these were embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame fil...
Test your skills: Multimedia and embedding - Learn web development
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. multimedia and embedding 3 for this final task you have two tasks to do: embed a pdf into the page. the pdf is called mypdf.pdf, and is contained in the media folder. go to a sharing site like youtube or google maps, and embed a video or other media item into the page. 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. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable ed...
Introducing asynchronous JavaScript - Learn web development
n which functions are run and what data is passed between them, they also allow you to pass data to different functions depending on circumstance. 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 referenc...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
following css to the html template (in whatever way you prefer). this sets a red background on the page, sets the <body> height to 100% of the <html> height, and centers the <div> inside the <body>, horizontally and vertically. html { background-color: white; height: 100%; } body { height: inherit; background-color: red; margin: 0; display: flex; justify-content: center; align-items: center; } div { display: inline-block; font-size: 10rem; } insert a <script> element just above the closing </body> tag. insert the following javascript inside your <script> element. here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an uninitialized variable that will later be used to contain a reference to the request...
Functions — reusable blocks of code - Learn web development
note: feel free to enter these lines into your browser's javascript console to re-familiarize yourself with t...
Image gallery - 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 loops, functions, conditionals, and events. ...
Test your skills: Loops - Learn web development
l via javascript. we haven't explicitly taught this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions. a good starting place is our manipulating documents tutorial. loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list. download the starting point for this task to work in your own editor or in an online editor. loops 2 in this next task, we want you to write a simple program that, given a name, searches an array of objects containing names and phone numbers (phonebook)...
JavaScript building blocks - Learn web development
...
Fetching data from the server - Learn web development
this seemingly small detail has had a huge impact on the performance and behavior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as xmlhttprequest and the fetch api. ...
Client-side web APIs - Learn web development
object model (dom), a set of apis for controlling html and styling information that makes heavy use of the document object. in this article, we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways. fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entirely new page. this seemingly small detail has had a huge impact on the performance and behavior of sites. in this article, we'll explain the concept, and look at technologies that make it possible, such as xmlhttprequest and the fetch api. third party apis the apis we've covered so far are built into the browser, b...
A first splash into JavaScript - Learn web development
rsor into the <input> text field as soon as the page loads, meaning that the user can start typing their first guess right away, without having to click the form field first. it's only a small addition, but it improves usability — giving the user a good visual clue as to what they've got to do to play the game. let's analyze what's going on here in a bit more detail. in javascript, most of the items you will manipulate in your code are objects. an object is a collection of related functionality stored in a single grouping. you can create your own objects, but that is quite advanced and we won't be covering it until much later in the course. for now, we'll just briefly discuss the built-in objects that your browser contains, which allow you to do lots of useful things. in this particular ca...
Storing the information you need — Variables - Learn web development
/numbers, or big long phrases. variables are case sensitive — so myage is a different variable from myage. one last point: you also need to avoid using javascript reserved words as your variable names — by this, we mean the words that make up the actual syntax of javascript! so, you can't use words like var, function, let, and for as variable names. browsers recognize them as different code items, and so you'll get errors. note: you can find a fairly complete list of reserved keywords to avoid at lexical grammar — keywords. good name examples: age myage init initialcolor finaloutputvalue audio1 audio2 bad name examples: 1 a _12 myage myage var document skjfndskjfnbdskjfb thisisareallylongstupidvariablenameman try creating a few more variables now, with the above guidance in mi...
JavaScript First Steps - Learn web development
ve looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more. arrays in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides. assessments the following assessment will test your understanding of the javascript basics covered in the guides above. silly story generator in this assessment you'll be tasked with taking some of the knowledge you've...
Solve common problems in your JavaScript code - Learn web development
ther? can you join strings and numbers together? how do you find the length of a string? how do you find what character is at a certain position in a string? how do you find and extract a specific substring from a string? how do you change the case of a string? how do you replace one specific substring with another? arrays how do you create an array? how do you access and modify the items in an array? (this includes multidimensional arrays) how do you find the length of an array? how do you add and remove array items? how do you split a string into array items, or join array items into a string? debugging javascript what are the basic types of error? what are browser developer tools, and how do you access them? how do you log a value to the javascript console? how do y...
Object prototypes - Learn web development
ect's prototype object, and it has. so the method is called, and all is good! note: we want to reiterate that the methods and properties are not copied from one object to another in the prototype chain. they are accessed by walking up the chain as described above. note: before ecmascript 2015, there wasn't officially a way to access an object's prototype directly — the "links" between the items in the chain are defined in an internal property, referred to as [[prototype]] in the specification for the javascript language (see ecmascript). most modern browsers, however, do offer property available called __proto__ (that's 2 underscores either side), which contains the object's constructor's prototype object. for example, try person1.__proto__ and person1.__proto__.__proto__ to see what ...
Test your skills: Object basics - Learn web development
ality: a string representing the country the band comes from. genre: what type of music the band plays. members: a number representing the number of members the band has. formed: a number representing the year the band formed. split: a number representing the year the band split up, or false if they are still together. albums: an array representing the albums released by the band. each array item should be an object containing the following members: name: a string representing the name of the album. released: a number representing the year the album was released. include at least two albums in the albums array. once you've done this, you should then write a string to the variable bandinfo, which will contain a small biography detailing their name, nationality, years ac...
Introducing JavaScript objects - Learn web development
representing structured data based on javascript object syntax, which is commonly used for representing and transmitting data on web sites (i.e. sending some data from the server to the client, so it can be displayed on a web page). you'll come across it quite often, so in this article, we give you all you need to work with json using javascript, including parsing the json so you can access data items within it and writing your own json. object building practice in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from. in this article we dive into a practical exercise, giving you some more practice in building custom javascript objects, which produce something fun and colorful — some colored bouncing balls. as...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
). get todocountisone() { return this.incomplete.length === 1; } then go back over to footer.hbs and update the previous template section we edited to the following: <strong>{{this.todos.incomplete.length}}</strong> {{#if this.todos.todocountisone}} todo {{else}} todos {{/if}} left now save and test, and you'll see the correct pluralization used when you only have one todo item present! note that this is the block form of if in ember; you could also use the the inline form: {{if this.todos.todocountisone "todo" "todos"}} completing todos as with the other components, we need a class to access the service. creating a todo class run the following command in your terminal: ember generate component-class todo now go to the newly-created todomvc/app/compo...
Routing in Ember - Learn web development
ents: import emberrouter from '@ember/routing/router'; import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; rooturl = config.rooturl; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when the 2nd and 3rd commands above were run. router.js behaves as a "sitemap" for developers to be able to quickly 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 ...
Ember app structure and componentization - Learn web development
s of application.hbs should be updated so that they call the appropriate components, like so: <section class="todoapp"> <h1>todos</h1> <header /> <todolist /> <footer /> </section> with these changes made, run npm start in your terminal again, then head over to http://localhost:4200 to ensure that the todo app still looks as it did before the refactor. notice how the todo items both say "buy movie tickets" — this is because the same component is being invoked twice, and the todo text is hardcoded into it. we'll look at showing different todo items in the next article! summary great! everything looks as it should. we have successfully refactored our html into components! in the next article we'll start looking into adding interactivity to our ember application. ...
Accessibility in React - Learn web development
etimes, the place we want to send our focus to is obvious: when we toggled our <todo /> templates, we had an origin point to "go back" to — the "edit" button. in this case however, since we're completely removing elements from the dom, we have no place to go back to. the next best thing is an intuitive location somewhere nearby. the list heading is our best choice because it's close to the list item the user will delete, and focusing on it will tell the user how many tasks are left. creating our ref import the useref() and useeffect() hooks into app.js — you'll need them both below: import react, { 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 ...
Componentizing our React app - Learn web development
t second bullet is especially valuable: making a component out of common ui elements allows you to change your code in one place and see those changes everywhere that component is used. you don't have to break everything out into components right away, either. let's take the second bullet point as inspiration and make a component out of the most reused, most important piece of the ui: a todo list item. make a <todo /> before we can make a component, we should create a new file for it. in fact, we should make a directory just for our components. the following commands make a components directory and then, within that, a file called todo.js. make sure you're in the root of your app before you run these! mkdir src/components touch src/components/todo.js our new todo.js file is currently empty...
React interactivity: Events and state - Learn web development
s this array into settasks() to update the state. putting that all together, your addtask() function should read like so: function addtask(name) { const newtask = { id: "id", name: name, completed: false }; settasks([...tasks, newtask]); } now you can use the browser to add a task to our data! type anything into the form and click "add" (or press the enter key) and you'll see your new todo item appear in the ui! however, we have another problem: our addtask() function is giving each task the same id. this is bad for accessibility, and makes it impossible for react to tell future tasks apart with the key prop. in fact, react will give you a warning in your devtools console — "warning: encountered two children with the same key..." we need to fix this. making unique identifiers is a h...
React interactivity: Editing, filtering, conditional rendering - Learn web development
editing to false so that it switches us back to the view template. update the "cancel" button in the edittemplate like so: <button type="button" classname="btn todo-cancel" onclick={() => setediting(false)} > cancel <span classname="visually-hidden">renaming {props.name}</span> </button> with this code in place, you should be able to press the "edit" and "cancel" buttons in your todo items to toggle between templates. the next step is to actually make the editing functionality work. editing from the ui much of what we're about to do will mirror the work we did in form.js: as the user types in our new input field, we need to track the text they enter; once they submit the form, we need to use a callback prop to update our state with the new name of the task. we'll start by ...
Getting started with Vue - Learn web development
ll now show our heading, as you'd expect. summary let's leave this here for now. we've learnt about some of the ideas behind vue, created some scaffolding for our example app to live inside, inspected it, and made a few preliminary changes. with a basic introduction out of the way, we'll now go further and build up our sample app, a basic todo list application that allows us to store a list of items, check them off when done, and filter the list by all, complete, and incomplete todos. in the next article we'll build our first custom component, and look at some important concepts such as passing props into it and saving its data state. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react ...
Handling common JavaScript problems - Learn web development
already familiar with the basics of troubleshooting javascript, you should study that article before moving on. there are a number of common javascript problems that you will want to be mindful of, such as: basic syntax and logic problems (again, check out troubleshooting javascript). making sure variables, etc. are defined in the correct scope, and you are not running into conflicts between items declared in different places (see function scope and conflicts). confusion about this, in terms of what scope it applies to, and therefore if its value is what you intended. you can read what is "this"? for a light introduction; you should also study examples like this one, which shows a typical pattern of saving a this scope to a separate variable, then using that variable in nested functions ...
Learn web development
ample, if you were in the parent directory: cd learning-area update the repository using the following command: git pull contact us if you want to get in touch with us about anything, the best way is to drop us a message on our discourse forum. we'd like to hear from you about anything you think is wrong or missing on the site, requests for new learning topics, requests for help with items you don't understand, or any other questions or concerns. if you're interested in helping develop/improve the content, take a look at how you can help and get in touch! we are more than happy to talk to you, whether you are a learner, teacher, experienced web developer, or someone else interested in helping to improve the learning experience. ...
Accessibility information for UI designers and developers
if the extra content obscures existing content, there should be a way to close it without moving focus if the extra content is opened on hover, hovering the additional content itself should not cause it to disappear consistent navigation navigation should be consistent across different pages on your site. it does not need to be exactly the same, it is fine to have a different current menu item or different subnavigation links. do make sure they appear in the same place. that way, users of screen readers and screen magnifiers can reliably make assumptions about them and skip over them. see also: understanding success criterion 3.2.3: consistent navigation headings the heading structure of a page is like its table of contents, so it is important that the levels are consistent. the mos...
Multiprocess on Windows
ta. in order for the interceptor to be able to work with our interfaces, we must do some additional work to compensate for typelib's weaknesses. the required steps are as follows: ensure that you generate typelibs for all of your com interfaces; ensure that those interfaces are registered; register any outparams that consist of arrays of interfaces. we will now further detail each of these items: generating typelibs for all com interfaces you first need to include a library statement in your idl. when midl processes your idl, it generates c code for building a proxy dll, containing the oicf metadata. it also will output a file with the .tlb extension. this file contains the typelib metadata. both metadata types must be shipped with firefox. the oicf metadata is shipped via the proxy d...
Mozilla’s UAAG evaluation report
control panel. mozilla exposes the focus via wm_focus system messages mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support css) 7.2 respect input configuration conventions. (p1) vg mozilla implements standard keyboard bindings there are a few missing pieces, such as support in xul comboboxes (menulist) for selecting items by typing alphanumeric keystrokes 7.3 operating environment conventions. (p2) g mozilla uses non-native controls. it does, however, support the look and feel of widgets on various operating systems, when the classic theme is selected (on by default). 7.4 input configuration indications. (p2) g menus indicate accesskey and accelerator configurations accelerators ...
Accessibility and Mozilla
a strives to make its software accessible; the documents below cover the ways in which we do so. these articles provide mozilla-specific details about accessibility. accessibility api cross-referencethis cross-reference helps us see the difference between today's accessibility api's. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc.accessibility features in firefoxfirefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. we are optimistic that jaws support will catch up this year. in recent articles from both afb's access world and nfb's voice of the nation's blind...
Adding a new CSS property
list and just override the value parsing by setting css_property_value_parser_function. you must take the latter approach for properties that are part of shorthands if you want the shorthand parser to be able to reuse the longhand parser. (note that when the longhand property css_property_parse_value_list, the shorthand property parser would be assumed to be reusing the longhand parser once per item, not for a whole list, as for properties like background-image or transform-timing-function.) if the property takes a list of keywords other than inherit/initial/etc., auto, none, or normal (which can be expressed using the variant_* flags), you should use variant_keyword and add a keyword table to the nscssprops class. the name of this keyword table needs to go in the nscssproplist entry; othe...
ESLint
ndef rules below. no-undef the no-undef rule is currently being enabled throughout the code base. here are some common issues: my script is imported into the global browser.xul scope. add a line like: /* eslint-env mozilla/browser-window */ or enable the rule in a .eslintrc.js if it will apply to the whole directory. ...
Eclipse CDT
maybe you need to increase the limits still further for your os/jvm combination. resource is out of sync with the file system if you get the message "resource is out of sync with the file system", then you didn't set the "refresh" options above in the initial workspace preferences section. either set those, or else refresh the project (or an individual directory/file) manually using the refresh item from the context menu in the project explorer tab. old everything that follows is old content that should maybe just be deleted now? gdb timeouts i don't think this old comment from 2007/2008 is an issue anymore. out of the box, you may/will get gdb connection timeouts. this is because eclipse is trying to push every subfolder in gdb's environment. the easiest way to resolve this issue is to...
Commenting IDL for better documentation
included in the remarks section of the documentation. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. @see description either an interface or a html link. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. - or . used at the beginning of a comment line to indicate an unordered list item. there must be a space between the list marker and the item. nested lists should be indented from the previous level by two spaces. -# used at the beginning of a comment line to indicate an ordered list item. there must be a space between the list marker and the item. nested lists should be indented from the previous level by two spaces. other tips some other helpful writing style tips that ...
Multiple Firefox profiles
this for each icon you'd like to have a specific profile for. once done, each one should automatically start with the specified profile. linux there is no extremely straightforward way to create custom application launchers in gnome 3 like there was in gnome 2. the following tutorial will help get you going overall: gnome 3 custom application launcher. once you get to the point of adding a new item, you can have the profile dialog show up every time or set the launcher to launch a specific profile. if you want to have the profile manager to pop up each time you start firefox, so you can choose a profile, you will need to set the command line for your new launcher. set the "command" text field to target the executable file, likely "/usr/bin/firefox", and add the -p parameter. if you wa...
Limitations of frame scripts
yed these must be registered in the content process. qi from content window to chrome window there's a particular pattern often used to get from a content window to the associated chrome window. it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work. in the content process the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail. if you want a chrome window: send a message from t...
Limitations of frame scripts
yed these must be registered in the content process. qi from content window to chrome window there's a particular pattern often used to get from a content window to the associated chrome window. it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work. in the content process, the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail. if you want a chrome window: send a message from ...
Process scripts
ndow's content frame message manager, e.g. if responses should be processed by a frame script instead of the process script. this can be achieved by traversing the docshell tree up to the top window and then retrieving its content message manager, as follows: function contentmmfromcontentwindow(window) { let tree = window.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshelltreeitem); let top = tree.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterfacerequestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process. chrome-privileged pages or things running in the parent process may require special treatment. if the above doesn't work try this: ...
Blocked: All storage access requests
ies or storage on “x” was blocked because we are blocking all storage access requests. what went wrong? a request to access cookies or storage was blocked because the browser is blocking all storage access. the permission can be changed or removed by: going to preferences > content blocking in the custom content blocking section, selecting a value other than all cookies for the cookies item if the resource that is being blocked doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to your element. ...
Using the Browser API
Mozilla › Gecko › Chrome › API › Browser API › Using
ad(); } }); implementing the search bar let's now turn our attention to implementing browser search using the browser api. tap the "s" button and try it out. try searching for "firefox" on the default page when the app first loads. so how do we do this? first, we declare a searchactive variable as false, which influences behaviour later on. then, we disable the "previous" and "next" search item buttons so that they don't run anything unless there are search items to cycle between. var searchactive = false; prev.disabled = true; next.disabled = true; next, we add an event listener to the searchform so that when it is submitted, the htmliframeelement.findall() method is used to do a search for the string entered into the search input element (searchbar) within the text of the current pa...
HTMLIFrameElement.getStructuredData()
specification not part of any specification. ...
Browser API
eraudioplaybackchange sent when audio starts or stops playing within the browser <iframe> content. mozbrowsercaretstatechanged sent when the text selected inside the browser <iframe> content changes. mozbrowserclose sent when window.close() is called within a browser <iframe>. mozbrowsercontextmenu sent when a browser <iframe> tries to open a context menu. this allows handling of the <menuitem> element available within the browser <iframe>'s content. mozbrowserdocumentfirstpaint sent when a new paint occurs on any document in the browser <iframe>. mozbrowsererror sent when an error occurs while trying to load content within a browser <iframe>. mozbrowserfindchange sent when a search operation is performed on the browser <iframe> content (see htmliframeelement search methods.) mo...
-moz-window-dragging
...
::-moz-tree-image
activated by the properties attribute. ...
::-moz-tree-indentation
activated by the properties attribute. ...
::-moz-tree-line
activated by the properties attribute. ...
Overview of Mozilla embedding APIs
emory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference document for more information. public return codes ns_succeeded ns_error_failure ns_error_not_implemented public functions the following functions are available from the xpcom dll. ns_initembedding this function initializes the gecko embedding support. this must be the first function call made into gecko. ns_termembedding this function shuts down gecko and cleans up any remaining resources... currently, once gecko has been shutdown, it cannot be restarted in the same process space... this should change in the future. nsmemory nsmemory::alloc nsmemory::realloc...
Gecko Keypress Event
match those specified in the handler. for the us keyboard layout, a related handler is defined with <key key="=" modifiers="accel"/>, so that users do not need to use the shift key to access the zoom-in shortcut. of course, this is not much help to users with other keyboard layouts. e.g., on a japanese keyboard, '+' is entered with shift+';' (bug 339723). problem 2 the access keys for the menu items are specified with the localized characters on some localized builds. these localized access keys work fine with the keyboard layout of the locale. however, users with the same non-latin keyboard layouts would also like to be able to use latin access keys of en-us builds (including nightly builds) without needing to switch keyboard layout (bug 399939). problem 3 users with non-latin keyboard ...
Getting from Content to Layout
parent chain does) are also stored. the restyles accumulated in the restyletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications. frame construction regardless of whether content nodes are inserted/appended/deleted, frames can be created and destroyed, based on whatever is optimal for the changes in the content tree. "frame construction items" are queued for each change. these items are then examined in relation to the location in the content tree that is being modified and either the relevant frames are created/destroyed or the logic moves up to the parent frame. to give a trivial example of when this might be necessary, consider: "<span>foo <div></div> bar</span>". separate frames are created for the pre and post-div parts of th...
IME handling guide
editor. this is a technical term from windows but these days, this is used on other platforms as well. ime is a helper application of a user's text input. it handles native key events before or after focused application (depending on the platform) and creates a composition string (a.k.a. preedit string), suggests a list of what the user attempts to input, commits composition string as a selected item off the list and commits composition string without any conversion. ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly. however, especially on mobile devices nowadays, ime is also used for inputting latin languages like autocomplete. additionally, ime may be used f...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
you can use the following workaround until the conversion to punycode is completed for these top domains: using netscape 7.1 or mozilla 1.4: type about:config into the location/url bar. this will list all the preferences for your current profile. these preferences can be modified or new ones can be created without quitting the browser using the steps described below. create a new preference item using the menu new > string via a right-mouse click. the name of the preference is: network.idn_prefix. the value should be "bq--". this will change the default from puncycode to race. next create another new preference item using the right-mouse click menu new > boolean. the name of the preference is: network.idn_testbed. the value should be "true". now access idn sites under the .com and .net...
JavaScript Tips
interface definition. dom elements dom elements are just xpcom objects with some of the interfaces precached. don't call getattribute to see if an attribute exists, call hasattribute instead. prefer to loop through childnodes rather than using first/lastchild with next/previoussibling. but prefer haschildnodes() to childnodes.length > 0. similarly prefer document.getelementsbytagname(atag).item(0) != null to document.getelementsbytagname(atag).length > 0. prefer to use localname rather than tagname. xul elements have many of the attributes mapped to properties. this was done for a reason, so use them! the properties are: align allowevents contextmenu datasources dir flex height id left maxheight maxwidth minheight minwidth observes ori...
UpdateInfo
rsion string the version of the update. updateurl string the updateurl that the update can be downloaded from. updatehash string a hash for the update's file. updateinfourl string a url containing simple release notes for the update. targetapplications object[] information about what applications the update is compatible with. each item in the array contains "id", "minversion", and "maxversion" properties. ...
DownloadList
afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list. the returned array does not change when downloads are added or removed, though the download objects it contains are still updated in real time. promise<array<download>> getall(); parameters none. promise resolves to an array of download objects. add() adds a new download to the end of the items list. note: when a download is added to the list, its onchange event is registered by the list, thus it cannot be used to monitor the download. to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications. promise add( download adownload ); parameters adownload the download object to add. ...
FileUtils.jsm
en creating directories methods getfile() gets a file at the specified hierarchy under a nsidirectoryservice key. nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key. the last item in this array must be the leaf name of a file. followlinks optional true if links should be followed, false otherwise. return value returns a nsifile object for the file specified. the file is not created if it does not exist, however all required directories along the way are. getdir() gets a directory at the specified hierarchy under a nsidirectoryservice key. nsifile getdir( string k...
Task.jsm
ly called, and the yield operator works on the returned promise. this reduces the syntax overhead of calling task.spawn() explicitly when you want to recurse into other task functions. if you specify a function that is not a generator, it is called with no arguments, and the yield operator returns the return value of the function. this comes in handy when iterating over function lists where some items have been converted to tasks and some not. if you specify anything else, the yield operator returns exactly what you specified. method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator funct...
Using JavaScript code modules
de module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type. the module also defines a special array named exported_symbols. any javascript item named in exported_symbols will be exported from the module and injected into the importing scope. for example: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code...
Webapps.jsm
checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent:...
JavaScript code modules
l, customizable error reporting. bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloading capabilities of the platform. fileutils.jsm provides helpers for dealing with files. g...
Localizing with Pontoon
on will automatically open that locale's project for you to get started. note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow. and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated. only the toolbar on top belongs to pontoon, containing the following items (from left to right): list of strings opens a sidebar with a list of all strings to localize. project selector (affiliates) switches between projects to localize. resource selector (homepage) switches between project resources to localize, like subpages or localization files. hidden if no resources available for project. locale selector (slovenian) switches between languages to...
Localization technical reviews
be any utf-7 encodings in the file toolkit/chrome/global/intl.properties. for more info about utf-7 in firefox, see bug 441876. more intl.properties checkpoints, cont we also check the plural rule for the locale, that the general.useragent.locale is set to the locale code, that accept-lang shows the locale code(s) (like ab, ab-cd,...) and is followed by en and en-us, and finally that intl.menuitems.insertseparatorbeforeaccesskeys = true, where "true" should be left untranslated. inspect firefox-l10n.js we ensure that there are no odd preferences, or #filter substitutions for general.useragent.locale. most locales should have the following: #filter substitution pref("general.useragent.locale", "@ab_cd@") how it all works a large part of the review process takes place before you even...
MathML In Action
...
Mozilla Development Strategies
review. a twenty line patch doesn't take twice as long to review as a ten line patch, it usually takes much more time. if you can divide and conquer what you are working on into smaller chunks, you will find you'll get faster reviews. of course, not everything can be divided up. and, shorter fixes aren't necessarily better than longer ones. having parallel trees should allow you to work on other items while you are awaiting reviews. get advice before working on a patch or feature, instead of after if you are blocked, or stumped as to what to work on, talk to a lead sooner rather than later. most likely they will have a bug they can hand off to you, or they can help get you unblocked. since they are going to be reviewing your code later, run your plan of attack by them first. it's better to ...
AsyncTestUtils extended framework
key) removes the given tag from all the messages in the set. see the addtag notes. setjunk(abejunk) sets the junk score for the messages in the set as junk (true) / not junk (false). this does not involves the bayesian classifier and does not do anything like moving the message to the junk folder. it does, however, send a junkstatuschanged notification via the nsimsgfoldernotificationservice's itemevent mechanism. set manipulation union(aotherset) take the union of this set and the provided other set and return the (new, not modified) result. you should stop using both the message set that you called this on and the other set that you passed in unless you are very careful. namely, if you use async_move_messages / async_trash_messages on the resulting set, the original sets won't know ...
Leak And Bloat Tests
total memory usage (aka bloat). provide a consistent number from build to build where no source code has changed. provide reasonable coverage for the normal activities that a user performs. method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). ...
About NSPR
though it is possible to configure the network i/o channels as non-blocking in the traditional sense. network addresses part of nspr deals with manipulation of network addresses. nspr defines a network address object that is internet protocol (ip) centric. while the object is not declared as opaque, the api provides methods that allow and encourage clients to treat the addresses as polymorphic items. the goal in this area is to provide a migration path between ipv4 and ipv6. to that end it is possible to perform translations of ascii strings (dns names) into nspr's network address structures, with no regard to whether the addressing technology is ipv4 or ipv6. time timing facilities are available in two forms: interval timing and calendar functions. interval timers are based on a free ru...
PLHashAllocOps
syntax #include <plhash.h> typedef struct plhashallocops { void *(pr_callback *alloctable)(void *pool, prsize size); void (pr_callback *freetable)(void *pool, void *item); plhashentry *(pr_callback *allocentry)(void *pool, const void *key); void (pr_callback *freeentry)(void *pool, plhashentry *he, pruintn flag); } plhashallocops; #define ht_free_value 0 /* just free the entry's value */ #define ht_free_entry 1 /* free value and entire entry */ description users of the hash table functions can provide their own memory allocation functions. a pair of functions is used to allocate and tree the table, and another pair of functions is used to allocate and free the table entries. the first argument, pool, for all four functions is a void * pointer that is a piece of data for the mem...
PL_strlen
returns if successful, the function returns length of the specified string. ...
Function_Name
one-line description of what the function does (more than just what it returns). syntax #include <headers.h> returntype function_name( paramtype paramname, paramtype paramname, ); parameters paramname sample: in pointer to a certcertdbhandle representing the certificate database to look in paramname sample: in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description long description of this function, what it does, and why you would use it. describe all side-effects on "out" parameters. avoid describing the return until the next section, for example: this function looks in the nsscryptocontext and the nsstrustdomain to find the certificate that matches the der-encoded certificate. a ...
CERT_FindCertByDERCert
find a certificate in the database that matches a der-encoded certificate. syntax #include <cert.h> certcertificate *cert_findcertbydercert( certcertdbhandle *handle, secitem *dercert ); parameters handle in pointer to a certcertdbhandle representing the certificate database to look in dercert in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description this function looks in the ?nsscryptocontext? and the ?nsstrustdomain? to find the certificate that matches the der-encoded certificate. a match is found when the issuer and serial number of the der-encoded certificate are found on a certificate in the certificate database. returns a pointer to a certcertificate representing the certi...
NSS Certificate Download Specification
, which can be in any of the binary formats described above. this data must be base64 encoded as described by rfc 1113. following the data should be the following line: -----end certificate----- in a text format download, nss ignores any text before the first begin certificate line, and ignores any text after the first end certificate line. between those two lines, there must be exactly one item of any of the supported binary formats described above, and that one item must be base64 encoded. regardless of which of the supported binary formats is used, the begin and end lines must say certificate, and not any other word (such as key). the begin and end lines must begin and end with 5 dashes, with no extra leading or trailing white space (excluding the end of line characters). importing c...
Cryptography functions
sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cachestaticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypublickey mxr 3.6 and later seckey_copysubjectpublickeyinfo mxr 3.4 and later ...
Getting Started With NSS
keyword "good-first-bug" that you can view. creating your patch seee our section on nss sources, building, and testing to get started making your patch. when you're satisfied with it, you'll need code review. code review http://phabricator.services.mozilla.com/ is our code review tool, which uses your bugzilla account. use our phabricator user instructions to upload patches for review. some items that will be evaluated during code review are listed in checklist form on github. after passing review, your patch can be landed by a member of the nss team. you can find us on mozilla irc in channel #nss. note that we don't land code that isn't both reviewed and tested. code only works when it has tests, and tests only work when they're part of the automation. ...
NSS_3.12.1_release_notes.html
ug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool is still using static libraries. ...
NSS 3.16.2 release notes
s supported. use the new pk11_privdecrypt and pk11_pubencrypt functions with the ckm_rsa_pkcs_oaep mechanism. new intel aes assembly code for 32-bit and 64-bit windows, contributed by shay gueron and vlad krasnov of intel. new functions in cert.h ​cert_addextensionbyoid - adds an extension to a certificate. it is the same as cert_addextension except that the oid is represented by a secitem instead of a secoidtag. in pk11pub.h pk11_privdecrypt - decrypts with a private key. the algorithm is specified with a ck_mechanism_type. pk11_pubencrypt - encrypts with a public key. the algorithm is specified with a ck_mechanism_type. new macros in sslerr.h ssl_error_next_protocol_no_callback - an ssl error code that means the next protcol negotiation extension was ...
NSS 3.24 release notes
. for functions that use temporary arenas, allocating a portcheaparena on the stack is more performant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_freearena to allocate or free an instance on the heap, declare a portcheaparenapool on the stack and use port_initcheaparena/port_destroycheaparena to initialize and destroy it. items allocated from the arena are still created on the heap, only the arena itself is stack-allocated. note: this approach is only useful when the arena use is tightly bounded, for example, if it is only used in a single function. new elements this section lists and briefly describes the new functions, types, and macros in nss 3.24. new functions in ssl.h ssl_configservercert - configur...
NSS 3.38 release notes
an existing orphan private key can be reused. parameter -k may be used to specify the id of an existing orphan key. the available orphan key ids can be displayed using command certutil -k. when using certutil -o to print the chain for a given certificate nickname, the new parameter --simple-self-signed may be provided, which can avoid ambiguous output in some scenarios. new functions in secitem.h secitem_makeitem - allocate and make an item with the requested contents new macros in ssl.h ssl_record_size_limit - used to control the tls record size limit extension notable changes in nss 3.38 fixed cve-2018-0495 in bug 1464971. various security fixes in the asn.1 code. nss automatically enables caching for sql database storage on linux, if i...
NSS 3.54 release notes
.c. bug 1642153 - fix infinite recursion building nss. bug 1642638 - fix fuzzing assertion crash. bug 1642871 - enable ssl_sendsessionticket after resumption. bug 1643123 - support ssl_exportearlykeyingmaterial with external psks. bug 1643557 - fix numerous compile warnings in nss. bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys. bug 1645479 - don't use secitem_makeitem in secutil.c. bug 1646520 - stricter enforcement of asn.1 integer encoding. this bugzilla query returns all the bugs fixed in nss 3.54: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.54 compatibility nss 3.54 shared libraries are backward compatible with all older nss 3.x shared libraries. a p...
NSS Sample Code sample3
2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) {...
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to try to do some operation. pkcs #11 modules should fail with ckr_invalid_session. we are working to remove these cases as we find them. ...
TLS Cipher Suite Discovery
in order to communicate securely, an tls client and tls server must agree on the cryptographic algorithms and keys that they will both use on the secured connection. they must agree on these items: key establishment algorithm (such as rsa, dh, or ecdh) peer authentication algorithm (such as rsa, dsa, ecdsa) bulk data encryption algorithm (such as rc4, des, aes) and key size digest algorithm for message authentication checking (sha1, sha256) there are numerous available choices for each of those categories, and the number of possible combinations of all those choices is large. tls does not allow all possible combinations of choices from those categories to be used. instead, tls allows only certain well-defined combinations of those choices, known as cipher suites, defined in the ietf...
Creating JavaScript jstest reftests
f those features aren't present; or make it a jit-test (so that it never runs in the browser); or at the top of the test, add the comment // skip-if(!xulruntime.shell), so that it only runs in the shell. it is easy to make a test silently pass; anyone who has written js code for the web has written this kind of if-statement: if (typeof gc === 'function') { var arr = []; arr[10000] = 'item'; gc(); asserteq(arr[10000], 'item', 'gc must not wipe out sparse array elements'); } else { print('test skipped: no gc function'); } reportcompare(0, 0, 'ok'); handling abnormal test terminations some tests can terminate abnormally even though the test has technically passed. earlier we discussed the deprecated approach of using the -n naming scheme to identify tests whose passed,...
How to embed the JavaScript engine
d a bunch of native functions to define, you would probably put them in a table: static jsfunctionspec my_functions[] = { js_fn("doit", doit, doit_minargs, 0), /* etc... */ js_fs_end }; js_fs_end terminates the table. and say: ok = js_definefunctions(cx, global, my_functions); how to call javascript functions from c first, create arguments for the call, here i create arguments with 2 items: // [spidermonkey 24] js::autovaluearray is not defined. // js::autovaluevector argv(cx); // argv.resize(2); js::autovaluearray<2> argv(cx); argv[0].setint32(1); argv[1].setint32(2); then call the function: // [spidermonkey 24] pass arguments length and the 'jsval *' pointer. // js_callfunctionname(cx, global, "func", 2, argv.begin(), rval.address()); js_callfunctionname(cx, global, "func", ...
JSAPI User Guide
lls updates, so security fixes are deployed as soon as they are available. unless you also regularly deploy spidermonkey security updates, a determined hacker could use publicly known bugs in the engine to attack your application. note that the kind of attack we're talking about here is where a hacker uses javascript to attack the c++ code of the engine itself (or your embedding). the rest of the items in this list talk about security issues that arise within javascript itself, even if the engine is working properly. block simple denial-of-service attacks - a program like while(true){} should not hang your application. to stop execution of scripts that run too long, use js_setoperationcallback. likewise, a function like function f(){f();} should not crash your application with a stack overflo...
JSVAL_IS_DOUBLE
t any time. try to avoid using it. determines if a given jsval is a number represented as a jsdouble. syntax jsval_is_double(v) description jsval_is_double(v) is true if v is a number represented in memory as a jsdouble. to check whether v is a number, regardless of implementation details, use jsval_is_number instead. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js double data type. if (jsval_is_double(myitem)) { . . . } see also bug 952650 ...
JSVAL_IS_INT
s_int(v) description jsval_is_int(v) is true if the jsval v is a number represented in memory as an integer. to test whether a value is a number, regardless of how it is represented in memory, use jsval_is_number instead. to convert between c integer types and jsval, use jsval_to_int, int_fits_in_jsval, and int_to_jsval. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer data type. if (jsval_is_int(myitem)) { . . . } see also bug 952650 ...
JSVAL_IS_NULL
determine if a given jsval is null. syntax jsval_is_null(v) description jsval_is_null(v) is true if v is jsval_null, which is the javascript null value. (note: jsval_is_object(jsval_null) is also true.) example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it contains a null value. if (jsval_is_null(myitem)) { ... } see also bug 952650 ...
JSVAL_IS_NUMBER
e browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determine if a given jsval is a javascript number. syntax jsval_is_number(v) description jsval_is_number(v) is true if v is a javascript number. to convert a numeric jsval to a c floating-point number, use js_valuetonumber. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer or double value. if (jsval_is_number(myitem)) { ... } see also bug 952650 ...
JSVAL_IS_STRING
wsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is a string. syntax jsval_is_string(v) description jsval_is_string(v) is true if v is a string. to access the content of a string jsval, use jsval_to_string, js_getstringchars, and js_getstringlength. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a string. if (jsval_is_string(myitem)) { ... } see also bug 952650 ...
JSVAL_IS_VOID
hough it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. determines if a given jsval is the javascript value undefined. syntax jsval_is_void(v) description jsval_is_void(v) is true if v is jsval_void, which represents the javascript value undefined. example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is void. if (jsval_is_void(myitem)) { ... } see also bug 952650 ...
JS_EnterLocalRootScope
*vp) { jsbool ok; if (!js_enterlocalrootscope(cx)) return js_false; // this function doesn't need to bother rooting any new objects, // strings, or doubles it creates using cx. even if js_gc is // called, these new values will not be collected. ok = my_getpropertybody(cx, obj, id, vp); // when we leave the local root scope, this protection ends. new // items created in this local root scope become subject to gc. js_leavelocalrootscope(cx); return ok; } note: js_leavelocalrootscope or js_leavelocalrootscopewithresult must be called once for every prior successful call to js_enterlocalrootscope. if js_enterlocalrootscope fails, you must not make the matching js_leavelocalrootscope call. local root scopes do not cover objects that are the resu...
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 ...
ROLE_CELL
« gecko roles page represents a cell within a table. also, see role_table. ...
XForms Accessibility
pi accessible properties this section describes common rules how accessibility properties are formed for forms control elements. name it is formed from value of child xforms label element if the element doesn't have labelledby attribute. description it is formed from value of child xforms hint element if the element doesn't have describedby attribute. state it is formed as well from model item properties (mips) of instance node that xforms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. instance node states are mapped to accessibility state constants declared in nsiaccessiblestates interface like it shown below: relevant - state_unavailable readonly - state_readonly required - state_required invalid - state_invalid out of range - state...
Embedded Dialog API
decent documentation on writing factories or components? i can't find any.) both contain implementations of nsipromptservice as native dialogs. the replacement library should be installed during application initialization. the default dialog-posing library is a component (promptservice for instance is part of the embedding component), registered as a component during gecko initialization (by ns_initembedding). (line number accurate in version 1.30). after initializing embedding, an application can override a default factory by registering its replacement. a powerplant example can be found at cbrowserapp::overridecomponents (line number accurate in version 1.24) and an mfc example at cmfcembedapp::overridecomponents (line number accurate in version 1.20). the powerplant example is more is more ...
The Places database
bookmarks using places for more information. annotation tables moz_anno_attributes: contains the names of all the annotations in the system and a name id. there should be relatively few unique names. moz_annos: contains the values of page annotations. it maps a page (reference to moz_places) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. moz_items_annos: contains the values of bookmark item annotations. it maps a bookmark, folder or separator (reference to moz_bookmarks) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. favicon table moz_favicons: this contains a list of unique favicon uris and data. one or more pages in moz_places refer to each entry. when no pages reference a favicon, the ico...
FUEL
ing some of the xpcom formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. fuel has a fueliapplication interface that implements all the functions of extiapplication. the library has also been implemented in thunderbird ("steel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow xpcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code. th...
SMILE
uctive, by minimizing some of the xpcom formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. smile has a smileiapplication interface that implements all the functions of extiapplication. the library has also been implemented in firefox ("fuel") and in thunderbird ("steel"). objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication xpcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code. the object needs to be accessed like any other xpcom ...
STEEL
criptable thunderbird easy extension library. it is a fuel-like set of interfaces to facilitate thunderbird extension development. currently, steel has an steeliapplication interface that implements all the functions of extiapplication. the library has also been implemented in firefox ("fuel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication xpcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code. the object needs to be accessed like any other xpcom service: var application = components.classe...
Toolkit API
e management application update service safe mode printing official references structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how to package themes multiple-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps see also the following developer pages contain examples and discussions of particular topics: xul xul overlays developing extensions xulrunner developing themes dom ...
An Overview of XPCOM
reate components that can be reused in different applications or that can be replaced to change the functionality of existing applications. xpcom not only supports component software development, it also provides much of the functionality that a development platform provides, such as: component management file abstraction object message passing memory management we will discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a platform for component development, in which features such as those listed above are provided. gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level. the most important use of xpcom is within gecko, an open source, standards...
Receiving startup notifications
etter_copies(previous)); with "service," specified, the component is instantiated using nsicomponentmanager.getservice(). in either case, there's no need to additionally register for the startup notifications. simply registering with the category manager is enough. what happens next once you've registered with the category manager, at mozilla startup time (or when the embedding application's ns_initembedding() function is called), the appstartupnotifier component is instantiated, and its observe() method is called; this in turn enumerates all components in the app-startup category and sends them the appropriate notifications. ...
XPCOM guide
Mozilla › Tech › XPCOM › Guide
to get to them. in this document the term array refers to a container for multiple objects with a numeric, zero-based index.xpcom changes in gecko 2.0several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code.xpcom hashtable guidea hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences:xpcom stream guidein mozilla code, a stream is an object which represents access to a sequence of characters. it is not that sequence of characters, though: the characters may not all be available when you re...
Components.utils.Sandbox
dditional information such as origin attributes and same-origin privilege changes caused by setting document.domain. example of obtaining content principal from the window: var principal = gbrowser.selectedtab.linkedbrowser.contentprincipal; var sandbox = components.utils.sandbox(principal); expanded principal an expanded principal is specified as an array of the principals it subsumes. each item in the array should be an nsiprincipal, a dom window, or a uri. so this can be simply an array with a single element. for example the content principal above can be made expanded/extended like so: var principal = [gbrowser.selectedtab.linkedbrowser.contentprincipal]; // this is now an expanded (aka extended) principal var sandbox = components.utils.sandbox(principal); null principal you can cr...
nsIRegistry
la.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); now you have the registry service. rs.openwellknownregistry(2); // 2 signifies the applicationregistry, if i understand right var st = rs.enumerateallsubtrees(2); // 2 signifies "common", see libreg source (reg.h) for info now you have an nsienumerator that can report the subtrees. ...
XPCshell Test Manifest Expressions
supported. strings: any series of characters enclosed in double quotes " or single quotes '. no escape sequences are supported. variables variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by writemozinfo.py which writes mozinfo.json into the root of the build directory. see also the official docs for this set of variables. note that it currently seems like neither this list nor the one on the official docs is exhaustive, so if you need something and it's not here, best check the source code! os - the operating system on which the test is being run one of: 'win', 'mac', 'linux', 'a...
mozIStorageStatementParams
this interface has no defined properties, but has properties based on the named parameters found in the sql from the statement it was accessed off of. for example, say you create a statement like so: var statement = dbconn.createstatement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; for more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters. enumeration of properties you can also enumerate all the properties on this object with a for..in enumeration: // valuestobind is an object that contains key-value pairs // to bind to the statement be...
KeyboardShortcut
« nsiaccessible page summary provides localized string of accesskey name, such as alt+d (alt + d). the modifier may be affected by user and platform preferences. usually alt+letter (alt + letter), or just the letter alone for menu items. attribute astring keyboardshortcut; see also nsiaccessible.defaultkeybinding nsiaccessible.getkeybindings() ...
nsIAccessibleRelation
...
nsIApplicationCacheChannel
or_already_opened if set after calling asyncopen() on the channel. loadedfromapplicationcache prbool true if the resource was loaded from the application cache, otherwise false. this value may be false even if the resource is assigned to an application cache if, for example, it was loaded as a fallback. read only. methods markofflinecacheentryasforeign() a shortcut method to mark the cache item of this channel as 'foreign'. see the 'cache selection algorithm' and cache_selection_reload action handling in nscontentsink. void markofflinecacheentryasforeign(); parameters none. see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIAuthModule
intext data from the server. aouttokenlength the length of the output token buffer. exceptions thrown ns_error_not_implemented if the underlying authentication mechanism does not support security layers. wrap() once a security context has been established through calls to getnexttoken() it may be used to protect data exchanged between client and server. calls to this method are used to protect items of data to be sent to the server. void wrap( [const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the data to be sent to the server. aintokenlength the length of the input token. confidential if set to true, it will encrypt the data, otherwise data wil...
nsIAutoCompleteInput
ex the index number of the search session object whose name is to be returned. return value the name of the specified object. onsearchbegin() called when the search starts. void onsearchbegin(); parameters none. onsearchcomplete() called when the search ends successfully. void onsearchcomplete(); parameters none. ontextentered() called when the user selects and presses enter on a result item. boolean ontextentered(); parameters none. return value return true to prevent handling the selection. ontextreverted() called when the user cancels the autocomplete session. boolean ontextreverted(); parameters none. return value return true to prevent the reversion. selecttextrange() selects a range of text in the autocomplete text field. void selecttextrange( in long startindex, in long ...
nsIBlocklistPrompt
ers aaddons an array of addons and plugins that are blocked. these are javascript objects with properties: name - the plugin or extension name version - the version of the extension or plugin icon - the plugin or extension icon disable - can be used by the nsiblocklistprompt to allows users to decide whether a soft-blocked add-on should be disabled blocked - true if the item is hard-blocked, false otherwise item - the nsiplugintag or addon object acount optional the number of addons. ...
nsICacheService
temporaryclientid( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy. return value returns a newly created unique, temporary cache client id. exceptions thrown ns_error_not_implemented this method is deprecated. evictentries() this method evicts all entries in all devices implied by the storage policy. note: this function may evict some items but will throw if it fails to evict everything. void evictentries( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) initialize the cache service. void init(); parameters none. exceptions thrown missing exception missing descript...
nsIDOMFontFaceList
layout/inspector/public/nsidomfontfacelist.idlscriptable a list of nsidomfontface objects, each representing a single font face. 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list. read only. methods item() returns the nsidomfontface object at the specified index into the list. nsidomfontface item( in unsigned long index ); parameters index the index into the array of the font face object to return. return value an nsidomfontface object representing a single font face. see...
nsIDOMStorageEventObsolete
arameters typearg the type argument. canbubblearg true if the event is allowed to bubble, otherwise false. cancelablearg true if the event can be canceled, otherwise false. domainarg the domain to which the event belongs, or "#session" if the event is associated with session storage. see also storage storageevent structured client-side storage (html 5 specification) nsidomstorageitem ...
nsIDOMStorageList
dom/interfaces/storage/nsidomstoragelist.idlscriptable this interface is used to access the contextual storage areas used by globalstorage by domain. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes. nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object. return value the nsidomstorage object representing the data store for the specified domain.see also dom storage structured client-side storage (html 5 specification) nsidomwindow ...
nsIDownloadManager
ill be moved to the location indicated by atarget when the download is complete. this may be null. acancelable an object that can be used to abort the download. must not be null. aisprivate indicates whether this download should be considered private (ie. to be removed at the end of the private browsing session, cached in non-permanent storage, etc.) return value the newly created download item with the passed-in properties. addlistener() adds a listener to the download manager. void addlistener( in nsidownloadprogresslistener alistener ); parameters alistener the nsidownloadprogresslistener object to receive status information from the download manager. canceldownload() cancels the download with the specified id if it's currently in-progress. this calls cancel(ns_binding_...
nsIEffectiveTLDService
gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/effective-tld-service;1. to use this service, use: var etldservice = components.classes["@mozilla.org/network/effective-tld-service;1"] .getservice(components.interfaces.nsieffectivetldservice); the name "effective tld service" is a historical one; today, the items this interface manipulates are called public suffixes, and the list of them is the public suffix list, or psl. see publicsuffix.org for more information. the methods below implement the public suffix algorithm in full, including the implicit "*" rule. therefore, if you call getpublicsuffix("a.b.c.nonexistent"), you will get back "nonexistent" - this "tld" is not in the public suffix list, but t...
nsIEnumerator
... ...
nsIFeedResult
formation in a processing instruction. it's generally intended for use by clients designed to work with specific feeds. uri nsiuri the address from which the feed was fetched. version astring the version of the feed; null if a non-feed is processed. this value will be one of the following: atom, rss2, rss09, rss091, rss091userland, rss092, rss1, atom03, atomentry, rssitem methods registerextensionprefix() registers a prefix for a namespace used to access an extension in the feed or entry. warning: this method is not implemented at this time. void registerextensionprefix( in astring anamespace, in astring aprefix ); parameters anamespace the namespace for the extension. aprefix the prefix used to access the extension. see also nsis...
nsIFile
) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on utf-16 encoded characters strings. an alternate form operates on characters strings encoded in the "native" charse...
nsILoginManager
ith a new one. if newlogindata is a nsilogininfo, all of the old login's nsilogininfo properties are changed to the values from newlogindata (but the old login's nsiloginmetainfo properties are unmodified). if newlogindata is a nsipropertybag, only the specified properties will be changed. the nsiloginmetainfo properties of oldlogin can be changed in this manner. if the propertybag contains an item named "timesusedincrement", the login's timesused property will be incremented by the item's value. void modifylogin( in nsilogininfo oldlogin, in nsisupports newlogindata ); parameters oldlogin the login to be modified. newlogindata the login information to replace the oldlogin with. this may be specified as either an nsilogininfo or an nsipropertybag2 object. removealllogins() r...
nsIMenuBoxObject
openedwithkey boolean true if the menubar was opened using the keyboard; otherwise false. note: for gecko 2.0, the openedwithkey attribute exists on the nsimenuboxobject_mozilla_2_0_branch interface. subsequent gecko versions will have the attribute on the nsimenuboxobject interface. methods handlekeypress() boolean handlekeypress( in nsidomkeyeven...
nsIMsgDBViewCommandUpdater
void updatecommandstatus(); parameters none. displaymessagechanged() called when the displayed message has changed. void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message. asubject the subject of the selected message. akeywords keywords associated with the selected message.
nsIMsgIdentity
ses this to determine whether or not to ask the user to complete all the fields. smtpserverkey astring the preferred smtp server for this identity. if this is set, this is the smtp server that should be used for the message send. requestreturnreceipt boolean readonly: default request for return receipt option for this identity. if this is set, the return receipt menu item on the compose window will be checked. receiptheadertype long readonly: requestdsn boolean readonly: default request for dsn option for this identity. if this is set, the dsn menu item on the compose window will be checked. methods clearallvalues() note: this is really dangerous! this destroys all pref values; do not call this unless you know what you're doi...
nsIMutableArray
eak reference is requested, but the element does not support nsiweakreference. removeelementat() remove an element at a specific position, moving all elements stored at a higher position down one. to remove a specific element, use nsiarray.indexof() to find the index first, then call removeelementat. void removeelementat( in unsigned long index ); parameters index the position of the item. replaceelementat() replace the element at the given position. void replaceelementat( in nsisupports element, in unsigned long index, in boolean weak ); parameters element the new element to insert. index the position in the array. if the position is lower than the current length of the array, an existing element will be replaced. if the position is equal to the current l...
nsINavHistoryObserver
long atransitiontype, in acstring aguid, out unsigned long aadded ); parameters auri the uri of the page being visited. avisitid id of the visit that was just created. atime time of the visit. asessionid the id of one connected sequence of visits. areferringid the id of the visit the user came from. 0 if empty. atransitiontype the type of the item that is about to be removed; this is one of the nsinavbookmarksservice.constants defined in the nsinavbookmarksservice interface. aguid the unique id associated with the page. aadded incremented by query nodes when the visited uri belongs to them. if no such query exists, the history result creates a new query node dynamically. it is used in places views only and can be ignored. ...
nsINavHistoryQueryResultNode
nderbird 3.3 / seamonkey 2.1) note: if you request that places not be expanded in the options that generated the node, the node will report that it has no children and will never try to populate itself. method overview void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder. otherwise, this is set to -1. read only. queryoptions nsinavhistoryqueryoptions the options that group the node's children; only valid for result_type_query nodes. read only. methods getqueries() returns the queries that build the node's children; only valid for result_t...
nsINavHistoryService
in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries boolean true if there is any history. this can be used in ui to determine whether the "clear history" button should be enabled or not. this is much better than using browserhistory.count since that can be very slow if there is a lot of history (it must enumerate each item). this is pretty fast. historydisabled boolean true if history is disabled. currently, history is disabled if the browser.history_expire_days pref is "0". constants transition type constants constant value description transition_link 1 this transition type means the user followed a link and got a new toplevel window. transition_typed ...
nsINavHistoryVisitResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface describes a result from a result_type_visit query on the places service. it describes a visit to an entry; you can use it to determine the date and time of the last time the user visited a particular page, for example. this interface provides the session id so that it's possible to group items from the same session together. 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type description sessionid long long the session id of the visit, used for session grouping when a tree view is sorted by date. read only. see also nsinavhistoryresultnode ...
nsIWindowMediator
you should use getxulwindowenumerator(). however, if you are looking for the most recent nsixulwindow, it can be helpful to get the corresponding nsixulwindow from the nsidomwindow returned by getmostrecentwindow(). win.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem).treeowner .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsixulwindow) enumerating windows the following code can be used if you need to do something for each open window of a particular type. for example, you could use it in the "ok" handler of your options dialog to apply the new settings to each open browser window. var wm = co...
nsIXULTemplateBuilder
a template builder, given an input source of data, a template, and a reference point, generates a list of results from the input, and copies part of the template for each result. templates may generate content recursively, using the same template, but with the previous iteration's results as the reference point. as an example, for an xml data source the initial reference point would be a specific node in the dom tree and a template might generate a list of all child nodes. for the next iteration, those children would be used to generate output for their child nodes and so forth. ...
nsIZipReader
he zip file to open. example demonstrating this function: list contents of xpi and read file contents openinner() opens a zip file inside a zip file for reading. void openinner( in nsizipreader zipreader, in autf8string zipentry ); parameters zipreader the zipreader object. zipentry the zip entry. test() tests the integrity of the archive by performing a crc check on each item expanded into memory. if an entry is specified the integrity of only that item is tested. if null (javascript) or emptycstring() (c++) is passed in the integrity of all items in the archive are tested. void test( in autf8string aentryname ); parameters aentryname the single entity to check or null for checking all entries in the archive. examples list contents of xpi and read file con...
XPCOM reference
e are as follows.xpcom glue classesthese "glue" classes are provided to make it easier to use xpcom from c++ code.xpcom interface referencethis is a reference to the xpcom interfaces provided by the mozilla platform.xpcom interface reference by groupingthis page lists the current (as of dec. 01, 2010) list of mozilla interfaces as listed on the xpcom interface reference page where that page lists items by alphabetical sorting, this page attempts to group them by function. grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.)xpcom primitivean xpcom primitive is an xpcom object that "boxe...
XPCOM tasks
ved to netwerk p3 the `twips' units routines (or perhaps all routines) in "nsunitconversion.h" probably belong in layout. p3 nsstringtokenizer probably belongs in the parser. 5.1 3rd party code that doesn't use any services from our tree should be below xpcom; particularly, code xpcom could exploit, e.g., expat berkeley db changes to apis, functionality, and implementations the following items are listed (very) roughly in their order of importance, i.e., fixing observers is the first thing i want to do. p1 various threading issues, e.g., too many locks. see bug 13009. not enough locks. see bug 5795, bug 12755, and bug 12755. p1 we would like to move to a scheme where no one writes queryinterface, and we save code-space with a table driven implementation. a first step is moving a...
Index
go to tools > options or do thunderbird > preferences. if you are on mac os x, and on linux do edit > preferences on, select the advanced options panel, click on the general tab, and click on config editor. this will display a list of used preferences, as well as a search bar at the top. 70 thunderbird extensions add-ons, extensions, thunderbird categori 71 adding items to the folder pane this tutorial examines how to add items to an existing folder pane view. the result is a javascript file that will add a "numbers" container to the end of thunderbird's "all folders" mode. that container will have 3 child-items, the numbers 1, 2, and 3. clicking on those items will display the number in the main viewing pane of thunderbird. 72 adding view...
Mail composition back end
= 0; ns_imethod removelistener(nsimsgsendlistener *alistener) = 0; sending listener interfaces the nsimsgsendlistener interface will let a caller keep track of the progress and any status of a send operation. these are critical for message delivery since message sending is asynchronous. it is the only way to determine if the operation was successful or not. an important item to note is the fact that this interface should also implement the nsimsgcopyservicelistener interface if it wants to be notified of the progress and completion of the copy operation. nsimsgsendlistener the following describes the methods of the nsimsgsendlistener interface: onstartsending the onstartsending interface is called when the sending operation has...
Building a Thunderbird extension 3: install manifest
the first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of your website. while this value is in email address format, it is not an ema...
Finding the code for a feature
hich is part of my standard configuration). the second is mozilla's source code search tool mxr. i keep two prominent links to this on my firefox toolbar, one to comm-central string search, and one to comm-central file search. so, how did i use those to figure out how to do this? i know there is a menu command "tag" to tag the message - how does it do it? using dom inspector, i find the tag menu item, and i see that it uses command "cmd_tag". then i use mxr and look for "cmd_tag". i see it occurs in mail3panewindowcommands.js a couple of times. i look at the last occurrence, and see it is just an enable item with no real action involved. oops, i guess i need to get the submenu instead. repeating this process, i see that the submenu items all call a function togglemessagetagmenu. looking that ...
Use SQLite
g message created and row inserted.</p>'; document.queryselector('#status').innerhtml = msg; }); db.transaction(function (tx) { tx.executesql('select * from logs', [], function (tx, results) { var len = results.rows.length, i; msg = "<p>found rows: " + len + "</p>"; document.queryselector('#status').innerhtml += msg; for (i = 0; i < len; i++){ msg = "<p><b>" + results.rows.item(i).log + "</b></p>"; document.queryselector('#status').innerhtml += msg; } }, null); }); ...
WebIDL bindings
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 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 aindex in iterable storage nsastring& getkeyatindex(uint32_t aindex); // returns value of pair at aindex in iterable storage uint32_t& getvalueatindex(uint32_t aindex); } stringifiers named stringifiers operations in webidl will just invoke the corresponding c++ method. anonymous stringifiers in webidl wi...
Working with windows in chrome code
task is to access elements above your chrome document, i.e. to break out of your chrome window and access the ancestors. this can be done using the following statement: var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); this allows you to cross the chrome-content boundaries, and returns the main window object. finding already opened windows the window mediator xpcom component (nsiwindowmediator interface) provides information ab...
Using COM from js-ctypes
} finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetpropertystoreforwindow - this examples shows that coinit is not needed, some winapi functions return the interface. this example uses ipropertystore::setvalue to change the system.usermodelapp.id of an open firefox window. ishellitem ifileoperation ishelllink & ipersistfile - create shortcut files. example a - based on bugzilla :: bug 738501 - attachement 608538 exmaple b - based on example a ishelllink & ipersistfile & ipropertystore - uses ipropertystore to set and get the system.usermodelapp.id on shortcut files. ...
Examples
these examples demonstrate how to use js-ctypes. general using c struct and pointers an example on how to use basic c data types with js-ctypes. standard os libraries some examples on how to get cursor position on each os. mac os x these examples require mac os x to operate. add image to iphoto an extension that adds a contextual menu item to images that lets you easily add them to iphoto on mac os x. using objective-c from js-ctypes an example how to use objective-c from js-ctypes, by converting objective-c code into c code. using com from js-ctypes an example how to use com api of windows systems from js-ctypes, by converting c++ code to c code. using jni from js-ctypes an example how to use java from js-ctypes, by converting java code into c code. js-macosx an exten...
Drawing and Event Handling - Plugins
off-screen drawing of plug-ins. this makes it possible to manipulate plug-in contents. for example, a 3d application could use the contents of a plug-in as a texture map. because windowless plug-ins can be layered or drawn to arbitrary drawables, the browser (as opposed to the native windowing system) is responsible for controlling both their drawing and their event handling. ...
URLs - Plugins
sted on this table. url scheme description about locates browser information or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather than an internet resource. ftp (file transfer protocol) locates files and directories on internet hosts for file download. gopher (gopher protocol) locates specified items on a gopher server. obsolete since gecko 2.0 http (hypertext transfer protocol) locates resources on the internet. javascript executes javascript code that follows the url. netscape-specific. mailto (electronic mail address) locates the internet mailing address of an individual or service. nethelp displays a nethelp topic in a nethelp window. brows...
Debugging service workers - Firefox Developer Tools
nd then fill it again. the firefox devtools’ storage tab has a cache storage section that lists all the different caches you have stored under each different origin. right/ctrl clicking on one of the caches gives you two options: delete all — delete all caches under this origin. delete "name of cache" — delete only the highlighted cache. you can also click on one of the individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item, or every item in the cache. these options make it much easier to remove a cache if it is required for testing a code update. it is also worth knowing that if you are testing an app's offline capabilities, you'll be able to see whether requests are being retrieved from a service worker-initiated cache r...
Browser Toolbox - Firefox Developer Tools
enable it you need to check the settings "enable chrome and addon debugging" and "enable remote debugging". to do this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows ...
Debug worker threads - Firefox Developer Tools
the debugger shows the source code for all running worker threads — web workers, service workers, etc. — listed in the sources list. you can open the javascript file for the worker process and set breakpoints and logpoints just as you can with javascript code running on the main thread. inspecting worker code for example, see the selected item worker.js below — it is listed in a separate thread in the sources list, but appears in the source pane in the same way as main thread code when selected. setting breakpoints, etc. you can set a breakpoint (or logpoint) on any active worker thread: when execution is paused in a worker thread, the context of the debugger is updated to show the correct breakpoints, call stack, etc., just as you'd expect. ...
Access debugging in add-ons - Firefox Developer Tools
we are planning to deprecate the use by firefox add-ons of the techniques described in this document. don't write new add-ons that use these techniques. the following items are accessible in the context of chrome://browser/content/debugger.xul (or, in version 23 beta, chrome://browser/content/devtools/debugger.xul): window.addeventlistener("debugger:editorloaded") - called when the read-only script panel loaded. window.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the ...
Highlight and inspect DOM nodes - Firefox Developer Tools
if you hover over a dom node in the watch expresions, it will be highlighted in the page. when you are working with dom notes in the debugger, you can easily highlight the node on the page or view it in the page inspector. a dom object in the watch expressions area, for example, includes a target. hover over the target to highlight the item on the page, click on the target to switch to the page inspector with the item highlighted. also, when you view the details of a dom node in the code panel, objects that you can highlight in the list will also have a target next to them. you can click any one of these targets to switch to the page inspector with this item highlighted. ...
Set a conditional breakpoint - Firefox Developer Tools
example. to set a conditional breakpoint, activate the context menu in the source pane, on the line where you want the breakpoint, and select "add conditional breakpoint". you'll then see a textbox where you can enter the expression. press return to finish. conditional breakpoints are shown as orange arrows laid over the line number. if you context-click on any breakpoint, you'll see a menu item "edit breakpoint". you can use this to modify an existing condition or to add a condition to a normal breakpoint. ...
Set an XHR breakpoint - Firefox Developer Tools
ter the url in which you are interested, and press enter. note: if you enter a key word instead of a url, code execution will pause on any call to a url that contains that keyword. when your code breaks on an xhr request, the righthand pane will have two additional sections: call stack the list of functions that were executed in order ot get to the currently executing code. click on an item in the call stack to jump to the associated line in the code display. scopes a list of the values that are in scope in the function, method, or event handler where the break occurred. inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through. see set a breakpoint > inline variable preview for mor...
Tutorial: Set a breakpoint - Firefox Developer Tools
...
DevTools API - Firefox Developer Tools
er key or keycode value. modifiers string, optional. modifiers for the keyboard shortcut. preventclosingonkey boolean, optional. if true the tool won't close if its keybinding is pressed while it is active. default: false inmenu boolean, optional. if true the tool will be shown in the developer menu. default: false menulabel string, optional. a label for the developer menu item. default: {label} accesskey string, optional. accesskey for the developer menu <xul:menuitem>. example here's a minimal definition for a tool. let def = { id: "my-tool", label: "my tool", icon: "chrome://browser/skin/devtools/tool-webconsole.svg", url: "about:blank", istargetsupported: target => true, build: (window, toolbox) => new mytoolpanel(window, toolbox) }; // regist...
Aggregate view - Firefox Developer Tools
in the snapshot. if we click the star-triangle, we'll see all four array instances: for each instance, you can see the retained size and shallow size of that instance. in this case, you can see that the first three arrays have a fairly large shallow size (5% of the total heap usage) and a much larger retained size (26% of the total). on the right-hand side is a pane that just says "select an item to view its retaining paths". if you select an item, you'll see the retaining paths panel for that item: call stack the call stack shows you exactly where in your code you are making heap allocations. because tracing allocations has a runtime cost, it must be explicitly enabled by checking "record call stacks" before you allocate the memory in the snapshot. you'll then see a list of all...
Dominators view - Firefox Developer Tools
paths for a node, you have to select the node in the dominators tree panel: here, we've selected an object, and can see a single path back to a gc root. the window gc root holds a reference to an htmldivelement object, and that holds a reference to an object, and so on. if you look in the dominators tree panel, you can trace the same path there. if either of these references were removed, the items below them could be garbage-collected. each connection in the graph is labeled with the variable name for the referenced object. sometimes there's more than one retaining path back from a node: here there are three paths back from the documentprototype node to a gc root. if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the ...
Tree map view - Firefox Developer Tools
e top level into four categories: objects: javascript and dom objects, such as function, object, or array, and dom types like window and htmldivelement. scripts: javascript sources loaded by the page. strings other: this includes internal spidermonkey objects. each category is represented with a rectangle, and the size of the rectangle corresponds to the proportion of the heap occupied by items in that category. this means you can quickly get an idea of roughly what sorts of things allocated by your site are using the most memory. within top-level categories: objects is further divided by the object's type. scripts is further subdivided by the script's origin. it also includes a separate rectangle for code that can't be correlated with a file, such as jit-optimized code. other is...
Examine and edit CSS - Firefox Developer Tools
rline; color: cadetblue; font-weight: bold; } add rules you can add new rules in the rules view. ...
Responsive Design Mode - Firefox Developer Tools
nally, firefox sets the user-agent http request header to identify itself as the default browser on the selected device. for example, if you've selected an iphone, then firefox identifies itself as safari. the navigator.useragent property is set to the same value. the devices listed in the drop-down are just a subset of the devices that can be selected. at the end of the drop-down, there is an item labeled edit list. select this to see a panel containing all the choices, which enables you to check the devices you want to see in the drop-down. the set of devices, and the values associated with each device, are taken from https://github.com/mozilla/simulated-devices. you can also define a custom device, as described below. creating custom devices you can create and save custom devices in re...
Shader Editor - Firefox Developer Tools
hader editor, you can examine and edit the source of the vertex and fragment shaders. here's another screencast, showing how you can use the shader editor for complex applications (in this case, the unreal engine demo): opening the shader editor the shader editor is disabled by default. to enable it, open the toolbox settings and check "shader editor" in the "default firefox developer tools" item. you'll now see "shader editor" appear in the toolbar. click it and the shader editor opens. at first you'll just see a blank window with a button asking you to reload the page: to get started, load a page which creates a webgl context and loads a program into it. the screenshots below are from the unreal engine demo. you'll now see a window divided into three panes: a list of all the glsl...
Cookies - Firefox Developer Tools
xisting table headings and use the resulting context menu to show/hide the columns. you can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want. context menu the context menu for each cookie includes the following commands: add item - add a new cookie. delete <cookie name>.<domain> - deletes the selected cookie delete all from <domain> - deletes all cookies from the selected domain. this must be an exact match. for example, if you select "delete all from test8.example.com" only cookies from that domain will be deleted. cookies from "test13.example.com" will not be deleted. delete all - deletes all cookies for the current ...
Extension Storage - Firefox Developer Tools
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: key — the name of the stored item. value — the value of the stored item. storage area — the name of the area where the item is stored. ...
Local Storage / Session Storage - Firefox Developer Tools
when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table. you can edit local and session storage items by double-clicking inside cells in the table widget and editing the values they contain: you can delete local storage and session storage entries using the context menu: you can also delete local and session storage entries by selecting an item and pressing the delete or backspace key. finally, you can add new storage items by clicking the "plus" (+) button and then editing the resulting new row to the value you want. ...
Style Editor - Firefox Developer Tools
editor supports autocomplete. just start typing, and it will offer you a list of suggestions. you can switch autocomplete off in the style editor settings. the media sidebar the style editor displays a sidebar on the right-hand side whenever the current sheet contains any @media rules. the sidebar lists the rules and provides a link to the line of the sheet where the rule is defined. click an item to jump to that rule in the sheet. the condition text of the rule is greyed-out if the media query doesn’t currently apply. the media sidebar works especially well with responsive design view for creating and debugging responsive layouts: from firefox 46 onwards, if an @media rule contains a screen size in a condition, then it is made clickable: clicking it then resizes the screen to that s...
View Source - Firefox Developer Tools
the keyboard, press control + option + l on macos, or alt + shift + l on windows or linux. link to a line number it is possible to link to a particular line, by adding the #linennn anchor to the url the browser will jump to the nnn line. for example view-source:https://www.mozilla.org/#line100 view selection source if you select part of a web page and conext-click, you'll see a context menu item labeled "view selection source", that behaves just like "view page source", except you only see the source for the selection. view mathml source if you context-click while the mouse is over some mathml, you'll see a context menu item labeled "view mathml source": click it to see the mathml source. limitations of view source there are limitations to what view source does for you that you need ...
Web Console Helpers - Firefox Developer Tools
...
Firefox Developer Tools
e page or of a single element. measure a portion of the page measure a specific area of a web page. rulers overlay horizontal and vertical rulers on a web page for the latest developer tools and features, try firefox developer edition. download firefox developer edition connecting the developer tools if you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. but you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices. about:debugging debug add-ons, content tabs, and workers running in the browser. connecting to firefox for android connect the developer tools to an instance of firefox running...
AnalyserNode.getByteFrequencyData() - Web APIs
the getbytefrequencydata() method of the analysernode interface copies the current frequency data into a uint8array (unsigned byte array) passed into it. the frequency data is composed of integers on a scale from 0 to 255. each item in the array represents the decibel value for a specific frequency. the frequencies are spread linearly from 0 to 1/2 of the sample rate. for example, for 48000 sample rate, the last item of the array will represent the decibel value for 24000 hz. if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new uint8array(analyser.frequencybincount); // ui...
AudioParam.setValueCurveAtTime() - Web APIs
tion a double representing the total time (in seconds) over which the parameter's value will change following the specified curve. the specified values are spaced equally along this duration. return value a reference to this audioparam object. some older browser implementations of this interface return undefined. exceptions invalidstateerror the specified array of values has fewer than 2 items in it. rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number. typeerror one or more of the values in the values array is non-finite. non-finite values are nan, infinity, and -infinity. usage notes when the parameter's value finishes following the curve, its value is guaranteed to match the last value in the set o...
AudioWorkletProcessor.process - Web APIs
heck the size of the sample array rather than assuming a particular size. this size may even be allowed to change over time, so you mustn't look at just the first block and assume the sample buffers will always be the same size. syntax var isactivelyprocessing = audioworkletprocessor.process(inputs, outputs, parameters); parameters inputs an array of inputs connected to the node, each item of which is, in turn, an array of channels. each channel is a float32array containing 128 samples. for example, inputs[n][m][i] will access n-th input, m-th channel of that input, and i-th sample of that channel. each sample value is in range of [-1 .. 1]. the number of inputs and thus the length of that array is fixed at the construction of the node (see audioworkletnodeoptions). if there is...
Background Tasks API - Web APIs
renttasknumberelem is the element used to display the number of tasks processed so far. progressbarelem is the <progress> element showing the percentage of the tasks processed so far. startbuttonelem is the start button. logelem is the <div> we'll insert logged text messages into. let logfragment = null; let statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered. statusrefreshscheduled is used to track whether or not we've already scheduled an update of the status display box for the upcoming frame, so that we only do it once per frame the shim to function even if idle cal...
BeforeInstallPromptEvent - Web APIs
ace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeinstallpromptevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor beforeinstallpromptevent() creates a new beforeinstallpromptevent. properties inherits properties from its parent, event. beforeinstallpromptevent.platforms read only returns an array of domstring items containing the platforms on which the event was dispatched. this is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dis...
CSSPositionValue.x - Web APIs
syntax var x = csspositionvalue.x value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
CSSPositionValue.y - Web APIs
syntax var y = csspositionvalue.y value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
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. ...
CSSStyleDeclaration.setProperty() - Web APIs
">border</button> <button class="bgcolor">background</button> <button class="color">text</button> </div> <div class="box"> <p>box</p> </div> css html { background: orange; font-family: sans-serif; height: 100%; } body { height: inherit; width: 80%; min-width: 500px; max-width: 1000px; margin: 0 auto; } .controls { display: flex; justify-content: space-around; align-items: center; } div button { flex: 1; margin: 20px; height: 30px; line-height: 30px; } .box { display: flex; justify-content: center; align-items: center; height: calc(100% - 70px); } .box p { width: 50%; text-align: center; font-weight: bold; font-size: 40px; height: 150px; line-height: 150px; background: red; border: 5px solid purple; color: white; transition:...
CSSStyleSheet.addRule() - Web APIs
selector a domstring specifying the selector portion of the css rule. the default is the string undefined. styleblock a domstring indicating the style block to apply to elements matching the selector. the default is the string undefined. index optional an optional index into the stylesheet's cssrulelist at which to insert the new rule. if index is not specified, the next index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length). return value always returns -1. note that due to somewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown. see insertrule() for more information. usage notes this method is implemented by browsers by constructing a string using the template literal `${...
CSSStyleSheet.cssRules - Web APIs
syntax var rules = cssstylesheet.cssrules; value a live-updating cssrulelist containing each of the css rules making up the stylesheet. each entry in the rule list is a cssrule object describing one rule making up the stylesheet. ...
CSSStyleSheet - Web APIs
the various ways a cssstylesheet object can be obtained. properties inherits properties from its parent, stylesheet. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the stylesheet. this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified index into ...
CSSUnparsedValue.length - Web APIs
syntax var length = cssunparsedvalue.length; value an integer. ...
CSSUnparsedValue - Web APIs
ts property values that reference custom properties. it consists of a list of string fragments and variable references. custom properties are represented by cssunparsedvalue and var() references are represented using cssvariablereferencevalue. constructor cssunparsedvalue.cssunparsedvalue() creates a new cssunparsedvalue object. properties cssunparsedvalue.length returns the number of items in the cssunparsedvalue object. methods cssunparsedvalue.entries() returns an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well). cssunparsedvalue.foreach() executes a provided function once for each element of the cssunpar...
CSS Painting API - Web APIs
ockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10, y); ctx.closepath(); ctx.fill(); ctx.stroke(); } } }); we then include the paintworklet: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> <...
Cache - Web APIs
Web › API › Cache
r example as part of the serviceworker life cycle. note that the cache interface is exposed to windowed scopes as well as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. an origin can have multiple, named cache objects. you are responsible for implementing how your script (e.g. in a serviceworker) handles cache updates. items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted. use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usage estim...
CanvasRenderingContext2D.clearRect() - Web APIs
syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). ...
Basic animations - Web APIs
div#selector>div { flex-basis: 30% } @keyframes diss { from { opacity: 1 } to { opacity: 0 } } .keypress>div { border: dashed 3px #fff; height: 48%; width: 48%; display: flex; align-content: center; justify-content: center; align-self: center; align-items: center; font-size: -webkit-xxx-large; font-weight: 900; color: #fff; transition: .5s; opacity: .1; border-radius: 7px } .keypress { position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; display: flex; flex-wrap: wrap; justify-content: space-around; opacity: 1...
Optimizing canvas - Web APIs
e. don’t scale images in drawimage cache various sizes of your images on an offscreen canvas when loading as opposed to constantly scaling them in drawimage(). use multiple layered canvases for complex scenes in your application, you may find that some objects need to move or change frequently, while others remain relatively static. a possible optimization in this situation is to layer your items using multiple <canvas> elements. for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged. <div id="stage...
Clipboard API - Web APIs
ard secure context provides an interface for reading and writing text and data to or from the system clipboard. the specification refers to this as the 'async clipboard api.' clipboardevent secure context represents events providing information related to modification of the clipboard, that is cut, copy, and paste events. the specification refers to this as the 'clipboard event api'. clipboarditem secure context represents a single item format, used when reading or writing data. specifications specification status comment clipboard api and events working draft initial definition. ...
Console.info() - Web APIs
Web › API › Console › info
note: this feature is available in web workers. syntax console.info(obj1 [, obj2, ..., objn]); console.info(msg [, subst1, ..., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. ...
CustomElementRegistry.whenDefined() - Web APIs
the provided name is not a valid custom element name, the promise rejects with a syntaxerror. examples this example uses whendefined() to detect when the custom elements that make up a menu are defined. the menu displays placeholder content until the actual menu content is ready to display. <nav id="menu-container"> <div class="menu-placeholder">loading...</div> <nav-menu> <menu-item>item 1</menu-item> <menu-item>item 2</menu-item> ... <menu-item>item n</menu-item> </nav-menu> </nav> const container = document.getelementbyid('menu-container'); const placeholder = container.queryselector('.menu-placeholder'); // fetch all the children of menu that are not yet defined. const undefinedelements = container.queryselectorall(':not(:defined)'); const promises = [..
DOMImplementationList - Web APIs
returned by domimplementationsource.getdomimplementationlist() and domimplementationregistry.getdomimplementationlist() . can be iterated with 0-based index. properties domimplementationlist.length read only returns an integer. methods domimplementationlist.item() returns the pos item. specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'domimplementationlist' in that specification. obsolete initial definition. ...
DOMStringList - Web APIs
a type returned by some apis which contains a list of domstring (strings). properties domstringlist.length read only returns the length of the list. methods domstringlist.item() returns a domstring. domstringlist.contains() returns boolean indicating if the given string is in the list specifications specification status comment html living standardthe definition of 'domstringlist' in that specification. living standard initial specification ...
DOMTokenList - Web APIs
htmliframeelement.sandbox, or htmloutputelement.htmlfor. it is indexed beginning with 0 as with javascript array objects. domtokenlist is always case-sensitive. properties domtokenlist.length read only is an integer representing the number of objects stored in the object. domtokenlist.value a stringifier property that returns the value of the list as a domstring. methods domtokenlist.item(index) returns the item in the list by its index, or undefined if index is greater than or equal to the list's length. domtokenlist.contains(token) returns true if the list contains the given token, otherwise false. domtokenlist.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the list. domtokenlist.remove(token1[, token2[, ...tokenn]]) removes the specified token(s) from ...
DataTransfer.dropEffect - Web APIs
to the action that was desired, which will be the value dropeffect had after the last dragenter or dragover event. in a dragend event, for instance, if the desired dropeffect is "move", then the data being dragged should be removed from the source. syntax datatransfer.dropeffect; values a domstring representing the drag operation effect. the possible values are: copy a copy of the source item is made at the new location. move an item is moved to a new location. link a link is established to the source at the new location. none the item may not be dropped. assigning any other value to dropeffect has no effect and the old value is retained. example this example shows the use of the dropeffect and effectallowed properties. html content <div> <p id="source" ondragstart="drag...
DataTransfer.effectAllowed - Web APIs
event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted. assigning a value to effectallowed in events other than dragstart has no effect. syntax datatransfer.effectallowed; values a domstring representing the drag operation that is allowed. the possible values are: none the item may not be dropped. copy a copy of the source item may be made at the new location. copylink a copy or link operation is permitted. copymove a copy or move operation is permitted. link a link may be established to the source at the new location. linkmove a link or move operation is permitted. move an item may be moved to a new location. all all operations are permitted. uninitializ...
DataTransfer.files - Web APIs
if the drag operation had no files, the list is empty. ...
DataTransfer.setData() - Web APIs
if data for the given type already exists, the existing data is replaced in the same position. that is, the order of the types list is not changed when replacing data of the same type. example data types are text/plain and text/uri-list. ...
Document: DOMContentLoaded event - Web APIs
fired dosomething(); } live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { win...
Document.forms - Web APIs
Web › API › Document › forms
the forms read-only property of the document interface returns an htmlcollection listing all the <form> elements contained in the document. note: similarly, you can access a list of a form's component user input elements using the htmlformelement.elements property. syntax collection = document.forms; value an htmlcollection object listing all of the document's forms. each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. examples getting form information <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form id="robby"> <input type="button" onclick="alert(document.forms[0].id);" value="robby's form" /> </form>...
Document.images - Web APIs
Web › API › Document › images
y of the document interface returns a collection of the images in the current html document. syntax var imagecollection = document.images; value an htmlcollection providing a live list of all of the images contained in the current document. each entry in the collection is an htmlimageelement representing a single image element. usage notes you can use either javascript array notation or the item() method on the returned collection to access the items in the collection. the following are equivalent: firstimage = imagecollection.item(0); firstimage = imagecollection[0]; example this example looks through the list of images and finds one whose name is "banner.gif". var ilist = document.images; for(var i = 0; i < ilist.length; i++) { if(ilist[i].src == 'banner.gif') { // fo...
Document.mozSyntheticDocument - Web APIs
the document.mozsyntheticdocument property indicates whether or not the document is a synthetic one; that is, a document representing a standalone image, video, audio, or the like. syntax var issynthetic = document.mozsyntheticdocument; on return, issynthetic is true if the document is a synthetic one; otherwise it's false. example this can be useful if you have a contextual menu item you only want to display for synthetic documents (or, conversely, for documents that aren't synthetic). var issynthetic = document.mozsyntheticdocument; if (issynthetic) { /* insert your menu item here */ } specifications not part of any specification. ...
Document.popupNode - Web APIs
et for popups attached via the popup or context attributes. for other types of popups, the value is not changed. in these other cases, for example when calling the popup's showpopup method, you may wish to set the popupnode property directly beforehand. this property applies only to xul documents. syntax var node = document.popupnode; example <menupopup id="toolbarcontextmenu"> ... <menuitem oncommand="mailnewscore.deletebutton(document.popupnode)"> ... </menupopup> ...
Document: readystatechange event - Web APIs
atechange examples live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { win...
Document.styleSheetSets - Web APIs
tylesheetsets; on return, sets is a list of style sheet sets that are available. example given an <ul> (list) element with the id "sheetlist", you can populate it with the names of all the available style sheet sets with code like this: let list = document.getelementbyid('sheetlist'); let sheets = document.stylesheetsets; list.innerhtml = ''; for (let i = 0; i < sheets.length; i++) { let item = document.createelement('li'); item.innerhtml = sheets[i]; list.appendchild(item); } notes the list of available style sheet sets is constructed by enumerating all the style sheets available for the document, in the order in which they're listed in the document.stylesheets attribute, adding the title of each style sheet that has a title to the list. duplicates are dropped from the list (u...
Document: wheel event - Web APIs
on the wheel event's delta* properties to get the scrolling direction. instead, detect value changes of scrollleft and scrolltop in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
Locating DOM elements using selectors - Web APIs
the selectors api provides methods that make it quick and easy to retrieve element nodes from the dom by matching against a set of selectors. this is much faster than past techniques, wherein it was necessary to, for example, use a loop in javascript code to locate the specific items you needed to find. the nodeselector interface this specification adds two new methods to any objects implementing the document, documentfragment, or element interfaces: queryselector() returns the first matching element node within the node's subtree. if no matching node is found, null is returned. queryselectorall() returns a nodelist containing all matching element nodes within the node's subtree, or an empty nodelist if no matches are found. note: the nodelist returned by queryselectorall() i...
Using the W3C DOM Level 1 Core - Web APIs
ollowing script would do the job: html content <body> <input type="button" value="change this document." onclick="change()"> <h2>header</h2> <p>paragraph</p> </body> javascript content function change() { // document.getelementsbytagname("h2") returns a nodelist of the <h2> // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h2").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document". var para = document.getelementsbytagname("p").item(0); para.firstchild.data = "this is the first paragraph."; // create a new text node for the second paragraph var newtext = document.createtextnode("this is the second paragrap...
Document Object Model (DOM) - Web APIs
representing one of (or a family of closely related) elements. the html dom api provides access to various browser features such as tabs and windows, css styles and stylesheets, browser history, and so forth. these interfaces are discussed further in the html dom api documentation. ...
Element: MSManipulationStateChanged event - Web APIs
...
Element: auxclick event - Web APIs
tion to capturing the auxclick event using onauxclick, the contextmenu event is also captured, and preventdefault() called on that event, in order to prevent the context menu from popping up after the color change is applied. html <button><h1>click me!</h1></button> css html { height: 100%; overflow: hidden; } body { height: inherit; display: flex; justify-content: center; align-items: center; margin: 0; } button { border: 0; background-color: white; font-size: 8vw; display: block; width: 100%; height: 100%; } h1 { letter-spacing: 0.5rem; } result note: if you are using a three-button mouse, you'll notice that the onauxclick handler is run when any of the non-left mouse buttons are clicked (usually including any "special" buttons on gaming mice). spe...
Element.className - Web APIs
Web › API › Element › className
the classname property of the element interface gets and sets the value of the class attribute of the specified element. syntax var cname = elementnodereference.classname; elementnodereference.classname = cname; cname is a string variable representing the class or space-separated classes of the current element. example let el = document.getelementbyid('item'); if (el.classname === 'active'){ el.classname = 'inactive'; } else { el.classname = 'active'; } notes the name classname is used for this property instead of class because of conflicts with the "class" keyword in many languages which are used to manipulate the dom. classname can also be an instance of svganimatedstring if the element is an svgelement. it is better to get/set the classname of an element using element.getat...
Element.closest() - Web APIs
Web › API › Element › closest
eventually. however, it will only support css 2.1 selectors in ie 8, and it can cause severe lag spikes in production websites. if (window.element && !element.prototype.closest) { element.prototype.closest = function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {}; } while ((i < 0) && (el = el.parentelement)); return el; }; } specifications specification status comment domthe definition of 'element.closest()' in that specification. living standard initial definition. ...
Element: error event - Web APIs
ml <div class="controls"> <button id="img-error" type="button">generate image error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { l...
Element.getClientRects() - Web APIs
="withclientrectsoverlay">paragraph that spans multiple lines</span> </p> </div> example 2: this html creates three ordered lists. client rects are painted for the <ol> in the second block, and for each <li> element in the third block. <h3>a list</h3> <p>note that the border box doesn't include the number, so neither do the client rects.</p> <div> <strong>original</strong> <ol> <li>item 1</li> <li>item 2</li> </ol> </div> <div> <strong>ol's rect</strong> <ol class="withclientrectsoverlay"> <li>item 1</li> <li>item 2</li> </ol> </div> <div> <strong>each li's rect</strong> <ol> <li class="withclientrectsoverlay">item 1</li> <li class="withclientrectsoverlay">item 2</li> </ol> </div> example 3: this html creates two tables with captions. client ...
Element.matches() - Web APIs
Web › API › Element › matches
ie9+ support). if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } specification ...
Element.releasePointerCapture() - Web APIs
n explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element.setPointerCapture() - Web APIs
n explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element: show event - Web APIs
the show event is fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute. bubbles no cancelable no interface event event handler property onshow examples <div contextmenu="test"></div> <menu type="context" id="test"> <menuitem label="alert" onclick="alert('the alert label has been clicked')" /> </menu> <script> document.getelementbyid("test").addeventlistener("show", function(e){ alert("the context menu will be displayed"); }, false); </script> specifications specification status html5the definition of 'show event' in that specification. recommendation ...
Element: wheel event - Web APIs
vent's delta* properties to get the scrolling direction. instead, detect value changes of scrollleft and scrolltop of the target in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
Event.explicitOriginalTarget - Web APIs
case currenttarget will show the parent and explicitoriginaltarget will show the text node. explicitoriginaltarget differs from originaltarget in that it will never contain anonymous content. example this property can be used with <command> to get the event details of the original object calling the command. function mycommand(ev) { alert(ev.explicitoriginaltarget.nodename); // returns 'menuitem' } <xul:command id="my-cmd-anaction" oncommand="mycommand(event);"/> <xul:menulist> <xul:menupopup> <xul:menuitem label="get my element name!" command="my-cmd-anaction"/> </xul:menupopup> </menulist> specifications this is a mozilla-specific property. defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
File.webkitRelativePath - Web APIs
ctory hierarchies is generated and displayed. html content <input type="file" id="filepicker" name="filelist" webkitdirectory multiple /> <ul id="listing"></ul> javascript content document.getelementbyid("filepicker").addeventlistener("change", function(event) { let output = document.getelementbyid("listing"); let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath; output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe definition of 'webkitrelativepath' in that specification. draft initial specification. this api has no official w3c or whatwg specification...
FileReader.result - Web APIs
Web › API › FileReader › result
ead(), which reads a file from a file input. it works by creating a filereader object and creating a listener for load events such that when then file is read, the result is obtained and passed to the callback function provided to read(). the content is handled as raw text data. var fileinput = document.queryselector('input[type="file"]'); function read(callback) { var file = fileinput.files.item(0); var reader = new filereader(); reader.onload = function() { callback(reader.result); } reader.readastext(file); } specifications specification status comment file apithe definition of 'result' in that specification. working draft initial definition ...
FileSystem - Web APIs
it's not available for use in file or folder picker panels (such as when you use an <input> element with the htmlinputelement.webkitdirectory attribute.firefox full support 50ie no support noopera full support 15prefixed ...
FileSystemDirectoryReader - Web APIs
entry in a directory. because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. check the browser compatibility section for details. methods readentries() returns an array containing some number of the directory's entries. each item in the array is an object based on filesystementry—typically either filesystemfileentry or filesystemdirectoryentry. specifications specification status comment file and directory entries api draft draft of proposed api this api has no official w3c or whatwg specification. browser compatibility the compatibility table on this page is generated from ...
FileSystemEntry.getMetadata() - Web APIs
operation is succesfully completed. receives a single input parameter: a metadata object with information about the file. errorcallback optional an optional callback which is executed if an error occurs while looking up the metadata. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.not_found_err the filesystementry refers to an item which doesn't exist. fileerror.security_err security restrictions prohibit obtaining the requested metadata. example this example checks the size of a log file in a temporary folder and, if it exceeds a megabyte, moves it into a different directory. workingdirectory.getfile("tmp/log.txt", {}, function(fileentry) { fileentry.getmetadata(function(metadata) { if (metadata.size > 1048576)...
File and Directory Entries API support in Firefox - Web APIs
marized as follows: content scripts can't create file systems or initiate access to a file system. there are only two ways to get access to file system entries at this time: the <input> element, using the htmlinputelement.webkitentries property to access an array of filesystementry objects describing file system entries you can then read. using drag and drop by calling the datatransferitem.getasentry() method, which lets you get a filesystemfileentry or filesystemdirectoryentry for files dropped on a drop zone. you can't use the localfilesystem.requestfilesystem() method to get access to a specified local file system. the localfilesystem.resolvelocalfilesystemurl() method isn't implemented. only the asynchronous versions of the interfaces are implemented. any interfaces wit...
File and Directory Entries API - Web APIs
x also does not implement the synchronous api. check the browser compatibility for any part of the api you use carefully, and see file and directory entries api support in firefox for more details. getting access to a file system there are two ways to get access to file systems defined in the current specification draft: when handling a drop event for drag and drop, you can call datatransferitem.webkitgetasentry() to get the filesystementry for a dropped item. if the result isn't null, then it's a dropped file or directory, and you can use file system calls to work with it. the htmlinputelement.webkitentries property lets you access the filesystemfileentry objects for the currently selected files, but only if they are dragged-and-dropped onto the file chooser (bug 1326031). if htmlinput...
Using FormData Objects - Web APIs
eholder="email" required size="32" maxlength="64" /><br /> <label>custom file label:</label> <input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stash:</label> <input type="file" name="file" required /> <input type="submit" value="stash the file!" /> </form> <div></div> then you can send it using code like the following: var form = document.forms.nameditem("fileinfo"); form.addeventlistener('submit', function(ev) { var ooutput = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ...
GlobalEventHandlers.oncontextmenu - Web APIs
u = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. ...
GlobalEventHandlers.onwheel - Web APIs
nt. syntax target.onwheel = functionref; value functionref is a function name or a function expression. the function receives a wheelevent object as its sole argument. examples this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
HTMLDListElement - Web APIs
<text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldlistelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldlistelement.compact is a boolean indicating that spacing between list items should be reduced. methods no specific methods; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldlistelement' in that specification. living standard html5the definition of 'htmldlistelement' in that specification. recommendation no change from document object ...
HTMLFormControlsCollection - Web APIs
monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlformcontrolscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of its parent, htmlcollection. methods this interface inherits the methods of its parent, htmlcollection. htmlformcontrolscollection.nameditem() returns the radionodelist or the element in the collection whose name or id matches the specified name, or null if no nodes match. note that this version of nameditem() hide the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). specifications specifi...
HTMLInputElement.multiple - Web APIs
input can have more than one value. firefox currently only supports multiple for <input type="file">. example // fileinput is a <input type=file multiple> let fileinput = document.getelementbyid('myfileinput'); if (fileinput.multiple == true) { for (let i = 0; i < fileinput.files.length; i++) { // loop fileinput.files } // only one file available } else { let file = fileinput.files.item(0); } ...
HTMLMediaElement.controls - Web APIs
syntax var ctrls = video.controls; audio.controls = true; value a boolean. a value of true means controls will be displayed. example var obj = document.createelement('video'); obj.controls = true; specifications specification status comment html living standardthe definition of 'htmlmediaelement.controls' in that specification. ...
HTMLMediaElement - Web APIs
hat indicates the ranges of the media source that the browser has buffered (if any) at the moment the buffered property is accessed. htmlmediaelement.controller is a mediacontroller object that represents the media controller assigned to the element, or null if none is assigned. htmlmediaelement.controls is a boolean that reflects the controls html attribute, indicating whether user interface items for controlling the resource should be displayed. htmlmediaelement.controlslist read only returns a domtokenlist that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls. the domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback. htmlmediaelement.crossorigin a domstring...
HTMLOListElement - Web APIs
this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlolistelement' in that specification. living s...
HTMLOptionsCollection - Web APIs
this object is returned only by the options property of select. ...
HTMLTableElement.rows - Web APIs
tion of its content. syntax htmlcollectionobject = table.rows; value an htmlcollection providing a live-updating list of the htmltablerowelement objects representing all of the <tr> elements contained in the table. this provides quick access to all of the table rows, without having to manually search for them. example myrows = mytable.rows; firstrow = mytable.rows[0]; lastrow = mytable.rows.item(mytable.rows.length-1); this demonstrates how you can use both array syntax (line 2) and the htmlcollection.item() method (line 3) to obtain individual rows in the table. specifications specification status comment html living standardthe definition of 'htmltableelement: rows' in that specification. living standard ...
HTMLTableRowElement.rowIndex - Web APIs
ts are out of order in the html, browsers render the table in the right order. therefore the rows count from <thead> to <tbody>, from <tbody> to <tfoot>. syntax var index = htmltablerowelement.rowindex value returns the index of the row, or -1 if the row is not part of a table. example this example uses javascript to label all the row numbers in a table. ...
HTMLUListElement - Web APIs
/div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlulistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display. the values are browser dependent and have never been standardized. htmlulistelement.compact is a boolean indicating that spacing between list items should be reduced. this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlulistelement' in that specification. living s...
IDBCursor.continuePrimaryKey() - Web APIs
a typical use case, is to resume the iteration where a previous cursor 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. ...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
nsuccess = function(event) { const cursor = event.target.result; if (cursor) { if (cursor.value.albumtitle === 'a farewell to kings') { const updatedata = cursor.value; updatedata.year = 2050; const request = cursor.update(updatedata); request.onsuccess = function() { console.log('a better album year?'); }; }; const listitem = document.createelement('li'); 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 specific...
IDBCursorSync - Web APIs
ly increasing in the order of keys. prev 2 this cursor includes duplicates, and its direction is monotonically decreasing in the order of keys. prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys. methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's posit...
IDBCursorWithValue - Web APIs
cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('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 'idbcursorwithvalue' in that specification. ...
IDBDatabase.createObjectStore() - Web APIs
ndow.indexeddb.open(). // this handler is only supported in recent browsers. ...
IDBDatabase.onabort - Web APIs
gradeneeded = function(event) { var db = event.target.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.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified",...
IDBDatabase.onerror - Web APIs
adeneeded = function(event) { var db = this.result; 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.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified",...
IDBDatabase.onversionchange - Web APIs
d = function(event) { var db = event.target.result; 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.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified",...
IDBDatabase.transaction() - Web APIs
transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: 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 'trans...
IDBDatabase - Web APIs
ow.indexeddb.open line above dbopenrequest.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 using // idbdatabase.createobjectstore var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified",...
IDBIndex.getAll() - Web APIs
Web › API › IDBIndex › getAll
est = idbindex.getall(query); var getallkeysrequest = idbindex.getall(query, count); parameters query optional a key or an idbkeyrange identifying the records to retrieve. 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. 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 idbindex's transaction is inactive. invalidstateerr...
IDBIndex.getAllKeys() - Web APIs
t = idbindex.getallkeys(query); var allkeysrequest = idbindex.getallkeys(query, count); parameters query optional a key or an idbkeyrange identifying the keys to retrieve. 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. 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 idbindex's transaction is inactive. invalidstateerr...
IDBIndex.multiEntry - Web APIs
ds an array. this is decided when the index is created, using the idbobjectstore.createindex 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 = myindex.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 idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencurs...
IDBIndex - Web APIs
Web › API › IDBIndex
me the name of this index. idbindex.objectstore read only the name of the object store referenced by this index. idbindex.keypath read only the key path of this index. if null, this index is not auto-populated. idbindex.multientry read only affects how the index behaves when the result of evaluating the index's key path yields an array. if true, there is one record in the index for each item in an array of keys. if false, then there is one record for each key that is an array. idbindex.unique read only if true, this index does not allow duplicate values for a key. methods inherits from: eventtarget idbindex.count() returns an idbrequest object, and in a separate thread, returns the number of records within a key range. idbindex.get() returns an idbrequest object, and, in ...
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
in the indexeddb-examples repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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(...
IDBKeyRange.lower - Web APIs
Web › API › IDBKeyRange › lower
live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.lower); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'lowe...
IDBKeyRange.lowerBound() - Web APIs
t our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.lowerbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'lowe...
IDBKeyRange.lowerOpen - Web APIs
e too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.loweropen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'lowerop...
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
have a look at our idbkeyrange repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.only("a"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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' i...
IDBKeyRange.upper - Web APIs
Web › API › IDBKeyRange › upper
live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upper); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'uppe...
IDBKeyRange.upperBound() - Web APIs
t our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.upperbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'u...
IDBKeyRange.upperOpen - Web APIs
e too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upperopen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<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 'uppe...
IDBKeyRange - Web APIs
ok at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status comment indexed database api 2.0the definition of 'idbkeyrange' in that sp...
IDBObjectStore.createIndex() - Web APIs
eddb.open(). (see above.) // it is only implemented in recent browsers. ...
IDBObjectStore.deleteIndex() - Web APIs
// window.indexeddb.open line above //it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.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" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notifie...
IDBOpenDBRequest - Web APIs
e window.indexeddb.open line above // it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.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" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notifie...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error wi...
IDBRequest.onerror - Web APIs
todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error wi...
IDBRequest.onsuccess - Web APIs
todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database 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 'onsuccess' in that specification.
IDBRequest.readyState - Web APIs
todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications ...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
...
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
'todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the source 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 specificati...
IDBRequest.transaction - Web APIs
todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata();...
IntersectionObserver - Web APIs
nobserverentry objects for all observed targets. intersectionobserver.unobserve() tells the intersectionobserver to stop observing a particular target element. examples var intersectionobserver = new intersectionobserver(function(entries) { // if intersectionratio is 0, the target is out of view // and we do not need to do anything. if (entries[0].intersectionratio <= 0) return; loaditems(10); console.log('loaded new items'); }); // start observing intersectionobserver.observe(document.queryselector('.scrollerfooter')); specifications specification status comment intersection observerthe definition of 'intersectionobserver' in that specification. working draft ...
Timing element visibility with the Intersection Observer API - Web APIs
umn 2, row 2. articles each article is contained in an <article> element, styled like this: article { background-color: white; padding: 6px; } article:not(:last-child) { margin-bottom: 8px; } article h2 { margin-top: 0; } this creates article boxes with a white background which float atop the blue background, with a small margin around the article. every article which isn't the last item in the container has an 8px bottom margin to space things apart. ads finally, the ads have the following initial styling. individual ads may customize the style somewhat, as we'll see later. .ad { height: 96px; padding: 6px; border-color: #555; border-style: solid; border-width: 1px; } .ad:not(:last-child) { margin-bottom: 8px; } .ad h2 { margin-top: 0; } .ad div { position:...
Key Values - Web APIs
forward to the next content or program. keycode_media_skip_forward "mediatopmenu" top menu button. opens the media's main menu (e.g., for a dvd or blu-ray disc). qt::key_topmenu (0x0100010a) keycode_media_top_menu "navigatein" navigates into a submenu or option. keycode_navigate_in "navigatenext" navigates to the next item. keycode_navigate_next "navigateout" navigates out of the current screen or menu. keycode_navigate_out "navigateprevious" navigates to the previous item. keycode_navigate_previous "nextfavoritechannel" cycles to the next channel in the favorites list. vk_next_favorite_channel "nextuserprofile"...
KeyboardLayoutMap.get() - Web APIs
return value the value of the specified key. example the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard. ...
MediaDevices.ondevicechange - Web APIs
scribing one media input or output device. a foreach() loop is used to scan through all the devices. for each device, we create a new <li> object to be used to display it to the user. the line let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); deserves special notice. this uses destructuring assignment (a new feature of ecmascript 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction. we do this because the value of mediadeviceinfo.kind is a single string that includes both the media type and the direction the media flows, such as "audioinput" or "videooutput". this line, then, pulls out the type ("audio" or "video") and direction ("input" or "output") so they can be used to construct the stri...
MediaList - Web APIs
Web › API › MediaList
nt. properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. medialist.length read only returns the number of media queries in the medialist. methods medialist.appendmedium() adds a media query to the medialist. medialist.deletemedium() removes a media query from the medialist. medialist.item() a getter that returns a cssomstring representing a media query as text, given the media query's index value inside the medialist. examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext);...
MediaStream.onaddtrack - Web APIs
am.onaddtrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred. the mediastreamtrack representing the track which was added is specified in the event's track property. example this example adds a listener which, when a new track is added to the stream, appends a new item to a list of tracks; the new item shows the track's kind ("audio" or "video") and label. stream.onaddtrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = event.track.kind + ": " + event.track.label; tracklist.appendchild(label); }; specifications specification status comment ...
MediaStream Image Capture API - Web APIs
to be requested. this method returns a promise that resolves with a mediastream object. navigator.mediadevices.getusermedia({ video: true }) .then(mediastream => { // do something with the stream. }) next, isolate the visual part of the media stream. do this by calling mediastream.getvideotracks(). this returns an array of mediastreamtrack objects. the code below assumes that the first item in the mediastreamtrack array is the one to use. you can use the properties of the mediastreamtrack objects to select the one you need. const track = mediastream.getvideotracks()[0]; at this point, you might want to configure the device capabilities before capturing an image. you can do this by calling applyconstraints() on the track object before doing anything else. let zoom = document.query...
MediaStream Recording API - Web APIs
examine the available input devices, locate those which are audio input devices, and create <option> elements that are then added to a <select> element representing an input source picker. navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { let menu = document.getelementbyid("inputdevices"); if (device.kind == "audioinput") { let item = document.createelement("option"); item.innerhtml = device.label; item.value = device.deviceid; menu.appendchild(item); } }); }); code similar to this can be used to let the user restrict the set of devices they wish to use. for more information to learn more about using the mediastream recording api, see using the mediastream recording api, which shows how to use the ...
MessagePort.postMessage() - Web APIs
the postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. note: this feature is available in web workers. syntax port.postmessage(message, transferlist); returns void. parameters message the message you want to send through the channel. this can be of any basic data type. multiple data items can be sent as an array. transferlist optional transferable objects to be transferred — these objects have their ownership transferred to the receiving browsing context, so are no longer usable by the sending browsing context. example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pas...
Microsoft API extensions - Web APIs
oeffect() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprof...
MimeTypeArray - Web APIs
the mimetypearray interface returns an array of mimetype instances, each of which contains information about a supported browser plugins. this object is returned by navigatorplugins.mimetypes. properties mimetypearray.length the number of items in the array. methods mimetypearray.item() returns the mimetype object with the specified index. mimetypearray.nameditem() returns the mimetype object with the specified name. example the following example tests whether a plugin is available for the application/pdf mime type and if so, which plugin that is. var mimetypes = navigator.mimetype; var flashplugin = mimetypes['video/x-flv']; if (typeof flashplugin === "undefined") { var vid = document.createelement('video'); // use vid.canplaytype() to test for a supported mime type. }...
NameList - Web APIs
Web › API › NameList
hough it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: although this interface was previously implemented in gecko, there was no way to actually create one. namelist has been removed, effective with gecko 10.0 the namelist interface provides an abstraction for an ordered collection of name and namespace value pairs. items can be accessed by a 0-based index. the dom spec does not specify how the collection is to be implemented. properties namelist.length read only methods namelist.contains() returns a boolean. namelist.containsns() returns a boolean. namelist.getname() returns a domstring. namelist.getnamespaceuri() returns a domstring. specifications specification status comment...
Online and offline events - Web APIs
eed to know when the user is offline, so that you can queue your server requests for a later time. it is this process that online/offline events help to simplify. api navigator.online navigator.online is a property that maintains a true/false value (true for online, false for offline). this property is updated whenever the user switches into "offline mode" by selecting the corresponding menu item (file -> work offline in firefox). additionally, this property should update whenever a browser is no longer capable of connecting to the network. according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)... firefox...
NavigatorPlugins.mimeTypes - Web APIs
returns a mimetypearray object, which contains a list of mimetype objects representing the mime types recognized by the browser. note: named properties of mimetypearray objects are no longer enumerable in the latest browser versions. syntax var mimetypes[] = navigator.mimetypes; mimetypes is a mimetypearray object which has a length property as well as item(index) and nameditem(name) methods. example function isjavapresent() { return 'application/x-java-applet' in navigator.mimetypes; } function getjavaplugindescription() { var mimetype = navigator.mimetypes['application/x-java-applet']; if (mimetype === undefined) { // no java plugin present return undefined; } return mimetype.enabledplugin.description; } specifications specification status comme...
Node.childNodes - Web APIs
Web › API › Node › childNodes
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 documentelement. (in (x)html documents this is the html element.) childnodes...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
{ get: function(){ var e = this.nextsibling; while(e && 1 !== e.nodetype) e = e.nextsibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/nextelementsibling/nextelementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('nextelementsibling')) { return; } object.defineproperty(item, 'nextelementsibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefine...
ParentNode.children - Web APIs
the parentnode property children is a read-only property that returns a live htmlcollection which contains all of the child elements of the node upon which it was called. syntax let children = node.children; value an htmlcollection which is a live, ordered collection of the dom elements which are children of node. you can access the individual child nodes in the collection by using either the item() method on the collection, or by using javascript array-style notation. if the node has no element children, then children is an empty list with a length of 0. example const foo = document.getelementbyid('foo'); for (let i = 0; i < foo.children.length; i++) { console.log(foo.children[i].tagname); } polyfill // overwrites native 'children' prototype. // adds document & documentfragment su...
ParentNode.querySelectorAll() - Web APIs
ose id is test. var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active=1]"); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested...
PaymentCurrencyAmount.currency - Web APIs
so 4127 standard. syntax currency = paymentcurrencyamount.currency; value a domstring specifying the canonical, three-character currency identification code defined by the iso 4217 standard. this is the currency in which the payment's value is given. all currency values must include the currency system in this property. example this example represents the price of $42.95 in us dollars. let itemprice = { currency: "usd", value: "42.95" }; specifications specification status comment payment request apithe definition of 'paymentcurrencyamount.currency' in that specification. candidate recommendation ...
PaymentCurrencyAmount.value - Web APIs
iod (".") as the decimal character, regardless of the user's locale. you need to convert the value to this format before submitting the payment. see the example verifying a properly formatted price below for a simple regular expression that can be used to validate the value string prior to submission. ...
PaymentDetailsBase - Web APIs
the paymentdetailsbase dictionary is a mixin used by the paymentdetailsinit and paymentdetailsupdate dictionaries. it is never directly used by developers and is included here only to be used as the basis for those documents. properties displayitemsoptional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. modifiersoptional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). shippingoptionsoptional an array of paymentshippingoption objects, each describing one available shipping option from which th...
PaymentRequest.onshippingoptionchange - Web APIs
= 'international shipping'; shippingoption.amount.value = '10.00'; details.total.amount.value = '65.00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details.shippingoptions = []; return promise.resolve(details); console.log(details.error); } // hardcode for simplicity if (details.displayitems.length === 2) { details.displayitems[2] = shippingoption; } else { details.displayitems.push(shippingoption); } details.shippingoptions = [shippingoption]; return promise.resolve(details); })(details, request.shippingaddress)); }); specifications specification status comment payment request apithe definition of 'onshippingoptionchange' in...
PaymentRequest.shippingAddress - Web APIs
candidate recommendation initial definition. browser compatibility the compatibilit...
PaymentResponse.shippingAddress - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if ...
PaymentResponse.shippingOption - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-comp...
performance.getEntries() - Web APIs
(for example by calling the mark() method) at explicit points in time. if you are only interested in performance entries of certain types or that have certain names, see getentriesbytype() and getentriesbyname(). note: this feature is available in web workers. syntax general syntax: entries = window.performance.getentries(); return value entries an array of performanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_performanceentry_methods() { console.log("performanceentry tests ..."); if (performance.mark === undefined) { console.log("... performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mar...
performance.getEntriesByName() - Web APIs
me, type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function use_performanceentry_methods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... performance.mark not supported"); return; } // create some performance entries via the mark() method performa...
performance.getEntriesByType() - Web APIs
ple by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useperformanceentrymethods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... performance.mark not supported"); return; } // create some performance entries via the...
PerformanceObserverEntryList.getEntries() - Web APIs
are listed in the performanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the performanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed performanceentry objects that meets the criteria of the filter. the items will be in chronological order based on the entries' starttime. if no objects that meet the filter are found, an empty list is returned. if no argument is given, all entries are returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: ...
PerformanceObserverEntryList.getEntriesByName() - Web APIs
name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performance entry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create observer for all perfo...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
lback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // creat...
Plugin - Web APIs
Web › API › Plugin
browser plugin. note: own properties of plugin objects are no longer enumerable in the latest browser versions. properties plugin.description read only a human readable description of the plugin. plugin.filename read only the filename of the plugin file. plugin.name read only the name of the plugin. plugin.version read only the plugin's version number string. methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types. plugin.nameditem returns the mime type of a supported item. specifications specification status comment html living standardthe definition of 'plugin' in that specification. living standard initial definition. ...
PluginArray - Web APIs
the pluginarray interface is used to store a list of plugin objects describing the available plugins; it's returned by the window.navigator.plugins property. the pluginarray is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods. note: own properties of pluginarray objects are no longer enumerable in the latest browser versions. properties pluginarray.lengthread only the number of plugins in the array. methods pluginarray.item returns the plugin at the specified index into the array. pluginarray.nameditem returns the plugin with the specified name. pluginarray.refresh refreshes all plugins on the current page, optionally reloading documents...
RTCInboundRtpStreamStats.averageRtcpInterval - Web APIs
f seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server won't be flooded with rtcp packets coming in all at once. the sending endpoint computes this value when sending compound rtcp packets, which must contain at least an rtcp rr or sr packet and an sdes packet with the cname item. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.averagertcpinterval' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.averageRtcpInterval - Web APIs
f seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server won't be flooded with rtcp packets coming in all at once. the sending endpoint computes this value when sending compound rtcp packets, which must contain at least an rtcp rr or sr packet and an sdes packet with the cname item. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.averagertcpinterval' in that specification. candidate recommendation initial definition. ...
Range.cloneContents() - Web APIs
s are duplicated as they are for the dom core clonenode method. html id attributes are also cloned, which can lead to an invalid document through cloning. partially selected nodes include the parent tags necessary to make the document fragment valid. syntax documentfragment = range.clonecontents(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); documentfragment = range.clonecontents(); document.body.appendchild(documentfragment); specifications specification status comment domthe definition of 'range.clonecontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.clonecontents()' in that specifi...
Range.cloneRange() - Web APIs
Web › API › Range › cloneRange
the range.clonerange() method returns a range object with boundary points identical to the cloned range. the returned clone is copied by value, not reference, so a change in either range does not affect the other. syntax clone = range.clonerange(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); clone = range.clonerange(); specifications specification status comment domthe definition of 'range.clonerange()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.clonerange()' in that specification. obsolete initial specification. ...
Range.collapse() - Web APIs
Web › API › Range › collapse
specifying a single-point in a dom tree. to determine if a range is already collapsed, see the range.collapsed property. syntax range.collapse(tostart); parameters tostart optional a boolean value: true collapses the range to its start, false to its end. if omitted, it defaults to false . example var range = document.createrange(); referencenode = document.getelementsbytagname("div").item(0); range.selectnode(referencenode); range.collapse(true); specifications specification status comment domthe definition of 'range.collapse()' in that specification. living standard the parameter is now optional and default to false. document object model (dom) level 2 traversal and range specificationthe definition of 'range.collapse()' in that specifica...
Range.comparePoint() - Web APIs
is the number of child nodes between the start of the reference node. syntax returnvalue = range.comparepoint(referencenode, offset) parameters referencenode the node to compare with the range. offset an integer greater than or equal to zero representing the offset inside the referencenode. example range = document.createrange(); range.selectnode(document.getelementsbytagname('div').item(0)); returnvalue = range.comparepoint(document.getelementsbytagname('p').item(0), 1); specification specification status comment domthe definition of 'range.comparepoint()' in that specification. living standard initial specification. ...
Range.createContextualFragment() - Web APIs
ead. syntax documentfragment = range.createcontextualfragment(tagstring) parameters tagstring text that contains text and tags to be converted to a document fragment. example var tagstring = "<div>i am a div node</div>"; var range = document.createrange(); // make the parent of the first div in the document becomes the context node range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.createcontextualfragment(tagstring); document.body.appendchild(documentfragment); specification specification status comment dom parsing and serializationthe definition of 'range.createcontextualfragment()' in that specification. working draft initial specification. ...
Range.deleteContents() - Web APIs
the range.deletecontents() method removes the contents of the range from the document. unlike range.extractcontents(), this method does not return a documentfragment containing the deleted content. syntax range.deletecontents() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.deletecontents(); specifications specification status comment domthe definition of 'range.deletecontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.deletecontents()' in that specification. obsolete initial specification. ...
Range.detach() - Web APIs
Web › API › Range › detach
the range.detach() method does nothing. it used to disable the range object and enable the browser to release associated resources. the method has been kept for compatibility. syntax range.detach(); example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.detach(); specifications specification status comment domthe definition of 'range.detach()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.detach()' in that specification. obsolete initial specification. ...
Range.getClientRects() - Web APIs
the range.getclientrects() method returns a list of domrect objects representing the area of the screen occupied by the range. this is created by aggregating the results of calls to element.getclientrects() for all the elements in the range. syntax rectlist = range.getclientrects() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); rectlist = range.getclientrects(); specification specification status comment css object model (cssom) view modulethe definition of 'range.getclientrects()' in that specification. working draft initial specification. ...
Range.insertNode() - Web APIs
Web › API › Range › insertNode
is a document fragment, the children of the document fragment are inserted instead. syntax range.insertnode(newnode); parameters newnode the node to insert at the start of the range. example range = document.createrange(); newnode = document.createelement("p"); newnode.appendchild(document.createtextnode("new node inserted here")); range.selectnode(document.getelementsbytagname("div").item(0)); range.insertnode(newnode); specifications specification status comment domthe definition of 'range.insertnode()' in that specification. living standard no change document object model (dom) level 2 traversal and range specificationthe definition of 'range.insertnode()' in that specification. obsolete initial definition ...
Range.intersectsNode() - Web APIs
the range.intersectsnode() method returns a boolean indicating whether the given node intersects the range. syntax bool = range.intersectsnode( referencenode ) parameters referencenode the node to compare with the range. example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var bool = range.intersectsnode(document.getelementsbytagname("p").item(0)); specification specification status comment domthe definition of 'range.intersectnode()' in that specification. living standard initial definition. ...
Range.isPointInRange() - Web APIs
ge. it returns true if the point (cursor position) at offset within referencenode is within this range. syntax bool = range.ispointinrange( referencenode, offset ) parameters referencenode the node to compare with the range. offset the offset into node of the point to compare with the range. example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); bool = range.ispointinrange(document.getelementsbytagname("p").item(0),1); specification specification status comment domthe definition of 'range.ispointinrange()' in that specification. living standard initial definition. ...
Range.selectNode() - Web APIs
Web › API › Range › selectNode
the range.selectnode() method sets the range to contain the node and its contents. the parent node of the start and end of the range will be the same as the parent of the referencenode. syntax range.selectnode(referencenode); parameters referencenode the node to select within a range. example let range = document.createrange(); let referencenode = document.getelementsbytagname('div').item(0); range.selectnode(referencenode); specifications specification status comment domthe definition of 'range.selectnode()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.selectnode()' in that specification. obsolete initial specification. ...
Range.setEnd() - Web APIs
Web › API › Range › setEnd
r equal to the length of the node or is less than zero. usage notes if the endnode is a node of type text, comment, or cdatasection, then endoffset is the number of characters from the start of endnode. for other node types, endoffset is the number of child nodes between the start of the endnode. example const range = document.createrange(); const endnode = document.getelementsbytagname('p').item(3); const endoffset = endnode.childnodes.length; range.setend(endnode, endoffset); setend() is commonly used in conjunction with setstart() to fully configure a range. specifications specification status comment domthe definition of 'range.setend()' in that specification. living standard no change. document object model (dom) level 2 traversal and rang...
Range.setEndAfter() - Web APIs
Web › API › Range › setEndAfter
the range.setendafter() method sets the end position of a range relative to another node. the parent node of end of the range will be the same as that for the referencenode. syntax range.setendafter(referencenode); parameters referencenode the node to end the range after. example var range = document.createrange(); var referencenode = document.getelementsbytagname('div').item(0); range.setendafter(referencenode); specifications specification status comment domthe definition of 'range.setendafter()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendafter()' in that specification. obsolete initial specification. ...
Range.setEndBefore() - Web APIs
the range.setendbefore() method sets the end position of a range relative to another node. the parent node of end of the range will be the same as that for the referencenode. syntax range.setendbefore(referencenode); parameters referencenode the node to end the range before. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setendbefore(referencenode); specifications specification status comment domthe definition of 'range.setendbefore()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendbefore()' in that specification. obsolete initial specification. ...
Range.setStartAfter() - Web APIs
the range.setstartafter() method sets the start position of a range relative to a node. the parent node of the start of the range will be the same as that for the referencenode. syntax range.setstartafter(referencenode); parameters referencenode the node to start the range after. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartafter(referencenode); specifications specification status comment domthe definition of 'range.setstartafter()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartafter()' in that specification. obsolete initial specification. ...
Range.setStartBefore() - Web APIs
tstartbefore() method sets the start position of a range relative to another node. the parent node of the start of the range will be the same as that for the referencenode. syntax range.setstartbefore(referencenode); parameters referencenode the node before which the range should start. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartbefore(referencenode); specifications specification status comment domthe definition of 'range.setstartbefore()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartbefore()' in that specification. obsolete initial specification. ...
Range.toString() - Web APIs
Web › API › Range › toString
e contents of a range makes an implicit tostring() call, so comparing range and text through an alert dialog is ineffective. syntax text = range.tostring(); example html <p>this example logs <b>everything</b> between the bold <b>words</b>. look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe defi...
ReadableStream.tee() - Web APIs
cesstext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'read ' + charsreceived + ' characters so far. current chunk = ' + chunk; list.appendchild(listitem); // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'tee()' in that specification. ...
Using the Resource Timing API - Web APIs
performance.clearresourcetimings(); } else { console.log("... performance.clearresourcetiming() = not supported"); return; } // getentries should now return zero var p = performance.getentriesbytype("resource"); if (p.length == 0) console.log("... performance data buffer cleared"); else console.log("... ...
SVGAnimationElement: beginEvent event - Web APIs
0 0 h 300 z" dur="5s" repeatcount="indefinite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property e...
SVGAnimationElement: repeatEvent event - Web APIs
m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property e...
Using the Screen Capture API - Web APIs
for the video, it's applied by scaling the video after the user selects the area to share. it doesn't establish a restriction on the size of the source itself. note: constraints never cause changes to the list of sources available for capture by the screen sharing api. this ensures that web applications can't force the user to share specific content by restricting the source list until only one item is left. while display capture is in effect, the machine which is sharing screen contents will display some form of indicator so the user is aware that sharing is taking place. note: for privacy and security reasons, screen sharing sources are not enumerable using enumeratedevices(). related to this, the devicechange event is never sent when there are changes to the sources available for getd...
Selection.getRangeAt() - Web APIs
cted. syntax range = sel.getrangeat(index) parameters index the zero-based index of the range to return. a negative number or a number greater than or equal to selection.rangecount will result in an error. return value the specified range object. example let ranges = []; sel = window.getselection(); for(let i = 0; i < sel.rangecount; i++) { ranges[i] = sel.getrangeat(i); } /* each item in the ranges array is now * a range object representing one of the * ranges in the current selection */ specifications specification status comment selection apithe definition of 'selection: getrangeat()' in that specification. working draft current ...
ServiceWorkerGlobalScope: contentdelete event - Web APIs
the contentdelete event of the serviceworkerglobalscope interface is fired when an item is removed from the indexed content via the user agent. bubbles no cancelable no interface contentindexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: se...
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
the oncontentdelete property of the serviceworkerglobalscope interface is an event handler fired when an item is removed from the indexed content via the user agent. syntax serviceworkerglobalscope.oncontentdelete = function(event) { ... }; examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); specifications specification status comment unknownthe definition of 'contentdelete' in that specification. unknown initial definit...
ServiceWorkerGlobalScope - Web APIs
stration object that represents the service worker's registration. serviceworkerglobalscope.caches read only contains the cachestorage object associated with the service worker. events activate occurs when a serviceworkerregistration acquires a new serviceworkerregistration.active worker. also available via the serviceworkerglobalscope.onactivate property. contentdelete occurs when an item is removed from the content index. also available via the serviceworkerglobalscope.oncontentdelete property. fetch occurs when a fetch() is called. also available via the serviceworkerglobalscope.onfetch property. install occurs when a serviceworkerregistration acquires a new serviceworkerregistration.installing worker. also available via the serviceworkerglobalscope.oninstall property. ...
SpeechGrammarList - Web APIs
ecognition service to recognize. grammar is defined using jspeech grammar format (jsgf.) other formats may also be supported in the future. constructor speechgrammarlist.speechgrammarlist() creates a new speechgrammarlist object. properties speechgrammarlist.length read only returns the number of speechgrammar objects contained in the speechgrammarlist. methods speechgrammarlist.item() standard getter — allows individual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax. speechgrammarlist.addfromuri() takes a grammar present at a specific uri and adds it to the speechgrammarlist as a new speechgrammar object. speechgrammarlist.addfromstring() takes a grammar present in a specific domstring within the code base (e.g. stored in a variabl...
SpeechRecognition.onnomatch - Web APIs
r that will run when the speech recognition service returns a final result with no significant recognition (when the nomatch event fires.) this may involve some degree of recognition, which doesn't meet or exceed the confidence threshold. note: the onnomatch handler does not yet work properly in firefox — the speech recognition system always returns a positive match, and then guesses at what item in the grammar it found. this is being worked on. syntax myspeechrecognition.onnomatch = function() { ... }; examples var recognition = new speechrecognition(); recognition.onnomatch = function() { console.log('speech not recognised'); } specifications specification status comment web speech apithe definition of 'onnomatch' in that specification. draft ...
SpeechRecognitionResult - Web APIs
or not (false) — if so, then this is the final time this result will be returned; if not, then this result is an interim result, and may be updated later on. speechrecognitionresult.length read only returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) methods speechrecognitionresult.item a standard getter that allows speechrecognitionalternative objects within the result to be accessed via array syntax. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognition...
SpeechRecognitionResultList - Web APIs
the speechrecognitionresultlist interface of the web speech api represents a list of speechrecognitionresult objects, or a single one if results are being captured in continuous mode. properties speechrecognitionresultlist.length read only returns the length of the "array" — the number of speechrecognitionresult objects in the list. methods speechrecognitionresultlist.item a standard getter that allows speechrecognitionresult objects in the list to be accessed via array syntax. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it ...
Storage.clear() - Web APIs
Web › API › Storage › clear
the clear() method of the storage interface clears all keys stored in a given storage object. syntax storage.clear(); return value undefined. examples the following function creates three data entries in local storage, and then deletes them by using clear(). function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'migato.png'); localstorage.clear(); } note: for a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.clear' in that specification. living standard ...
Storage.key() - Web APIs
Web › API › Storage › key
not exist, null is returned. examples the following function iterates over the local storage keys: function foreachkey(callback) { for (var i = 0; i < localstorage.length; i++) { callback(localstorage.key(i)); } } the following function iterates over the local storage keys and gets the value set for each key: for(var i =0; i < localstorage.length; i++){ console.log(localstorage.getitem(localstorage.key(i))); } note: for a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.key' in that specification. living standard ...
Storage.length - Web APIs
Web › API › Storage › length
the length read-only property of the storage interface returns the number of data items stored in a given storage object. syntax length = storage.length; return value the number of items stored in the storage object. example the following function adds three data items to the local storage for the current domain, then returns the number of items in the storage: function populatestorage() { localstorage.setitem('bgcolor', 'yellow'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'cats.png'); return localstorage.length; // should return 3 } note: for a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.length' in that specification. livi...
Using the Storage Access API - Web APIs
s false, we can then call document.requeststorageaccess(), returning the result so that then we can chain it onto the previous promise call. in the final then, we'll have first-party storage access. document.hasstorageaccess().then(hasaccess => { if (!hasaccess) { return document.requeststorageaccess(); } }).then(_ => { // now we have first-party storage access! // let's access some items from the first-party cookie jar document.cookie = "foo=bar"; // set a cookie localstorage.setitem("username", "john"); // access a localstorage entry }).catch(_ => { // error obtaining storage access. }); note that access requests are automatically denied unless the embedded content is currently processing a user gesture such as a tap or click — so this code needs to be run...
Using writable streams - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
StylePropertyMapReadOnly.keys() - Web APIs
return value a new array. ...
StylePropertyMapReadOnly - Web APIs
mapreadonly.get() returns the value of the specified property. stylepropertymapreadonly.getall() returns an array of cssstylevalue objects containing the values for the provided property. stylepropertymapreadonly.has() indicates whether the specified property is in the stylepropertymapreadonly object. stylepropertymapreadonly.keys() returns a new array iterator containing the keys for each item in stylepropertymapreadonly. stylepropertymapreadonly.values() returns a new array iterator containing the values for each index in the stylepropertymapreadonly object. examples we have to have an element to observe: <p> this is a paragraph with some text. we can add some css, or not. the style map will include all the default and inherted css property values. </p> <dl id="output"></d...
Text - Web APIs
Web › API › Text
new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. ...
TextEncoder.prototype.encodeInto() - Web APIs
be long-lived, it makes sense to compute minimum allocation rounduptobucketsize(s.length), the maximum allocation size s.length * 3, and to have a chosen (as a tradeoff between memory usage and speed) threshold 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 allocat...
Touch() - Web APIs
Web › API › Touch › Touch
the touch() constructor creates a new touch object. syntax touch = new touch(touchinit); arguments touchinit is a touchinit dictionary, having the following fields: "identifier", required, of type long, that is the identification number for the touch point. "target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface. "clientx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset. "clienty", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, excluding any scroll offset. "screenx", optional and defaulting to 0, of type dou...
Touch.clientX - Web APIs
Web › API › Touch › clientX
example this example illustrates using the touch object's touch.clientx and touch.clienty properties. the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. ...
Touch.clientY - Web APIs
Web › API › Touch › clientY
example this example illustrates using the touch object's touch.clientx and touch.clienty properties. the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. ...
Touch.force - Web APIs
Web › API › Touch › force
this is a value between 0.0 (no pressure) and 1.0 (the maximum amount of pressure the hardware can recognize). a value of 0.0 is returned if no value is known (for example the touch device does not support this property). in environments where force is known, the absolute pressure represented by the force attribute, and the sensitivity in levels of pressure, may vary. ...
Touch.identifier - Web APIs
Web › API › Touch › identifier
the touch.identifier returns a value uniquely identifying this point of contact with the touch surface. this value remains consistent for every event involving this finger's (or stylus's) movement on the surface until it is lifted off the surface. syntax touchitem.identifier; return value a long that represents the unique id of the touch object. example someelement.addeventlistener('touchmove', function(e) { // iterate through the list of touch points that changed // since the last event and print each touch point's identifier. for (var i=0; i < e.changedtouches.length; i++) { console.log("changedtouches[" + i + "].identifier = " + e.changedtouches[i].identifier); } }, false); specifications specification status comment touch events – level 2 ...
Touch.pageX - Web APIs
Web › API › Touch › pageX
example this example illustrates how to access the touch object's touch.pagex and touch.pagey properties. the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. ...
Touch.pageY - Web APIs
Web › API › Touch › pageY
example this example illustrates how to access the touch object's touch.pagex and touch.pagey properties. the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. ...
Touch.radiusY - Web APIs
Web › API › Touch › radiusY
the screen. this may be a large ellipse representing the contact between a fingertip and the screen or a small one representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var yradius = touchitem.radiusy; return value yradius the y radius of the ellipse that most closely circumscribes the area of contact with the screen. example the touch.radiusx example includes an example of this property's usage. specifications specification status comment touch events – level 2 draft non-stable version. ...
Touch.rotationAngle - Web APIs
. this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var angle = touchitem.rotationangle; return value angle the number of degrees of rotation to apply to the described ellipse to align with the contact area between the user and the touch surface. example the touch.radiusx example includes an example of this property's usage. specifications specification status comment touch events – level 2 draft non-stable version. ...
Touch.screenX - Web APIs
Web › API › Touch › screenX
example this example illustrates how to access the touch object's touch.screenx and touch.screeny properties. the touch.screenx property is the horizontal (x) coordinate of a touch point relative to the screen in css pixels. the touch.screeny property is the vertical coordinate of a touch point relative to the screen in css pixels. ...
Touch.screenY - Web APIs
Web › API › Touch › screenY
example the touch.screenx example includes an example of this property's usage. ...
TouchList - Web APIs
Web › API › TouchList
contact points on a touch surface. for example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding touchlist object would have one touch object for each finger, for a total of three entries. properties touchlist.length read only the number of touch objects in the touchlist. methods touchlist.identifiedtouch() returns the first touch item in the list whose identifier matches a specified value. touchlist.item() returns the touch object at the specified index in the list. example see the example on the main touch events article. specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation initial definition. ...
URL API - Web APIs
Web › API › URL API
specifications specification status comment url living standard whatwg specification ...
Vibration API - Web APIs
specifications specification status comment vibration api recommendation linked to spec is the latest editor's draft; w3c version is a rec. ...
WebGLRenderingContext.clear() - Web APIs
syntax void gl.clear(mask); parameters mask a glbitfield bitwise or mask that indicates the buffers to be cleared. possible values are: gl.color_buffer_bit gl.depth_buffer_bit gl.stencil_buffer_bit return value none. exceptions if mask is not one of the listed possible values, a gl.invalid_enum error is thrown. ...
WebGLRenderingContext.colorMask() - Web APIs
: true. blue a glboolean specifying whether or not the blue color component can be written into the frame buffer. default value: true. alpha a glboolean specifying whether or not the alpha (transparency) component can be written into the frame buffer. default value: true. return value none. examples gl.colormask(true, true, true, false); to get the current color mask, query the color_writemask constant which returns an array. gl.getparameter(gl.color_writemask); // [true, true, true, false] specifications specification status comment webgl 1.0the definition of 'colormask' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcolormask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.depthMask() - Web APIs
t.depthmask() method of the webgl api sets whether writing into the depth buffer is enabled or disabled. syntax void gl.depthmask(flag); parameters flag a glboolean specifying whether or not writing into the depth buffer is enabled. default value: true, meaning that writing is enabled. return value none. examples gl.depthmask(false); to get the current depth mask, query the depth_writemask constant which returns a boolean. gl.getparameter(gl.depth_writemask); // false specifications specification status comment webgl 1.0the definition of 'depthmask' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldepthmask' in that specification. standard man page of the opengl api. ...
Using the Web Speech API - Web APIs
it quickly: the lines are separated by semi-colons, just like in javascript. the first line — #jsgf v1.0; — states the format and version used. this always needs to be included first. the second line indicates a type of term that we want to recognise. public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term. note how each is separated by a pipe character. you can have as many terms defined as you want on separate lines following the above structure, and include fairly complex grammar definitions. for this basic demo, we are just keeping things simple. plugging the gramm...
Using Web Workers - Web APIs
be accessed from multiple scripts. note: see the web workers api landing page for 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 ...
Web Workers API - Web APIs
utilized by a single script), or a sharedworkerglobalscope (in the case of shared workers - workers that are shared between multiple scripts). 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...
Window.back() - Web APIs
Web › API › Window › back
this was a firefox-specific method and was removed in firefox 31. note: use the standard history.back method instead. syntax window.back(); parameters none. return value undefined. example this simple example handles a click on a "back" button by calling back(). ...
Window: error event - Web APIs
<div class="controls"> <button id="script-error" type="button">generate script error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: ...
Window.frames - Web APIs
Web › API › Window › frames
returns the window itself, which is an array-like object, listing the direct sub-frames of the current window. syntax framelist = window.frames; framelist is a list of frame objects. it is similar to an array in that it has a length property and its items can be accessed using the [i] notation. framelist === window evaluates to true. each item in the window.frames pseudo-array represents the window object corresponding to the given <frame>'s or <iframe>'s content, not the (i)frame dom element (i.e., window.frames[0] is the same thing as document.getelementsbytagname("iframe")[0].contentwindow). for more details about the returned value, refer to this thread on mozilla.dev.platform. example var frames = window.frames; // or // var frames = window.parent.frames; for (var i = 0; i < ...
Window.history - Web APIs
Web › API › Window › history
ons. for security reasons the history object doesn't allow the non-privileged code to access the urls of other pages in the session history, but it does allow it to navigate the session history. there is no way to clear the session history or to disable the back/forward navigation from unprivileged code. the closest available solution is the location.replace() method, which replaces the current item of the session history with the provided url. specifications specification status comment html living standardthe definition of 'the history interface' in that specification. living standard html5the definition of 'the history interface' in that specification. recommendation ...
Window: load event - Web APIs
Web › API › Window › load event
ge is fully loaded'); }; live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { wind...
Window.updateCommands() - Web APIs
summary updates the state of commands of the current chrome window (ui). syntax window.updatecommands("scommandname") parameters scommandname is a particular string which describes what kind of update event this is (e.g. whether we are in bold right now). notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the xul command nodes. specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
ild = 0; nchild < this.parts.length; nchild++) { onode.removechild(this.parts[nchild]); this.parts[nchild] = new sheet(this.parts[nchild]); } } var nintervid, ocurrent = null, btyping = false, bstart = true, nidx = 0, spart = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = s...
WritableStream.WritableStream() - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStream.getWriter() - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStream - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStreamDefaultWriter.close() - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStreamDefaultWriter.write() - Web APIs
; const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queu...
WritableStreamDefaultWriter - Web APIs
euingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err)...
XPathResult - Web APIs
ch may be null. xpathresult.snapshotlengthread only the number of nodes in the result snapshot. xpathresult.stringvalueread only a string representing the value of the result if resulttype is string_type. methods xpathresult.iteratenext() if the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes. xpathresult.snapshotitem() returns an item of the snapshot collection or null in case the index is not within the range of nodes. unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. constants result type defined constant value description any_type 0 a result set containing whatever type naturally results f...
XRFrame.getPose() - Web APIs
Web › API › XRFrame › getPose
f objects relative to each other and to fixed locations throughout the scene. for example, to get the position of a controller relative to the viewer's head, you would compare the controller's gripspace to the xrreferencespace of type viewer. syntax var xrpose = xrframe.getpose(space, basespace); parameters space an xrspace specifying the space for which to obtain an xrpose describing the item's position and orientation. basespace an xrspace to use as the base or origin for the purposes of computing the relative position and orientation. return value an xrpose object specifying the position and orientation, relative to the xrspace indicated by basespace. specifications specification status comment webxr device apithe definition of 'xrframe.getpose()' in t...
XRInputSourceArray.entries() - Web APIs
most frequently, you will use this in tandem with statements such as for...of. syntax let inputsourceiterator = xrinputsourcearray.entries(); for (let entry of xrinputsourcearray.entries()) { /* ... */ } parameters none. return value an iterator which can be used to walk through the list of xrinputsource objects included in the input source array. ...
XRInputSourceArray.forEach() - Web APIs
the specified callback once for each input source in the array, starting at index 0 and progressing until the end of the list. syntax xrinputsourcearray.foreach(callback, thisarg); parameters callback a function to execute once for each entry in the array xrinputsourcearray. the callback accepts up to three parameters: currentvalue a xrinputsource object which is the value of the item from within the xrinputsourcearray which is currently being processed. currentindex optional an integer value providing the index into the array at which the element given by currentvalue is located. if you don't need to know the index number, you can omit this. sourcelist optional the xrinputsourcearray object which is being processed. if you don't need this information, you may omit thi...
XRInputSourceArray.keys() - Web APIs
the keys() method 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. 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 */ checkinpu...
XRInputSourceArray.length - Web APIs
syntax let inputsourcecount = xrinputsourcearray.length; value an integer value indicating the number of xrinputsource objects representing webxr input sources are includled in the array. examples in this example, a game that requires at least one input source uses length to check this before proceeding to allow the user to play the game. ...
XRSession.onsqueezeend - Web APIs
a primary squeeze action. examples this snippet of code adds a simple handler for the squeezeend event, which responds only to events on the user's dominant hand. in response to the end of the squeeze operation, this code looks to see if there is an object currently being held by the user by checking to see if the variable user.heldobject contains a reference to an object representing the held item. if heldobject has an object reference, that object is passed to a function called cancelobjectdrag(), which would be written to return the object to its original position. this takes care of the situation in which the drag is aborted or canceled. xrsession.onsqueezeend = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputs...
ARIA: document role - Accessibility
ser can use the reading mode commands to read through the messages, 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 tabindex 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 ...
ARIA: feed role - Accessibility
ol + end: move focus to the first focusable element after the feed. control + home: move focus to the first focusable element before the feed. if a feed is nested within a feed, such as a comments feed within a feed of blog posts, the convention is to tab into the nested feed with the tab key and to provide another key, such as alt + page down, to navigate from an 'outer' article to the first item in that article's nested feed. navigate between the nested feed and main feed with control + end , moving focus from the inner feed to the next article in the outer feed. wai-aria roles, states, and properties aria-labelled if the feed has no visible title, the feed element has a label specified with aria-label. if it does, see aria-labelledby. aria-labelledby if the feed has a visible t...
ARIA: figure role - Accessibility
nerally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text. <div role="figure" aria-labelledby="caption"> <img src="image.png" alt="full alternative image description"> <p id="caption">figure 1: the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption. this is wrapped by a <div> element that identifies the content as a figure using role="figure". instead of using aria to create a figure, consider using the native, semantic html <figure> element. along with the <figcaption> element. see best practices below. description any content that should be grouped together and consumed as a figure (which could include imag...
ARIA: form role - Accessibility
</div> this is a form that collects and saves a user's contact information. important: use an html <form> element to contain your form controls, rather than the aria form role, unless you have a very good reason. the html <form> element is sufficient to tell assistive technologies that there is a form. description a form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a form when no other named landmark is appropriate (e.g. main or search). using the <form> element will automatically communicate a section of content as a form landmark, if it is provided an accessible name. developers should always prefer using the correct semantic html element over using aria. use the html <form> element if possible...
ARIA: grid role - Accessibility
, states, and properties roles treegrid (subclass) if a grid has columns that can expanded or collapsed, a treegrid can be used. row a row inside the grid. rowgroup a group containing one or multiple rows. states and properties aria-level indicates the hierarchical level of the grid within other structures. aria-multiselectable if aria-multiselectable is set to true, multiple items in the grid can be selected. the default value is false. aria-readonly if the user can navigate the grid but not change the value or values of the grid, the aria-readonly should be set to true. the default value is false. for many use cases, an html table element is sufficient as it and its elements already include many aria roles. keyboard interactions when a keyboard user encounters a ...
ARIA: gridcell role - Accessibility
t to the rest of the table-style grouping of content. interactive grids and treegrids editable cells both td elements and elements with a role of gridcell applied to them can be made editable, mimicking functionality similar to editing a spreadsheet. this is done by applying the html contenteditable attribute. <td contenteditable="true">notes</td> <div role="gridcell" contenteditable="true">item cost</div> contenteditable will make the element it is applied to focusable via the tab key. if a gridcell is conditionally toggled into a state where editing is prohibited, toggle aria-readonly on the gridcell element. expandable cells in a treegrid, gridcells may be made expandable by toggling the aria-expanded attribute. note that if this attribute is provided, it applies only to the indiv...
ARIA: search role - Accessibility
rch landmark role is used to identify a section of the page used to search the page, site, or collection of sites. <form role="search"> <!-- search input --> </form> description the search role is a landmark. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. the search role is added to the container element that encompasses the items and objects that, as a whole, combine to create search functionality. when a <form> is a search form, use the search role instead of form. if a document includes more than one search, each should have a unique label. while there is a input of type search, there is html element that defines a search landmark. examples <form id="search" role="search"> <label for="search-input">search this site...
ARIA: button role - Accessibility
with enter or space // get the new name value from the input element let newnameinput = document.getelementbyid('newname'); let name = newnameinput.value; newnameinput.value = ''; // clear the text field newnameinput.focus(); // give the text field focus to enable entering and additional name. // don't add blank entries to the list. if(name.length > 0) { listitem = document.createelement('li'); listitem.appendchild(document.createtextnode(name)); // add the new name to the list. let list = document.getelementbyid('namelist'); list.appendchild(listitem); } } toggle button example in this snippet a <span> element is converted to a toggle button using the button role and the aria-pressed attribute. when the button is ...
ARIA: checkbox role - Accessibility
press="changecheckbox()" tabindex="0" aria-labelledby="chk1-label"></span> <label id="chk1-label" onclick="changecheckbox()" onkeypress="changecheckbox()">remember my preferences</label> css [role="checkbox"] { padding:5px; } [aria-checked="true"]::before { content: "[x]"; } [aria-checked="false"]::before { content: "[ ]"; } javascript function changecheckbox(event) { let item = document.getelementbyid('chkpref'); switch(item.getattribute('aria-checked')) { case "true": item.setattribute('aria-checked', "false"); break; case "false": item.setattribute('aria-checked', "true"); break; } } accessibility concerns when the checkbox role is added to an element, the user agent should do the following:...
An overview of accessible web applications and widgets - Accessibility
mary of how keyboard navigation should work in an aria-enabled web application: the tab key should provide focus to the widget as a whole. for example, tabbing to a menu bar should not put focus on the menu's first element. the arrow keys should allow for selection or navigation within the widget. for example, using the left and right arrow keys should move focus to the previous and next menu items. when the widget is not inside a form, both the enter and spacebar keys should select or activate the control. within a form, the spacebar key should select or activate the control, while the enter key should submit the form's default action. if in doubt, mimic the standard desktop behavior of the control you are creating. so, for the tabs widget example above, the user should be able to na...
Architecture - Accessibility
ok one character ahead. if the next character does not exist, proceed to the next accessible in depth first search order and recurse on the first character until a non-embed is found. if the current character falls within a text substring, locate the line ending of that substring or the next embed, whichever comes first: get the current line start and end offsets. ...
Perceivable - Accessibility
readers, etc. image alt text. content images should have text available that clearly describes the image's contents, which can be programmatically associated with it (e.g., alt text), or otherwise is easy to associate (e.g., describes it and is sat right next to it). this should mean that the full meaning can still be inferred even if you can't see the image. lists. if the order of list items is important, use an ordered list (<ol>). the whole of html: a good basis for accessibility is packed with information about this, but you should particularly refer to good semantics, ui controls, and text alternatives. 1.3.2 meaningful content sequence (a) a sensible, logical reading order should be easy to determine for any content, even if it is visually presen...
Understandable - Accessibility
r example, if pressing a button causes the application to exit the current view, the user should be asked to confirm this action, save their work if appropriate, etc. globaleventhandlers.oninput is useful here. 3.2.3 consistent navigation (aa) navigation menu/control style and positioning should be consistent between different pages or views of a web page, and the existing items should appear in the same order, even if for example new iteam are added. if the user has initiated a change, e.g. choosing a different color scheme or position for the navigation, their choice should be respected across all pages. again, sensible design — make the navigation controls the same across all pages or views. see page layouts for information on modern markup for layouts.
::-moz-list-bullet - CSS: Cascading Style Sheets
the ::-moz-list-bullet css pseudo-element is a mozilla extension that represents the marker (typically a bullet) of a list item (<li>) in an unordered list (<ul>). syntax li::-moz-list-bullet examples html <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> css ::-moz-list-bullet { color: red; font-size: 1.5em; } result specifications not part of any standard. ...
::-moz-list-number - CSS: Cascading Style Sheets
the ::-moz-list-number css pseudo-element is a mozilla extension that represents the marker (typically a number) of a list item (<li>) in an ordered list (<ol>). syntax li::-moz-list-number examples html <ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol> css li::-moz-list-number { font-style: italic; font-weight: bold; } result screenshotlive sample specifications not part of any standard. ...
:-moz-ui-invalid - CSS: Cascading Style Sheets
ing rules apply only if the user has changed the value or attempted to submit the form. the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. required items have the pseudo-class applied only if the user changes them or attempts to submit an unchanged valid value. by default, gecko applies a style that creates a red "glow" (using the box-shadow property) around items, which have this pseudo-class applied. see the :invalid pseudo-class for an example that shows how to override the default style. the specification for :user-invalid is still in progre...
:-moz-ui-valid - CSS: Cascading Style Sheets
ing rules apply only if the user has changed the value or attempted to submit the form. the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. required items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value. syntax syntax not found in db! specifications not part of any standard. ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
hadow. css text decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-letter' in that specification. recommendation introduction of the two-colon syntax. definition of edge-case behavior, such as in list items or with specific languages (e.g., the dutch digraph ij). css level 2 (revision 1)the definition of '::first-letter' in that specification. recommendation no change. css level 1the definition of '::first-letter' in that specification. recommendation initial definition, using the one-colon syntax. ...
::marker - CSS: Cascading Style Sheets
Web › CSS › ::marker
::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright, unicode-bidi and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. ...
:first-child - CSS: Cascading Style Sheets
el 4, this is no longer required. syntax :first-child examples basic example html <div> <p>this text is selected!</p> <p>this text isn't selected.</p> </div> <div> <h2>this text isn't selected: it's not a `p`.</h2> <p>this text isn't selected.</p> </div> css p:first-child { color: lime; background-color: black; padding: 5px; } result styling a list html <ul> <li>item 1</li> <li>item 2</li> <li>item 3 <ul> <li>item 3.1</li> <li>item 3.2</li> <li>item 3.3</li> </ul> </li> </ul> css ul li { color: blue; } ul li:first-child { color: red; font-weight: bold; } result specifications specification status comment selectors level 4the definition of ':first-child' in that specification. working...
:last-child - CSS: Cascading Style Sheets
level 4, this is no longer required. syntax :last-child examples basic example html <div> <p>this text isn't selected.</p> <p>this text is selected!</p> </div> <div> <p>this text isn't selected.</p> <h2>this text isn't selected: it's not a `p`.</h2> </div> css p:last-child { color: lime; background-color: black; padding: 5px; } result styling a list html <ul> <li>item 1</li> <li>item 2</li> <li>item 3 <ul> <li>item 3.1</li> <li>item 3.2</li> <li>item 3.3</li> </ul> </li> </ul> css ul li { color: blue; } ul li:last-child { border: 1px solid red; color: red; } result specifications specification status comment selectors level 4the definition of ':last-child' in that specification. worki...
:not() - CSS: Cascading Style Sheets
Web › CSS › :not
/* selects any element that is not a paragraph */ :not(p) { color: blue; } the :not() pseudo-class has a number of quirks, tricks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated list of one or more selectors as its argument. the list must not contain another negation selector or a pseudo-element. the ability to list more than one selector is experimental and not yet widely supported. ...
:nth-last-of-type() - CSS: Cascading Style Sheets
the :nth-last-of-type() css pseudo-class matches elements of a given type, based on their position among a group of siblings, counting from the end. /* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. see :nth-last-child for a more detailed explanation of its syntax. formal syntax :nth-last-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples html <div> <span>this is a span.<...
fallback - CSS: Cascading Style Sheets
then its fallback style will be used. if a valid fallback style is not specified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. formal definition related at-rule@counter-styleinitial valuedecimalcomputed valueas specified formal syntax <counter-style-name>where <counter-style-name> = <custom-ident> examples specifying a fallback counter style html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul...
speak-as - CSS: Cascading Style Sheets
l be spell-out. if system is cyclic, the effective value of speak-as will be bullets. if system is extends, the value of speak-as will be the same as if speak-as: auto is specified on the extended style. for all other cases, specifying auto has the same effect as specifying speak-as: numbers. bullets a phrase or an audio cue defined by the user agent for representing an unordered list item will be read out. numbers the numerical value of the counter will be read out in the document language. words the user agent will generate a counter value as normal and read it out as a word in the document language. spell-out the user agent will generate a counter representation as normal and would read it out letter by letter. if the user agent doesn't know how to read out a partiular cou...
@counter-style - CSS: Cascading Style Sheets
... Ⓨ twenty five Ⓩ twenty six 27 twenty seven 28 twenty eight 29 twenty nine 30 thirty see more examples on the demo page. specifications specification status comment css counter styles level 3the definition of 'counter-style' in ...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
the format hint contains ...
@supports - CSS: Cascading Style Sheets
Web › CSS › @supports
ther operators, like and and or, the parentheses are required. the and operator the and operator creates a new expression from the conjunction of two shorter expressions. it returns true only if both of the shorter expressions are also true. the following example returns true if and only if the two shorter expressions are simultaneously true: @supports (display: table-cell) and (display: list-item) {} multiple conjunctions can be juxtaposed without the need of more parentheses. the following are both equivalent: @supports (display: table-cell) and (display: list-item) and (display:run-in) {} @supports (display: table-cell) and ((display: list-item) and (display:run-in)) {} the or operator the or operator creates a new expression from the disjunction of two shorter expressions. it retur...
Handling Overflow in Multicol - CSS: Cascading Style Sheets
for example, the situation could happen when an image in a column is wider than the column-width value or the width of the column based on the number of columns declared with column-count. ...
CSS Multi-column Layout - CSS: Cascading Style Sheets
ak-after break-before break-inside orphans widows guides basic concepts of multicol an overview of the multiple-column layout specification styling columns how to use column rules and manage the spacing between columns. spanning and balancing how to make elements span across all columns and controlling the way columns are filled. handling overflow in multicol what happens when an item overflows the column it is in and what happens when there is too much columned content to fit a container. content breaks in multicol introduction to the fragmentation specification and how to control where column content breaks. specifications specification status comment css multi-column layout module working draft initial definition ...
Using feature queries - CSS: Cascading Style Sheets
, we would like to have a layout for older browsers using floats. we can start by creating that floated layout with the following code, which gives us three columns. when browsers don't understand a css property or value, they ignore it. so we could start enhancing our layout by using css grid. browsers that do not support grid will ignore the grid value of the display property. once a floated item becomes a grid item, the float is removed — something you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column track, not the width of the conta...
CSS Grid Layout - CSS: Cascading Style Sheets
columns and rows. however, many more layouts are either possible or easier with css grid than they were with tables. for example, a grid container's child elements could position themselves so they actually overlap and layer, similar to css positioned elements. basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. * {box-sizing: border-box;} .wrapper { max-width: 940px; margin: 0 auto; } .wrapper > div { border: 2px solid rgb(233,171,88); border-radius: 5px; background-color: rgba(233,171,88,.5); padding: 1em; color: #d9480f; } html <div class="wrapper"> <div class="one">one</div> <div class="two">two</div> <div class="th...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. implementation suppose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the url()() in the background, or as background-position. for example: #btn1 { background-position: -20px 0px; } #btn2 { background-position: -40px 0px; } this would move the element with the id 'btn1' 2...
Logical properties for floating and positioning - CSS: Cascading Style Sheets
roperties specification defines the values inline-start and inline-end as mappings for left and right. in the example below i have two boxes — the first has the box floated with float: left, the second with float: inline-start. if you change the writing-mode to vertical-rl or the direction to rtl you will see that the left-floated box always sticks to the left, whereas the inline-start-floated item follows the direction and writing-mode. example: inset properties for positioned layout positioning generally allows us to position an element in a manner relative to its containing block — we essentially inset the item relative to where it would fall based on normal flow. to do this we have historically used the physical properties top, right, bottom and left. these properties take a leng...
CSS selectors - CSS: Cascading Style Sheets
basic selectors universal selector selects all elements. optionally, it may be restricted to a specific namespace or to all namespaces. syntax: * ns|* *|* example: * will match all the elements of the document. type selector selects all elements that have the given node name. syntax: elementname example: input will match any <input> element. class selector selects all elements that have the given class attribute. ...
Shapes from box values - CSS: Cascading Style Sheets
l of the examples below i am using an element which has padding, a border, and a margin defined in order that you can see the different ways in which content will flow. margin-box the margin-box is the shape defined by the outside margin edge and includes the corner radius of the shape, should border-radius have been used in defining the element. in the example below, we have a circular purple item which is a <div> with a height, width, and background colour. the border-radius property has been used to create a circle by setting border-radius: 50%. as the element has a margin, you can see that the content is flowing around the circular shape and the margin applied to it. border-box the border-box value is the shape defined by the outside border edge. this shape follows all of the normal...
Using CSS transitions - CSS: Cascading Style Sheets
it's easy to use transitions to make the effect even more attractive. before we look at code snippets, you might want to take a look at the live demo (assuming your browser supports transitions). first, we set up the menu using html: <nav> <a href="#">home</a> <a href="#">about</a> <a href="#">contact us</a> <a href="#">links</a...
Child combinator - CSS: Cascading Style Sheets
the child combinator (>) is placed between two css selectors. it matches only those elements matched by the second selector that are the direct children of elements matched by the first. /* list items that are children of the "my-things" list */ ul.my-things > li { margin: 2em; } elements matched by the second selector must be the immediate children of the elements matched by the first selector. this is stricter than the descendant combinator, which matches all elements matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of "hops" up the dom. syntax selector1 > selector2 { style properties } examples css span { background-color: white; } div > span { background-color: dodgerblue; } html <div> <sp...
Layout and the containing block - CSS: Cascading Style Sheets
t's containing block. identifying the containing block the process for identifying the containing block depends entirely on the value of the element's position property: if the position property is static, relative, or sticky, the containing block is formed by the edge of the content box of the nearest ancestor element that is either a block container (such as an inline-block, block, or list-item element) or establishes a formatting context (such as a table container, flex container, grid container, or the block container itself). if the position property is absolute, the containing block is formed by the edge of the padding box of the nearest ancestor element that has a position value other than static (fixed, absolute, relative, or sticky). if the position property is fixed, the conta...
Breadcrumb Navigation - CSS: Cascading Style Sheets
recipe download this example note: the example above uses two selectors to insert content before every li except the first one. this could also be achieved using one selector only: .breadcrumb li:not(:first-child)::before { content: "→"; } this solution uses a more complex selector, but requires less rules. feel free to choose the solution that you prefer. ...
Card - CSS: Cascading Style Sheets
ault. therefore this will fit the content added to it. note: the various elements in separate cards do not align with each other, as each card is an independent grid. the proposed subgrid feature of grid level 2 would give a solution to this issue. useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow. this would be a reasonable way to lay out the card, although i have a slight preference for being able to control the tracks from the container rather than needing to add rules to the items. for the overall layout you could use flexbox, however this will result in cards stretching over the final flex row where there are fewer than can fit in the rows above. alternatively you could use...
Center an element - CSS: Cascading Style Sheets
in this recipe you will see how to center one box inside another. centering both horizontally and vertically was difficult before flexbox, with the box alignment properties it is now straightforward. requirements to place an item into the center of another box horizontally and vertically. recipe download this example choices made to center one box inside another we make the containing box a flex container. then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are specified to apply to block layout too. however, support is currently limited for box ...
Recipe: Media objects - CSS: Cascading Style Sheets
need to place it into the second track in the regular layout, and the first track when flipped. fallbacks there are a number of possible fallbacks for this pattern, depending on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is remove any margins applied to the item, and any widths which we don’t need in a grid context (we have the gap property to control it in grids, and the track takes control of the sizing). relevant resources on mdn css grid layout progressive enhancement and grid layout u...
Sticky footers - CSS: Cascading Style Sheets
ting a min-height of 100vh on the <body> and then using it as your grid container. choices made in the above example we achieve the sticky footer using css grid layout. the .wrapper has a minimum height of 100% which means it is as tall as the container it is in. we then create a single column grid layout with three rows, one row for each part of our layout. grid auto-placement will place our items in source order and so the header goes into the first auto sized track, the main content into the 1fr track and the footer into the final auto sized track. the 1fr track will take up all available space and so grows to fill the gap. alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer. the flexbox example...
Layout mode - CSS: Cascading Style Sheets
led layout, is an algorithm that determines the position and size of boxes based on the way they interact with their sibling and ancestor boxes. there are several of them: normal flow — all elements are part of normal flow until you do something to take them out of it. normal flow includes block layout, designed for laying out boxes such as paragraphs and inline layout, which lays out inline items such as text. table layout, designed for laying out tables. float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it. positioned layout, designed for positioning elements without much interaction with other elements. multi-column layout, designed for laying content out in columns as in a newspaper. flexible box l...
CSS Tutorials - CSS: Cascading Style Sheets
Web › CSS › Tutorials
xes 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 concepts. css counters counting items and pages is an easy task in css. learn to use counter-reset, counter-increment, counters(), and counter(). css animations css3 animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. css transitions css3 transitions allow you to define an animation between several styles and to control the way this transition happens. css ...
Value definition syntax - CSS: Cascading Style Sheets
bold, as smaller must appear at least one time. bold smaller smaller smaller, as the different occurrence of smaller must be separated by commas. smaller, as bold is juxtaposed and must appear before any smaller keyword. exclamation point (!) the exclamation point multiplier after a group indicates that the group is required, and must produce at least one value; even if the grammar of the items within the group would otherwise allow the entire contents to be omitted, at least one component value must not be omitted. [ bold? smaller? ]! this example matches the following values: bold smaller bold smaller but not: neither bold nor smaller, as one of them must appear. smaller bold, as bold is juxtaposed and must appear before the smaller keyword. bold smaller bold, as bold ...
backdrop-filter - CSS: Cascading Style Sheets
editor's draft initial defi...
background-position-x - CSS: Cascading Style Sheets
he left edge of the container, and a value of 100% means that the right edge of the background image is aligned with the right edge of the container, thus a value of 50% horizontally centers the background image. ...
background-position-y - CSS: Cascading Style Sheets
the top edge of the container, and a value of 100% means that the bottom edge of the background image is aligned with the bottom edge of the container, thus a value of 50% vertically centers the background image. ...
background - CSS: Cascading Style Sheets
-position: refer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetsbackground-size: relative to the background positioning areacomputed valueas each of the properties of the shorthand:background-image: as specified, but with <url> values made absolutebackground-position: a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one per dimensionbackground-origin: as specifiedbackground-clip: as specifiedbac...
box-align - CSS: Cascading Style Sheets
Web › CSS › box-align
full support no support no supportnon-standard. expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use. see also align-items, box-orient, box-direction, box-pack ...
color-adjust - CSS: Cascading Style Sheets
luding on paper, so we also use color-adjust: exact to tell the browser not to make color or style adjustments to the box when rendering it. css .my-box { background-color: black; background-image: linear-gradient(rgba(0, 0, 180, 0.5), rgba(70, 140, 220, 0.5)); color: #900; width: 15rem; height: 6rem; text-align: center; font: 24px "helvetica", sans-serif; display: flex; align-items: center; justify-content: center; color-adjust: exact; } html <div class="my-box"> <p>need more contrast!</p> </div> result specifications specification status comment css color adjustment module level 1the definition of 'color-adjust' in that specification. editor's draft initial definition. ...
content - CSS: Cascading Style Sheets
Web › CSS › content
this example inserts an image before the link. if the image is not found, it inserts text instead. html <a href="http://www.mozilla.org/">mozilla home page</a> css a::before { content: url("https://mozorg.cdn.mozilla.net/media/img/favicon.ico") / " mozilla: "; font: x-small arial, sans-serif; color: gray; } result targeting classes this example inserts additional text after special items in a list. html <h2>paperback best sellers</h2> <ol> <li>political thriller</li> <li class="new-entry">halloween stories</li> <li>my biography</li> <li class="new-entry">vampire romance</li> </ol> css .new-entry::after { content: " new!"; /* the leading space creates separation between the added content and the rest of the content */...
<display-inside> - CSS: Cascading Style Sheets
display: flex or display: grid is specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. examples in this example the parent box has been given display: flow-root and so establishes a new bfc and contains the floated item. html <div class="box"> <div class="float">i am a floated box!</div> <p>i am content inside the container.</p> </div> css .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; display: flow-root; } .float { float: left; width: 200px; height: 150px; background-color: white; border:1px solid black; padding: 10px; } result spe...
<display-legacy> - CSS: Cascading Style Sheets
nt and lays out its content according to the flexbox model. it is equivalent to inline flex. inline-grid the element behaves like an inline element and lays out its content according to the grid model. it is equivalent to inline grid. examples in the below example, we are creating an inline flex container with the legacy keyword inline-flex. html <div class="container"> <div>flex item</div> <div>flex item</div> </div> not a flex item css .container { display: inline-flex; } result in the new syntax the inline flex container would be created using two values, inline for the outer display type, and flex for the inner display type. .container { display: inline flex; } specifications specification status css display module level 3the def...
<easing-function> - CSS: Cascading Style Sheets
height: 100px; } div > div { position: absolute; width: 50px; height: 50px; background-color: blue; background-image: radial-gradient(circle at 10px 10px, rgba(25,255,255,0.8),rgba(25,255,255,0.4)); border-radius: 50%; top: 25px; animation: 1.5s infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } javascript const selectelem = document.queryselector('select'); const startbtn = document.queryselector('button'); const divelem = document.queryselector('div > div'); startbtn.addeventlistener('click', () => { if(startbtn.textcontent === 'start animation') { divelem.style.animationname = 'move-right'; startbtn.textcontent...
<filter-function> - CSS: Cascading Style Sheets
ption> <option>sepia</option> </select> </li> <li> <input type="range"><output></output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { width: 60% } output { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector('select'); const divelem = document.queryselector('div'); const slider = document.queryselector('input'); const output = document.queryselector('output'); const curv...
flex-direction - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note that the values row and row-reverse are affected by the directionality of the flex container. if its dir attribute is ltr, row represents the horizontal axis oriented from the left to the right, and row-reverse from the right to the left; if the dir attribute is rtl, row represents the axis oriented from the right to the left, and row-reverse from the left to the right. ...
flex-flow - CSS: Cascading Style Sheets
Web › CSS › flex-flow
candidate recommendation initial definition ...
float - CSS: Cascading Style Sheets
Web › CSS › float
agna ac massa aliquet tincidunt vel in massa. phasellus feugiat est vel leo finibus congue.</p> </section> css section { border: 1px solid blue; width: 100%; float: left; } div { margin: 5px; width: 50px; height: 150px; } .left { float: left; background: pink; } .right { float: right; background: cyan; } result clearing floats sometimes you may want to force an item to move below any floated elements. for instance, you may want paragraphs to remain adjacent to floats, but force headings to be on their own line. see clear for examples. specifications specification status comment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and...
font-family - CSS: Cascading Style Sheets
t family. for example, "times" and "helvetica" are font families. font family names containing whitespace should be quoted. <generic-name> generic font families are a fallback mechanism, a means of preserving some of the style sheet author's intent when none of the specified fonts are available. generic family names are keywords and must not be quoted. a generic font family should be the last item in the list of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. sans-serif glyphs have stroke endings that are plain. e.g. "open sans", "fira sans", "lucida sans", "lucida sans unicode", "...
font-stretch - CSS: Cascading Style Sheets
"container"> <p class="condensed">an elephantine lizard</p> <p class="normal">an elephantine lizard</p> <p class="expanded">an elephantine lizard</p> </div> css /* this example uses the league mono variable font, developed by tyler finck (https://www.tylerfinck.com/) and used here under the terms of the sil open font license, version 1.1: http://scripts.sil.org/cms/scripts/page.php?item_id=ofl_web */ @font-face { src: url('https://mdn.mozillademos.org/files/16014/leaguemonovariable.ttf'); font-family:'leaguemonovariable'; font-style: normal; font-stretch: 1% 500%; /* required by chrome */ } .container { border: 10px solid #f5f9fa; padding: 0 1rem; font: 1.5rem 'leaguemonovariable', sans-serif; } .condensed { font-stretch: 50%; } .normal { font-stretch: 100%...
font-variant-numeric - CSS: Cascading Style Sheets
[ proportional-nums | tabular-nums ]<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ] examples setting ordinal numeric forms html <p class="ordinal">1st, 2nd, 3rd, 4th, 5th</p> css /* this example uses the source sans pro opentype font, developed by adobe and used here under the terms of the sil open font license, version 1.1: http://scripts.sil.org/cms/scripts/page.php?item_id=ofl_web */ @font-face { font-family: "source sans pro"; font-style: normal; font-weight: 400; src: url("https://mdn.mozillademos.org/files/15757/sourcesanspro-regular.otf") format("opentype"); } .ordinal { font-variant-numeric: ordinal; font-family: "source sans pro"; } result specifications specification status comment css fonts module level 3th...
grid-template-areas - CSS: Cascading Style Sheets
emplate-areas css property specifies named grid areas, establishing the cells in the grid and assigning them names. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. those areas are not associated with any particular grid item, but can be referenced from the grid-placement properties grid-row-start, grid-row-end, grid-column-start, grid-column-end, and their shorthands grid-row, grid-column, and grid-area. syntax /* keyword value */ grid-template-areas: none; /* <string> values */ grid-template-areas: "a b"; grid-template-areas: "a b b" "a c d"; /* global values */ grid-template-areas: inherit;...
<length> - CSS: Cascading Style Sheets
Web › CSS › length
ee; position: relative; } .inner { height: 50px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); } .result { height: 20px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); background-color: orange; display: flex; align-items: center; margin-top: 10px; } .result code { position: absolute; margin-left: 20px; } .results { margin-top: 10px; } .input-container { position: absolute; display: flex; justify-content: flex-start; align-items: center; height: 50px; } label { margin: 0 10px 0 20px; } javascript const inputdiv = document.queryselector('.inner'); const inputelem = document.queryselector(...
mask-composite - CSS: Cascading Style Sheets
es compositing mask layers with addition css #masked { width: 100px; height: 100px; background-color: #8cffa0; mask-image: url(https://mdn.mozillademos.org/files/12668/mdn.svg), url(https://mdn.mozillademos.org/files/12676/star.svg); mask-size: 100% 100%; mask-composite: add; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="compositemode"> <option value="add">add</option> <option value="subtract">subtract</option> <option value="intersect">intersect</option> <option value="exclude">exclude</option> </select> javascript var clipbox = document.getelementbyid("compositemode"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskcomposite = evt.target.value; }); result ...
object-fit - CSS: Cascading Style Sheets
2> <img class="scale-down" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="scale-down narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> </section> css h2 { font-family: courier new, monospace; font-size: 1em; margin: 1em 0 0.3em; } div { display: flex; flex-direction: column; flex-wrap: wrap; align-items: flex-start; height: 940px; } img { width: 150px; height: 100px; border: 1px solid #000; } .narrow { width: 100px; height: 150px; margin-top: 10px; } .fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification sta...
offset-anchor - CSS: Cascading Style Sheets
-anchor: bottom 10px right 20px; offset-anchor: right 3em bottom 10px; /* global values */ offset-anchor: inherit; offset-anchor: initial; offset-anchor: unset; values auto offset-anchor is given the same value as the element's transform-origin, unless offset-path is none, in which case it takes its value from offset-position. <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrelativetowidthandheig...
offset-position - CSS: Cascading Style Sheets
px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* global values */ offset-position: inherit; offset-position: initial; offset-position: unset; values auto the initial position is the position of the box specified by the position property. <position> a <position>. a position defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. if two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword v...
paint-order - CSS: Cascading Style Sheets
be painted in the order they are specified in, followed by the unspecified one. note: in the case of this property, markers are only appropriate when drawing svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. they do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. formal definition initial valuenormalapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ fill | stroke | markers ] examples reversing the paint order of stroke and fill svg <svg xmlns="http://www.w3.org...
position - CSS: Cascading Style Sheets
Web › CSS › position
nce... #one { position: sticky; top: 10px; } ...would position the element with id one relatively until the viewport were scrolled such that the element would be less than 10 pixels from the top. beyond that threshold, the element would be fixed to 10 pixels from the top. a common use for sticky positioning is for the headings in an alphabetized list. the "b" heading will appear just below the items that begin with "a" until they are scrolled offscreen. rather than sliding offscreen with the rest of the content, the "b" heading will then remain fixed to the top of the viewport until all the "b" items have scrolled offscreen, at which point it will be covered up by the "c" heading, and so on. you must specify a threshold with at least one of top, right, bottom, or left for sticky positionin...
scroll-behavior - CSS: Cascading Style Sheets
working draft initial specification ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
e the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin values, a different one for the second a...
scroll-margin-inline-start - CSS: Cascading Style Sheets
e the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin-values, a different one for the sec...
scroll-margin-inline - CSS: Cascading Style Sheets
e the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin values, a different one for the second a...
scroll-margin - CSS: Cascading Style Sheets
e the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin-values, a different one for the sec...
scroll-snap-stop - CSS: Cascading Style Sheets
; and must snap to the first of this elements' snap positions. formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances. ...
scroll-snap-type - CSS: Cascading Style Sheets
container y mandatory-scroll-snapping" dir="rtl"> <div>y mand. rtl</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> <div class="container y proximity-scroll-snapping" dir="rtl"> <div>y prox. ...
matrix3d() - CSS: Cascading Style Sheets
<div class="face bottom">6</div> </section> css #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); margin: 50px auto; } #example-element:hover, #example-element:focus { transform: rotate3d(1, 1, 1, 30deg) matrix3d(1,0,0,0,0,1,6,0,0,0,1,0,50,100,0,1.1); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90de...
<transform-function> - CSS: Cascading Style Sheets
d(1,0,0,0,0,1,3,0,0,0,1,0,50,100,0,1.1)</option> </select> </div> </main> css main { width: 400px; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90de...
transform-style - CSS: Cascading Style Sheets
div> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90de...
z-index - CSS: Cascading Style Sheets
Web › CSS › z-index
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. ...
Video player styling basics - Developer guides
section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. html markup there are a few changes that were made to the html markup shown in the previous article. the custom video controls and <progress> element are now contained within <div> elements, rather than residing inside unordered list items. the markup for the custom controls now looks as follows: <div id="video-controls" class="controls" data-state="hidden"> <button id="playpause" type="button" data-state="play">play/pause</button> <button id="stop" type="button" data-state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progre...
Creating a cross-browser video player - Developer guides
most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. once again the html is quite straightforward, using an unordered list with list-style-type:none set to enclose the controls, each of which is a list item with float:left. for the progress bar, the progress element is taken advantage of, with a fallback provided for browsers that don't support it (e.g. ie8 and ie9). this list is inserted after the <video> element, but inside the <figure> element (this is important for the fullscreen functionality, which is explained later on). <ul id="video-controls" class="controls"> <li><button id="playpause"...
Block formatting context - Developer guides
ells implicitly created by the elements with display: table, table-row, table-row-group, table-header-group, table-footer-group (which is the default for html tables, table rows, table bodies, table headers, and table footers, respectively), or inline-table. block elements where overflow has a value other than visible. display: flow-root. elements with contain: layout, content, or paint. flex items (direct children of the element with display: flex or inline-flex) if they are neither flex nor grid nor table containers themselves. grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves. multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1)...
Constraint validation - Developer guides
s the :valid and :invalid pseudo-classes are used to represent <input> elements whose content validates and fails to validate respectively according to the input's type setting. these classes allow the user to style valid or invalid form elements to make it easier to identify elements that are either formatted correctly or incorrectly. controlling the text of constraint violation the following items can help with controlling the text of a constraint violation: element.setcustomvalidity(message) method on the following elements: <fieldset>. note: setting a custom validity message on fieldset elements will not prevent form submission in most browsers. <input> <output> <select> submit buttons (created with either a <button> element with the submit type, or an input elemen...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
g to greater performance. history api allows the manipulation of the browser history. this is especially useful for pages loading interactively new information. the contenteditable attribute: transform your website to a wiki! html5 has standardized the contenteditable attribute. learn more about this feature. drag and drop the html5 drag and drop api allows support for dragging and dropping items within and between web sites. this also provides a simpler api for use by extensions and mozilla-based applications. focus management in html the new html5 activeelement and hasfocus attributes are supported. web-based protocol handlers you can now register web applications as protocol handlers using the navigator.registerprotocolhandler() method. requestanimationframe allows control of an...
Mobile Web Development - Developer guides
Web › Guide › Mobile
of media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device. working with touch screens to use a touch screen you'll need to work with dom touch events. you won't be able to use the css :hover pseudo-class, and will need to design clickable items like buttons to respect the fact that fingers are fatter than mouse pointers. see this article on designing for touch screens. you can use the pointer or any-pointer media query to load different css on a touch-enabled device. optimizing images to help users whose devices have low or expensive bandwidth, you can optimize images by loading images appropriate to the device screen size and resol...
User input and controls - Developer guides
k is then used to remove the mouse pointer and allow you to move the ball directly using the mouse. ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
8zz the address levels are: address-level1: the post town — "winchelsea" in this case. address-line2: the locality — "upper-wapping" in this case. address-line1: the house/street particulars — "103 frogmarch street" the postcode is separate. note that you can actually use just the postcode and address-line1 to sucessfully deliver mail in the uk, so they should be the only mandatory items, but usually people tend to provide more details. china china can use as many as three administrative levels: the province, the city, and the district. japan an address in japan is typically written in one line, in an order from the least-specific to more-specific portions (in reverse order to the united states). there are two or three administrative levels in an address. additional line can...
disabled - HTML: Hypertext Markup Language
t's descendant controls. if this attribute is not specified, the control inherits its setting from the containing element, for example fieldset; if there is no containing element with the disabled attribute set, and the control itself does not have the attribute, then the control is enabled. if declared on an <optgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the option group are selectable. note: if a <fieldset> is disabled, the descendant form controls are all disabled, with the exception of form controls within the <legend>. when a supporting element has the disabled attribute applied, the :disabled pseudo-class also applies to it. conversely, elements that support the disabled attribute but don't have the attribute set match the :enabled p...
HTML attribute: multiple - HTML: Hypertext Markup Language
eight: 1.5em; vertical-align: top; } select[multiple]:focus, select[multiple]:active { height: auto; } */ there are a few ways to select multiple options in a <select> element with a multiple attribute. depending on the operating system, mouse users can hold the ctrl, command, or shift keys and then click multiple options to select/deselect them. keyboard users can select multiple contiguous items by focusing on the <select> element, selecting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options. the selection of non-contiguous is not as well supported: items should be able to be selected and deselected by pressing space , but support varies between browsers. specifications specification status comme...
Block-level elements - HTML: Hypertext Markup Language
st. <dt> description list term. <fieldset> field set label. <figcaption> figure caption. <figure> groups media content with a caption (see <figcaption>). <footer> section or page footer. <form> input form. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> heading levels 1-6. <header> section or page header. <hgroup> groups header information. <hr> horizontal rule (dividing line). <li> list item. <main> contains the central content unique to this document. <nav> contains navigation links. <ol> ordered list. <p> paragraph. <pre> preformatted text. <section> section of a web page. <table> table. <ul> unordered list. see also inline elements display block and inline layout in normal flow ...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
ning content can be labeled using a combination of the aria-labelledby and id attributes, with the label concisely describing the purpose of the section. this technique is useful for situations where there is more than one sectioning element on the same page. example <header> <nav aria-labelledby="primary-navigation"> <h2 id="primary-navigation">primary navigation</h2> <!-- navigation items --> </nav> </header> <!-- page content --> <footer> <nav aria-labelledby="footer-navigation"> <h2 id="footer-navigation">footer navigation</h2> <!-- navigation items --> </nav> </footer> in this example, screen reading technology would announce that there are two <nav> sections, one called "primary navigation" and one called "footer navigation". if labels were not provided, the...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
Web › HTML › Element › abbr
n the text needs to be semantically noted, the <abbr> element is useful. this can be used, in turn, for styling or scripting purposes. you can use <abbr> in concert with <dfn> to establish definitions for terms which are abbreviations or acronyms. see the example defining an abbreviation below. grammar considerations in languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your title attribute as inside your <abbr> element. this is especially important in languages with more than two numbers, such as arabic, but is also relevant in english. default styling the purpose of this element is purely for the convenience of the author and all browsers display it inline (display: inline) by default, t...
<button>: The Button element - HTML: Hypertext Markup Language
Web › HTML › Element › button
abelable, and submittable form-associated element, palpable content. permitted content phrasing content but there must be no interactive content tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role button permitted aria roles checkbox, link, menuitem, menuitemcheckbox, menuitemradio, option, radio, switch, tab dom interface htmlbuttonelement attributes this element's attributes include the global attributes. autofocus html5 this boolean attribute specifies that the button should have input focus when the page loads. only one element in a document can have this attribute. autocomplete this attribute on a <button> is...
<command>: The HTML Command element - HTML: Hypertext Markup Language
Web › HTML › Element › command
the html command element (<command>) represents a command which the user can invoke. commands are often used as part of a context menu or toolbar. however, they can be used anywhere on the page. the <command> element is included in the w3c specification, but not in the whatwg specification, and browser support is nonexistent. you should use the <menuitem> element instead, although that element is non-standard and only supported in edge and firefox. content categories flow content, phrasing content, metadata content. permitted content none, it is an empty element. tag omission the start tag is mandatory, but, as it is a void element, the use of an end tag is forbidden. permitted parent elements <colgroup> only, though it can be implicitly d...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
etting/removing its open attribute. by default when closed, the widget is only tall enough to display the disclosure triangle and summary. when open, it expands to display the details contained within. note: unfortunately, at this time there's no built-in way to animate the transition between open and closed. fully standards-compliant implementations automatically apply the css display: list-item to the <summary> element. you can use this to customize its appearance further. see customizing the disclosure widget for further details. content categories flow content, sectioning root, interactive content, palpable content. permitted content one <summary> element followed by flow content. tag omission none, both the starting and ending tag are mandatory. ...
<dl>: The Description List element - HTML: Hypertext Markup Language
Web › HTML › Element › dl
dentation on a page. although it works, this is a bad practice and obscures the meaning of description lists. to change the indentation of a description term, use the css margin property. accessibility concerns each screen reader announces <dl> content differently. some screen readers, such as voiceover on ios, will not announce that <dl> content is a list. because of this, make sure each list item's content is written in such a way that it communicates its relationship to the other list items in the list grouping. codepen - html buddies: dt & dd specifications specification status comment html living standardthe definition of '<dl>' in that specification. living standard html5the definition of '<dl>' in that specification. recommendation...
<dt>: The Description Term element - HTML: Hypertext Markup Language
Web › HTML › Element › dt
tag omission must have a start tag. the end tag may be omitted if this element is immediately followed by another <dt> or a <dd> element, or if there is no more content in the parent element. permitted parents before a <dt> or a <dd> element, inside a <dl> or (in whatwg html) a <div> that is inside a <dl>. implicit aria role term permitted aria roles listitem dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. example for an example, see the example provided for the <dl> element. specifications specification status comment html living standardthe definition of...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
es it easier to click the option you want, especially on small-screen devices like smartphones. beyond accessibility, this is another good reason to properly set up <label> elements on your forms. indeterminate state checkboxes in addition to the checked and unchecked states, there is a third state a checkbox can be in: indeterminate. this is a state in which it's impossible to say whether the item is toggled on or off. this is set using the htmlinputelement object's indeterminate property via javascript (it cannot be set using an html attribute): inputinstance.indeterminate = true; a checkbox in the indeterminate state has a horizontal line in the box (it looks somewhat like a hyphen or minus sign) instead of a check/tick in most browsers. there are not many use cases for this property.
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
ve example. we make use of the :valid and :invalid pseudo-elements to add an icon next to the input, based on whether or not the current value is valid. we had to put the icon on a <span> next to the input, not on the input itself, because in chrome at least the input's generated content is placed inside the form control, and can't be styled or shown effectively. label { display: flex; align-items: center; } span::after { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid+span::after { content: '✓'; } important: client-side form validation is no substitute for validating on the server. it's easy for someone to modify the html, or bypass your html entirely and submit the data directly to your server. if your server fails to validate the received d...
<input type="datetime-local"> - HTML: Hypertext Markup Language
ve example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. div { margin-bottom: 10px; display: flex; align-items: center; } label { display: inline-block; width: 300px; } input:invalid+span:after { content: '✖'; padding-left: 5px; } input:valid+span:after { content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html tha...
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
domain names and the validation of e-mail addresses in html. see w3c bug 15489 for details. pattern validation if you need the entered e-mail address to be restricted further than just "any string that looks like an e-mail address," you can use the pattern attribute to specify a regular expression the value must match for it to be valid. if the multiple attribute is specified, each individual item in the comma-delineated list of values must match the regular expression. for example, let's say you're building a page for employees of best startup ever, inc. which will let them contact their it department for help. in our simplified form, the user needs to enter their e-mail address and a message describing the problem they need help with. we want to ensure that not only does the user provid...
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
is still editing the value of the field. webkit and blink only (safari, chrome, opera, etc.). mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. results the maximum number of items that should be displayed in the drop-down list of previous search queries. safari only. autocorrect a safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. permitted values are: on enable automatic correction of typos, as well as processing of text substitutions if any are config...
<label> - HTML: Hypertext Markup Language
Web › HTML › Element › label
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. associating a <label> with an <input> element offers some major advantages: the label text is not only visually associated with its corresponding text input; it is programmatically associated with it too. this means that, for example, a screenreader will read out the label when the user is focused on the form input, making it easier for an assistive technology user to understand what data should be entered. ...
<optgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › optgroup
t, or if the parent element has no more content. permitted parents a <select> element. implicit aria role group permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested. attributes this element includes the global attributes. disabled if this boolean attribute is set, none of the items in this option group is selectable. often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones. label the name of the group of options, which the browser can use when labeling the options in the user interface. this attribute is mandatory if this element is used. examples <select> <optgroup label="group 1"> <option>option 1.1...
<option>: The HTML Option element - HTML: Hypertext Markup Language
Web › HTML › Element › option
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content text, possibly with escaped characters (like &eacute;). tag omission the start tag is mandatory. ...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
Web › HTML › Element › summary
event is sent to the <details> element, which can be used to let you know when this state change occurs. default label text if a <details> element's first child is not a <summary> element, the user agent will use a default string (typically "details") as the label for the disclosure box. default style per the html specification, the default style for <summary> elements includes display: list-item. this makes it possible to change or remove the icon displayed as the disclosure widget next to the label from the default, which is typically a triangle. you can also change the style to display: block to remove the disclosure triangle. see the browser compatibility section for details, as not all browsers support full functionality of this element yet. examples below are some examples showi...
accesskey - HTML: Hypertext Markup Language
what may work for one combination of operating system, assistive technology, and browser may not work with other combinations. certain...
title - HTML: Hypertext Markup Language
please clone https://github.com/mdn/interactive-examples and send us a pull request. some typical uses: labeling <iframe> elements for assistive technology providing a programmatically associated label for an <input> element as a fallback for a real <label> labeling controls in data tables additional semantics are attached to the title attributes of the <link>, <abbr>, <input>, and <menuitem> elements. multiline titles the title attribute may contain several lines. each u+000a line feed (lf) character represents a line break. some caution must be taken, as this means the following renders across two lines: html <p>newlines in <code>title</code> should be taken into account, like <abbr title="this is a multiline title">example</abbr>.</p> result title attribute inheritance if...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
ender"> renders a specified webpage in the background, speeding up its load if the user navigates to it. because of the potential to waste users bandwidth, chrome treats prerender as a nostate prefetch instead. <link rel="subresource"> was supported in chrome a while ago, and was intended to tackle the same issue as preload, but it had a problem: there was no way to work out a priority for the items (as didn't exist back then), so they all got fetched with fairly low priority. there are a number of script-based resource loaders out there, but they don't have any power over the browser's fetch prioritization queue, and are subject to much the same performance problems. specifications specification status comment preloadthe definition of 'preload' in that speci...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
description of the default-src directive). a policy needs to include a default-src or script-src directive to prevent inline scripts from running, as well as blocking the use of eval(). a policy needs to include a default-src or style-src directive to restrict inline styles from being applied from a <style> element or a style attribute. there are specific directives for a wide variety of types of items, so that each type can have its own policy, including fonts, frames, images, audio and video media, scripts, and workers. examples: common use cases this section provides examples of some common security policy scenarios. example 1 a web site administrator wants all content to come from the site's own origin (this excludes subdomains.) content-security-policy: default-src 'self' example 2 ...
HTTP caching - HTTP
Web › HTTP › Caching
ore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request. use pragma only for backwards compatibility with http/1.0 clients. freshness once a resource is stored in a cache, it could theoretically be served by the cache forever. caches have finite storage so items are periodically removed from storage. this process is called cache eviction. on the other side, some resources may change on the server so the cache should be updated. as http is a client-server protocol, servers can't contact caches and clients when a resource changes; they have to communicate an expiration time for the resource. before this expiration time, the resource is fresh; after the ex...
Index - HTTP
Web › HTTP › Headers › Index
to opt-out of mime type sniffing, or, in other words, it is a way to say that the webmasters knew what they were doing. 117 x-dns-prefetch-control dns, http, header the x-dns-prefetch-control http response header controls dns prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as urls for items referenced by the document, including images, css, javascript, and so forth. 118 x-forwarded-for http, http header, non-standard, reference, request header, header the x-forwarded-for (xff) header is a de-facto standard header for identifying the originating ip address of a client connecting to a web server through an http proxy or a load balancer. when traffic is intercepte...
HTTP headers - HTTP
Web › HTTP › Headers
r field is specified, then the sender must also send the connection header field with the upgrade option specified. for details on the connection header field please see section 6.1 of the aforementioned rfc. x-dns-prefetch-control controls dns prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as urls for items referenced by the document, including images, css, javascript, and so forth. x-firefox-spdy ... x-pingback ... x-requested-with ... x-robots-tag the x-robots-tag http header is used to indicate how a web page is to be indexed within public search engine results. the header is effectively equivalent to <meta name="robots" content="...">. x-ua-compatible used by internet explore...
HTTP Index - HTTP
Web › HTTP › Index
sniffing, or, in other words, it is a way to say that the webmasters knew what they were doing. 199 x-dns-prefetch-control dns, http, x-dns-prefetch-control, header the x-dns-prefetch-control http response header controls dns prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as urls for items referenced by the document, including images, css, javascript, and so forth. 200 x-forwarded-for http, http header, non-standard, reference, request header, header the x-forwarded-for (xff) header is a de-facto standard header for identifying the originating ip address of a client connecting to a web server through an http proxy or a load balancer. when traffic is intercepte...
Control flow and error handling - JavaScript
e a resource that your script has tied up. the following example opens a file and then executes statements that use the file. (server-side javascript allows you to access files.) if an exception is thrown while the file is open, the finally block closes the file before the script fails. using finally here ensures that the file is never left open, even if an error occurs. ...
Functions - JavaScript
on't know in advance how many arguments will be passed to the function. you can use arguments.length to determine the number of arguments actually passed to the function, and then access each argument using the arguments object. for example, consider a function that concatenates several strings. the only formal argument for the function is a string that specifies the characters that separate the items to concatenate. the function is defined as follows: function myconcat(separator) { var result = ''; // initialize list var i; // iterate through arguments for (i = 1; i < arguments.length; i++) { result += arguments[i] + separator; } return result; } you can pass any number of arguments to this function, and it concatenates each argument into a string "list": // retur...
Keyed collections - JavaScript
iterate its elements in insertion order. a value in a set may only occur once; it is unique in the set's collection. the following code shows some basic operations with a set. see also the set reference page for more examples and the complete api. let myset = new set(); myset.add(1); myset.add('some text'); myset.add('foo'); myset.has(1); // true myset.delete('foo'); myset.size; // 2 for (let item of myset) console.log(item); // 1 // "some text" converting between array and set you can create an array from a set using array.from or the spread operator. also, the set constructor accepts an array to convert in the other direction. note: remember that set objects store unique values—so any duplicate elements from an array are deleted when converting! array.from(myset); [...myset2]; ...
Regular expressions - JavaScript
substring "abc". using special characters when the search for a match requires something more than a direct match, such as finding one or more b's, or finding white space, you can include special characters in the pattern. for example, to match a single "a" followed by zero or more "b"s followed by "c", you'd use the pattern /ab*c/: the * after "b" means "0 or more occurrences of the preceding item." in the string "cbbabbbbcdebc", this pattern will match the substring "abbbbc". the following pages provide lists of the different special characters that fit into each category, along with descriptions and examples. assertions assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (incl...
JavaScript technologies overview - JavaScript
ve the abstract concepts defined in dom core, html also defines the meaning of elements. the html dom includes such things as the classname property on html elements, or apis such as document.body. the html specification also defines restrictions on documents; for example, it requires all children of a <ul> element, which represents an unordered list, to be <li> elements, as those represent list items. in general, it also forbids using elements and attributes that aren't defined in a standard. looking for the document object, window object, and the other dom elements? read the dom documentation. other notable apis the settimeout and setinterval functions were first specified on the window interface in html standard. xmlhttprequest makes it possible to send asynchronous http requests. t...
getter - JavaScript
st now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden). examples defining a getter on new objects in object initializers this will create a pseudo-property latest for object obj, which will return the last array item in log. const obj = { log: ['example','test'], get latest() { if (this.log.length === 0) return undefined; return this.log[this.log.length - 1]; } } console.log(obj.latest); // "test" note that attempting to assign a value to latest will not change it. deleting a getter using the delete operator if you want to remove the getter, you can just delete it: delete obj.latest; def...
Array.prototype.join() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
Array.prototype.length - JavaScript
extend an array by changing its length property, the number of actual elements increases; for example, if you set length to 3 when it is currently 2, the array now contains 3 elements, which causes the third element to be a non-iterable empty slot. const arr = [1, 2]; console.log(arr); // [ 1, 2 ] arr.length = 5; // set array length to 5 while currently 2. console.log(arr); // [ 1, 2, <3 empty items> ] arr.foreach(element => console.log(element)); // 1 // 2 as you can see, the length property does not necessarily indicate the number of defined values in the array. see also relationship between length and numerical properties. property attributes of array.prototype.length writable yes enumerable no configura...
Array.prototype.slice() - JavaScript
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. ...
JSON.stringify() - JavaScript
{ 'name': 'screenc', 'width': 750, 'height': 120 }); session.screens.push({ 'name': 'screend', 'width': 250, 'height': 60 }); session.screens.push({ 'name': 'screene', 'width': 390, 'height': 120 }); session.screens.push({ 'name': 'screenf', 'width': 1240, 'height': 650 }); // converting the json string with json.stringify() // then saving with localstorage in the name of session localstorage.setitem('session', json.stringify(session)); // example of how to transform the string generated through // json.stringify() and saved in localstorage in json object again var restoredsession = json.parse(localstorage.getitem('session')); // now restoredsession variable contains the object that was saved // in localstorage console.log(restoredsession); well-formed json.stringify() engines implementi...
Map - JavaScript
t, a map object returns keys in order of insertion. the keys of an object are not ordered. note: since ecmascript 2015, objects do preserve creation order for string and symbol keys. in javascript engines that comply with the ecmascript 2015 spec, iterating over an object with only string keys will yield the keys in order of insertion. size the number of items in a map is easily retrieved from its size property. the number of items in an object must be determined manually. iteration a map is an iterable, so it can be directly iterated. iterating over an object requires obtaining its keys in some fashion and iterating over them. performance performs better in scenarios involving frequent additions and removals of key-...
Object.getOwnPropertyNames() - JavaScript
on() { return this.foo; }, enumerable: false } }); my_obj.foo = 1; console.log(object.getownpropertynames(my_obj).sort()); // logs ["foo", "getfoo"] if you want only the enumerable properties, see object.keys() or use a for...in loop (note that this will also return enumerable properties found along the prototype chain for the object unless the latter is filtered with hasownproperty()). ...
Object.prototype.hasOwnProperty() - JavaScript
sts'; o.hasownproperty('prop'); // returns true o.hasownproperty('tostring'); // returns false o.hasownproperty('hasownproperty'); // returns false iterating over the properties of an object the following example shows how to iterate over the properties of an object without executing on inherited properties. note that the for...in loop is already only iterating enumerable items, so one should not assume based on the lack of non-enumerable properties shown in the loop that hasownproperty itself is confined strictly to enumerable items (as with object.getownpropertynames()). var buz = { fog: 'stack' }; for (var name in buz) { if (buz.hasownproperty(name)) { console.log('this is fog (' + name + ') for sure. value: ' + buz[name]); } else { console.l...
RegExp.prototype[@@split]() - JavaScript
ease clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.split](str[, limit]) parameters str the target of the split operation. limit optional integer specifying a limit on the number of splits to be found. the [@@split]() method still splits on every match of this regexp pattern (or, in the syntax above, regexp), until the number of split items match the limit or the string falls short of this pattern. return value an array containing substrings as its elements. description this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp. for example, the following two examples return the same result. 'a-b-c'.split(/-/); /-/[symbol.split]('a-b-c'); ...
RegExp.prototype.exec() - JavaScript
teractive-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 lastindex 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 lastindex 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 brow...
String.prototype.localeCompare() - JavaScript
localecompare('c'); // -2 or -1 (or some other negative value) // alphabetically the word "check" comes after "against" yielding a positive value 'check'.localecompare('against'); // 2 or 1 (or some other positive value) // "a" and "a" are equivalent yielding a neutral value of zero 'a'.localecompare('a'); // 0 sort an array localecompare() enables case-insensitive sorting for an array. let items = ['réservé', 'premier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them, use th...
String.prototype.match() - JavaScript
g: [""]. return value an array whose contents depend on the presence or absence of the global (g) flag, or null if no matches are found. if the g flag is used, all results matching the complete regular expression will be returned, but capturing groups will not. if the g flag is not used, only the first complete match and its related capturing groups are returned. in 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...
String.prototype.replace() - JavaScript
et newstr = str.replace(re, '$2, $1'); console.log(newstr); // smith, john this logs 'smith, john'. using an inline function that modifies the matched characters in this example, all occurrences of capital letters in the string are converted to lower case, and a hyphen is inserted just before the match location. the important thing here is that additional operations are needed on the matched item before it is given back as a replacement. the replacement function accepts the matched snippet as its parameter, and uses it to transform the case and concatenate the hyphen before returning. function stylehyphenformat(propertyname) { function uppertohyphenlower(match, offset, string) { return (offset > 0 ? '-' : '') + match.tolowercase(); } return propertyname.replace(/[a-z]/g, upper...
const - JavaScript
attempting to overwrite the object throws an error // uncaught typeerror: assignment to constant variable. my_object = {'other_key': 'value'}; // however, object keys are not protected, // so the following statement is executed without problem my_object.key = 'othervalue'; // use object.freeze() to make object immutable // the same applies to arrays const my_array = []; // it's possible to push items into the array my_array.push('a'); // ["a"] // however, assigning a new array to the variable throws an error // uncaught typeerror: assignment to constant variable. my_array = ['b']; specifications specification ecmascript (ecma-262)the definition of 'let and const declarations' in that specification. ...
try...catch - JavaScript
an exception is thrown, the statements in the finally-block execute even if no catch-block handles the exception. the following example shows one use case for the finally-block. the code opens a file and then executes statements that use the file; the finally-block makes sure the file always closes after it is used even if an exception was thrown. ...
<mi> - MathML
Web › MathML › Element › mi
mes. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value for more than one character) ; example bold ; example italic (default value for a single character) ; example bold-italic ; example double-struck ; example bold-fraktur ; example s...
<mn> - MathML
Web › MathML › Element › mn
e text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the number which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example ...
<mo> - MathML
Web › MathML › Element › mo
text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the operator which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example ...
<ms> - MathML
Web › MathML › Element › ms
t color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example ...
<mtext> - MathML
Web › MathML › Element › mtext
t color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example ...
OpenSearch description format
ment can safely ignore it. autodiscovery of search plugins web sites with search plugins can advertise them so firefox users can easily install the plugins. to support autodiscovery, add a <link> element for each plugin to the <head> of your web page: <link rel="search" type="application/opensearchdescription+xml" title="searchtitle" href="pluginurl"> replace the bolded items as explained below: searchtitle the name of the search to perform, such as "search mdc" or "yahoo! search". this must match your plugin file's <shortname>. pluginurl the url to the xml search plugin, so the browser can download it. if your site offers multiple search plugins, you can support autodiscovery for them all. for example: <link rel="search" type="application/opensearchdescript...
Performance fundamentals - Web Performance
css to style that html: the html must be parsed the dom for that html must be constructed resources like images in that part of the dom have to be loaded and decoded the css styles must be applied to that dom the styled document has to be reflowed nowhere in that list is "load the js file needed for an uncommon menu"; "fetch and decode the image for the high scores list", etc. those work items are not on the critical path to painting the first frame. it seems obvious, but to reach a user-perceived startup event more quickly, the main "trick" is run only the code on the critical path. shorten the critical path by simplifying the scene. the web platform is highly dynamic. javascript is a dynamically-typed language, and the web platform allows loading code, html, css, images, and other...
Progressive web app structure - Progressive web apps (PWAs)
ode block requests permission for notifications when a button is clicked: var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if(result === 'granted') { randomnotification(); } }); }); the last block creates notifications that display a randomly-selected item from the games list: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notift...
Media - Progressive web apps (PWAs)
d recently e:visited any e element that is a hyperlink to a url that the user has visited recently note: the information that can be obtained from the :visited selector is restricted in gecko 2.0. see privacy and the : visited selector for more details. the cursor property specifies the shape of the pointer: some of the common shapes are as follows. ...
requiredFeatures - SVG: Scalable Vector Graphics
www.w3.org/tr/svg11/feature#viewportattribute the browser supports the clip and overflow attributes. http://www.w3.org/tr/svg11/feature#shape the browser supports the <rect>, <circle>, <line>, <polyline>, <polygon>, <ellipse> and <path> elements. http://www.w3.org/tr/svg11/feature#text the browser supports the <text>, <tspan>, <tref>, <textpath>, <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> elements. http://www.w3.org/tr/svg11/feature#basictext the browser supports the <text> element http://www.w3.org/tr/svg11/feature#paintattribute the browser supports the color, fill, fill-rule, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-width, color-interpolation and color-rendering attributes http://www.w...
transform-origin - SVG: Scalable Vector Graphics
note: as a presentation attribute in svg, transform-origin corresponds in syntax and behavior to the transform-origin property in css, and can be used as css property to style svg. see the css transform-origin property for more information. ...
<altGlyphDef> - SVG: Scalable Vector Graphics
the <altglyphdef> svg element defines a substitution representation for glyphs. usage context categoriestext content elementpermitted contenteither: one or more <glyphref> elements, or one or more <altglyphitem> elements attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphdefelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyphdef>' in that specification. recommendation initial definition ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
of the spec, has been removed from it and is therefor not implemented (bug 273171). textpath implemented. recently implemented bindings: selectsubstring altglyph implemented as tspans, no font features as of gecko 2.0 (bug 456286, bug 571808). altglyphdef not implemented. altglyphitem not implemented. glyphref not implemented. marker module marker implemented. color profile module color-profile not implemented (bug 427713). gradient module lineargradient implemented. radialgradient ...
Same-origin policy - Web security
ument or script loaded from one origin can interact with a resource from another origin. it helps isolate potentially malicious documents, reducing possible attack vectors. definition of an origin two urls have the same origin if the protocol, port (if specified), and host are the same for both. you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
Using templates and slots - Web Components
lement's content property (and clone it). however, it is generally more practical to add slots within a <template> element, since you are unlikely to need to define a pattern based on an already-rendered element. in addition, even if it is not already rendered, the purpose of the container as a template should be more semantically clear when using the <template>. in addition, <template> can have items directly added to it, like <td>, which would disappear when added to a <div>. note: you can find this complete example at element-details (see it running live also). creating a template with some slots first of all, we use the <slot> element within a <template> element to create a new "element-details-template" document fragment containing some named slots: <template id="element-details-te...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
red attributes none. optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. the default value is single: single numbers sibling nodes sequentially, as in the items in a list. the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an empty list. multiple numbers nodes as a composite sequence ...
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › sort
n to specify the nodes to be sorted. order specifies whether the nodes should be processed in "ascending" or "descending" order. the default is "ascending". case-order indicates whether upper- or lowercase letters are to be ordered first. the allowable values are "upper-first" and "lower-first". lang specifies which language is to be used by the sort. data-type defines whether items are to be ordered alphabetically or numerically. the allowable values are "text" and "number" with "text" being the default. type subinstruction, always appears as a child of <xsl:for-each>, where it must appear before the template proper or of <xsl:apply-templates>. defined xslt, section10. gecko support supported. ...