Search completed in 1.07 seconds.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
followed by the announcement that you’re in a textbox, and that it contains the number 21. isn’t that cool? you do not need to navigate around to find out the unit. “days” could easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands. the solution is in an aria attribute called aria-
labelledby. its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name. both aria-
labelledby and aria-describedby are specified on the form element that is to be
labelled, for example an <input> in both cases, the
label for/
label control bindings that may also exist are overridden by aria-
labelledby. if on an html page you provide aria...
...edby. its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name. both aria-
labelledby and aria-describedby are specified on the form element that is to be
labelled, for example an <input> in both cases, the
label for/
label control bindings that may also exist are overridden by aria-
labelledby. if on an html page you provide aria-
labelledby, you should also provide a
label for construct to also support older browsers that do not have aria support yet. ...
...a-
labelledby. if on an html page you provide aria-
labelledby, you should also provide a
label for construct to also support older browsers that do not have aria support yet. with firefox 3, your blind users will automatically get better accessibility from the new attribute, but the users of older browsers are not left in the dark this way. ...
...And 4 more matches
Text labels and names - Accessibility
there are many situations in which a control, dialog, or other website feature should be given a descriptive name or
label to allow users of assistive technologies to understand what its purpose is and to be able to understand and operate it correctly. there are a number of different types of problems in this category, found in different contexts, and each has its own solution. the different problems and solutions are discussed in the sections below. use alt attribute to
label area elements that have the href attribute in image maps, give each <area> element an alt attribute containing a name that describes what resources the areas links to. failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the pur...
...a." /> <map id="map1" name="map1"> <area shape="rect" coords="0,0,30,30" href="reference.html" alt="reference" /> <area shape="rect" coords="34,34,100,100" href="media.html" alt="audio visual lab" /> </map> see the <area> element reference page for a live interactive example. ...
..." alt="audio visual lab" /> </map> see the <area> element reference page for a live interactive example. see also <area> h24: providing text alternatives for the area elements of image maps dialogs should be
labeled for any container whose contents act as a dialog box (for example, a modal dialog asking the user to make a choice or respond to an action being taken), give it a descriptive
label or name, so that assistive technology users can easily discover what its purpose is. a dialog box is generally denoted by an aria role="dialog" or role="alertdialog"; you can use the aria-
label or aria-
labelledby attributes to provide a
label. examples the following example shows a simple dialog box, defined as such using role="dialog" and
labelled using aria-
labelledby. <div role="dialog" a...
...And 25 more matches
Using the aria-labelledby attribute - Accessibility
description the aria-
labelledby attribute establishes relationships between objects and their
label(s), and its value should be one or more element ids, which refer to elements that have the text needed for
labeling. list multiple element ids in a space delimited fashion. this idea is similar to how the "for" attribute is used to link a
label to an input. assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. without an element id, the assistive technology cannot catalog the object. aria-
labelledby is very similar to aria-describedby: a
label provides essential information about an object, while a description provides extended information that the user might need. in addition to form elements,...
...ttribute to catalog the objects in a document so that users can navigate between them. without an element id, the assistive technology cannot catalog the object. aria-
labelledby is very similar to aria-describedby: a
label provides essential information about an object, while a description provides extended information that the user might need. in addition to form elements, you can use the aria-
labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects. the examples section below provides more information on how to use the attribute this way. to improve compatibility with user agents that do not support aria, you can use aria-
labelledby with the <
label> element (using the for attribute). this at...
...u can use aria-
labelledby with the <
label> element (using the for attribute). this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. value a space-separated list of element ids possible effects on user agents and assistive technology when user agents compute the accessible name property of elements that have both an aria-
labelledby attribute and an aria-
label attribute, the user agents give precedence to aria-
labelledby. ...
...And 18 more matches
<label> - HTML: Hypertext Markup Language
the html <
label> element represents a caption for an item in a user interface. the source for this interactive example is stored in a github repository. if 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. ...
...t 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. you can click the associated
label to focus/activate the input, as well as the input itself. this increased hit area provides an advantage to anyone trying to activate the input, including those using a touch-screen device. to associate the <
label> with an <input> element, you need to give the <input> an id attribute. the <
label> then needs a for attribute whose value is the same as the input's id. alternatively, you can nest t...
... well as the input itself. this increased hit area provides an advantage to anyone trying to activate the input, including those using a touch-screen device. to associate the <
label> with an <input> element, you need to give the <input> an id attribute. the <
label> then needs a for attribute whose value is the same as the input's id. ...
...And 14 more matches
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. ...
... « 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. ...
...And 10 more matches
label - JavaScript
the
labeled statement can be used with break or continue statements. it is prefixing a statement with an identifier which you can refer to. the source for this interactive example is stored in a github repository. if 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:
labeled loops or blocks are very uncommon. usually function calls can be used instead of loop jumps. syntax
label : statement
label any javascript identifier that is not a reserved word. statement a javascript statement. break can be used with any
labeled statement, and continue can be used with looping
labeled statements. ...
... send us a pull request. note:
labeled loops or blocks are very uncommon. usually function calls can be used instead of loop jumps. syntax
label : statement
label any javascript identifier that is not a reserved word. statement a javascript statement. break can be used with any
labeled statement, and continue can be used with looping
labeled statements. description you can use a
label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. note that javascript has no goto statement, you can only use
labels with break or continue. in strict mode code, you can't use "let" as a
label name. it will throw a syntaxerror (let is a reserved identifier). ...
...you can use a
label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. note that javascript has no goto statement, you can only use
labels with break or continue. in strict mode code, you can't use "let" as a
label name. it will throw a syntaxerror (let is a reserved identifier). ...
...And 9 more matches
HTMLButtonElement.labels - Web APIs
the htmlbuttonelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <button> element. syntax var
labelelements = button.
labels; return value a nodelist containing the <
label> elements associated with the <button> element. ...
... the htmlbuttonelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <button> element. syntax var
labelelements = button.
labels; return value a nodelist containing the <
label> elements associated with the <button> element. ...
... the htmlbuttonelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <button> element. syntax var
labelelements = button.
labels; return value a nodelist containing the <
label> elements associated with the <button> element. ...
...And 7 more matches
HTMLMeterElement.labels - Web APIs
the htmlmeterelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <meter> element. syntax var
labelelements = meter.
labels; return value a nodelist containing the <
label> elements associated with the <meter> element. ...
... the htmlmeterelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <meter> element. syntax var
labelelements = meter.
labels; return value a nodelist containing the <
label> elements associated with the <meter> element. ...
... the htmlmeterelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <meter> element. syntax var
labelelements = meter.
labels; return value a nodelist containing the <
label> elements associated with the <meter> element. ...
...And 7 more matches
HTMLOutputElement.labels - Web APIs
the htmloutputelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <output> element. syntax var
labelelements = output.
labels; return value a nodelist containing the <
label> elements associated with the <output> element. ...
... the htmloutputelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <output> element. syntax var
labelelements = output.
labels; return value a nodelist containing the <
label> elements associated with the <output> element. ...
... the htmloutputelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <output> element. syntax var
labelelements = output.
labels; return value a nodelist containing the <
label> elements associated with the <output> element. ...
...And 7 more matches
HTMLProgressElement.labels - Web APIs
the htmlprogresselement.
labels read-only property returns a nodelist of the <
label> elements associated with the <progress> element. syntax var
labelelements = progress.
labels; return value a nodelist containing the <
label> elements associated with the <progress> element. ...
... the htmlprogresselement.
labels read-only property returns a nodelist of the <
label> elements associated with the <progress> element. syntax var
labelelements = progress.
labels; return value a nodelist containing the <
label> elements associated with the <progress> element. ...
... the htmlprogresselement.
labels read-only property returns a nodelist of the <
label> elements associated with the <progress> element. syntax var
labelelements = progress.
labels; return value a nodelist containing the <
label> elements associated with the <progress> element. ...
...And 7 more matches
HTMLSelectElement.labels - Web APIs
the htmlselectelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <select> element. syntax var
labelelements = select.
labels; return value a nodelist containing the <
label> elements associated with the <select> element. ...
... the htmlselectelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <select> element. syntax var
labelelements = select.
labels; return value a nodelist containing the <
label> elements associated with the <select> element. ...
... the htmlselectelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <select> element. syntax var
labelelements = select.
labels; return value a nodelist containing the <
label> elements associated with the <select> element. ...
...And 7 more matches
HTMLTextAreaElement.labels - Web APIs
the htmltextareaelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <textarea> element. syntax var
labelelements = textarea.
labels; return value a nodelist containing the <
label> elements associated with the <textarea> element. ...
... the htmltextareaelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <textarea> element. syntax var
labelelements = textarea.
labels; return value a nodelist containing the <
label> elements associated with the <textarea> element. ...
... the htmltextareaelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <textarea> element. syntax var
labelelements = textarea.
labels; return value a nodelist containing the <
label> elements associated with the <textarea> element. ...
...And 7 more matches
AudioTrack.label - Web APIs
the list is filtered to only allow certain track kinds through. ...
...the list is filtered to only allow certain track kinds through. ...
...the list is filtered to only allow certain track kinds through. ...
...And 6 more matches
label - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to provide a
label for a control element. if the user clicks the
label, it will move the focus to the associated control, specified with the control attribute. more information is available in the xul tutorial. attributes accesskey, control, crop, disabled, href, value properties accesskey, accessibletype, control, crop, disabled, value style classes header, indent, monospace, plain, small-margin, text-link examples <
label value="email address" control="email"/> <textbox id="email"/> 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 appear...
...es accesskey, accessibletype, control, crop, disabled, value style classes header, indent, monospace, plain, small-margin, text-link examples <
label value="email address" control="email"/> <textbox id="email"/> 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. control type: id this attribute specifies the id of the element with which the
label is associated. when the user clicks on the
label, the associated element is given focus. ...
...an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. ...
...And 5 more matches
VideoTrack.label - Web APIs
the list is filtered to only allow certain track kinds through. ...
...the list is filtered to only allow certain track kinds through. ...
...the list is filtered to only allow certain track kinds through. ...
...And 5 more matches
HTMLLabelElement.control - Web APIs
specifications specification status comment html living standardthe definition of 'control' in that specification. ...
... specifications specification status comment html living standardthe definition of 'control' in that specification. ...
... specifications specification status comment html living standardthe definition of 'control' in that specification. ...
...And 4 more matches
HTMLLabelElement - Web APIs
it inherits methods and properties from the base htmlelement interface. ...
...it inherits methods and properties from the base htmlelement interface. ...
...aco,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/html
labelelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
labelelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits p...
...And 4 more matches
Adding Labels and Images - Archive of obsolete content
« previousnext » this section describes a way to add
labels and images to a window. in addition, we look at how to include elements into groups. text elements you cannot embed text directly into a xul file without tags around it and expect it to be displayed. you can use two xul elements for this purpose.
label element the most basic way to include text in a window is to use the
label element. it should be used when you want to place a descriptive
label beside a control, such as a button. an example is shown below: example 1 : source view <
label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed. the text will not wrap, so the text will all be displayed on a single line. this syntax is the most common of
labels. if t...
...low: example 1 : source view <
label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed. the text will not wrap, so the text will all be displayed on a single line. this syntax is the most common of
labels. if the text needs to wrap, you can place the text content inside opening and closing tags as in the following example: example 2 : <
label>this is some longer text that will wrap onto several lines.</
label> as with html, line breaks and extra whitespace are collapsed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily. control attribute you can use the control attribute to set which control the
label is associated with. when the user clicks on an associated l...
...ed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily. control attribute you can use the control attribute to set which control the
label is associated with. when the user clicks on an associated
label, that control will be focused. this association is also important for accessibility, so that screen readers read aloud the
label for the control as the user tabs to it. set the value of the control attribute to the id of the element to be focused. example 3 : source view <
label value="click here:" control="open-button"/> <button id="open-button"
label="open"/> in the example above, clicking the
label will cause the button to be focused. description element for descriptive text not associated with any particular control, y...
...And 3 more matches
MediaDeviceInfo.label - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 3 more matches
HTMLLabelElement.form - Web APIs
specifications specification status comment html living standardthe definition of 'form' in that specification. ...
... specifications specification status comment html living standardthe definition of 'form' in that specification. ...
... specifications specification status comment html living standardthe definition of 'form' in that specification. ...
...And 2 more matches
HTMLLabelElement.htmlFor - Web APIs
specifications specification status comment html living standardthe definition of 'htmlfor' in that specification. ...
... specifications specification status comment html living standardthe definition of 'htmlfor' in that specification. ...
... specifications specification status comment html living standardthe definition of 'htmlfor' in that specification. ...
...And 2 more matches
Using the aria-label attribute - Accessibility
the aria-
label attribute is used to define a string that
labels the current element. use it in cases where a text
label is not visible on the screen. if there is visible text
labeling the element, use aria-
labelledby instead. this attribute can be used with any typical html element; it is not limited to elements that have an aria role assigned. value string possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: multiple
labels in the example below, a button is styled to look like a typical "close" button, with an x in the middle. since there is nothing indicating that the purpose of the...
...ns may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: multiple
labels in the example below, a button is styled to look like a typical "close" button, with an x in the middle. since there is nothing indicating that the purpose of the button is to close the dialog, the aria-
label attribute is used to provide the
label to any assistive technologies. <button aria-
label="close" onclick="mydialog.close()">x</button> notes the most common accessibility api mapping for a
label is the accessible name property. attributes, including aria-
label declarations, are ignored by most automatic translation services. used by aria roles all elements of the base markup related ...
...abel to any assistive technologies. <button aria-
label="close" onclick="mydialog.close()">x</button> notes the most common accessibility api mapping for a
label is the accessible name property. attributes, including aria-
label declarations, are ignored by most automatic translation services. ...
...el is the accessible name property. attributes, including aria-
label declarations, are ignored by most automatic translation services. ...
label - Archive of obsolete content
« xul reference
label type: string gets and sets the value of the
label attribute. ...
... « xul reference
label type: string gets and sets the value of the
label attribute. ...
... « xul reference
label type: string gets and sets the value of the
label attribute. ...
XForms Label Element - Archive of obsolete content
introduction specifies the
label (short description) for the xforms control (see the spec). every form control other than the output and choices elements must contain a
label element. it is valid for a form control to have an empty
label element. the
label text can be specified in instance data, in a remote document, or as inline text. if more than one source of
label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on
labeled xforms controls or on the
label element itself then the
label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the labe...
...single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on
labeled xforms controls or on the
label element itself then the
label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the
label text. focus behavior - when a
label element is clicked or its accesskey is activated then the form control that contains the
label will be given the focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent form control. ...
...accesskey character in the
label text. focus behavior - when a
label element is clicked or its accesskey is activated then the form control that contains the
label will be given the focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent form control. single-node binding linking src - url of a document whose contents will be retrieved by the
label element and used to provide
label text for the containing form control. type restrictions the
label element can be bound to any simple content. representations the xforms
label element is represented by the text retrieved from instance data, a document or the
label element's own inline content. ...
RTCDataChannel.label - Web APIs
the read-only rtcdatachannel property
label returns a domstring containing a name describing the data channel. these
labels are not required to be unique. you may use the
label as you wish; you could use it to identify all the channels that are being used for the same purpose, by giving them all the same name. or you could give each channel a unique
label for tracking purposes. it's entirely up to the design decisions made when building your site or app. a unique id can be found in the id property. a data channel's
label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. ...
...iving them all the same name. or you could give each channel a unique
label for tracking purposes. it's entirely up to the design decisions made when building your site or app. a unique id can be found in the id property. a data channel's
label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. syntax var name = adatachannel.
label; value a string identifier assigned by the web site or app when the data channel was created, as specified when rtcpeerconnection.createdatachannel() was called to create the channel. example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name. var pc = new rtcpeerconnection(); var dc = pc.createda...
....createdatachannel() was called to create the channel. example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); /* ... */ document.getelementbyid("channel-name").innerhtml = "<span class='channelname'>" + dc.
label + "</span>"; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.
label' in that specification. candidate recommendation initial specification. ...
<mlabeledtr> - MathML
attributes class, id, style provided for use with stylesheets. columnalign overrides the horizontal alignment of cells specified by <mtable> for this row. possible values are: left, center and right. groupalign href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. ...
...et a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign overrides the vertical alignment of cells specified by <mtable> for this row. possible values are: axis, baseline, bottom, center and top. examples rendering: <math> <mtable> <m
labeledtr> <mtd><mn>1</mn></mtd> <!--
label --> <mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </m
labeledtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> </mtr> </mtable> </math> specifications specification status comment mathml 3.0the definition of 'm
labeledtr' in that specification. recommen...
.../mtd> <mtd><mi>b</mi></mtd> </m
labeledtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> </mtr> </mtable> </math> specifications specification status comment mathml 3.0the definition of 'm
labeledtr' in that specification. recommendation current specification mathml 2.0the definition of 'm
labeledtr' in that specification. recommendation initial specification ...
Label and description - Archive of obsolete content
the default style for these xul elements includes white-space: wrap;. this reduces all whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <description>i am your father's brother's nephew's cousin's former roommate. ...
...ommate. what's that make us? absolutely nothing!</description> text can also be made to wrap by inserting an <html:br/> element regardless of the css style, but this creates a hard-break that does not change as parent elements resize. <description>i am your father's brother's nephew's cousin's former roommate.<html:br/> what's that make us?<html:br/> absolutely nothing!</description> using
labels as anchors its possible to make a
label look and act like an html <a> tag: <
label class="text-link" href="http://whatever.com" value="click here to go to whatever"/> "text-link" is a built-in, predefined class. note: if running in a xulrunner application add the following preferences to your default preferences file: pref("network.protocol-handler.expose.http", false); pref("network.protoco...
treeitem.label - Archive of obsolete content
« xul reference home
label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro. ...
... « xul reference home
label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro. ...
nsIDOMXULLabeledControlElement
dom/interfaces/xul/nsidomxul
labeledcontrolel.idlscriptable this interface is used as a basis for
labeled control elements in xul. inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring 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 for the element. when the user presses the appropriate modifier and the access key, the element will be focused and/or activated from anywhere in the window. on non-macintosh platforms, the character on the element's
label matching the access key is underlined. note: the access key is copied to any associated
label element. command domstring this property reflects the element's command attribute. ...
...the window. on non-macintosh platforms, the character on the element's
label matching the access key is underlined. note: the access key is copied to any associated
label element. command domstring this property reflects the element's command attribute. crop domstring this property reflects the element's crop attribute. image domstring this property reflects the element's image attribute.
label domstring this property reflects the element's
label attribute. ...
accessKeyLabel - Web APIs
the htmlelement.accesskey
label read-only property returns a string that represents the element's assigned access key (if any); otherwise it returns an empty string. syntax
label = element.accesskey
label example javascript var node = document.getelementbyid('btn1'); if (node.accesskey
label) { node.title += ' [' + node.accesskey
label + ']'; } else { node.title += ' [' + node.accesskey + ']'; } node.onclick = function () { var p = document.createelement('p'); p.textcontent = 'clicked!'; node.parentnode.appendchild(p); }; html <button accesskey="h" title="caption" id="btn1">hover me</button> result specifications specification status comment html living standardthe definition of 'htmlelement.accesskey
label' in that specification. living stan...
...e</button> result specifications specification status comment html living standardthe definition of 'htmlelement.accesskey
label' in that specification. living standard no change from initial definition. html 5.1 recommendation removed. pull w3c/html#144, issue w3c/html#99, wicg discussion. html5the definition of 'htmlelement.accesskey
label' in that specification. recommendation snapshot of html living standard, initial definition. ...
HTMLInputElement.labels - Web APIs
the htmlinputelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <input> element. syntax var
labelelements = input.
labels; return value a nodelist containing the <
label> elements associated with the <input> element. example html <
label id="
label1" for="test">
label 1</
label> <input id="test"/> <
label id="
label2" for="test">
label 2</
label> javascript window.addeventlistener("domcontentloaded", function() { const input = document.getelementbyid("test"); for(var i = 0; i < input.
labels.length; i++) { console.log(input.
labels[i].textcontent); // "
label 1" and "
label 2" } }); specifications specification status comment html living standardthe definition of '
labels' in that specification. living stand...
...ction() { const input = document.getelementbyid("test"); for(var i = 0; i < input.
labels.length; i++) { console.log(input.
labels[i].textcontent); // "
label 1" and "
label 2" } }); specifications specification status comment html living standardthe definition of '
labels' in that specification. living standard no change html5the definition of '
labels' in that specification. recommendation initial definition ...
searchlabel - Archive of obsolete content
« xul reference home search
label type: string text used for 'find-as-you-type' (fayt) searching. in situations where the search text is ambiguous or missing, search
label can be used to give context to fayt. if search
label is not present, fayt falls back to use the
label property. ...
labelElement - Archive of obsolete content
« xul reference
labelelement type:
label element the
label element associated with the control. this is set when a
label has a control attribute pointing to this element. this property will be null when no
label is associated with the control. ...
richlistitem.label - Archive of obsolete content
« xul reference
label type: string gets the concatentation of text from any child
label elements. does not support setting
label values. use the child elements directly to set
label text. ...
textbox.label - Archive of obsolete content
« xul reference
label type: string sets the
label attribute. gets the
label attribute if it is present and not empty. otherwise it returns the value of the associated
label element, if applicable. otherwise it returns the placeholder or emptytext property. the getter is mostly useful for screen readers. note: prior to firefox 3, and always in thunderbird and seamonkey, the
label property of an autocomplete textbox returns its value, for compatibility with the menulist element. ...
nsMsgLabelValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsg
labelvalue; ...
MediaStreamTrack.label - Web APIs
the mediastreamtrack.
label read-only property returns a domstring containing a user agent-assigned
label that identifies the track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. when the track is deassociated from its source, the
label is not changed. syntax const
label = track.
label specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.
label' in that specification. candidate recommendation initial specification. ...
TrackDefault.label - Web APIs
the
label read-only property of the trackdefault interface returns the default
label for an associated sourcebuffer to use when an initialization segment does not contain
label information for a new track. syntax var my
label = trackdefault.
label; value a domstring. example tbd ...
ui/button/toggle - Archive of obsolete content
features: they emit a change event when clicked, as well as a click event. they have an extra attribute checked that is automatically toggled when the button is clicked. when a button is checked it gets a "pressed" look in the user interface (note that the "pressed" look currently does not work in mac os x). ...
...hat is automatically toggled when the button is clicked. when a button is checked it gets a "pressed" look in the user interface (note that the "pressed" look currently does not work in mac os x). usage creating buttons to create a button you must give it an id, an icon, and a
label: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button",
label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onchange: function(state) { console.log(state.
label + " checked state: " + state.checked); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel: badged buttons new in firefox 36. you can add a "badge" to a button usin...
...new in firefox 36. you can add a "badge" to a button using its badge property. this can contain a number or a string, and you can update it at any time. by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1",
label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in different sizes. if you specify ...
...And 60 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
ensions, this kind of xml function is being used. reading in style sheets xul uses css to specify the appearance of its elements. again, since xul is a type of xml, stylesheets are read in using the xml-stylesheet processing instruction. on line 2 of listing 2, we’re reading in the theme’s standard style sheet. by referring to a special style sheet within chrome://global/skin/, we can make
label and button sizes, window background color, etc, match the currently selected theme in firefox. we can also read in a stylesheet that we had set up ourselves. the xul box model in principle, xul lays out all ui components using combinations of two kinds of boxes: horizontal and vertical. as shown in listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or verti...
...esheet that we had set up ourselves. the xul box model in principle, xul lays out all ui components using combinations of two kinds of boxes: horizontal and vertical. as shown in listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or vertically using the vbox (vertical box) element. when this file is opened in firefox, it is displayed as shown in figure 1. ...
...odel in principle, xul lays out all ui components using combinations of two kinds of boxes: horizontal and vertical. as shown in listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or vertically using the vbox (vertical box) element. when this file is opened in firefox, it is displayed as shown in figure 1. ...
...And 50 more matches
ui/button/action - Archive of obsolete content
experimental add a button to the firefox user interface. with this module you can create buttons that display icons and can respond to click events. usage creating buttons to create a button you must give it an id, an icon, and a
label: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button",
label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("button '" + state.
label + "' was clicked"); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36. you can add a "badge" to a button using its badg...
...ns new in firefox 36. you can add a "badge" to a button using its badge property. this can be a number or a string, and you can update it at any time. by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1",
label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in different sizes. if you specify ...
... actionbutton constructor. responding to click events you can respond to click events by assigning a listener to the button's click event. you can do this in the button's constructor, by assigning the listener to the onclick option. ...
...And 45 more matches
How to structure a web form - Learn web development
rm using the form attribute. this was introduced to let you explicitly bind a control with a form even if it is not nested inside it. let's move forward and cover the structural elements you'll find nested in a form. the <fieldset> and <legend> elements the <fieldset> element is a convenient way to create groups of widgets that share the same purpose, for styling and semantic purposes. you can
label a <fieldset> by including a <legend> element just below the opening <fieldset> tag. the text content of the <legend> formally describes the purpose of the <fieldset> it is included inside. many assistive technologies will use the <legend> element as if it is a part of the
label of each control inside the corresponding <fieldset> element. for example, some screen readers such as jaws and nvda wil...
...t below the opening <fieldset> tag. the text content of the <legend> formally describes the purpose of the <fieldset> it is included inside. many assistive technologies will use the <legend> element as if it is a part of the
label of each control inside the corresponding <fieldset> element. for example, some screen readers such as jaws and nvda will speak the legend's content before speaking the
label of each control. ...
...d> element as if it is a part of the
label of each control inside the corresponding <fieldset> element. for example, some screen readers such as jaws and nvda will speak the legend's content before speaking the
label of each control. here is a little example: <form> <fieldset> <legend>fruit juice size</legend> <p> <input type="radio" name="size" id="size_1" value="small"> <
label for="size_1">small</
label> </p> <p> <input type="radio" name="size" id="size_2" value="medium"> <
label for="size_2">medium</
label> </p> <p> <input type="radio" name="size" id="size_3" value="large"> <
label for="size_3">large</
label> </p> </fieldset> </form> note: you can find this example in fieldset-legend.html (see it live also). when reading th...
...And 33 more matches
context-menu - Archive of obsolete content
cts on the page as a whole. it does not occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists. declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var cm = require("sdk/context-menu"); cm.item({
label: "my menu item", context: cm.urlcontext("*.mozilla.org") }); constructor description pagecontext() the page context. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is invoked on a node that either matches selector, a c...
...d "context" is emitted in your content scripts whenever the context menu is about to be shown. if you register a listener function for this event and it returns true, the menu item associated with the listener's content script is shown in the menu. for example, this item appears whenever the context menu is invoked on a page that contains at least one image: require("sdk/context-menu").item({
label: "this page has images", contentscript: 'self.on("context", function (node) {' + ' return !!document.queryselector("img");' + '});' }); note that the listener function has a parameter called node. this is the node in the page that the user context-clicked to invoke the menu. you can use it to determine whether your item should be shown. you can both specify ...
...any descendant of that node, but the "context" event handler is passed the actual node on which the menu was invoked. the example above works because <img> elements can't contain other elements, but in the example below, node.nodename is not guaranteed to be "p" - for example, it won't be "p" if the user context-clicked a link inside a paragraph: var cm = require("sdk/context-menu"); cm.item({
label: "a paragraph", context: cm.selectorcontext("p"), contentscript: 'self.on("context", function (node) {' + ' console.log(node.nodename);' + ' return true;' + '});' }); the content script is executed for every page that a context menu is shown for. it will be executed the first time it is needed (i.e. when the context menu is first shown and...
...And 30 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
this table is designed to show how to expose text properly for various xul element types. sections in bold are to draw attention to pieces that are often overlooked for visual layouts. underlined text may be read by the screen reader. element enabled usage comments description <description value="<!-- text -->" /> <description><!--
label text--></description> use for non-
label text. although tutorials claim
label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas
labels do.
label <
label control="controlid" value="<!--
label text-->" /> <
label control="controlid"><!--
label text--></
label> either syntax is fine. button <bu...
... use for non-
label text. although tutorials claim
label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas
labels do.
label <
label control="controlid" value="<!--
label text-->" /> <
label control="controlid"><!--
label text--></
label> either syntax is fine. ...
... description have the same underlying implementation, description elements appear to not associate correctly with controls whereas
labels do.
label <
label control="controlid" value="<!--
label text-->" /> <
label control="controlid"><!--
label text--></
label> either syntax is fine. ...
...And 28 more matches
Building accessible custom components in XUL - Archive of obsolete content
xul, you may need to use dhtml accessibility techniques to ensure that your custom controls are equally accessible. a super-simple spreadsheet download stage-1.zip install stage-1.xpi to build our xul spreadsheet, we'll use three built-in xul controls: a single grid element to contain the other elements and position them in rows and columns. description elements for each row and column header.
label elements for each cell in the spreadsheet. the xul markup is straightforward. we define the grid, then define the headers for each row (numbered 1 through 7), then define the column header and cells for each column. the
label for each header and cell is defined in the value attribute. the flex attributes are simply for layout. note: the row and column headers are denoted by description elements,...
...this is not an accessibility requirement; as we'll see in the next section, the actual xul elements are irrelevant because we will define the role of each element in a separate attribute. ...
...flex="1"> <rows flex="1"></rows> <columns flex="1"> <column> <description value="entry #"/> <description value="1"/> <description value="2"/> <description value="3"/> <description value="4"/> <description value="5"/> <description value="6"/> <description value="7"/> </column> <column flex="1"> <description value="date"/> <
label value="03/14/05" flex="1"/> <
label value="03/15/05" flex="1"/> <
label value="03/15/05" flex="1"/> <
label value="03/16/05" flex="1"/> <
label value="03/16/05" flex="1"/> <
label value="03/16/05" flex="1"/> <
label value="03/16/05" flex="1"/> </column> <column flex="1"> <description value="expense"/> <
label value="conference fee" flex="1"/> ...
...And 26 more matches
UI pseudo-classes - Learn web development
nt-side form validation is whether a form input is required (it has to be filled in before the form can be submitted) or optional. <input>, <select>, and <textarea> elements have a required attribute available which, when set, means that you have to fill in that control before the form will successfully submit. ...
...er a form input is required (it has to be filled in before the form can be submitted) or optional. <input>, <select>, and <textarea> elements have a required attribute available which, when set, means that you have to fill in that control before the form will successfully submit. ...
...nal. <input>, <select>, and <textarea> elements have a required attribute available which, when set, means that you have to fill in that control before the form will successfully submit. ...
...And 26 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
ts. when autofocus is assigned, screen-readers "teleport" their user to the form control without warning them beforehand. use careful consideration for accessibility when applying the autofocus attribute. automatically focusing on a control can cause the page to scroll on load. the focus can also cause dynamic keyboards to display on some touch devices. while a screen reader will announce the
label of the form control receiving focus, the screen reader will not announce anything before the
label, and the sighted user on a small device will equally miss the context created by the preceding content. capture introduced in the html media capture specification and valid for the file input type only, the capture attribute defines which media—microphone, video, or camera—should be used t...
... dirname valid for text and search input types only, the dirname attribute enables the submission of the directionality of the element. when included, the form control will submit with two name/value pairs: the first being the name and value, the second being the value of the dirname as the name with the value of ltr or rtl being set by the browser. <form action="page.html" method="post"> <
label>fruit: <input type="text" name="fruit" dirname="fruit.dir" value="cherry"></
label> <input type="submit"/> </form> <!-- page.html?fruit=cherry&fruit.dir=ltr --> when the form above is submitted, the input cause both the name / value pair of fruit=cherry and the dirname / direction pair of fruit.dir=ltr to be sent. disabled a boolean attribute which, if present, indicates that the user s...
...image input button only, the height is the height of the image file to display to represent the graphical submit button. see the image input type. id global attribute valid for all elements, including all the input types, it defines a unique identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking. the value is used as the value of the <
label>'s for attribute to link the
label with the form control. see <
label>. inputmode global value valid for all elements, it provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. values include none, text, tel, url, email, numeric, decimal, and search. list the value given to the list attribute should be. the id of a...
...And 26 more matches
Index - Archive of obsolete content
xpcom code snippets, javascript, xpcom, about:, nsiaboutmodule no summary! 192 javascript debugger service code snippets no summary! 193 javascript timers javascript timers, needsbetterplace no summary! 194 javascript daemons management dom, guide, javascript, javascript timers, makebrowseragnostic no summary! 195
label and description code snippets no summary! 196 lookupnamespaceuri no summary! 197 lookupprefix no summary! 198 miscellaneous add-ons, code, code snippets, extensions, snippets no summary! 199 modules no summary! 200 on page load add-ons, extensions no summary! 201 page l...
... landing, mozilla, xul xul (xml user interface language) is mozilla's xml-based language for building user interfaces of applications like firefox. 749 <statusbarpanel> deprecated, xul, xul elements, xul reference an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a
label or an 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. 750 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 descri...
...xul attributes, xul reference no summary! 785 buttonaccesskeyhelp xul attributes, xul reference no summary! 786 buttonalign xul attributes, xul reference no summary! 787 buttondir xul attributes, xul reference no summary! 788 buttondisabledaccept xul attributes, xul reference no summary! ...
...And 24 more matches
Index - Web APIs
read-only, reference, id, track the id property contains a string which uniquely identifies the track represented by the audiotrack. 189 audiotrack.kind api, audio, audio track, audiotrack, html dom, media, property, read-only, reference, id, track the kind property contains a string indicating the category of audio contained in the audiotrack. 190 audiotrack.
label api, audio, audio track, audiotrack, html dom, media, property, read-only, reference,
label, metadata, track the read-only audiotrack property
label returns a string specifying the audio track's human-readable
label, if one is available; otherwise, it returns an empty string. 191 audiotrack.language api, audio, audiotrack, html dom, language, localization, media, property...
...confused with <link>, which is represented by htmllinkelement) 1564 htmlanchorelement.download api, html dom, htmlanchorelement, property, reference, download the htmlanchorelement.download property is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value, if any, specifies the default file name for use in
labeling the resource in a local file system. if the name is not a valid file name in the underlying os, the browser will adjust it. 1565 htmlanchorelement.referrerpolicy api, experimental, htmlanchorelement, property, reference, referrer policy the htmlanchorelement.referrerpolicy property reflect the html referrerpolicy attribute of the <a> element defining which referrer is sent...
...erited from the regular htmlelement interface) for manipulating <body> elements. 1580 htmlbuttonelement api, html dom, htmlbuttonelement, interface, reference the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements. 1581 htmlbuttonelement.
labels api, dom, property, reference the htmlbuttonelement.
labels read-only property returns a nodelist of the <
label> elements associated with the <button> element. 1582 htmlcanvaselement api, canvas, html dom, interface, reference the htmlcanvaselement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements. the htmlca...
...And 24 more matches
Menus - Archive of obsolete content
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 menu example, containing a menubar with a single menu
labeled 'file'. <menubar id="sample-menubar"> <m...
... 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 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 eleme...
... menuitem a single item to appear on a menu. ...
...And 21 more matches
The Essentials of an Extension - Archive of obsolete content
d: 2 blank space indents. we never use actual tab characters, with the exception of makefiles, which will be covered later on. most of our coding standards are based on mozilla's or other known and used standards. ...
...never use actual tab characters, with the exception of makefiles, which will be covered later on. most of our coding standards are based on mozilla's or other known and used standards. ...
...own and used standards. ...
...And 20 more matches
Index - Archive of obsolete content
landing, mozilla, xul xul (xml user interface language) is mozilla's xml-based language for building user interfaces of applications like firefox. 2 <statusbarpanel> deprecated, xul, xul elements, xul reference an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a
label or an 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. the purpose of this article is not to describe...
... xul attributes, xul reference no summary! 38 buttonaccesskeyhelp xul attributes, xul reference no summary! 39 buttonalign xul attributes, xul reference no summary! 40 buttondir xul attributes, xul reference no summary! 41 buttondisabledaccept xul attributes, xul reference no summary! 42 button
labelaccept xul attributes, xul reference no summary! 43 button
labelcancel xul attributes, xul reference no summary! 44 button
labeldisclosure xul attributes, xul reference no summary! 45 button
labelextra1 xul attributes, xul reference no summary! 46 button
labelextra2 xul attributes, xul reference no summary! ...
... 48 buttonorient xul attributes, xul reference no summary! 49 buttonpack xul attributes, xul reference no summary! 50 buttons xul attributes, xul reference no summary! ...
...And 20 more matches
Vue conditional rendering: editing existing todos - Learn web development
erview: 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 installation, and to...
... 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. ...
...tive: 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. ...
...And 20 more matches
ARIA Test Cases - Accessibility
age) expected at behavior: at should speak the fact that this is an alert, the title and contents of the dialog, then place virtual focus or the real focus on the desired control (like a button). screen magnifier should show the focused button or emulate any other standard behavior found in notification dialogs in windows or respective operating systems. markup used: role="alert" aria-
labeledby notes: in the uiuc test example, the 'close' button cannot recieve focus. results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 2 pass, 1 pass with known focus of the close button problem. ffd - i concur - - - voiceover (leopard) n/a n/a - fail voiceover (leopard) n/a n/a ...
... button plus alternative text of any images within the button (the accessible name of the button). the word "button" is also spoken before or after the accessible name. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc mode, pass in v-pc-mode also if the button's text is not provided via
labelledby or
label. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - toggle button buttons with icons and without text -- under construction. only the bold/italic butto...
... if the currently selected option is changed the new option should be spoken whether the list is open or closed. when the combo box is opened or 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. la...
...And 20 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. ...
... 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. <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 result is that the items will display the shortcut key next to their
labels. for the "open" item...
...tcut key next to their
labels. for the "open" item in this example, this command can be invoked by using the "accel" modifier key and pressing 'o'. the "accel" modifier key varies on each platform, but is the key typically used for shortcut keys. for instance, if the "accel" key is control, the menu might display "ctrl + o". although there isn't usually a need to do so, you can also set a custom
label for the keyboard shortcut on the menu using the acceltext attribute. you might do this if the key associated with the item changes, for instance a list of open windows displayed on a window menu. <menuitem
label="first window" acceltext="1"/> here the keyboard shortcut
label will be '1', however you will need to write code to handle the key as well. adding icons to menu items an icon may be ...
...And 19 more matches
XUL accessibility guidelines - Archive of obsolete content
or no visual change. alternative text provide alternative text for meaningful images. alternative text is not needed when an image serves a purely decorative function. use the "alt" attribute to describe html images and use the "tooltiptext" attribute on xul elements that use images (i.e. image elements, buttons with images). ...
... change. alternative text provide alternative text for meaningful images. alternative text is not needed when an image serves a purely decorative function. use the "alt" attribute to describe html images and use the "tooltiptext" attribute on xul elements that use images (i.e. image elements, buttons with images). ...
...titles provide users the most basic information about the application. ...
...And 17 more matches
Client-side form validation - Learn web development
rflow, stepmismatch, toolong or tooshort, typemismatch, valuemissing, or a customerror. built-in form validation examples in this section, we'll test out some of the attributes that we discussed above. simple start file let's start with a simple example: an input that allows you to choose whether you prefer a banana or a cherry. ...
...mples in this section, we'll test out some of the attributes that we discussed above. simple start file let's start with a simple example: an input that allows you to choose whether you prefer a banana or a cherry. this example involves a simple text <input> with an associated <
label> and a submit <button>. find the source code on github at fruit-start.html and a live example below. <form> <
label for="choose">would you prefer a banana or cherry?</
label> <input id="choose" name="i_like"> <button>submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } to begin, make a copy of fruit-start.html in a new directory on your hard drive. the required attribute the simplest html5 validation feature is the required attribute. to make ...
.... to make an input mandatory, add this attribute to the element. when this attribute is set, the element matches the :required ui pseudo-class and the form won't submit, displaying an error message on submission when the input is empty. while empty, the input will also be considered invalid, matching the :invalid ui pseudo-class. add a required attribute to your input, as shown below. ...
...And 17 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
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 form that lets you enter a new todo item and submit it into the app. ...
...ponents 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 form that lets you enter a new todo item and submit it into the app. we need a <form> with a <
label>, an <input>, and a <button>. ...
...d a blank <template> and a <script> tag like before: <template></template> <script> export default {}; </script> let's add in an html form that lets you enter a new todo item and submit it into the app. we need a <form> with a <
label>, an <input>, and a <button>. update your template as follows: <template> <form> <
label for="new-todo-input"> what needs to be done? </
label> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" /> <button type="submit"> add </button> </form> </template> so we now have a form component into which we can enter the title of a new todo item (which will become a
label for the corresponding todoitem when it is eventually rendered). let's load this component into ...
...And 17 more matches
<input type="tel"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
...ule, you should avoid using them unless it can't be helped. attribute description autocorrect whether or not to allow autocorrect while editing this input field. safari only. 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. 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 configured. off disable automat...
...correction of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of
label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the change being implemented in firefox, see bug 1490661. permitted values are: go, done, next, search, and send. the browser decides, using this hint, what
label to put on the enter key. using tel inputs telephone nu...
...And 17 more matches
Localization - Archive of obsolete content
s of entities which can be used to place less than and greater than signs into the text. xml has a syntax which allows you to declare custom entities. you can use these so that the entity is replaced with its value, which can be a string of text. entities may be used whenever text occurs, including the values of attributes. the example below demonstrates the use of an entity in a button. <button
label="&find
label;"/> the text that will appear on the
label will be the value that the entity &find
label; has. a file is created which contains the entity declarations for each supported language. in english, the &find
label; entity will probably be declared to have the text "find". dtd files entities are declared in document type definition (dtd) files. files of this type are normally used to decl...
...he url indicated is to be used as a dtd for the file. in this case, we have declared that we want to use the findfile.dtd dtd file. this line is typically placed just before the window element. you also need to add the locale to the chrome.manifest file, for example: locale findfile en-us locale/ declaring entities the entities are declared using a simple syntax as shown below: <!entity find
label "find"> this example creates an entity with the name find
label and the value "find". this means that wherever the text "&find
label;" appears in the xul file, it will be replaced with the text "find". note that entity declarations do not have a trailing slash at the end of them. in the dtd file for a different language, the text for that language will be used instead. for japanese: <!entity fin...
..."find"> this example creates an entity with the name find
label and the value "find". this means that wherever the text "&find
label;" appears in the xul file, it will be replaced with the text "find". note that entity declarations do not have a trailing slash at the end of them. in the dtd file for a different language, the text for that language will be used instead. for japanese: <!entity find
label "検索"> for example, the following text: <description value="&find
label;"/> is translated as: english version: <description value="find"/> japanese 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 t...
...And 16 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
number. methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input. the format of the date and time value used by this input type is described in local date and time strings in date and time formats used in html. ...
... value a domstring representing the value of the date entered into the input. the format of the date and time value used by this input type is described in local date and time strings in date and time formats used in html. you can set a default value for the input by including a date and time inside the value attribute, like so: <
label for="party">enter a date and time for your party booking:</
label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30"> one thing to note is that the displayed date and time formats differ from the actual value; the displayed date and time are formatted according to the user's locale as reported by their operating system, whereas the date/time value is always formatted yyyy-mm-ddthh:mm. when the above value submitted to the serv...
...r's locale. however, there are issues with <input type="datetime-local"> because of the limited browser support. we'll look at basic and more complex uses of <input type="datetime-local">, then offer advice on mitigating the browser support issue later on (see handling browser support). basic uses of datetime-local the simplest use of <input type="datetime-local"> involves a basic <input> and <
label> element combination, as seen below: <form> <
label for="party">enter a date and time for your party booking:</
label> <input id="party" type="datetime-local" name="partydate"> </form> setting maximum and minimum dates and times you can use the min and max attributes to restrict the dates/times that can be chosen by the user. in the following example we are setting a minimum datetime o...
...And 16 more matches
<input type="month"> - HTML: Hypertext Markup Language
d year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). the format of the month string used by this input type is described in format of a valid local month string in date and time formats used in html. you can set a default value for the input control by including a month and year inside the value attribute, like so: <
label for="bday-month">what month were you born in?</
label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; most user agents display the month and year in a locale-appropriate form, based on the set locale of the user's operating system, whereas the date value is always formatted yyyy-mm. when...
...; most user agents display the month and year in a locale-appropriate form, based on the set locale of the user's operating system, whereas the date value is always formatted yyyy-mm. when the above value is submitted to the server, for example, it will look like bday-month=1978-06. ...
...cale-appropriate form, based on the set locale of the user's operating system, whereas the date value is always formatted yyyy-mm. when the above value is submitted to the server, for example, it will look like bday-month=1978-06. ...
...And 16 more matches
<input type="radio"> - HTML: Hypertext Markup Language
h the name property set to contact but one with the value email, one with the value phone, and one with the value mail. the user never sees the value or the name (unless you expressly add code to display it). ...
... but one with the value email, one with the value phone, and one with the value mail. the user never sees the value or the name (unless you expressly add code to display it). ...
...er never sees the value or the name (unless you expressly add code to display it). ...
...And 16 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
ray of elements, which is the anonymous content. to get elements below that, you can use the regular dom functions because they aren't hidden. note that it is possible for an xbl-bound element to be placed inside another one, in which case you will have to use the getanonymousnodes() function again. the following example creates a row of buttons: <binding id="buttonrow"> <content> <button
label="yes"/> <button
label="no"/> <button
label="sort of"/> </content> </binding> to refer to each button, you can use the getanonymousnodes() function, passing it a reference to the element the binding is bound to as the parameter. in the returned array, the first button is stored in the first array element (getanonymousnodes(element)[0]), the second button is stored in the second array e...
... bound to as the parameter. in the returned array, the first button is stored in the first array element (getanonymousnodes(element)[0]), the second button is stored in the second array element and the third button is stored in the third array element. for code inside a binding method, you can pass 'this' as the parameter to getanonymousnodes(). the next example can be used to create text with a
label. ...
...utton is stored in the first array element (getanonymousnodes(element)[0]), the second button is stored in the second array element and the third button is stored in the third array element. for code inside a binding method, you can pass 'this' as the parameter to getanonymousnodes(). the next example can be used to create text with a
label. the method 'showtitle' can be used to show or hide the
label. ...
...And 15 more matches
Box Objects - Archive of obsolete content
our boxobject position and size references, which include borders as part of the element. the values are always the position and sizes as currently displayed, so the values will be different if the element is moved or resized. for example, a flexible element will change in size and the box object dimensions will update accordingly. the following example shows this. example 1 : source view <button
label="click me" oncommand="alert('the width is ' + this.boxobject.width);"/> you can use the width and height attributes of the element to specify the element's width and height, respectively. note that retrieving these values will return the size only if it was explicitly specified. these properties will return an empty string if the width or height attributes or properties were not set alr...
...f the element to 0. this means that while both hidden and collapsed elements have 0 width and height, hidden elements have a x and y position of 0, while collapsed elements will retain their position in the window. to retrive or modify the hidden or collapsed state use the corresponding properties as in the following example. ...
...le both hidden and collapsed elements have 0 width and height, hidden elements have a x and y position of 0, while collapsed elements will retain their position in the window. to retrive or modify the hidden or collapsed state use the corresponding properties as in the following example. ...
...And 15 more matches
Basic form hints - Accessibility
when implementing forms using traditional html form-related elements, it is important to provide
labels for controls, and explicitly associate a
label with its control. when a screen reader user navigates a page, the screen reader will describe form controls. without a direct association between the control and its
label, the screen reader has no way of knowing which
label is the correct one. the example below shows a simple form with
labels. note that each <input> element has an id, and each <
label> element has a for attribute, indicating the id of the associated <input>. ...
...rect association between the control and its
label, the screen reader has no way of knowing which
label is the correct one. the example below shows a simple form with
labels. note that each <input> element has an id, and each <
label> element has a for attribute, indicating the id of the associated <input>. ...
...s
label, the screen reader has no way of knowing which
label is the correct one. the example below shows a simple form with
labels. note that each <input> element has an id, and each <
label> element has a for attribute, indicating the id of the associated <input>. ...
...And 15 more matches
<input type="time"> - HTML: Hypertext Markup Language
tributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. ...
... idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. ...
...ent). if the time includes seconds (see using the step attribute), the format is always hh:mm:ss. you can learn more about the format of the time value used by this input type in time strings in date and time formats used in html. in this example, you can see the time input's value by entering a time and seeing how it changes afterward. first, a look at the html. this is simple enough, with the
label and input as we've seen before, but with the addition of a <p> element with a <span> to display the value of the time input: <form> <
label for="starttime">start time: </
label> <input type="time" id="starttime"> <p> value of the <code>time</code> input: <code> "<span id="value">n/a</span>"</code>. </p> </form> the javascript code adds code to the time input to watch for t...
...And 15 more matches
widget - Archive of obsolete content
l with the contenturl property. upon creation, the widget is automatically added to the add-on bar. you can set the width of a widget, but the height is fixed so as to fit in the add-on bar. if the content is an image, it is automatically scaled to be 16x16 pixels. ...
...-icon",
label: "my mozilla widget", contenturl: "http://www.mozilla.org/favicon.ico" }); you can make contenturl point to an html or icon file which you have packaged inside your add-on. just save the file in your add-on's data directory, and reference it using the data.url() method of the self module: var data = require("sdk/self").data; require("sdk/widget").widget({ id: "my-widget",
label: "my widget", contenturl: data.url("my-content.html") }); this widget contains an entire web page: require("sdk/widget").widget({ id: "hello-display",
label: "my hello widget", content: "hello!", width: 50 }); widgets are quite small by default, so this example used the width property to grow it in order to show all the text. scripting widget content to interact with the widget's c...
... self.port.emit("stop"); } we save this file in the add-on's data directory as "button-script.js". finally. in the add-on's "main.js" file, we create the widget, assign it the html file and the content script, and listen for events from the content script: const widgets = require("sdk/widget"); const data = require("sdk/self").data; var player = widgets.widget({ id: "player", width: 72,
label: "player", contenturl: data.url("buttons.html"), contentscriptfile: data.url("button-script.js") }); player.port.on("play", function() { console.log("playing"); }); player.port.on("pause", function() { console.log("pausing"); }); player.port.on("stop", function() { console.log("stopping"); }); to learn much more about content scripts, see the working with content scripts guide. scr...
...And 14 more matches
Componentizing our Svelte app - Learn web development
lert. we'll add that functionality back in later on. create a new component file — components/todo.svelte. ...
... in later on. create a new component file — components/todo.svelte. ...
...create a new component file — components/todo.svelte. ...
...And 14 more matches
XUL controls - Archive of obsolete content
the following table lists the xul user interface controls. for a step-by-step guide on how to use these controls, see the xul tutorial. for more reference information, see the 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 ...
... 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 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 reference <colorpicker> a control that may be used to select a color. ...
...And 13 more matches
Advanced form styling - Learn web development
at the reference page you'll see a lot of different possible values listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the styles yourself using css. ...
... see a lot of different possible values listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the styles yourself using css. ...
...r by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the styles yourself using css. ...
...And 13 more matches
Beginning our React todo list - Learn web development
this project, we're going to provide two things: an app() function to replace the one you have now, and some css to style your app. ...
...o provide two things: an app() function to replace the one you have now, and some css to style your app. ...
... replace the one you have now, and some css to style your app. ...
...And 13 more matches
Creating our first Vue component - Learn web development
> 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. ...
...ntly 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 mapping the checkbox to the
label, as shown below. <template> <div> <input type="checkbox" id="todo-item" checked="false" /> <
label for="todo-item">my todo item</
label> </div> </template> using todoitem inside our app this is all fine, but we haven’t added the component to our app yet, so there’s no way to test it and see if everything is working. let’s add it now. open up app.vue again. at t...
... list (<ul>) containing a single list item (<li>). inside the list item add <to-do-item></to-do-item>. your app.vue <template> contents should now look something like this: <div id="app"> <h1>to-do list</h1> <ul> <li> <to-do-item></to-do-item> </li> </ul> </div> if you check your rendered app again, you should now see your rendered todoitem, consisting of a checkbox and a
label. making components dynamic with props our todoitem component is still not very useful because we can only really include this once on a page (ids need to be unique), and we have no way to set the
label text. nothing about this is dynamic. what we need is some component state. this can be achieved by adding props to our component. you can think of props as being similar to inputs in a functio...
...And 13 more matches
<input type="date"> - HTML: Hypertext Markup Language
browser support. in this section, we'll look at basic and then more complex uses of <input type="date">, and offer advice on mitigating the browser support issue later (see handling browser support). hopefully, over time browser support will become ubiquitous, and this problem will fade away. basic uses of date the simplest use of <input type="date"> involves one <input> combined with its <
label>, as seen below: <form action="https://example.com"> <
label> enter your birthday: <input type="date" name="bday"> </
label> <p><button>submit</button></p> </form> this html submits the entered date under the key bday to https://example.com — resulting in a url like https://example.com/?bday=1955-06-08. setting maximum and minimum dates you can use the min and max attributes ...
...tton></p> </form> this html submits the entered date under the key bday to https://example.com — resulting in a url like https://example.com/?bday=1955-06-08. setting maximum and minimum dates you can use the min and max attributes to restrict the dates that can be chosen by the user. in the following example, we set a minimum date of 2017-04-01 and a maximum date of 2017-04-30: <form> <
label for="party">choose your preferred party date: <input type="date" name="party" min="2017-04-01" max="2017-04-30"> </
label> </form> the result is that only days in april 2017 can be selected — the month and year parts of the textbox will be uneditable, and dates outside april 2017 can't be selected in tte picker widget. note: you should be able to use the step attribute to vary the num...
...ese dates, if the date picker isn't fully supported on the user's device. you can also use the required attribute to make filling in the date mandatory — an error will be displayed if you try to submit an empty date field. this should work in most browsers, even if they fall back to a text input. let's look at an example of minimum and maximum dates, and also made a field required: <form> <
label> choose your preferred party date (required, april 1st to 20th): <input type="date" name="party" min="2017-04-01" max="2017-04-20" required> <span class="validity"></span> </
label> <p> <button>submit</button> </p> </form> if you try to submit the form with an incomplete date (or with a date outside the set bounds), the browser displays an error. try playing with the exampl...
...And 13 more matches
Building Trees - Archive of obsolete content
identical. however, the tree builder requires a very specific form to the action body. specifically, the action body should be a single treeitem with its rows and cells. ...
...a very specific form to the action body. specifically, the action body should be a single treeitem with its rows and cells. ...
...this template uses the simple rule syntax. the extended syntax could a...
...And 12 more matches
XBL Attribute Inheritance - Archive of obsolete content
tributes xbl allows us to build composite widgets while hiding their actual implementation. however, with the features mentioned so far, the anonymous content is always created in the same way. it would be useful to add attributes to the bound elements that modify the inner elements. for example: xul: <searchbox/> xbl: <binding id="searchbinding"> <content> <xul:textbox/> <xul:button
label="search"/> </content> </binding> in the example, the
label attribute has been placed directly on the button element. the problem with this is that the
label would be the same every time the binding was used. in this case, it would be preferable if the attribute could be specified on the searchbox instead. xbl provides an inherits attribute which can be used to inherit attributes from the bound...
...d on the searchbox instead. xbl provides an inherits attribute which can be used to inherit attributes from the bound element. it should be placed on the element that should inherit an attribute from the outer element, in this case the button. its value should be set to a comma-separated list of attribute names that are to be inherited. <xul:textbox xbl:inherits="flex"/> <xul:button xbl:inherits="
label"/> when the content is generated, the textbox grabs the flex attribute from the searchbox and the button grabs the
label attribute from the searchbox. this allows both the flexibility of the textbox and the
label of the button to be different for each use of the binding. in addition, changing the value of the attributes on the searchbox with a script will update the textbox and button also. you ...
...s attribute has been placed in the xbl namespace, by prefixing it with 'xbl:'. the namespace should be declared somewhere earlier, usually on the bindings element. the next example demonstrates this. ...
...And 12 more matches
HTML: A good basis for accessibility - Learn web development
a</a>.</p> <p>another link, to the <a href="https://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <
label for="name">fill in your name:</
label> <input type="text" id="name" name="name"> </div> <div> <
label for="age">enter your age:</
label> <input type="text" id="age" name="age"> </div> <div> <
label for="mood">choose your mood:</
label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</o...
... however, it is again the case that people sometimes do strange things with html. ...
... however, it is again the case that people sometimes do strange things with html. ...
...And 12 more matches
HTML: A good basis for accessibility - Learn web development
a</a>.</p> <p>another link, to the <a href="https://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <
label for="name">fill in your name:</
label> <input type="text" id="name" name="name"> </div> <div> <
label for="age">enter your age:</
label> <input type="text" id="age" name="age"> </div> <div> <
label for="mood">choose your mood:</
label> <select id="mood" name="mood"> <option>happy</option> <option>sad</option> <option>angry</option> <option>worried</o...
... however, it is again the case that people sometimes do strange things with html. ...
... however, it is again the case that people sometimes do strange things with html. ...
...And 12 more matches
WAI-ARIA basics - Learn web development
, but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis. properties — these define properties of elements, which can be used to give them extra meaning or semantics. ...
...are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis. properties — these define properties of elements, which can be used to give them extra meaning or semantics. ...
...r", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis. properties — these define properties of elements, which can be used to give them extra meaning or semantics. ...
...And 12 more matches
Making decisions in your code — conditionals - Learn web development
if the last example provided us with two choices, or outcomes — but what if we want more than two? there is a way to chain on extra choices/outcomes to your if...else — using else if. each extra choice requires an additional block to put in between if() { ... } and else { ... ...
... outcomes — but what if we want more than two? there is a way to chain on extra choices/outcomes to your if...else — using else if. each extra choice requires an additional block to put in between if() { ... } and else { ... ...
...tch. note: you don't have to include the default section — you can safely omit it if there is no chance that the expression could end up equaling an unknown value. if there is a chance of this, however, you need to include it to handle unknown cases. ...
...And 12 more matches
Starting our Svelte Todo list app - Learn web development
url you'll see our todos.svelte component being rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like. ...
...os.svelte component being rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like. ...
...rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like. ...
...And 12 more matches
Loops and iteration - JavaScript
y repeat an action some number of times. (note that it's possible that number could be zero!) the various loop mechanisms offer different ways to determine the start and end points of the loop. there are various situations that are more easily served by one type of loop over the others. the statements for loops provided in javascript are: for statement do...while statement while statement
labeled statement break statement continue statement for...in statement for...of statement for statement a for loop repeats until a specified condition evaluates to false. the javascript for loop is similar to the java and c for loop. a for statement looks as follows: for ([initialexpression]; [conditionexpression]; [incrementexpression]) statement when a for loop executes, the following o...
...statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the succeeding if statement, and increments i by after each pass through the loop. ...
...elect> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the succeeding if statement, and increments i by after each pass through the loop. ...
...And 12 more matches
Focus and Selection - Archive of obsolete content
ift to the element with the next highest tab index. that means that you can order the elements by setting indices on elements in sequence. usually, however, you would not set the tabindex attribute. if you do not, pressing tab will set the focus to the next displayed element. you only need to set tab indices if you wish to use a different order. here is an example: example 1 : source view <button
label="button 1" tabindex="2"/> <button
label="button 2" tabindex="1"/> <button
label="button 3" tabindex="3"/> the focus event the focus event is used to respond when the focus is given to an element. the blur event is used to respond when the focus is removed from an element. you can respond to focus changes by adding an onfocus or onblur attribute on an element. they work just like their html count...
...t. example 2 : source view <script> function displayfocus(){ var elem=document.getelementbyid('sbar'); elem.setattribute('value','enter your phone number.'); } </script> <textbox id="tbox1"/> <textbox id="tbox2" onfocus="displayfocus();"/> <description id="sbar" value=""/> the focus event, when it occurs, will call the displayfocus function. this function will change the value of the text
label. we could extend this example to remove the text when the blur event occurs. typically, you will use focus and blur events to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values. don't display an alert during a focus or blur event as this will be distracting for...
...we want to use a capturing event handler, so the addeventlistener method needs to be used. it registers a capturing event handler with the ...
...And 11 more matches
More Menu Features - Archive of obsolete content
and menuseparators in menupopups. however, you can create submenus by simply placing the menu element inside the menupopup element. this works because the menu element is valid even when it isn't directly placed inside a menu bar. ...
...y placing the menu element inside the menupopup element. this works because the menu element is valid even when it isn't directly placed inside a menu bar. ...
...use 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 commands to a...
...And 11 more matches
Using Remote XUL - Archive of obsolete content
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/there.is.only.xul"> <menubar> <menu
label="the mozilla organization" /> <menu
label="developer docs" /> <menu
label="testing" /> <menu
label="tools" /> <button
label="faq" /> <button
label="search" /> </menubar> <iframe src="https://www.mozilla.org/" flex="1" /> </window> the menubar element is a container for a series of menus. it can also contain other elements. it serves to group menus together into a single ...
...e src="https://www.mozilla.org/" flex="1" /> </window> the menubar element is a container for a series 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/gateke...
...n 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. ...
...And 11 more matches
Rendering a list of Vue components - Learn web development
to add new todo items, we can start with some mock to do items. each to-do item will be represented by an object with a name and a done property. add a few sample to-do items, along the lines of those seen below. this way you have some data available for rendering using v-for. export default { name: 'app', components: { todoitem }, data() { return { todoitems: [ {
label: 'learn vue', done: false }, {
label: 'create a vue project with the cli', done: true }, {
label: 'have fun', done: true }, {
label: 'create a to-do list', done: false } ] }; } }; now that we have a list of items, we can use the v-for directive to display them. directives are applied to elements like other attributes. in case of v-for, you use a special syntax...
... to each element in your todoitems array, and assign each of them a value of uniqueid('todo-'). ...
...value of uniqueid('todo-'). ...
...And 11 more matches
Styling Vue components with CSS - Learn web development
pitalize; } .btn__danger { color: #fff; background-color: #ca3c3c; border-color: #bd2130; } .btn__filter { border-color: lightgrey; } .btn__danger:focus { outline-color: #c82333; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 auto; } .btn-group > * + * { margin-left: 0.8rem; } .
label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } [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; } } .visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1p...
...u might do it in plain html — by adding a class="" attribute to the element. add class="btn btn__primary btn__lg" to your form’s <button> element: <button type="submit" class="btn btn__primary btn__lg"> add </button> while we're here, there's one more semantic and styling change we can make. since our form denotes a specific section of our page, it could benefit from an <h2> element. ...
...imary btn__lg" to your form’s <button> element: <button type="submit" class="btn btn__primary btn__lg"> add </button> while we're here, there's one more semantic and styling change we can make. since our form denotes a specific section of our page, it could benefit from an <h2> element. the
label, however, already denotes the purpose of the form. to avoid repeating ourselves, let's wrap our
label in an <h2>. there are a few other global css styles which we can add as well. ...
...And 11 more matches
XUL Accessibility
introduction this article shows how xul control elements are mapped to accessibility api. it is much in progress. at api general rules this section holds some rules applied to generating accessible name and description. ...
...progress. at api general rules this section holds some rules applied to generating accessible name and description. ...
...ion holds some rules applied to generating accessible name and description. ...
...And 11 more matches
ARIA: dialog role - Accessibility
up an html based application dialog or window that separates content or ui from the rest of the web application or page. dialogs are generally placed on top of the rest of the page content using an overlay. dialogs can be either non-modal (it's still possible to interact with content outside of the dialog) or modal (only the content in the dialog can be interacted with). ...
... account section.</p> <button>close</button> </div> description marking up a dialog element with the dialog role helps assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. however, adding role="dialog" alone is not sufficient to make a dialog accessible. ...
...s assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. however, adding role="dialog" alone is not sufficient to make a dialog accessible. additionally, the following needs to be done: the dialog must be properly
labeled keyboard focus must be managed correctly the sections below describe how these two requirements can be met.
labeling even though it is not required for the dialog itself to be able to receive focus, it still needs to be
labeled. ...
...And 11 more matches
<input type="text"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
...neral rule, you should avoid using them unless it can't be helped. attribute description autocorrect a string indicating whether or not autocorrect is on or off. safari only. 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. 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 configured. off disable automa...
...rrection of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of
label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the change being implemented in firefox, see bug 1490661. permitted values are: go, done, next, search, and send. the browser decides, using this hint, what
label to put on the enter key. using text inputs <input> el...
...And 11 more matches
Adding menus and submenus - Archive of obsolete content
mac os x. mac os x treats menus in a very different way than other systems. if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. ...
...s in a very different way than other systems. if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. ...
... if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. ...
...And 10 more matches
The Box Model - Archive of obsolete content
d next to each other from left to right. a vbox is oriented vertically by default, its child nodes displayed one below the other from top to bottom. a box is a generic version that you can orient as you please, but its default is horizontal orientation, so it's pretty much equivalent to an hbox and it is seldom used. here's a very simple example of an hbox with 3 child buttons: <hbox> <button
label="cat" /> <button
label="parrot" /> <button
label="porcupine" /> </hbox> this is how it looks on mac os (the black border was added for illustrative purposes, boxes don't have borders by default): if you use a vbox instead, it looks like this: the orientation of boxes (and most xul elements) can be controlled using the orient attribute or the -moz-box-orient css property. with these yo...
...this is what we get: now the flexible button is taking the available inner space, moving the other two buttons all the way to the end of the box. what would happen if we also add flexibility to the "parrot" button? since both buttons have a flexibility of 1, the available space is distributed evenly among the two. note that this is not always the case. if one of the buttons has a very long
label that restricts its minimum size, then it could be the
label determining its size, while the other button would flex taking the rest of the room. now, if you want a different size distribution in flexible elements, you can use flexibility values higher than 1. in this case, the "cat" button has a flex value of 3, while the "parrot" button still has a flex value of 1. the "cat" button is now la...
...ex taking the rest of the room. now, if you want a different size distribution in flexible elements, you can use flexibility values higher than 1. in this case, the "cat" button has a flex value of 3, while the "parrot" button still has a flex value of 1. the "cat" button is now larger in a 3 to 1 proportion. note that, again, this can depend on the contents of the elements, in this case, the
labels and paddings in the buttons. if the
label of the "parrot" button was something much longer, the size ratio would not be kept. you can have even more control over the size of flexible elements using the minwidth, maxwidth, minheight and maxheight attributes, or their css counterparts: min-width, max-width, min-height and max-height. the latter are recommended to keep style code in the skin secti...
...And 10 more matches
Menu - Archive of obsolete content
u is shown. the function is invoked just before the item's menu is shown and when the items array of the item's menu is retrieved. it must return a non-function menuitem. if the item belongs to a context menu, the function is called as function(context) and otherwise function(). context is an object describing the context in which the menu was shown. string a simple menuitem with the given string
label. object a menuitem with specific properties. the object may define any of the properties listed below. properties property type description command function a function that will be called when the menuitem is clicked. if the menu property is present, command will instead be called when any of the item's descendants is clicked. in th...
... data string an arbitrary string that the feature may associate with the menuitem. disabled boolean if true, the menuitem is disabled. icon string the url of an icon to display in the menuitem. note that some environments, notably gnome 2.28, do not support menuitem icons either by default or at all.
label string the
label of the menuitem. menu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's shortcut key while the menu is open. it should be one of the characters that appears in the item's
label. on some platforms this character is underlined in the
label. ...
...fancy separators may behave differently on different platforms, however. xulid string the id of the menuitem's backing xul element, exposed for the benefit of advanced developers. ...
...And 10 more matches
List Controls - Archive of obsolete content
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 control the size with the rows attribute. set it to the nu...
...bute. 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 later.
...n the listbox. the listcols element is used to hold the column information, each of which is specified using a listcol element. you will need one listcol element for each column in the listbox. the listcell element may be used for each cell in a row. if you want to have three columns, you will need to add three listcell elements inside each listitem. to specify the text content of a cell, place a
label attribute on a listcell. for the simple case where there is only one column, you may also place the
label attributes directly on the listitem elements and leave the listcell elements out entirely, as was seen in the earlier listbox examples. the following example is of a listbox with two columns and three rows: example 3 : source view <listbox> <listcols> <listcol/> <listcol/> </l...
...And 10 more matches
Modifying a XUL Interface - Archive of obsolete content
element to create. you can then set attributes of the element using the setattribute() function and append it to the xul document using the appendchild() function. for example, the following will add a button to a xul window: example 1 : source view <script> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("
label","a new button"); abox.appendchild(button); } </script> <box id="abox" width="200"> <button
label="add" oncommand="addbutton();"/> </box> this example has two parts a box container element in xul. notice that this is not the same as a vbox or an hbox. (this is discussed more in the box model pages.) the box element has two attributes "id" and "width". ...
...ommand="addbutton();"/> </box> this example has two parts a box container element in xul. notice that this is not the same as a vbox or an hbox. (this is discussed more in the box model pages.) the box element has two attributes "id" and "width". the box element contains a button element. the button element has two attributes "
label" and "oncommand" a javascript function named "addbutton()" this script first gets a reference to the box with getelementbyid(), which is the container to add a new button to. the function getelementbyid() does not know that the box it is looking for happens to be containing the tag that has the oncommand attribute that referenced it...
...erenced it. getelementbyid() only knows the box it is looking to find has an id with the value "abox". this is a subtle dependency between the function and the xul element to which you should pay attention. addbutton() the calls the createelement() function to create a new button. note this button is not visible, nor is it attached to anything yet. ...
...And 10 more matches
dialog - Archive of obsolete content
ar in the dialog box. these buttons will be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
...x. these buttons will be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
...ll be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
...And 10 more matches
<input type="email"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
....org" "me@example.org,you@example.org" "me@example.org, you@example.org" "me@example.org,you@example.org, us@example.org" some examples of invalid strings: "," "me" "me@example.org you@example.org" placeholders sometimes it's helpful to offer an in-context hint as to what form the input data should take. this can be especially important if the page design doesn't offer descriptive
labels for each <input>. this is where placeholders come in. a placeholder is a value that demonstrates the form the value should take by presenting an example of a valid value, which is displayed inside the edit box when the element's value is "". once data is entered into the box, the placeholder disappears; if the box is emptied, the placeholder reappears. here, we have an email input with the plac...
... a valid e-mail address, but for security purposes, we require that the address be an internal corporate e-mail address. since inputs of type email validate against both the standard e-mail address validation and the specified pattern, you can implement this easily. ...
...And 10 more matches
<input type="image"> - HTML: Hypertext Markup Language
for example, if you have a graphical button that shows an image with an icon and/or image text "login now", you should also set the alt attribute to something l...
... for example, if you have a graphical button that shows an image with an icon and/or image text "login now", you should also set the alt attribute to something like login now. ...
...d7ab0115d5a659fcfb7b.png"> the src attribute is used to specify the path to the image you want to display in the button. the alt attribute provides alt text for the image, so screen reader users can get a better idea of what the button is used for. it will also display if the image can't be shown for any reason (for example if the path is misspelled). if possible, use text which matches the
label you'd use if you were using a standard submit button. the width and height attributes are used to specify the width and height the image should be shown at, in pixels. the button is the same size as the image; if you need the button's hit area to be bigger than the image, you will need to use css (e.g. padding). also, if you specify only one dimension, the other is automatically adjusted so that...
...And 10 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
t, helloworld@xuldev.org. set the contents of that file to be the full path to the work folder for your extension source files, c:\extensions\helloworld. listing 3: additional content for overlay.xul <?xml version="1.0"?> <overlay id="helloworldoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="menu_toolspopup"> <menuitem id="helloworldmenuitem"
label="hello, world!" insertbefore="sanitizeseparator" oncommand="window.opendialog('chrome://helloworld/content/clock.xul','clock','chrome,centerscreen,modal');"/> </menupopup> </overlay> phase 2: adding a function to display the time in phase 2, we will make it so that selecting the hello world menu item we created in phase 1 will display a window with the time (figure 6). fixme: figure ...
... first, we add an event handler to the menu item that will open the window (listing 4). fixme: listing 4: event handler clock handler create the window that displays the clock (listing 5) and its controller (listing 6). we’ve already covered the dialog element in chapter 3. in this case, we only want to display an ok button, so we set the buttons attribute to accept. within the window are a
label element and textbox element, wrapped in a hbox element so that they are arranged horizontally. listing 5: content for clock.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/"?> <dialog id="clockdialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="clock" buttons="accept" onload="initclock();"> <script type="application/javascript...
...anged horizontally. ...
...And 9 more matches
Broadcasters and Observers - Archive of obsolete content
attribute forwarding we've already seen that elements such as buttons can be hooked up to commands. in addition, if you place the disabled attribute on the command element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. ...
...mmands. in addition, if you place the disabled attribute on the command element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. for instance, if you place a
label attribute on a command element, any buttons attached to the command will share the same
label. ...
...n the command element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. for instance, if you place a
label attribute on a command element, any buttons attached to the command will share the same
label. example 1 : source view <command id="my_command"
label="open"/> <button command="my_command"/> <checkbox
label="open in a new window" command="my_command"/> in this example, the button does not have a
label attribute, however it is attached to a command that does. the button will share the
label with the command. the checkbox already has a
label, however, it will be overridden by the command's
label. the result is that both the button and the chec...
...And 9 more matches
Trees - Archive of obsolete content
lems. of course, this is independant of the performance of the view object itself. a tree view is an object which implements the nsitreeview interface. this interface contains thirty properties and functions which you may implement. these functions will be called by the tree as necessary to retrieve data and state about the tree. for instance, the getcelltext() function will be called to get the
label for a particular cell in the tree. an advantage of using a tree view is that it allows the view to store the data in a manner which is more suitable for the data, or to load the data on demand as rows are displayed. this allows more flexibility when using trees. naturally, having to implement a tree view with thirty or so properties and methods for every tree can be very cumbersome, especially ...
...uses the ids to identify the columns when rearranging and hiding them. this is no longer required in mozilla 1.8 and later, but it is still a good idea to use ids on columns. treechildren this contains the main body of the tree where the individual rows of data will be displayed. example tree with two columns example 1 : source view <tree flex="1"> <treecols> <treecol id="namecolumn"
label="name" flex="1"/> <treecol id="addresscolumn"
label="address" flex="2"/> </treecols> <treechildren/> </tree> first, the entire table is surrounded with a tree element. this declares an element that is used as a table or tree. as with html tables, the data in a tree is always organized into rows. the columns are specified using the treecols tag. you may place as many columns as you ...
..."2"/> </treecols> <treechildren/> </tree> first, the entire table is surrounded with a tree element. this declares an element that is used as a table or tree. as with html tables, the data in a tree is always organized into rows. the columns are specified using the treecols tag. you may place as many columns as you wish in a tree. as with listboxes, a header row will appear with column
labels. a drop-down menu will appear in the upper-right corner of the tree, which the user may use to show and hide individual columns. each column is created with a treecol element. you can set the header
label using the
label attribute. you may also want to make the columns flexible if your tree is flexible, so that the columns stretch as the tree does. in this example, the second column will be appr...
...And 9 more matches
Using Spacers - Archive of obsolete content
more room in it. let's see what happens when a spacer is added between the text box and the find button. by adding a spacer and resizing the window, you can see that the spacer has expanded to fill the space. the buttons have been pushed over. our find file example the code to add a spacer is shown below. insert it just before the find button. <spacer flex="1"/> <button id="find-button"
label="find"/> more about flexibility xul lays out elements on a window by calculating suitable widths and heights for the elements and then adding space where they are flexible. unless you specify information about the width and height of an element, the default size of an element is determined by its contents. you'll notice that the cancel button in the dialogs has always set its width so that it f...
...ndow by calculating suitable widths and heights for the elements and then adding space where they are flexible. unless you specify information about the width and height of an element, the default size of an element is determined by its contents. you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it. if you create a button with a very long
label, the button's default size will be large enough to hold the entire
label. other elements, such as the text box have chosen a suitable default size. the flex attribute is used to specify if an element can change size to fit the box (in this case, the window) it is in. we've already seen the flex attribute applied to spacers, but it can be applied to any element. for example, you might want to have...
...an see in the image, by placing a flex attribute on the find button, it resizes when the window does. a spacer is really nothing special. it could really be considered a hidden button. it works much the same way as a button except it does not draw on screen. you may have noticed something about the image above. not only did the find button grow in size but some space has appeared between the main
label and the button. of course, this is the spacer that we put in earlier. it has resized itself also. if you look closely enough, you should notice that the change in size has been divided up equally between the spacer and the button. the spacer has received half of the free space and the button has received the other half. the reason we're seeing this effect is that both the spacer and the find butt...
...And 9 more matches
tooltip - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for the tooltip popups. for text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
... related ] this element is used for the tooltip popups. for text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
...the xul tutorial. ...
...And 9 more matches
Ember app structure and componentization - Learn web development
ber addon that renders the default welcome page we saw in the previous article, when we first navigated to our server at localhost:4200. however, we don't want this. instead, we want it to contain the todomvc app structure. to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-
label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-
label provides a
label for assistive technology to make use of — for example, for a screenreader to read out. this is useful in such cases where we have an <input> being used with no corresponding html text that could be turned into a
label. when you save application.hbs, the developmen...
...the development server you started earlier will automatically rebuild the app and refresh the browser. the rendered output should now look like this: it doesn't take too much effort to get our html looking like a fully-featured to-do list app. ...
... our html looking like a fully-featured to-do list app. ...
...And 9 more matches
font - CSS: Cascading Style Sheets
<'font-weight'> see the font-weight css property. <'font-stretch'> see the font-stretch css property. <'font-size'> see the font-size css property. <'line-height'> see the line-height css property. <'font-family'> see the font-family css property. system font values caption the system font used for captioned controls (e.g., buttons, drop-downs, etc.). icon the system font used to
label icons. menu the system font used in menus (e.g., dropdown menus and menu lists). message-box the system font used in dialog boxes. small-caption the system font used for
labeling small controls. status-bar the system font used in window status bars. prefixed system font keywords browsers often implement several more, prefixed, keywords: gecko implements -moz-window, -moz-document, -moz-...
... the status bar of the window */ p { font: status-bar } live sample html <p> change the radio buttons below to see the generated shorthand and it's effect. ...
... { font: status-bar } live sample html <p> change the radio buttons below to see the generated shorthand and it's effect. ...
...And 9 more matches
<input type="number"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
...ansaction in which the provided value may have any security implications of any kind. mobile browsers further help with the user experience by showing a special keyboard more suited for entering numbers when the user tries to enter a value. the following screenshot is taken from firefox for android: a simple number input in its most basic form, a number input can be implemented like this: <
label for="ticketnum">number of tickets you would like to buy:</
label> <input id="ticketnum" type="number" name="ticketnum" value="0"> a number input is considered valid when empty and when a single number is entered, but is otherwise invalid. if the required attribute is used, the input is no longer considered valid when empty. note: any number is an acceptable value, as long as it is a valid flo...
.... if the required attribute is used, the input is no longer considered valid when empty. note: any number is an acceptable value, as long as it is a valid floating point number (that is, not nan or infinity). placeholders sometimes it's helpful to offer an in-context hint as to what form the input data should take. this can be especially important if the page design doesn't offer descriptive
labels for each <input>. this is where placeholders come in. a placeholder is a value most commonly used to provide a hint as to the format the input should take value. it is displayed inside the edit box when the element's value is "". once data is entered into the box, the placeholder disappears; if the box is emptied, the placeholder reappears. here, we have an number input with the placeholder "mu...
...And 9 more matches
<input type="password"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed from javascript code that directly sets the value of the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effec...
...how many can be seen at a time. to set an upper limit on the length of the input data, use the maxlength attribute. using password inputs password input boxes generally work just like other textual input boxes; the main difference is the obscuring of the content to prevent people near the user from reading the password. a simple password input here we see the most basic password input, with a
label established using the <
label> element. <
label for="userpassword">password: </
label> <input id="userpassword" type="password"> allowing autocomplete to allow the user's password manager to automatically enter the password, specify the autocomplete attribute. for passwords, this should typically be one of the following: on allow the browser or a password manager to automatically fill out t...
...he browser or password manager to automatically enter a new password for the site; this is used on "change your password" and "new user" forms, on the field asking the user for a new password. the new password may be generated in a variety of ways, depending on the password manager in use. it may simply fill in a new suggested password, or it might show the user an interface for creating one. ...
...And 9 more matches
<input type="search"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
...emental whether or not to send repeated search events to allow updating live search results while the user 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 ar...
...y while editing the field). the search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of
label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the change being implemented in firefox, see bug 1490661. permitted values are: go, done, next, search, and send. the browser decides, using this hint, what
label to put on the enter key. results the results attrib...
...And 9 more matches
<input type="week"> - HTML: Hypertext Markup Language
ist. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the format of the date and time value used by this input type is described in format of a valid week string in date and time formats used in html. you can set a default value for the input by including a value inside the value attribute, like so: <
label for="week">what week would you like to start?</
label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www. when the above value is submitted to the server, for example, browsers may display it as week 01, 2017, but the submitted value will always look like week=2017-w01. ...
...he user's browser or locale. however, there are issues with <input type="week"> because browser support is not guaranteed across all browsers. we'll look at basic and more complex uses of <input type="week">, then offer advice on mitigating the browser support issue later on (see handling browser support). basic uses of week the simplest use of <input type="week"> involves a basic <input> and <
label> element combination, as seen below: <form> <
label for="week">what week would you like to start?</
label> <input id="week" type="week" name="week"> </form> controlling input size <input type="week"> doesn't support form sizing attributes such as size. you'll have to resort to css for sizing needs. using the step attribute you should be able to use the step attribute to vary the number o...
...k/year, which is helpful, but it's still possible to submit with the field empty, and you might want to restrict the range of choosable weeks. setting maximum and minimum weeks you can use the min and max attributes to restrict the valid weeks that can be chosen by the user. in the following example we are setting a minimum value of week 01, 2017 and a maximum value of week 52, 2017: <form> <
label for="week">what week would you like to start?</
label> <input id="week" type="week" name="week" min="2017-w01" max="2017-w52"> <span class="validity"></span> </form> here's the css used in the above 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 th...
...And 9 more matches
Adding sidebars - Archive of obsolete content
story 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. ...
...ou're using, so you should avoid changing the css in tab boxes. on the other hand, if you need ui that behaves like a tabbox but doesn't look like one, you should still favor using a tabbox and use css to change its look. using custom-made elements are likely to cause accessibility and functional problems. creating a tabbed view is simple: <tabbox id="xulschoolhello-tabbox"> <tabs> <tab
label="&xulschoolhello.maintab.
label;" /> <tab
label="&xulschoolhello.advancedtab.
label;" /> </tabs> <tabpanels> <tabpanel> <!-- content for the main panel. --> </tabpanel> <tabpanel> <!-- content for the advanced panel. --> </tabpanel> </tabpanels> </tabbox> the first tab is selected by default, but you can change the default selection by setting the selected a...
...we recommend that you use hbox or vbox elements as children of a deck or stack. the code is easier to read and maintain this way. a deck can be very useful when you have a large piece of xul code that only changes in a small way depending on different circumstances. for instance, you could have a window that is used for two different purposes, and the only difference between the two cases is a
label that has a value in one case and something else in another. using a .properties file and a string bundle is a viable option, but it involves a lot of code for something so simple, specially if that's the only case where you need dynamic text. the alternative is to use a deck with the two
labels, and change the selected index depending on the purpose of the window. this way you can still use dtd, ...
...And 8 more matches
Building Menus With Templates - Archive of obsolete content
his 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 on the menupopu...
...ursively. when creating recursive menus, you will need to use multiple rules, since leaf items will need to be created differently than non-leaf items. leaf items will need to use a menuitem element whereas non-leaf items will need to use a menu element. this will involve at least two rules, although you might use other rules if you had other differences to handle. ...
... other differences to handle. here is an rdf example: <button
label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <template> <rule rdf:type="http://www.xulplanet.com/rdf/house"> <menupopup> <menuitem uri="rdf:*"
label="rdf:http://www.xulplanet.com/rdf/address"/> </menupopup> </rule> <rule> <menupopup> <menu uri="rdf:*"
label="rdf:http://purl.org/dc/elements/1.1/title"/> </menupopup> </rule> </template> </button> this example uses the simple rdf query syntax. the first rule matches all houses, while the second rule is used for streets. the content generated for each rule...
...And 8 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. ...
...usnext » 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. ...
...e 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 been add...
...And 8 more matches
RDF Datasources - Archive of obsolete content
http://home.netscape.com/nc-rdf#referrer referrer of the page url http://home.netscape.com/nc-rdf#url url of the page visit count http://home.netscape.com/nc-rdf#visitcount number of page visits a typical history list will display a tree with a selection of these fields. to use them, just put the url values above in the
label attributes of the buttons or treecells. you can use nc:historyroot as the value of the ref attribute. you can also use the value nc:historybydate to get the history sorted into days. using the history list example let's see an example of displaying the history list. we'll display the history in a tree with three columns, the name, the url and the date. example 1 : source <tree flex="1" datasource...
...value of the ref attribute. you can also use the value nc:historybydate to get the history sorted into days. using the history list example let's see an example of displaying the history list. we'll display the history in a tree with three columns, the name, the url and the date. ...
...he value nc:historybydate to get the history sorted into days. using the history list example let's see an example of displaying the history list. we'll display the history in a tree with three columns, the name, the url and the date. ...
...And 8 more matches
XBL Example - Archive of obsolete content
the slideshow first, let's determine what elements need to go in the xbl content. because we want page flipping, a deck element would be the most suitable to hold the page content. the content of the pages will be specified in the xul file, not in xbl, but we'll need to add it inside the deck. the children tag will need to be used. ...
...to be used. along the bottom, we'll need a button to go the previous page, a
label to display the current page number, and a button to go to the next page. example 1 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="
label=previoustext"/> <xul:
label flex="1"/> <xul:button xbl:inherits="
label=nexttext"/> </xul:hbox> </xul:vbox> </content> </binding> this binding creates the slideshow structure that we want. the flex attribute has been added to a number of elements so that it stretches in the right way. the
label attributes on the two buttons inherit their values from the bound element. ...
...xul:hbox> </xul:vbox> </content> </binding> this binding creates the slideshow structure that we want. the flex attribute has been added to a number of elements so that it stretches in the right way. the
label attributes on the two buttons inherit their values from the bound element. here, they inherit from two custom attributes, previoustext and nexttext. this makes it easy to change the
labels on the buttons. the children of the element that the xbl is bound to will be placed inside the deck. the selectedindex is inherited by the deck, so we may set the initial page in the xul. ...
...And 8 more matches
ARIA: Navigation Role - Accessibility
screen readers use landmark roles to provide keyboard navigation to important sections of a page. ...
...screen readers use landmark roles to provide keyboard navigation to important sections of a page. ...
...through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. like the html <nav> element, navigation landmarks provide a way to identify groups (e.g. lists) of links that are intended to be used for website or page content navigation. if a page includes more than one navigation landmark, each should have a unique
label. if two or more navigational landmark on a page have the same set of links, use the same
label for each. it is preferable to use the html5 <nav> element to define a navigation landmark. if the html5 nav element technique is not being used, use a role="navigation" attribute to define a navigation landmark. using the <nav> element will automatically communicate a section has a role of navigation...
...And 8 more matches
ARIA: listbox role - Accessibility
n, 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 used to select all items, and ctrl+a could be used as a shortcut key for this. when the listbox role is added to an element, or such an element becomes visible, screen readers announce the
label and role of the listbox when it gets focus. if an option or item is focused within the list, it gets announced next, followed by an indication of the item's position with the list if the screen reader supports this. as focus moves within the list, the screen reader announces the relevant items. associated aria roles, states, and properties associated roles option one or more nested options ...
...attribute. if false or omitted, only the currently selected option, if any option is selected, needs the aria-selected attribute, and it must be set to true. aria-required a boolean attribute which indicates that an option with a non-empty string value must be selected. aria-readonly the user cannot change which options are selected or unselected, but the listbox is otherwise operable. ...
...ected, needs the aria-selected attribute, and it must be set to true. aria-required a boolean attribute which indicates that an option with a non-empty string value must be selected. aria-readonly the user cannot change which options are selected or unselected, but the listbox is otherwise operable. aria-
label a human-readable string value which identifies the listbox. if there's a visible
label, then aria-
labelledby should be used instead to refer to that
label. ...
...And 8 more matches
Border-image generator - CSS: Cascading Style Sheets
********************************************************/ /* * ui button */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox >
label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 2px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: ce...
...mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 2px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox >
label:hover { cursor: pointer; } .ui-checkbox > input:checked +
label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } /*************************************************************************************/ /*************************************************************************************/ /* * border image generator tool */ body ...
...: 10px 30px; background-color: #fff; opacity: 0.95; color: #888; /*border-radius: 2px;*/ box-shadow: 0 0 3px 0 #bababa; } #general-controls .property { width: 130px; float: left; } #general-controls .name { height: 20px; margin: 0 10px 0 0; line-height: 100%; text-align: right; float: left; } #general-controls .right { width: 200px; float: right; } #general-controls .ui-checkbox
label { height: 10px; } #general-controls .separator { height: 40px; width: 1px; margin: -10px 15px; background-color: #eee; float: left; } /* * controls */ #controls { color: #444; margin: 10px 0 0 0; } #controls .category { height: 190px; min-width: 260px; margin: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 3px; float: left; box-shadow: 0 0 3px 0 #bababa; trans...
...And 8 more matches
disabled - HTML: Hypertext Markup Language
of a disabled checkbox, radio button, <option> and <optgroup>, as well as some form controls that are disabled via the disabled attribute set on the ancestor <fieldset> element. the <option>s are disabled, but the <select> itself is not. we could have disable the entire <select> by adding the attribute to that element rather than it's descendants. ...
...me form controls that are disabled via the disabled attribute set on the ancestor <fieldset> element. the <option>s are disabled, but the <select> itself is not. we could have disable the entire <select> by adding the attribute to that element rather than it's descendants. ...
...that are disabled via the disabled attribute set on the ancestor <fieldset> element. the <option>s are disabled, but the <select> itself is not. we could have disable the entire <select> by adding the attribute to that element rather than it's descendants. ...
...And 8 more matches
Adding preferences to an extension - Archive of obsolete content
+ symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var output = httprequest.responsetext; if (output.length) { // remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // build the tooltip string var fieldarray = output.split(","); samplepanel.
label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5] + " | " + "low: " + fieldarray[6] + " | " + "high: " + fieldarray[7] + " | " + "vol: " + fieldarray[8]; } } var httprequest = new xmlhttprequest(); httprequest.open("get", fullurl, true); htt...
... false); design the preference dialog now that we've written all the code, we need to build the xul file for the options dialog. ...
...in our case, we have a single preference, the stock symbol to monitor. preferences are identified by name; in this case, the name is "extensions.stockwatcher2.s...
...And 7 more matches
accesskey - Archive of obsolete content
« xul reference home attribute of: button, checkbox, caption, description,
label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox 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. 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'. ...
... 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'. when the user presses a modifier key specific to the platform (eg, control* on windows, command* on macintosh) and the access key, the element will be focused and/or activated from anywhere in the window. on the macintosh,
labels are never underlined, however accesskeys can still be used by pressing the letter combined with the command key. ...
... window. on the macintosh,
labels are never underlined, however accesskeys can still be used by pressing the letter combined with the command key. *(these are the keys corresponding to event.ctrlkey and event.metakey respectively when listening to key events) although the value is case insensitive, a letter with the case matching the accesskey attribute will be used if both cases exist in the
label. otherwise, if the
label has two or more characters which are same as its accesskey, the first of those characters in the
label will be underlined. if a
label doesn't have the specified character, the character will be appended to the
label with parentheses. for example, when an accesskey of an 'open'
label is 'a', the generated
label will be 'open (a)'. however, if the last character of the la...
...And 7 more matches
ContextMenus - Archive of obsolete content
e mouse to open a context menu, the context is the element that was clicked. when using the keyboard, the context is the element in the window that is currently focused. although there are several ways to open a context menu, a single event may be used to listen for any of these situations; the 'contextmenu' event is fired in any case. ...
... to cancel a context menu event, you can use the preventdefault method of the event object. ...
...nt 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 those ...
...And 7 more matches
Box Model Details - Archive of obsolete content
lot of features of the box model. here, we'll find out some more details with some examples. more layout details the style properties such as min-width and max-height can be applied to any element. we've added them to buttons and textboxes, but we can also add them to spacers or boxes. in addition, the flex attribute can be applied to any element. example 1 : source view <hbox flex="1"> <button
label="left" style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button
label="right" style="min-width: 100px;" flex="1"/> </hbox> in the example above, all three elements will resize themselves as they are all flexible. the two buttons indicate a minimum width of 100 pixels. the buttons will never be smaller than this size but they may grow larger. here the window should appear just over 200...
...ribute controls this behavior on a horizontal box. you can also prevent this stretching by placing a maximum height on the elements or, better, on the box itself. if a box has a maximum height, the elements inside it are constrained by this. however, the problem with this is that you need to know how big the element will be beforehand. example 2 : source view <hbox flex="1" align="top"> <button
label="left" style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button
label="right" style="min-width: 100px;" flex="1"/> </hbox> summary of the box model to achieve complicated layouts, you will generally need to add nested boxes, specify minimum and maximum sizes on some elements, and make certain elements flexible. the best interface is one that can be displayed at various sizes without p...
...anywhere in a xul file, including inside an html element such as a table. however, the layout will be partly controlled by the html element. that means that the flex might not work exactly as you want it. remember that flexibility only has meaning for elements that are directly inside a box or an element that is a type of box. ...
...And 7 more matches
Element Positioning - Archive of obsolete content
suitable size to hold the text. width and height attributes you may need to have more control over the size of an element in a window. there are a number of features that allow you to control the size of an element. the quick way is to simply add the width and height attributes on an element, much like you might do on an html img tag. an example is shown below: example 1: source view <button
label="ok" width="100" height="40"/> however, it is not recommended that you do this. it is not very portable and may not fit in with some themes. a better way is to use style properties, which work similarly to style sheets in html. the following css properties can be used. width this specifies the width of the element. note that the css global skin of the xul application may also specify a min-...
...that have a flex attribute set to a value greater than 0. recall that flexible elements grow and shrink to fit the available space. their default size is still calculated the same as for inflexible elements. the following example demonstrates this: example 2 : source view <window orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <button
label="yes" flex="1"/> <button
label="no"/> <button
label="i really don't know one way or the other"/> </hbox> </window> the window will initially appear like in the image earlier. the first two buttons will be sized at a suitable default width and the third button will be larger because it has a longer
label. the first button is made flexible and all three elements have been placed inside a box...
... both will share the amount of extra space. if one button has a maximum width, the second will still continue to grow and take all of the remaining space. if a box has a maximum width or height, the children cannot grow larger than that maximum size. if a box has a minimum width or height, the children cannot shrink smaller than that minimum size. ...
...And 7 more matches
Popup Menus - Archive of obsolete content
scribed 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 is a g...
...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 it wil...
...the context attribute has been used to associate the box with a menupopup with the same id. in this case, the menupopup clipmenu will appear. this way, you can have a number of popups and associate them with different elements. you could associate multiple popups with the same element by putting more attributes of different types on an element. ...
...And 7 more matches
Tabboxes - Archive of obsolete content
g the size of the tabbox, the size of the largest page is used. that means that if there are ten textboxes on one tab page and only one on another, the tab page will be sized to fit the one with the ten on it as this takes up more room. the area taken up by the tab area does not change when the user switches to a new tab page. tabbox example example 1 : source view <tabbox> <tabs> <tab
label="mail"/> <tab
label="news"/> </tabs> <tabpanels> <tabpanel id="mailtab"> <checkbox
label="automatically check for mail"/> </tabpanel> <tabpanel id="newstab"> <button
label="clear news buffer"/> </tabpanel> </tabpanels> </tabbox> here, two tabs have been added, the first
labeled 'mail' and the other 'news'. when the user clicks on the mail tab, the contents ...
... the currently selected tab element is given an additional selected attribute which is set to true. this alters the appearance of the currently selected tab to make it look selected. ...
... the currently selected tab element is given an additional selected attribute which is set to true. this alters the appearance of the currently selected tab to make it look selected. only one tab will have a true value for this attribute at a time. ...
...And 7 more matches
Templates - Archive of obsolete content
curity reasons, mozilla doesn't allow access to them from other sources. to view this example, you will need to create a chrome package and load the file from there (you can do this easily, see manifest files). you can then enter the chrome url into the browser url field. example 1 : source <vbox datasources="rdf:bookmarks" ref="nc:bookmarksroot" flex="1"> <template> <button uri="rdf:*"
label="rdf:http://home.netscape.com/nc-rdf#name"/> </template> </vbox> here, a vertical box has been created that will contain a column of buttons, one for each top-level bookmark. you can see that the template contains a single button. this single button is used as a basis for all the buttons that need to be created. you can see in the image that the set of buttons has been created, one for each...
...e will usually correspond to the value of an about attribute on an rdf bag, seq or alt element. inside the template by adding these two attributes to the box above, it allows the generation of elements using the template. however, the elements inside the template need to be declared differently. you may notice in the example above that the button has a uri attribute and an unusual value for the
label attribute. an attribute value inside the template that begins with 'rdf:' indicates that the value should be taken from the datasource. in the example earlier, this is the case for the
label attribute. the remainder of the value refers to the name property in the datasource. it is constructed by taking the namespace url used by the datasource and appending the property name. if you don't underst...
...e remainder of the value refers to the name property in the datasource. it is constructed by taking the namespace url used by the datasource and appending the property name. if you don't understand this, try re-reading the last part of the previous section. it explains how resources in rdf can be referred to. here, we only use the name of the bookmark but numerous other fields are available. ...
...And 7 more matches
Trees and Templates - Archive of obsolete content
e difference by using mozilla's dom inspector on a tree with and without the flag. if you do use a content builder instead, note that the content won't generally get built until it is needed. with hierarchical trees, the children don't get generated until the parent nodes have been opened by the user. in the template, there will be one treecell for each column in the tree. the cells should have a
label attribute to set the
label for the cell. this would normally be set to an rdf property so that the
label is pulled from the datasource. template-built tree example the following example demonstrates a 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> <...
...the
label for the cell. this would normally be set to an rdf property so that the
label is pulled from the datasource. template-built tree example the following example demonstrates a template-built tree, in this case for the file system. ...
...the
label is pulled from the datasource. template-built tree example the following example demonstrates a template-built tree, in this case for the file system. ...
...And 7 more matches
menu - Archive of obsolete content
[ examples | attributes | properties | methods | related ] an element, much like a button, that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
...s 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. ...
...enu 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. ...
...And 7 more matches
menulist - Archive of obsolete content
st. 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. ...
...used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
... ...
...And 7 more matches
menupopup - Archive of obsolete content
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. ...
...pshown, 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. ...
...ode, 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. ...
...And 7 more matches
<statusbarpanel> - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox 4 note the status bar has been removed. refer to the add-on bar. an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a
label or an image but not both. ...
...« xul reference home [ examples | attributes | properties | methods | related ] firefox 4 note the status bar has been removed. refer to the add-on bar. an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a
label or an image but not both. ...
...removed. refer to the add-on bar. an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a
label or an 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. ...
...And 7 more matches
toolbarbutton - Archive of obsolete content
ewhere 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. ...
...e all toolbarbuttons focusable by -moz-user-focus: normal. ...
...ccesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image,
label, oncommand, open, orient, tabindex, title, type, validate properties 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"/> <menuit...
...And 7 more matches
tree - Archive of obsolete content
ct, rows, seltype, statedatasource, tabindex, treelines properties accessibletype, builderview, columns, contentview, currentindex, disablekeynavigation, disabled, editingcolumn, editingrow, enablecolumndrag, firstordinalcolumn, inputfield, seltype, selstyle, tabindex, treeboxobject, view examples a tree with several columns <tree flex="1" rows="2"> <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> ...
...treerow> <treecell
label="mel@whereever.com"/> <treecell
label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> a tree with several columns and nested items <tree id="mytree" flex="1" hidecolumnpicker="false" seltype="single" class="tree" rows="5"> <treecols id="mytree2-treecols"> <treecol id="mytree2-treecol0" primary="true" flex="2"
label="column a" persist="width" ordinal="1"/> <splitter class="tree-splitter" ordinal="2"/> <treecol id="mytree2-treecol1" flex="1"
label="column b" persist="width" ordinal="3"/> </treecols> <treechildren> <treeitem> <treerow> <treecell
label="1"/> <treecell
label="a"/> </treerow> </treeitem> <!-- make sure to set container=...
...if this attribute...
...And 7 more matches
treecol - Archive of obsolete content
e size and other information about the column. you can also place splitter elements between the columns to allow column resizing. you should always place an id attribute on a treecol element to ensure that the column positioning is handled properly. more information is available in the xul tutorial. ...
...in the xul tutorial. attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker,
label, primary, 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. ...
...itable, fixed, hidden, hideheader, ignoreincolumnpicker,
label, primary, 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. ...
...And 7 more matches
How to build custom form controls - Learn web development
elect> element using non-semantic html, css, and javascript. this select was selecting one option from a limited number of options, which is the same functionality of a same-named group of radio buttons. we could therefore reinvent this using radio buttons instead; let's look at this option. ...
...lement using non-semantic html, css, and javascript. this select was selecting one option from a limited number of options, which is the same functionality of a same-named group of radio buttons. we could therefore reinvent this using radio buttons instead; let's look at this option. ...
...ns instead; let's look at this option. we can start with a completely semantic, accessible, unordered list of radio buttons with an associated <
label>,
labeling the entire group with a semantically appropriate <fieldset> and <legend> pair. ...
...And 7 more matches
Your first form - Learn web development
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, although there are some other elements to learn about too. form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text
labels that describe their purpose to both sighted and blind users. designing your form before starting to code, it's always better to step back and take the time to think about your form. designing a quick mockup will help you to define the right set of data you want to ask your user to enter. from a user experience (ux) point of view, it's important to remember that the bigger your form, the more y...
...mple contact form. let's make a rough sketch. our form will contain three text fields and one button. we are asking the user for their name, their e-mail and the message they want to send. hitting the button will send their data to a web server. active learning: implementing our form html ok, let's have a go at creating the html for our form. we will use the following html elements: <form>, <
label>, <input>, <textarea>, and <button>. before you go any further, make a local copy of our simple html template — you'll enter your form html into here. the <form> element all forms start with a <form> element, like this: <form action="/my-handling-form-page" method="post"> </form> this element formally defines a form. it's a container element like a <section> or <footer> element, but speci...
...on and method attributes: the action attribute defines the location (url) where the form's collected data should be sent when it is submitted. the method attribute defines which http method to send the data with (usually get or post). note: we'll look at how those attributes work in our sending form data article later on. for now, add the above <form> element into your html <body>. the <
label>, <input>, and <textarea> elements our contact form is not complex: the data entry portion contains three text fields, each with a corresponding <
label>: the input field for the name is a single-line text field. the input field for the e-mail is an input of type email: a single-line text field that accepts only e-mail addresses. the input field for the message is a <textarea>; a multiline t...
...And 7 more matches
HTML text fundamentals - Learn web development
below, add elements to the raw text in the input field so that it appears as a heading and two paragraphs in the output field. if you make a mistake, you can always reset it using the reset button. if you get stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%">my short story i am a statistician and my name is trish. my legs are made of cardboard and i am married to a fish.</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="butto...
..." class="input" style="min-height: 100px; width: 95%">my short story i am a statistician and my name is trish. ...
...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. ...
...And 7 more matches
nsIPromptService
gname from javascript and as nsipromptservice::flagname from c++. button position flags on linux and mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. on windows and os/2, the buttons are centred in the order 0, 2, 1. constant value description button_pos_0 1 this is usually the button used to confirm the prompt. it typically has the
label "ok", "yes", or "save". button_pos_1 256 this is the button used to cancel the prompt. it typically has the
label "cancel" or "no". it is equivalent to pressing the escape key (or cmd+. on the mac), or closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the ...
..._pos_1 256 this is the button used to cancel the prompt. it typically has the
label "cancel" or "no". it is equivalent to pressing the escape key (or cmd+. on the mac), or closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. for instance, it might have the
label "don't save". button title flags these flags are used along with button position flags to set the
labels of buttons in the prompt. constant value description button_title_ok 1 these flags are used to select standard
labels from the user's current locale. button_title_cancel 2 button_title_yes 3 button_title_no 4 butt...
... button default flags these flags are used to select which button is the default. ...
...And 7 more matches
ARIA: checkbox role - Accessibility
the checkbox role is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology. <span role="checkbox" aria-checked="false" tabindex="0" aria-
labelledby="chk1-
label"> </span> <
label id="chk1-
label">remember my preferences</
label> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. ...
...similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. ...
...similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. ...
...And 7 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
ributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox. this is never seen on the client-side, but on the server this is the value given to the data submitted with the checkbox's name. take the following example: <form> <div> <input type="checkbox" id="subscribenews" name="subscribe" value="newsletter"> <
label for="subscribenews">subscribe to newsletter?</
label> </div> <div> <button type="submit">subscribe</button> </div> </form> in this example, we've got a name of subscribe, and a value of newsletter. when the form is submitted, the data name/value pair will be subscribe=newsletter. if the value attribute was omitted, the default value for the checkbox is on, so the submitted data in th...
...h them all separately, as shown above. however, if they're all related, things are not quite so simple. for example, in the following demo we include multiple checkboxes to allow the user to select their interests (see the full version in the examples section). <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding"> <
label for="coding">coding</
label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <
label for="music">music</
label> </div> </fieldset> in this example you will see that we've given each checkbox the same name. if both checkboxes are checked and then the form is submitted, you'll get a string of name/value pairs submitted like this: interest=coding&interest=...
... captured. for one technique used with php, see handle multiple checkboxes with a single serverside variable, for example. checking boxes by default to make a checkbox checked by default, you simply give it the checked attribute. see the below example: <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding" checked> <
label for="coding">coding</
label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <
label for="music">music</
label> </div> </fieldset> providing a bigger hit area for your checkboxes in the above examples, you may have noticed that you can toggle a checkbox by clicking on its associated <
label> element as well as on the checkbox itself. this is a really us...
...And 7 more matches
<input type="url"> - HTML: Hypertext Markup Language
ional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. see
labels and placeholders in <input>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with ...
...neral rule, you should avoid using them unless it can't be helped. attribute description autocorrect a string indicating whether or not autocorrect is on or off. safari only. 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. 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 configured. off disable automa...
...rrection of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of
label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the change being implemented in firefox, see bug 1490661. permitted values are: go, done, next, search, and send. the browser decides, using this hint, what
label to put on the enter key. using url inputs when you cr...
...And 7 more matches
dev/panel - Archive of obsolete content
that constructor you need to supply values for various properties . you can set the constructor up manually if you like, or you can use the add-on sdk core/heritage module to simplify the mechanics of inheriting from panel. ...
... mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing t...
...ent here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, {
label: "my panel", tooltip: "...", .... }); in the constructor definition there are a number of mandatory and optional parameters for you to supply. name type description
label string the string to display in the toolbox toolbar. mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing to an icon file, typically in your add-on's "data" directory. you can use the notation "./my-icon.png" as an alias for the url pointing to "data/my-icon.png". mandatory url string ...
...And 6 more matches
ui/frame - Archive of obsolete content
in this way you can customize the frame for each browser window. to do this, you call postmessage() not on the frame itself but on the source attribute of the object passed into an...
...in this way you can customize the frame for each browser window. to do this, you call postmessage() not on the frame itself but on the source attribute of the object passed into an event listener. for targetorigin, you can use the o...
... attach, load and ready, also provide access to source and origin. to receive such messages in the frame script, listen for the window's message event: window.addeventlistener("message", handlepong, false); sending json in all cases, you can send a string as a message or a json object. ...
...And 6 more matches
PopupEvents - Archive of obsolete content
icking 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 be applied to any type of popup. in this example, a
label within a panel is initialized with the current time. <panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocaleformat('%t')"> <
label value="time:"/> <
label id="time"/> </panel> <toolbarbutton
label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener. th...
... <
label id="time"/> </panel> <toolbarbutton
label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener. the default operation of the popupshowing event is to continue showing the popup. the preventdefault method will stop this from happening and the popup will not be opened. <menu
label="edit"> <menupopup onpopupshowing="if (gdisallowed) event.preventdefault();"> <menuitem
label="undo"/> <menuitem
label="redo"/> </menupopup> </menu> in this example, a global variable gdisallowed is checked and the preventdefault method is called. if you want to prevent a context menu from opening it is better to call preventdefault with a handler for the contextmenu event instead, t...
...dler for the contextmenu event instead, to avoid the extra steps necessary to fire the popupshowing event if it isn't needed. when using nested submenus, make sure to check in the popupshowing event that the event corresponds to the right popup. this is because the popup events bubble so the parent menu will receieve a popupshowing event whenever it opens, or any submenus open. for example: <menu
label="file"> <menupopup onpopupshowing="if (event.target == this) adjustfilemenu(this);"> <menu
label="open"> <menupopup> <menuitem
label="file..."/> <menuitem
label="page"/> </menupopup> </menu> </menupopup> </menu> the target of the event is examined to ensure that the event is for the desired menupopup. otherwise, the adjustfilemenu function would be called ...
...And 6 more matches
Tooltips - Archive of obsolete content
tooltips a tooltip is used to provide descriptive help to the user about the control that the mouse is over. for instance, moving the mouse over top of a toolbar button and waiting for a second can display a small popup
label containing text describing the button's function. when the mouse is moved again, the tooltip disappears. this is a useful means of providing additional details about a user interface without cluttering up the main interface. note that tooltips can only be activated using the mouse, so they should never contain important information that isn't available elsewhere. the tooltiptext attribute in most cases, the tooltip will display only a single
label. for this, the tooltiptext attribute may be used, which is valid for all xul elements. the value of this attribute ...
...that tooltips can only be activated using the mouse, so they should never contain important information that isn't available elsewhere. the tooltiptext attribute in most cases, the tooltip will display only a single
label. for this, the tooltiptext attribute may be used, which is valid for all xul elements. the value of this attribute should be the text to appear in the tooltip. <toolbarbutton
label="back" tooltiptext="go back one page"/> in this example, a back button on a toolbar is given additional text to appear on a tooltip. this could also be useful if the toolbar is configured such that
labels do not appear. if an element does not have a tooltiptext attribute, yet a parent element does, the parent tooltip will apply. for example, in the following, a toolbar has a tooltip set for it...
...e, a back button on a toolbar is given additional text to appear on a tooltip. this could also be useful if the toolbar is configured such that
labels do not appear. if an element does not have a tooltiptext attribute, yet a parent element does, the parent tooltip will apply. for example, in the following, a toolbar has a tooltip set for it. <toolbar tooltiptext="file buttons"> <toolbarbutton
label="open" tooltiptext="open a file"/> <toolbarbutton
label="close"/> </toolbar> the 'open' button has a tooltiptext attribute so will have a tooltip of its own. however, the close button does not have a tooltip associated with it, yet the parent toolbar does. the result is that the toolbar's tooltip will apply when the mouse is moved over the close button, as well as when the mouse is over an em...
...And 6 more matches
Actions - Archive of obsolete content
ment. 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 defined. this action contains only one element, but you can put as many or as few elements as you need. i...
...ariable, ?relateditem. you could think of this as changing the uri attribute to the id attribute, and replacing the variable. since the first result has a value of 'http://www.xulplanet.com/rdf/b' for the ?relateditem variable, the id will be set to this value. then, the remaining attributes on the element are examined and any variables are replaced in place. that is, the text ?relateditem in the
label attribute will be replaced with the string 'http://www.xulplanet.com/rdf/b' for the first result. in the image, you can see that the
label for the first button does indeed have this value. processing is now complete for the first result, so the builder moves on to the next result. for result b, the builder would have generated the following content: <button id="http://www.xulplanet.com/rdf/b" lab...
... the dom tree will look like the following: <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> <button id="http://www.xulplanet.com/rdf/b"
label="http://www.xulplanet.com/rdf/b"/> <button id="http://www.xulplanet.com/rdf/c"
label="http://www.xulplanet.com/rdf/c"/> <button id="http://www.xulplanet.com/rdf/d"
label="http://www.xulplanet.com/rdf/d"/> </vbox> since the template tag is hidden, the effect will be like in the image, three button...
...And 6 more matches
Special Condition Tests - Archive of obsolete content
ement, the one with the datasources attribute on it. for inner iterations, it will be the element with the uri attribute from the previous iteration. here is a previous example, rewritten to use the parent matching syntax: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <rule parent="vbox"> <action> <groupbox uri="?"> <caption
label="?name"/> </groupbox> </action> </rule> <rule> <action> <
label uri="?" value="?name"/> </action> </rule> </template> </vbox> previously, an assign element was used to assign the tagname of the result to a variable, which was then compared in a rule condition. the code above accomplishes the same effect except that it using the parent matching mecha...
...f parent matching for rdf sources, you can use the same technique. to do this kind of matching, you again place a parent attribute on the rule, set to the tag to match. for instance, we might use the following: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule parent="vbox"> <groupbox uri="rdf:*"> <caption
label="rdf:http://purl.org/dc/elements/1.1/title"/> </groupbox> </rule> <rule> <
label uri="rdf:*" value="rdf:http://www.xulplanet.com/rdf/address"/> </rule> </template> </vbox> on the first pass, the container where generated content would be inserted is a <vbox>, so the first rule will match and a captioned <groupbox> will be created. on the next pass, the parent container w...
... </template> </vbox> on the first pass, the container where generated content would be inserted is a <vbox>, so the first rule will match and a captioned <groupbox> will be created. on the next pass, the parent container will be the element with the uri attribute from the previous pass, in this case, the <groupbox> the first rule 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. here is the same example using the extended template 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="?i...
...And 6 more matches
Accesskey display rules - Archive of obsolete content
each controls of xul can have an accesskey which is specified by accesskey attribute or accesskey property (see accesskey attribute document for the detail). xul elements display their accesskeys in their
label automatically if it's necessary. this document describes the rules of generating a
label text. xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac. because macos x doesn't have the conception of accesskey function on its native widgets/applications. ...
...les of generating a
label text. xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac. because macos x doesn't have the conception of accesskey function on its native widgets/applications. basic accesskey display rules on non-mac platforms, a character which is same as its accesskey is underlined. e.g., when an accesskey of "file" is 'f', the generated
label will be "file". if a
label has two or more characters which are same as its accesskey, the first character of them will be underlined. if a
label doesn't have the character, xul elements append the accesskey character with parentheses. e.g., when an accesskey of "open" is 'a', the generated
label will be "open (a)". ...
... this document calls the appended text "accesskey text". ...
...And 6 more matches
Adding Buttons - Archive of obsolete content
eresting yet. in this section, we will add two buttons, a find button and a cancel button. we will also learn a simple way to position them on the window. like html, xul has a number of tags that can be used to create user interface elements. the most basic of these is the button tag. this element is used to create simple buttons. ...
...l button. we will also learn a simple way to position them on the window. like html, xul has a number of tags that can be used to create user interface elements. the most basic of these is the button tag. this element is used to create simple buttons. the button element has two main properties associated with it, a
label and an image. you need one or the other or both. thus, a button can have a
label only, an image only or both a
label and an image. ...
...you'll see this attribute on all elements. ...
...And 6 more matches
More Tree Features - Archive of obsolete content
l triangle or plus sign to appear before the cells in that column to indicate the cells that can be expanded. in addition, child rows are indented. note also that the user cannot hide the primary column using the drop down to the right of the columns. ...
...te the cells that can be expanded. in addition, child rows are indented. note also that the user cannot hide the primary column using the drop down to the right of the columns. ...
...op down to the right of the columns. ...
...And 6 more matches
The Box Model - Archive of obsolete content
, you can use the orient attribute to control the orientation of the box. you can set this attribute to the value horizontal to create a horizontal box and vertical to create a vertical box. thus, the two lines below are equivalent: <vbox></vbox> <box orient="vertical"></box> the following example shows how to place three buttons vertically. example 1 : source view <vbox> <button id="yes"
label="yes"/> <button id="no"
label="no"/> <button id="maybe"
label="maybe"/> </vbox> the three buttons here are oriented vertically as was indicated by the box. to change the buttons so that they are oriented horizontally, all you need to do is change the vbox element to a hbox element. login prompt example you can add as many elements as you want inside a box, including other boxes. in the case ...
...ther boxes. in the case of a horizontal box, each additional element will be placed to the right of the previous one. the elements will not wrap at all so the more elements you add, the wider the window will be. similarly, each element added to a vertical box will be placed underneath the previous one. the example below shows a simple login prompt: example 2 : source view <vbox> <hbox> <
label control="login" value="login:"/> <textbox id="login"/> </hbox> <hbox> <
label control="pass" value="password:"/> <textbox id="pass"/> </hbox> <button id="ok"
label="ok"/> <button id="cancel"
label="cancel"/> </vbox> here four elements have been oriented vertically, two inner hbox tags and two button elements. notice that only the elements that are direct descendants of the b...
...> <textbox id="login"/> </hbox> <hbox> <
label control="pass" value="password:"/> <textbox id="pass"/> </hbox> <button id="ok"
label="ok"/> <button id="cancel"
label="cancel"/> </vbox> here four elements have been oriented vertically, two inner hbox tags and two button elements. notice that only the elements that are direct descendants of the box are oriented vertically. the
labels and textboxes are inside the inner hbox elements, so they are oriented according to those boxes, which are horizontal. you can see in the image that each
label and textbox is oriented horizontally. aligning textboxes if you look closely at the image of the login dialog, you can see that the two textboxes are not aligned with each other horizontally. it would probably be better if they were. in o...
...And 6 more matches
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...opup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...And 6 more matches
panel - Archive of obsolete content
is called. warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported. some features may work, but only on some platforms. for those versions of firefox, it is best to avoid child frames in a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys,
label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype,
label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a
label. <panel id="thepanel"> <hbox align...
..., top, type properties accessibletype,
label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a
label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="you have 6 new messages."/> <hbox> <button
label="read mail"/> <button
label="new message"/> </hbox> </vbox> </hbox> </panel> <description value="6 new messages" popup="thepanel"/> attributes backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area. close type: boolean if the panel has a titleb...
...d the arrow slides towards the middle of the panel such that it is still aligned with the anchor. without flip="slide", the panel would have had its width truncated and the panel would not extend to the left of the anchor. ignorekeys type: boolean if false, the default value, the escape key may be used to close the panel. if true, the escape key cannot be used to close the panel.
label type: string for panels with titlebars, the
label on the titlebar. left type: integer overrides the horizontal position of the popup specified by the showpopup method. level type: one of the values below specifies whether the panel appears on top of all windows, or just on top of the window the panel is in. if this attribute is not set, the popup window level depends on the...
...And 6 more matches
Basic native form controls - Learn web development
ll browsers since the early days of the web. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand in detail the original set of native form widgets available in browsers for collecting data, and how to implement them using html. you've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <
label>, <button>, and <input>. this article covers: the common input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are common to all form controls. note: the features discussed in this article are supported in all browsers, which is not the case for all form controls. we cover newer form controls added in html5 in the next two ...
... hidden, the user can not see nor intentionally edit the value, it will never receive focus, and a screen reader will not notice it either. <input type="hidden" 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...
...t 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). for maximum usability/accessibility, you are advised to surround each list of related items in a <fieldset>, with a <legend> providing an overall description of the list. each individual pair of <
label>/<input> elements should be contained in its own list item (or similar). 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. check box a check box is created using the <input> element with a t...
...And 6 more matches
Example - Learn web development
this is the example code for the article your first html form. ...
... this is the example code for the article your first html form. ...
... this is the example code for the article your first html form. ...
...And 6 more matches
Waterfall - Firefox Developer Tools
time. recorded operations, called markers, are shown as horizontal bars, laid out in a waterfall to reflect the serial nature of the browser's execution. when a marker is selected you'll see more information about it in a sidebar on the right. this includes the marker's duration and some more information that's specific to the marker type. markers the markers for operations are color-coded and
labeled. the following operations are recorded: name and description color detailed information dom event javascript code that's executed in response to a dom event. event type for example, "click" or "message". event phase for example, "target" or "capture". javascript functions executed in th...
...lowing operations are recorded: name and description color detailed information dom event javascript code that's executed in response to a dom event. event type for example, "click" or "message". event phase for example, "target" or "capture". javascript functions executed in the page are
labeled with the reason the function was called: script tag setinterval settimeout requestanimationframe promise callback promise init worker javascript uri event handler stack call stack, with links to functions. parse html time spent parsing the page's html. stack call stack,...
...animations styleattribute styleattribute_animations force forcedescendants layout calculating the position and size of page elements. this operation is sometimes called "reflow". paint drawing pixels to the screen. garbage collection garbage collection event. non-incremental gc events are
labeled "(non-incremental)". reason a string indicating the reason gc was performed. non-incremental reason if the gc event was non-incremental, the string indicates the reason non-incremental gc was performed. new in firefox 46: if the gc event was caused by allocation pressure, a link appears,
labeled "show allocation triggers". click the link to se...
...And 6 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
c.start(); osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. ...
...dioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. ...
...ad an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. ...
...And 6 more matches
ARIA: Region role - Accessibility
the region landmark role is used to identify an area in the document that the author has identified as significant. it is used to provide a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate. <div role="region" aria-
label="example"> <!-- region content --> </div> description the region role is an aria landmark role. landmark roles provide a way to identify the organization and structure of a web page. by classifying and
labeling sections of a page, structural information conveyed visually through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. the region role should be reserved for sections of content sufficiently important that users ...
...portant that users will likely want to navigate to the section easily and to have it listed in a summary of the page. a region role is a more generic term, and should only be used if the section needing to be identified is not accurately described by one of the other landmark roles, such as banner, main, contentinfo, complementary, or navigation. every element with a region role should include a
label that describes the purpose of the content in the region, preferably with an aria-
labelledby referencing a visible header. if no visible appropriate header is present, aria-
label should be used.. region landmark roles content should make sense if separated from the main content of the document. using the <section> element will automatically communicate a section has a role of region if it is giv...
... region landmark roles content should make sense if separated from the main content of the document. using the <section> element will automatically communicate a section has a role of region if it is given an accessible name. developers should always prefer using the correct semantic html element, in this case <section>, over using aria. ...
...And 6 more matches
ARIA: img role - Accessibility
the 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. <div role="img" aria-
label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> description any set of content that should be consumed as a single image (which could include images, video, audio, code snippets, emojis, or other content) can be identified using role="img". you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a bla...
...mg". you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box, and not access the individual elements inside it. ...
...r the element with role="img" set on it to be to be like a black box, and not access the individual elements inside it. therefore, provide a comprehensive overall descriptive alt text for image, either in the surrounding text, or by using an aria-
label attribute, with optional alt attributes for search engines or sighted users to be written to the page should an image fail: <div role="img" aria-
label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> if you wish to add a caption or
label to your image that is visible on the page, you can do using: aria-
labelledby when the text is a concise
label. aria-describedby when the text is a longer description. for example: <div role="img" aria-
labelledby="image-1"> ... <p id="image-1">te...
...And 6 more matches
HTML attribute: readonly - HTML: Hypertext Markup Language
red attribute is not permitted on inputs with the readonly attribute specified. usability browsers display the readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint validation. ...
...s not permitted on inputs with the readonly attribute specified. usability browsers display the readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint validation. ...
...readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint validation. ...
...And 6 more matches
XUL user interfaces - Archive of obsolete content
doc7.xul. ...
...ersion="1.0"?> <?xml-stylesheet type="text/css" href="style7.css"?> <!doctype window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="css getting started - xul demonstration" onload="init();"> <script type="application/javascript" src="script7.js"/> <
label class="head-1" value="xul demonstration"/> <vbox> <groupbox class="demo-group"> <caption
label="day of week calculator"/> <grid> <columns> <column/> <column/> </columns> <rows> <row> <
label class="text-prompt" value="date:" accesskey="d" control="date-text"/> <textbox id="date-text" type="timed" timeout="750" oncommand="refresh();"/> </row> <row> <
label value="day:"/> ...
... <columns> <column/> <column/> </columns> <rows> <row> <
label class="text-prompt" value="date:" accesskey="d" control="date-text"/> <textbox id="date-text" type="timed" timeout="750" oncommand="refresh();"/> </row> <row> <
label value="day:"/> <hbox id="day-box"> <
label class="day" value="sunday" disabled="true"/> <
label class="day" value="monday" disabled="true"/> <
label class="day" value="tuesday" disabled="true"/> <
label class="day" value="wednesday" disabled="true"/> <
label class="day" value="thursday" disabled="true"/> <
label class="day" value="friday" disabled="true"/> <
label class="da...
...And 5 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
lockpref("mail.identity.id1.useremail", mail); lockpref("mail.server.server2.name", mail); lockpref("mail.identity.id1.fullname", cn); //debug with popup error messages doesn't work anymore :-( !! var env_mozdebug= getenv("mozilla_debug"); if (env_mozdebug) {dis...
...es doesn't work anymore :-( !! var env_mozdebug= getenv("mozilla_debug"); if (env_mozdebug) {displayerror("no error, just a debug, cn =" + cn + " and mail = " + mail); } } } // 4) call ldap servers to get ldap attributes (mail & cn), this will finally call processldapvalues, "3)" just above. getldapattributes("ldap2.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,
labeleduri"); // close the try, and call the catch() } catch(e) { displayerror("lockedpref", e); } thunderbird.cfg (version 2 with ad) using thunderbird 9.0.1 and try to use a active directory (windows server 2008) as ldap-source did not work with version 1. here's my own version. //note: for accessing the active directory of windows server later than 2000 //it is necessary to allow anonymous re...
...or autoconfig (pref extension!) but unfortunately not for ldap calls :-( (cf. moz_ldap_xpcom=1). it is not vital in firefox as it is for us in thunderbird (need to get the cn and email address to set email account, which are not available by default in the environment variables). however i could be useful to get ldap values for firefox extra config, for example to set the default home page to the
labeleduri ldap attribute of the user. firefox 22 omni.jar archive file became omni.ja since http://blog.ffextensionguru.com/2011/11/16/omni-jar-to-become-omni-ja/ [root@localhost firefox]# unzip -l /usr/lib/firefox/browser/omni.ja | grep defaults/pr warning [/usr/lib/firefox/browser/omni.ja]: 3598815 extra bytes at beginning or within zipfile (attempting to process anyway) error [/usr/lib/firef...
...And 5 more matches
MenuButtons - Archive of obsolete content
menu buttons menus may be attached to buttons in several ways. both the button and the toolbar button elements support two special types used for creating menu buttons. a button or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed. an arrow appears on the button next to the
label or image indicating to the user that a menu is present. a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally. however a segment of the button displays an arrow which, when pressed, opens a menu. in either case, a menupopup element should be placed as a direct child of the button. the 'menu' button the 'menu' type of button is used when pressing the button alone should just open the menu and...
... set the type attribute of the button 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 u...
...> </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. ...
...And 5 more matches
MenuModification - Archive of obsolete content
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. 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 purp...
...ertitemat method is used to insert a new 'delete' item at the beginning of the menu's popup. the first argument is the index where the new item should be inserted. in this case, 0 is supplied as the index, which means before the first item. indicies are counted starting at 0, so to insert an item before the fourth item pass 3 as the argument. the second and third arguments to insertitemat are the
label and value for the new item, as with appenditem. both the appenditem and insertitemat methods return the new menuitem, so you can further modify it, for instance to add an access key, as in the following example: var item = menu.appenditem("insert", "insert"); item.accesskey = "i"; appending submenus there is no built-in method to append submenus to a menu. to do this, we instead need to use ...
... a menu. to do this, we instead need to use the inherited node modification methods available for all elements. first, we need to retrieve the menupopup for the menu, and then use the appendchild method to append a new item. ...
...And 5 more matches
Using Recursive Templates - Archive of obsolete content
on name="laura secord"/> </group> </people> we could display this data in a flat list by using the right query: <query expr="group/person/"> or, we could display one level for the two groups, and use another level for each person. <groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <
label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the xpath expression just gets the list of child elements of the reference node. for the outermost iteration, a vbox is created with a child
label. since the initial reference node is the root of the xml source document, the results are two elements, one for each group element. however, a further st...
...body is again generated for each result, but instead of being inserted inside the outermost groupbox, this new content is inserted inside the content generated from the previous iteration. the content is always inserted directly inside the element with the uri attribute. the result is output like the following: <groupbox> ... ...
...eing inserted inside the outermost groupbox, this new content is inserted inside the content generated from the previous iteration. the content is always inserted directly inside the element with the uri attribute. the result is output like the following: <groupbox> ... ...
...And 5 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
addsession method. ...
...chsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting,
label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultva...
...ultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the
label attribute for the element. alwaysopenpopup obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif true, the autocomplete popup will be displayed even when there are no matches. if false, the default value, the popup will be hidden. this attribute is obsolete as of gecko 1.9.1; to control the display of the popup, use the minresultsforpopup attribute...
...And 5 more matches
Anonymous Content - Archive of obsolete content
xul elements and aren't valid in xbl. this namespace was declared on the bindings tag. if you don't use the namespace on xul elements, mozilla will assume that the elements are xbl, not understand them, and your elements won't work correctly. filename input field example another example, this time for a field for entering a filename: <binding id="fileentry"> <content> <textbox/> <button
label="browse..."/> </content> </binding> attaching this binding to an element will cause it to contain a field for entering text, followed by a browse button. this inner content is created anonymously and cannot be seen using the dom. override the bound element the anonymous content is created automatically whenever a binding is attached to an element. if you place child elements inside the xul, th...
... created anonymously and cannot be seen using the dom. override the bound element the anonymous content is created automatically whenever a binding is attached to an element. if you place child elements inside the xul, they will override the elements provided by the binding. for example, take this xul fragment, assuming it is bound to the scrollbar xbl earlier: <scrollbar/> <scrollbar> <button
label="overridden"/> </scrollbar> the first scroll bar, because it has no content of its own, will have its content generated from a binding definition declared in an xbl file. the second scroll bar has its own content so it will use that instead of the xbl content, resulting in something that isn't much of a scroll bar at all. note that the built-in elements such as scroll bars get their xbl from the...
...th 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 menup...
...And 5 more matches
Grids - Archive of obsolete content
ing the grid element. it has some similarities to the html table tag. the grid does not display anything itself; it is used only to position elements in a tabular form with rows and columns. a grid contains elements that are aligned in rows just like tables. inside a grid, you declare two things, the columns that are used and the rows that are used. just like html tables, you put content such as
labels and buttons inside the rows. however, the grid allows either row or column based organization so you may put content in either rows or in columns. it is most common to use rows, as with a table. however, you can still use columns to specify the size and appearance of the columns in a grid. alternatively, you can put content inside the columns, and use the rows to specify the appearance. we'll lo...
...rly, the columns are declared with the columns element, which should be placed as a child element of the grid. inside that go individual column elements, one for each column you want in the grid. this should be easier to understand with an example. example 1 : source view <grid flex="1"> <columns> <column flex="2"/> <column flex="1"/> </columns> <rows> <row> <button
label="rabbit"/> <button
label="elephant"/> </row> <row> <button
label="koala"/> <button
label="gorilla"/> </row> </rows> </grid> two rows and two columns have been added to a grid. each column is declared with the column tag. each column has been given a flex attribute. each row contains two elements, both buttons. the first element in each row element is placed in t...
...se any element in place of the button element of course. if you wanted one particular cell to contain multiple elements, you can use a nested hbox or other box element. an hbox is a single element but you can put as many elements that you want inside it. ...
...And 5 more matches
Input Controls - Archive of obsolete content
lue password to create a textbox that hides what it types. this is usually used for password entry fields. maxlength the maximum number of characters that the textbox allows. note that while in html, several different kinds of fields can be created with the input element, in xul there are separate elements for each type. the following example shows some textboxes: example 1 : source view <
label control="some-text" value="enter some text"/> <textbox id="some-text"/> <
label control="some-password" value="enter a password"/> <textbox id="some-password" type="password" maxlength="8"/> multiline textbox the textbox examples above will create text inputs that can only be used for entering one line of text. html also has a textarea element for creating a larger text entry area. in xul, you ...
...mple 2 : source view <textbox multiline="true" value="this is some text that could wrap onto multiple lines."/> like the html textarea, you can use the rows and cols attributes to set the size. this should be set to the number of rows and columns of characters to display. our find files example let's add a search entry field to the find file dialog. we'll use the textbox element. <
label value="search for:" control="find-text"/> <textbox id="find-text"/> <button id="find-button"
label="find"/> add these lines before the buttons we created in the last section. if you open this window, you will see something much like that shown in the image. notice that the
label and the text input field have now appeared in the window. the textbox is fully functional and you can type into i...
... checkboxes and radio buttons two additional elements are used for creating check boxes and radio buttons. they are variations of buttons. ...
...And 5 more matches
Manipulating Lists - Archive of obsolete content
d 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. 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...
...out 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 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.removeitem...
...e selected element. for instance the selecteditem of a menulist will be the menuitem that is selected. if no item is selected, selectedindex will return -1, while selecteditem will return null. getting the selected item these two properties are commonly inspected during a select event, as in the following example: example 2 : source view <listbox id="thelist" onselect="alert(this.selecteditem.
label);"> <listitem
label="short"/> <listitem
label="medium"/> <listitem
label="tall"/> </listbox> the select event is fired for a listbox when an item in the list is selected. the select handler here displays an alert containing the
label of the selected item in the list. since the select event fired we can assume that an item is selected. in other cases, you may wish to check to ensure that s...
...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. ...
... [ 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. ...
...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. ...
...And 5 more matches
radio - Archive of obsolete content
e [ examples | attributes | properties | methods | related ] an element that can be turned on and off. radio buttons are almost always listed together in groups. only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. ...
...utes | properties | methods | related ] an element that can be turned on and off. radio buttons are almost always listed together in groups. only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. ...
...ame radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a
label, specified with the
label attribute may be added beside the radio button. more information is available in the xul tutorial. ...
...And 5 more matches
toolbaritem - Archive of obsolete content
oolbarbutton). 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. ...
...e 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. ...
...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 5 more matches
XForms Group Element - Archive of obsolete content
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. ...
...ments (e.g. core form controls, groups, switches, repeats and host language content) within a non-relevant group are handled as non-relevant. ...
...ups, 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. ...
...And 5 more matches
Introduction to CSS layout - Learn web development
ound-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; margin: 10px; border-radius: 5px; } the rendered output is as follows: relative positioning relative positioning allows you to offset an item from the position in normal flow it would have by default. this means you could achieve a task such as moving an icon down a bit so it lines up with a text
label. to do this, we could add the following rule to add relative positioning: .positioned { position: relative; top: 30px; left: 30px; } here we give our middle paragraph a position value of relative — this doesn't do anything on its own, so we also add top and left properties. these serve to move the affected element down and to the right — this might seem like the opposite of what you w...
...ments that are not tables, a use which is sometimes described as "using css tables". the example below shows one such use; using css tables for layout should be considered a legacy method at this point, for those situations where you have very old browsers without support for flexbox or grid. let's look at an example. first, some simple markup that creates an html form. ...
...using css tables". the example below shows one such use; using css tables for layout should be considered a legacy method at this point, for those situations where you have very old browsers without support for flexbox or grid. let's look at an example. first, some simple markup that creates an html form. each input element has a
label, and we've also included a caption inside a paragraph. each
label/input pair is wrapped in a <div>, for layout purposes. ...
...And 5 more matches
Looping code - Learn web development
break statement will immediately exit the loop and make the browser move on to any code that follows it. ...
...op and make the browser move on to any code that follows it. ...
... if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else { para.textcontent = 'contact not found.'; } } }); hidden code 3 <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple contact search example</title> <style> </style> </head> <body> <
label for="search">search by contact name: </
label> <input id="search" type="text"> <button>search</button> <p></p> <script> const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.adde...
...And 5 more matches
DevTools API - Firefox Developer Tools
s triggered for. return value: undefined. properties the tooldefinition object can contain following properties. most of them are optional and can be used to customize the presense of the tool in the browser and the toolbox. id string, required. an unique identifier for the tool. it must be a valid id for an html element. url string, required. an url of the panel document.
label string, optional. the tool's name. if undefined the icon should be specified. tooltip string, optional. the tooltip for the tool's tab. panel
label string, optional. an accessibility
label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. default: 99 visibilityswitch string, optional. a preference name that controls the visiblit...
...default: false inverticonforlighttheme boolean, optional. ...
...default: false inverticonforlighttheme boolean, optional. if true the colors of the icon will be inverted for the light theme. default: false key string, optional. ...
...And 5 more matches
Example and tutorial: Simple synth keyboard - Web APIs
the keyboard, we'll put some controls for configuring the layer. for now, we will have two controls: one to set the master volume and another to select what periodic waveform to use when generating notes. the volume control first we create the <div> to contain the settings bar, so it can be styled as needed. then we establish a box that will be presented on the left side of the bar and place a
label and an <input> element of type "range". the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, stepping by 0.01 each position. <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volume...
...e "range". the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, stepping by 0.01 each position. <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volumes"> <option value="0.0"
label="mute"> <option value="1.0"
label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume". this lets us provide a set of common values and special strings which the browser may optionally choose to di...
...nnected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume". this lets us provide a set of common values and special strings which the browser may optionally choose to display in some fashion; we provide names for the values 0.0 ("mute") and 1.0 ("100%"). the waveform picker on the right side of the settings bar, we place a
label and a <select> element named "waveform" whose options correspond to the available waveforms. <div class="right"> <span>current waveform: </span> <select name="waveform"> <option value="sine">sine</option> <option value="square" selected>square</option> <option value="sawtooth">sawtooth</option> <option value="triangle">triangle</option> <option value="cust...
...And 5 more matches
ARIA: figure role - Accessibility
the aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist. a figure is generally considered to be one or more images, code snippets, or other content that puts across 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> elemen...
...o, audio, code snippets, or other content) can be identified as a figure using role="figure". there are no hard and fast rules about how you should write your figure content. you should make sure that it is accessible just like any other content. for example, make sure it is perceivable by users of assistive technology, navigable by keyboard as well as mouse, and so on. ...
... any other content. for example, make sure it is perceivable by users of assistive technology, navigable by keyboard as well as mouse, and so on. you can add a caption or
label to your figure in a number of ways. you could add an id to an element containing content that describes the figure, and then reference that id inside an appropriate attribute on the figure to associate the figure with the
label: <div role="figure" aria-
labelledby="figure-1"> ... <p id="figure-1">text that describes the figure.</p> </div> use aria-
labelledby when the text is a concise
label. use aria-describedby when the text is a longer description. again, this can be done semantically, without aria, with html's <figure> and <figcaption> elements <figure> ... <figcaption>text that describes the figure.</...
...And 5 more matches
ARIA: form role - Accessibility
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. ...
...s 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. the <form> element defines a form landmark when it has an accessible name (e.g. aria-
labelledby, aria-
label or title). make sure to have a unique
label on each form in a document to help users understand the purpose of the form. this
label should be visible to all users, not just assistive technology users. use the search landmark instead of the form landmark when the form is used for search functionality. use the role="form" to identify a region of the page; do not use it to identify...
...ctions no role specific keyboard interactions required javascript features onsubmit the onsubmit event handler handles the event raised when the form is submitted. anything that is not a <form> cannot be submitted, therefore you would have to use javascript to build an alternative data submission mechanism, for example with xmlhttprequest. ...
...And 5 more matches
ARIA: grid role - Accessibility
the grid role is for a widget that contains one or more rows of cells. the position of each cell is significant and can be focused using keyboard input. ...
...k that box even if the focus is not on the checkbox. ctrl + a selects all cells. shift + → extends selection one cell to the right. shift + ← extends selection one cell to the left. shift + ↓ extends selection one cell down. shift + ↑ extends selection one cell up. ...
...ne cell to the left. shift + ↓ extends selection one cell down. shift + ↑ extends selection one cell up. ...
...And 5 more matches
ARIA: search role - Accessibility
andmarks 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. ...
...ntainer 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</
label> <input type="search" id="search-input" name="search" spellcheck="false"> <input value="submit" type="submit"> </form> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand th...
...y concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <form> element in conjunction with a declaration of role="search" will provide the largest amount of support. ...
...And 5 more matches
ARIA: button role - Accessibility
le code. description the button role identifies an element as a button to screen readers. a button is a widget used to perform actions such as submitting a form, opening a dialog, cancelling an action, or performing a command such as inserting a new record or displaying information. a common convention to inform users a button will launch a dialog is to append "…" (ellipsis) to the button's
label, e.g., "save as…". in addition to the ordinary button widget, role="button" should be included when creating a toggle button or menu button using a non button element. a toggle button is a two-state button that can be either off (not pressed) or on (pressed). the aria-pressed attribute values of true or false identify a button as a toggle button. a menu button is a button that controls a menu ...
... aria-expanded="true" set, it is currently expanded; if the button has aria-expanded="undefined" set or the attribute is ommitted, it is not expandable. basic buttons buttons should always have an accessible name. for most buttons, this name will be the same as the text inside the button. in some cases, for example buttons represented by icons, the accessible name may be provided from the aria-
label or aria-
labelledby attributes. toggle buttons a toggle button typically has two states: pressed and not pressed. a third mixed state is available for toggle buttons that control other elements, such as other toggle buttons or checkboxes, which do not all share the same value. whether an element is a toggle button or not can be indicated with the aria-pressed attribute in addition to the button...
...ot used, or is set to the "undefined" state, the button is not a toggle button. if aria-pressed="false" is used the button is a toggle button that is currently not pressed. if aria-pressed="true" is used the button is a toggle button that is currently pressed. if aria-pressed="mixed" is used, the button is considered to be partially pressed. ...
...And 5 more matches
ARIA: textbox role - Accessibility
t it. the default is a single line input, in which return or enter submits the form; in this case, it is preferable to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. ...
... html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. ...
... type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. ...
...And 5 more matches
Cognitive accessibility - Accessibility
to ensure the site is navigable and content is findable: include a <title> make sure to include a <title> for the document, as titles provide a quick and easy to reference description of the screen's main point. people with cognitive disabilities, limited short-term memory, and reading disabilities all benefit from being able to identify the purpose of content this way. heading and
labels include clear and descriptive headings so users can easily find information and understand relationships between different content sections. descriptive
labels help users identify specific components within the content. people who read slowly and people with limited short-term memory benefit when section titles make it possible to predict what each section contains. section headings ...
... keep navigation consistent throughout the site keep the navigation order consistent between pages. for example, if you have a navigation bar on multiple pages, make that navigation uniform across the site with the same links in the same location. this doesn't just apply to navigation: present all repeated components in the same relative order each time they appear. ...
... keep the navigation order consistent between pages. for example, if you have a navigation bar on multiple pages, make that navigation uniform across the site with the same links in the same location. this doesn't just apply to navigation: present all repeated components in the same relative order each time they appear. provide consistent
labeling identical functions should have similar
labels every time they are utilized. ...
...And 5 more matches
Accessibility documentation index - Accessibility
ntact form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. 10 basic form hints aria, accessibility, forms when implementing forms using traditional html form-related elements, it is important to provide
labels for controls, and explicitly associate a
label with its control. 11 multipart
labels: using aria for
labels with embedded fields inside them aria, accessibility, ben millard, firefox, guide, help, html, html 4, jaws, needscontent, aria-
labelledby,
label, solution, trouble shoot, troubleshoot the solution is in an aria attribute called aria-
labelledby. its parameter is a stri...
...-activedescendant this article describes the aria-activedescendant property. 18 using the aria-describedby attribute aria, accessibility, attribute the aria-describedby attribute is used to indicate the ids of the elements that describe the object. it is used to establish a relationship between widgets or groups and text that described them. this is very similar to aria-
labelledby: a
label describes the essence of an object, while a description provides more information that the user might need. 19 using the aria-hidden attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent this technique demonstrates how to use the aria-hidden attribute. the aria-hidden attribute can eithe...
...ttribute is used to indicate that the value entered into an input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers. aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process. 21 using the aria-
label attribute aria, accessibility, codingscripting, html, needscontent, reference, référence(2), agent, aria-
label, user, useragent the aria-
label attribute is used to define a string that
labels the current element. use it in cases where a text
label is not visible on the screen. if there is visible text
labeling the element, use aria-
labelledby instead. 22 using the aria-labe...
...And 5 more matches
:checked - CSS: Cascading Style Sheets
the user can engage this state by checking/selecting an element, or disengage it by unchecking/deselecting the element. note: because browsers often treat <option>s as replaced elements, the extent to which they can be styled with the :checked pseudo-class varies from browser to browser. ...
...this state by checking/selecting an element, or disengage it by unchecking/deselecting the element. note: because browsers often treat <option>s as replaced elements, the extent to which they can be styled with the :checked pseudo-class varies from browser to browser. ...
...it by unchecking/deselecting the element. note: because browsers often treat <option>s as replaced elements, the extent to which they can be styled with the :checked pseudo-class varies from browser to browser. ...
...And 5 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
ption> from the list of options. <select multiple name="drawfs" id="drawfs"> <option>grumpy</option> <option>happy</option> <option>sleepy</option> <option>bashful</option> <option>sneezy</option> <option>dopey</option> <option>doc</option> </select> when multiple is specified, most browsers will show a scrolling list box instead of a single line dropdown. ...
...iple name="drawfs" id="drawfs"> <option>grumpy</option> <option>happy</option> <option>sleepy</option> <option>bashful</option> <option>sneezy</option> <option>dopey</option> <option>doc</option> </select> when multiple is specified, most browsers will show a scrolling list box instead of a single line dropdown. ...
...he required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datalist> for subsequent email addresses when multiple is present. others do not. ...
...And 5 more matches
break - JavaScript
the break statement terminates the current loop, switch, or
label statement and transfers program control to the statement following the terminated statement. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax break [
label];
label optional identifier associated with the
label of the statement. if the statement is not a loop or switch, this is required. description the break statement includes an optional
label that allows the program to break out of a
labeled statement. the break statement needs to be nested within the referenced
label. ...
...teractive-examples and send us a pull request. syntax break [
label];
label optional identifier associated with the
label of the statement. if the statement is not a loop or switch, this is required. description the break statement includes an optional
label that allows the program to break out of a
labeled statement. the break statement needs to be nested within the referenced
label. the
labeled statement can be any block statement; it does not have to be preceded by a loop statement. a break statement, with or without a following
label, cannot be used within the body of a function that is itself nested within the current loop, switch, or
label statement that the break statement is intended to break out of. examples break in while loop the following function has a break statement t...
...notice that inner_block is nested within outer_block. ...
...And 5 more matches
simple-prefs - Archive of obsolete content
attribute description type the type of preference, as defined in the "preference types" section below. name an identifier for the preference. this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier. title this is used as a
label for the preference in the add-ons manager user interface. optional common attributes these are attributes that all preferences may have: attribute description description this appears below the preference title in the add-ons manager ui. value a default value for the preference. depending on the preference type, this may be an integer, string...
...nd stores the full path and name of the directory selected. { "type": "directory", "name": "mydirectory", "title": "select a directory" } menulist displayed as a drop-down list. the type of the stored value depends on the default value. the options are specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "
label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "
label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "
label" attributes is used verbatim as
labels. { "name": "typeofbreath", "type": "menulist",...
...el" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "
label" attributes is used verbatim as
labels. { "name": "typeofbreath", "type": "menulist", "title": "type of breath", "value": 0, "options": [ { "value": "0", "
label": "fire" }, { "value": "1", "
label": "cold" }, { "value": "2", "
label": "disintegration" } ] } radio displayed as radio buttons. the type of the stored value depends on the default value. the options are specified by a mandatory "options" attribute, that is an array of objects wit...
...And 4 more matches
Boxes - Archive of obsolete content
nd vbox) by default. however, you can easily add this capability with a style change. ...
...wever, you can easily add this capability with a style change. ...
...dd this capability with a style change. ...
...And 4 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. ...
...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 4 more matches
Adding HTML Elements - Archive of obsolete content
or layout in xul. (there are xul elements for doing layout). notice that the prefix html: was added to the front of each tag. this is so that mozilla knows that this is an html tag and not a xul one. if you left out the html: part, the browser would think that the elements were xul elements and they would not display because img, input, table, and so on are not valid xul tags. ...
...l elements for doing layout). notice that the prefix html: was added to the front of each tag. this is so that mozilla knows that this is an html tag and not a xul one. if you left out the html: part, the browser would think that the elements were xul elements and they would not display because img, input, table, and so on are not valid xul tags. in xul, you can add
labels with the description or
label element. ...
...front of each tag. this is so that mozilla knows that this is an html tag and not a xul one. if you left out the html: part, the browser would think that the elements were xul elements and they would not display because img, input, table, and so on are not valid xul tags. in xul, you can add
labels with the description or
label element. you should use these elements when you can. you can also add
labels to controls either by using the html
label element, or you can simply put the text inside another html block element (such as p or div) as in the example below. example 1 : source view <html:p> search for: <html:input id="find-text"/> <button id="okbutton"
label="ok"/> </html:p> this code will cause the text 'search for:' to be displayed, followed by an input element and an ok button. not...
...And 4 more matches
Simple Menu Bars - Archive of obsolete content
cintosh has its own special menu along the top of the screen 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. ...
...olled 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. ...
...u 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. example of a simple menu bar example 1 : source view <toolbox flex="1"> <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> <menu id="edit-menu"
label="edit"> <menupopup id="edit-popup"> <menuitem
label="undo"/> <menuitem
label="redo"/> </menupopup> </menu> </menubar> </toolbox> here, a simple menu bar is created using the menubar element. it will cr...
...And 4 more matches
Tree View Details - Archive of obsolete content
y and constructs a tree from it. this tree will only support a single parent level with an inner child level, but it could be extended to support additional levels without too much effort. we'll examine it piece by piece. <window onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="elementlist" flex="1"> <treecols> <treecol id="element"
label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> </window> we use a simple tree here with no data in the treechildren. the 'init' function is called when the window is loaded to initialize the tree. it simply sets the custom view by retrieving the tree and setting its 'view' property. we will define 'treeview' next. function init() { document.getelementbyid("eleme...
...if not, the function just returns since non-cont...
...if not, the function just returns since non-containers cannot be opened or closed. since the third element in the it...
...And 4 more matches
XUL Questions and Answers - Archive of obsolete content
g if it is possible to have checkbox support for multi column lists. ...
...sheet 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="checkbox" value="1"
label="vghkvghk"/> <lis...
...if user wants checkbox support for multicolumn lists, then they will have to implement one. ...
...And 4 more matches
button - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a button that can be pressed by the user. event handlers can be used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the
label of the button using the
label attribute or by placing content inside the button. more information is available in the xul tutorial. ...
.... event handlers can be used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the
label of the button using the
label attribute or by placing content inside the button. more information is available in the xul tutorial. attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, icon, image,
label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image,
label, open, orient, tabindex, type examples <button
label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. th...
... autocheck type: boolean if this attribute is true or left out, the checked state of the button will be switched each time the button is pressed. if this attribute is false, the checked state must be adjusted manually. ...
...And 4 more matches
listcell - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single cell of a listbox. by default it only contains text but iconic and checkbox listcells are also available. attributes crop, disabled, image,
label, type properties disabled style classes listcell-iconic, examples (example needed) attributes crop type: one of the values below if the
label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the ...
...tirely. 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 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...
...r(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes listcell-iconic use this class to have an image appear on the listcell. specify the image using the image attribute. ...
...And 4 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. ...
... ] 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. ...
...ly 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. 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 tha...
...And 4 more matches
prefwindow - Archive of obsolete content
ttons, currentpane, defaultbutton, lastselected, preferencepanes, type methods acceptdialog, addpane, canceldialog, centerwindowonscreen, getbutton, opensubdialog, openwindow, showpane examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="saveoptions"
label="backups"> <preferences> <preference id="pref-backup" name="myapp.mybackups" type="bool"/> <preference id="pref-backupduration" name="myapp.mybackups.duration" type="int"/> </preferences> <checkbox
label="automatically save backups" preference="pref-backup"/> <textbox
label="duration:" preference="pref-backupduration"/> </prefpane> </prefwindow> attributes ac...
...: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel button which will cancel the operation. help: a help button for displaying help about the dialog. disclosure: a button to show more information. this might be a button or a disclosure triangle. extra1: an optional additional button. you can set its
label with the button
labelextra1 attribute and its command with the ondialogextra1 attribute. extra2: a second optional additional button. you can set its
label with the button
labelextra2 attribute and its command with the ondialogextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma). warning: if the accept a...
...: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel button which will cancel the operation. help: a help button for displaying help about the dialog. disclosure: a button to show more information. this might be a button or a disclosure triangle. extra1: an optional additional button. you can set its
label with the button
labelextra1 attribute and its command with the ondialogextra1 attribute. extra2: a second optional additional button. you can set its
label with the button
labelextra2 attribute and its command with the ondialogextra2 attribute. currentpane type: prefpane element reference to the currently displayed pane. to change the current pane, use the showpane me...
...And 4 more matches
textbox - Archive of obsolete content
tributes | properties | methods | related ] an input field where the user can enter text. it is similar to the html input element. only one line of text is displayed by default. the multiline attribute can be specified to display a field with multiple rows. more information is available in the xul tutorial. ...
...isabled, emptytext, hidespinbuttons, increment,
label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield,
label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select, setselectionrange style classes plain examples <vbox> <
label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attr...
...er box does not have arrow buttons next to it to allow the user to adjust the value. the value may still be adjusted with the keyboard. the default value is false. 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.
label type: string if present and not empty, this will be exposed to screen readers through the
label property. type: integer the maximum value that the scale or number box may be set to. the default value is 100 for scales and infinity for number boxes. maxlength type: integer the maximum number of characters that the textbox allows to be entered. min ...
...And 4 more matches
Example - Learn web development
this the example for a basic payment form for the article how to structure an html form. ...
...t form html content <form method="post"> <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <
label for="title_1"> <input type="radio" id="title_1" name="title" value="a"> ace </
label> </li> <li> <
label for="title_2"> <input type="radio" id="title_2" name="title" value="k" > king </
label> </li> <li> <
label for="title_3"> <input type="radio" id="title_3" name="title" value="q"> queen </
label> </li> </ul> </fieldset> <p> <
label for="...
...le_2" name="title" value="k" > king </
label> </li> <li> <
label for="title_3"> <input type="radio" id="title_3" name="title" value="q"> queen </
label> </li> </ul> </fieldset> <p> <
label for="name"> <span>name: </span> <strong><abbr title="required">*</abbr></strong> </
label> <input type="text" id="name" name="username"> </p> <p> <
label for="mail"> <span>e-mail: </span> <strong><abbr title="required">*</abbr></strong> </
label> <input type="email" id="mail" name="usermail"> </p> <p> <
label for="pwd"> <span>password: </span> <strong><abbr title="required">*</abbr></strong> </
label> ...
...And 4 more matches
Other form controls - Learn web development
cted>cherry</option> <option>lemon</option> </select> if required, the default value for the select box can be set using the selected attribute on the desired <option> element — this option is then preselected when the page loads. the <option> elements can be nested inside <optgroup> elements to create visually associated groups of values: <select id="groups" name="groups"> <optgroup
label="fruits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup
label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> on the <optgroup> element, the value of the
label attribute is displayed before the values of the nested options. the browser usually set...
.... multiple choice select box by default, a select box only lets the user select a single value. by adding the multiple attribute to the <select> element, you can allow users to select several values, by using the default mechanism provided by the operating system (e.g. holding down cmd/ctrl and clicking multiple values on desktop). ...
...select> element, you can allow users to select several values, by using the default mechanism provided by the operating system (e.g. holding down cmd/ctrl and clicking multiple values on desktop). <select id="multi" name="multi" multiple size="2"> <optgroup
label="fruits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup
label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> note: in the case of multiple choice select boxes, you'll notice that the select box no longer displays the values as drop-down content — instead, all values are displayed at once in a list, with the optional size attribute determining the height of the widget. n...
...And 4 more matches
Sending form data - Learn web development
hod the get method is the method used by the browser to ask the server to send back a given resource: "hey server, i want to get this resource." in this case, the browser sends an empty body. because the body is empty, if a form is sent using this method the data sent to the server is appended to the url. ...
...er to ask the server to send back a given resource: "hey server, i want to get this resource." in this case, the browser sends an empty body. because the body is empty, if a form is sent using this method the data sent to the server is appended to the url. consider the following form: <form action="http://www.foo.com" method="get"> <div> <
label for="say">what greeting do you want to say?</
label> <input name="say" id="say" value="hi"> </div> <div> <
label for="to">who do you want to say it to?</
label> <input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> since the get method has been used, you'll see the url www.foo.com/?say=hi&to=mom appear in the browser address bar when you submit the form. the data is appended ...
...n the body of the http request: "hey server, take a look at this data and send me back an appropriate result." if a form is sent using this method, the data is appended to the body of the http request. let's look at an example — this is the same form we looked at in the get section above, but with the method attribute set to post. ...
...And 4 more matches
Accessible Toolkit Checklist
used on the parent window. alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet
label making tab order definable. default tab order should be in document order. tab order must wrap, not have invisible items in tab order dynamically added items must not corrupt the tab cycle or make it disorderly tab cycle must be identical backwards and forwards the f6 and shift+f6 key combinations should cycle through panes in a window making focus visible on a...
...y combinations should cycle through panes in a window making focus visible on any widget, and focus must always be visible shift+f10 or context menu key should work like right click on focused item, and context menu should show just under and to the right of the current focus. 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. the system should require these
labels to be created/associated with each widget, not as a separate static text with no tie to the widget. the msaa support needs to know what
label goes with what widget. msaa support: expose window with role_dialog, unless it's already the standard dialog ...
... supporting the most important basic iaccessible events get_accparent: get the parent of an iaccessible. get_accchildcount: get the number of children of an iaccessible. get_accchild: get the child of an iaccessible. get_accname: get the "name" of the iaccessible, for example the name of a button, checkbox or menu item. this is one reason why a
label must be created together with each widget, rather than separately. 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. get_accrole: get an enumerated value representing what this iaccessible is used for, for example. is it a link, static text, editable text, a checkbox, or a table cell, etc. ...
...And 4 more matches
PKCS11 FAQ
in the regular certificate database. for the sake of completeness, it's also a good idea to expose public key objects. nss falls back to looking for for the existance of public keys to determine if the token may have the corresponding private key while the token is not logged in. ...
...ey objects. nss falls back to looking for for the existance of public keys to determine if the token may have the corresponding private key while the token is not logged in. how are permanent pkcs #11 objects found by nss? that is, which pkcs #11 attributes are used in the object searches?
labels? key ids? key types? these are the general guidelines: user certificates are identified by their
labels. certificates and keys are often looked up by the following methods: by looking up all private keys. by looking up all certificates. certificates may be looked up by
label. by convention, all certificates making up a single personality should have the same
label (that is, a pair of certificates, one for signing and one for key exchange, should have the same
label). s/mime-capable...
... private keys must have the same cka_id value as their corresponding certificate, and this value must be unique on the token. orphaned keys have a cka_id generated from some part of the public key. this value is set when the key is generated, so that nss will be able to find the key when the certificate for that key is loaded. this case is interesting only for read/write tokens. ...
...And 4 more matches
CanvasRenderingContext2D.arcTo() - Web APIs
adius of 50. the lineto() method connects the arc to (20, 20) with a straight line. note that the arc's second control point and the point specified by lineto() are the same, which produces a totally smooth corner. ...
...document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const p0 = { x: 230, y: 20 } const p1 = { x: 90, y: 130 } const p2 = { x: 20, y: 20 } const
labelpoint = function (p) { const offset = 15; ctx.filltext('(' + p.x + ',' + p.y + ')', p.x + offset, p.y + offset); } ctx.beginpath(); ctx.moveto(p0.x, p0.y); ctx.arcto(p1.x, p1.y, p2.x, p2.y, 50); ctx.lineto(p2.x, p2.y);
labelpoint(p0);
labelpoint(p1);
labelpoint(p2); ctx.stroke(); result result of a large radius if you use a relatively large radius, the arc may appear in a place you didn't expect. in this example, the arc's connecting line goes above, instead of below, the coordinate specified by moveto(). this happens because the radius is too large for the arc to fit entirely below the starting point. html ...
...arting point. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(180, 90); ctx.arcto(180,130, 110,130, 130); ctx.lineto(110, 130); ctx.stroke(); result live demo more sophisticated demo of the method. you can play around with range input to see how arc changes. ...
...And 4 more matches
Using FormData Objects - Web APIs
number", serialnumber++); request.send(formdata); this lets you augment the form's data before sending it along, to include additional information that's not necessarily user-editable. sending files using a formdata object you can also send files using formdata. ...
...equest.send(formdata); this lets you augment the form's data before sending it along, to include additional information that's not necessarily user-editable. sending files using a formdata object you can also send files using formdata. ...
...sarily user-editable. sending files using a formdata object you can also send files using formdata. ...
...And 4 more matches
Using the slider role - Accessibility
on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: simple numerical range in the example below, a simple slider is used to select a value between 1 and 100. the current volume is 50. the application will programmatically update the value of aria-valuenow in response to user input. ...
...gy should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: simple numerical range in the example below, a simple slider is used to select a value between 1 and 100. the current volume is 50. the application will programmatically update the value of aria-valuenow in response to user input. ...
...y user input: function outputupdate(vol) { document.queryselector('#volume').value = vol; } example 2: text values sometimes, a slider is used to choose a value that is not, semantically, a number. in these cases, the aria-valuetext attribute is used to provide the appropriate text name for the currently selected value. in the example below, the slider is used to select a day of the week. ...
...And 4 more matches
ARIA annotations - Accessibility
res associated with aria annotations, and have a look at some code examples that show them in action. note: you can find all the examples discussed in this article in a demo file at aria-annotations. aria annotations features the aria attributes providing these new abilities are as follows: aria-description="" — provides a detailed description of an html element, as opposed to the brief
label provided by aria-
label. role="insertion" and role="deletion" — semantically denote html elements whose contents represent an insertion to or deletion from the overall document. these are semantically equivalent to the html <ins> and <del> elements. note that these aren’t part of the new aria annotations features, but they are of central relevance. role="mark" — semantically denotes html e...
...be able to use any of these yet, as screenreader support is currently not there. for the moment, you can see the annotations data being exposed with tools like firefox accessibility inspector. the annotations should just work once screenreader support is added. ...
...bility inspector. the annotations should just work once screenreader support is added. associating annotated elements with their details there are a number of different ways in which you can associate ui features with text
labels or descriptions for accessibility purposes. it is useful to know when to use each. ...
...And 4 more matches
Alerts - Accessibility
on problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...ch are not valid, or a name field which does not contain at least a first name or a surname. the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...a surname. the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...And 4 more matches
Adding captions and subtitles to HTML5 video - Developer guides
5 video. ...
...ish — so we will reference all three of the relevant vtt files by adding <track> elements inside our html5 <video> element: <video id="video" controls preload="metadata"> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <track
label="english" kind="subtitles" srclang="en" src="captions/vtt/sintel-en.vtt" default> <track
label="deutsch" kind="subtitles" srclang="de" src="captions/vtt/sintel-de.vtt"> <track
label="español" kind="subtitles" srclang="es" src="captions/vtt/sintel-es.vtt"> </video> as you can see, each <track> element has the following attributes set: kind is given a value of subtitles, indicating the type of content the files contain
label is given a value indicating which language that subtitle s...
... src is assigned a valid url pointing to the relevant webvtt subtitle file in each case. srclang indicates what language each subtitle files' contents are in. ...
...And 4 more matches
<input type="file"> - HTML: Hypertext Markup Language
its value a string containing one or more of these unique file type specifiers, separated by commas. for example, a file picker that needs content that can be presented as an image, including both standard image formats and pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <
label for="file">choose file to upload</
label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live. regardless of the user's device or operating system, the file input ...
...e with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. ...
...es also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <
label for="profile_pic">choose file to upload</
label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces a similar-looking output to the previous example: note: you can find this example on github too — see the source code, and also see it running live. it may look similar, but if you t...
...And 4 more matches
Inline options - Archive of obsolete content
to set a descri...
...to set a description, either use the desc attribute, or a text node as ...
...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, except the button setting, which is designed more for actions. ...
...And 3 more matches
Drag and Drop Example - Archive of obsolete content
he board only needs to respond to the dragdrop and dragover events. we'll add a boardobserver to the file dragboard.js in a moment. next, a palette will be added to the right side of the window. it will contain three buttons, one to create new buttons, one to create check boxes and the other to create textboxes. this buttons will respond to the draggesture event and start a drag. ...
...a moment. next, a palette will be added to the right side of the window. it will contain three buttons, one to create new buttons, one to create check boxes and the other to create textboxes. this buttons will respond to the draggesture event and start a drag. <vbox> <button
label="button" elem="button" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button
label="check box" elem="checkbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button
label="text box" elem="textbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> </vbox> the nsdraganddrop object will be called to do most of the work. we'll create a listobserver object that will set the data to be dragged. note that each bu...
...in this case, it only accepts text. we don't need to do anything special for the ondragover function, so no code is added in its body. the ondrop handler first uses the createelement function to create a new element of the type stored in the drag ...
...And 3 more matches
id - Archive of obsolete content
« xul reference home id type: unique id a unique identifier so that you can identify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets. ...
...home id type: unique id a unique identifier so that you can identify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets. ...
...parameter to getelementbyid() and other dom functions and to reference the element in style sheets. ...
...And 3 more matches
Extensions - Archive of obsolete content
the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. ...
...the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. ...
...the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. ...
...And 3 more matches
Panels - Archive of obsolete content
will display whatever elements are placed as children of the panel element. for example, the following panel displays a textbox for entering a name. note that the panel is not placed in a separate file and is instead placed inside another window. <?xml-stylesheet href="chrome://global/skin" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button
label="details" type="panel"> <panel id="search-panel"> <
label control="name" value="name:"/> <textbox id="name"/> </panel> </button> </window> many panels will be associated with a button, as in this example. when the button is pressed, the panel is opened. clicking outside the panel or pressing escape will close the panel. you can also place a close button in the panel which will close...
... its topleft corner just underneath the bottom edge of the button, much as a menu does. the position can, however, be changed. for more information about positioning the popup, see positioning popups. only buttons (and toolbarbuttons) have this automatic behaviour which opens the popup when pressed. for other types of elements, you need to use a different technique as in the following example. <
label value="search" popup="search-panel"/> <panel id="search-panel"> <
label control="search" value="terms:"/> <textbox id="search"/> </panel> to attach a panel to an non-button element, for instance to have a panel open when a
label is clicked, use the popup attribute. the popup attribute should be set to the id of a panel within the same document. when the left mouse button is pressed on the...
.../> </panel> to attach a panel to an non-button element, for instance to have a panel open when a
label is clicked, use the popup attribute. the popup attribute should be set to the id of a panel within the same document. when the left mouse button is pressed on the element with the popup attribute, the corresponding panel will be displayed. for instance, to attach the popup defined above to a
label, use the following code: <
label value="search" popup="search-panel"/> the result is a search button which opens a panel for entering the search term. when using the popup attribute, the panel will appear with the top left corner at the mouse position. in this case, you may wish to have the popup appear below the
label instead. the position attribute may be used to control the placement of the ...
...And 3 more matches
Attribute Substitution - Archive of obsolete content
« previousnext » so far, attribute replacement in an action body has been used to replace an entire attribute with the value of a variable. however, you may also replace only part of attribute's value, or use multiple variables in one attribute. ...
...note that variable names must have a space after them as this is how the end of variable is determined. ...
... this is how the end of variable is determined. that is '?name?age' is considered to be a single variable with that name, not two variables together. to use two variables, place a space between them. it is sometimes useful though, to concatenate two values together without a space. this can be done simply by putting two variables next to each other in an attribute value separated by a caret (^). ...
...And 3 more matches
Recursive Generation - Archive of obsolete content
if you look at the graph again, you might begin to see why. in the graph, item c has a relateditem arrow pointing out of it to item d. this extra arrow which neither b or d have causes an extra set of buttons to be created. after generating content, the template builder always repeats the generation for inner levels as far as it can go. thus, the builder can be said to generate content from the graph recursively. ...
... generated after one iteration: <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> <hbox uri="?relateditem"> <button
label="?start"/> <button
label="?relateditem"/> </hbox> </action> </template> <hbox id="http://www.xulplanet.com/rdf/b"> <button
label="http://www.xulplanet.com/rdf/a"/> <button
label="http://www.xulplanet.com/rdf/b"/> </hbox> <hbox id="http://www.xulplanet.com/rdf/c"> <button
label="http://www.xulplanet.com/rdf/a"/> <button
label="http://www.xulplanet.com/rdf/...
...ction> </template> <hbox id="http://www.xulplanet.com/rdf/b"> <button
label="http://www.xulplanet.com/rdf/a"/> <button
label="http://www.xulplanet.com/rdf/b"/> </hbox> <hbox id="http://www.xulplanet.com/rdf/c"> <button
label="http://www.xulplanet.com/rdf/a"/> <button
label="http://www.xulplanet.com/rdf/c"/> </hbox> <hbox id="http://www.xulplanet.com/rdf/d"> <button
label="http://www.xulplanet.com/rdf/a"/> <button
label="http://www.xulplanet.com/rdf/d"/> </hbox> </vbox> for the next iteration, the insertion point will be the three <hbox> elements. however, since c is the only element that will end up having any additional content, only the second <hbox> element will have additional children added to it. for a nested item, the builder processes the query in ...
...And 3 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
suite. the example below will create an autocomplete textbox that will search the user's history. ...
...match, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield,
label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="hist...
...rolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> 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. autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autocompletesearch new in thunderbird 2requires seamonkey 1.1 type: space-separated list of values a space-separated list of search component names, each of which implements the nsiautocompletesearch interfac...
...And 3 more matches
Commands - Archive of obsolete content
cmd_'. you will probably want to use the same id if a command is already being used, however, for your own commands, you can use any command id you wish. to avoid conflicts, you may wish to include the application name in the command id. a simple way of using commands is as follows: example: simple command example 1 : source view <command id="cmd_openhelp" oncommand="alert('help!');"/> <button
label="help" command="cmd_openhelp"/> in this example, instead of placing the oncommand attribute on the button, we instead place it on a command element. the two are then linked using the command attribute, which has the value of the command's id. the result is that when the button is pressed, the command 'cmd_openhelp' is invoked. there are two advantages to using this approach. first, it moves...
... additionally, if you set the disabled attribute on the command, the command will be disabled and it will not be invoked. any buttons and menu items hooked up to it will be disabled automatically. if you re-enable the command, the buttons will become enabled again. example: toggling command disabled example 2 : source view <command id="cmd_openhelp" oncommand="alert('help');"/> <button
label="help" command="cmd_openhelp"/> <button
label="more help" command="cmd_openhelp"/> <button
label="disable" oncommand="document.getelementbyid('cmd_openhelp').setattribute('disabled','true');"/> <button
label="enable" oncommand="document.getelementbyid('cmd_openhelp').removeattribute('disabled');"/> in this example, both buttons use the same command. when the disable button is p...
...the supportscommand method returns true for the 'cmd_delete' command, which is the name of the command used when the delete menu item is selected. for other commands, false should be returned since the ...
...And 3 more matches
More Button Features - Archive of obsolete content
« previousnext » in this section, we will look at some additional features of buttons. adding an image you can add an image to a button by specifying a url in the image attribute. the image is loaded from the url, which can be a relative or absolute url, and then the image is displayed on the button. the button below will have both a
label and the image 'happy.png'. the image will appear to the left of the
label. you can change this position by using two other attributes. this will be explained in a moment. example 1 : source view <button
label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button. this is designed to allow the 'skin' (in this case, the appearance of the image) to be ...
...the style attribute functions similar to its html counterpart. in general, it can be used on all xul elements. note that you really should put the style declarations in a separate style sheet. ...
...nd" style="list-style-image: url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button. the style attribute functions similar to its html counterpart. in general, it can be used on all xul elements. note that you really should put the style declarations in a separate style sheet. positioning the images by default, the image on a button will appear to the left of the text
label. there are two attributes that can be used to control this position. the dir attribute controls the direction of the image and text. by setting this attribute to the value reverse, the image will be placed on the right side of the text. by using the value normal, or leaving the attribute out entirely, the image will be placed on the left side of the text. the orient attribute can be used to place...
...And 3 more matches
Tree Box Objects - Archive of obsolete content
treeboxobject interface. redrawing the tree we already saw the rowcountchanged() function of the tree box object in the previous section. it is used to indicate that one or more rows have been added to the tree or removed from the tree. the tree will redraw the affected area. you don't need to call the rowcountchanged() function when a row has simply changed in some way, for example if a cell's
label changes. in this case, there are other drawing functions that can be used. the simplest is to call invalidaterow() which will redraw a specific row in the tree. the tree will call the view to get the updated data and update the contents of the tree on screen. other redrawing functions are invalidatecell() to redraw only a single cell invalidatecolumn() to redraw a column invalidaterange() t...
...ow. here is a simple example. ...
...){ 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"/> <button lab...
...And 3 more matches
arrowscrollbox - Archive of obsolete content
the mouse over one of the (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...e (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...s a scroll event. more information is available in the xul tutorial. ...
...And 3 more matches
checkbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be turned on and off. this is most commonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a
label, specified with the
label attribute, may be added beside the check box. more information is available in the xul tutorial. ...
... on and off. this is most commonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a
label, specified with the
label attribute, may be added beside the check box. more information is available in the xul tutorial. attributes accesskey, checked, command, crop, disabled, src,
label, preference, tabindex properties accesskey, accessibletype, checked, command, crop, disabled, src,
label, tabindex examples <checkbox
label="enable javascript" checked="true"/> <checkbox
label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appea...
... checked type: boolean indicates whether the element is checked or not. use hasattribute() to determine whether this attribute is set instead of getattribute(). ...
...And 3 more matches
listbox - Archive of obsolete content
em, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem
label="ruby"/> <listitem
label="emerald"/> <listitem
label="sapphire" selected="true"/> <listitem
label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader
label="1ct gem" width="240"/> <listheader
label="price" width="150"/> </listhead> <listcols> <listcol/> <listcol flex="1"/> </listcols> </listbox> var thelist = document.gete...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out tex...
...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...
...And 3 more matches
listcol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column in a listbox. you can make some columns flexible and other columns non-flexible. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a column in a listbox. you can make some columns flexible and other columns non-flexible. ...
...s | properties | methods | related ] a column in a listbox. you can make some columns flexible and other columns non-flexible. ...
...And 3 more matches
prefpane - Archive of obsolete content
ments. both may be specified directly as children of the prefpane element, or the src attribute may be used to put a pane in a separate file. in this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. more information is available in the preferences system article. ...
... element, or the src attribute may be used to put a pane in a separate file. in this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. more information is available in the preferences system article. attributes helpuri, image,
label, onpaneload, selected, src properties image,
label, preferenceelements, preferences, selected, src examples methods preferenceforelement <prefpane id="panegeneral"
label="general" src="chrome://path/to/paneoverlay.xul"/> or <prefpane id="panegeneral"
label="general" onpaneload="ongeneralpaneload(event);"> <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> ... more preferences ... <...
...more ui elements ... </prefpane> attributes helpuri type: uri the uri of the help page associated with a preference panel. the uri will be opened using the help viewer when the help button is pressed. ...
...And 3 more matches
scrollbox - Archive of obsolete content
tional functions that can be used to scroll the content. note that a scrollbox doesn't cause scrollbars to be displayed. it is intended to be used when an application wants to be able to adjust the scroll position itself. if you just want scrollbars to appear, add style='overflow: auto;'. this may also be used with any other container element. ...
...d style='overflow: auto;'. this may also be used with any other container element. examples the following shows the xul for a bunch of
labels. they come out in a box. if their container doesn't give enough room to hold them (geometrically) what happens depends on the enclosing elements; often the content is just clipped off on the bottom or right (depending on what's too big to fit). ...
...any other container element. examples the following shows the xul for a bunch of
labels. they come out in a box. if their container doesn't give enough room to hold them (geometrically) what happens depends on the enclosing elements; often the content is just clipped off on the bottom or right (depending on what's too big to fit). ...
...And 3 more matches
Dialogs in XULRunner - Archive of obsolete content
log. dialog xul files can have dtd, css, and javascript, just like windows. ...
...sion="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" button
labelaccept="set favorite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" button
labelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption
label="select favorite fruit"/> <radiogroup> <radio...
...here is the code needed to open a dialog: function opendialog() { window.opendialog("chrom...
...And 3 more matches
Windows and menus in XULRunner - Archive of obsolete content
ype 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"/> ... </window> notice the references to css and dtd files. the css is used to apply formatting to elements, just as it would in html. the dtd is used to create entity references so strings for titles and
labels are not stored directly in the xul file; this makes updating the text -- and localization of the application -- much easier. the window title is done this way in the above example. also notice the <script> element which is used to include the window’s javascript into the xul file. keeping css, dtd and javascript out of the xul file is considered a best practice. when you launch your xul appli...
... xul menus and toolbars look like: <?xml version="1.0"?> <?xml-stylesheet 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-...
...e;"> <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"> <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;" oncom...
...And 3 more matches
XForms Input Element - Archive of obsolete content
e spec). attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special inputmode - not supported for this control incremental - supported. the default value is 'false'. mozilla extensions
labelposition - only for boolean types: show the
label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms input element can be represented by the following widgets for the spcified data types (or types deriv...
...ent then the bound instance node will be updated when the control loses the focus. checkbox most often used when the form author only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). ...
... loses the focus. checkbox most often used when the form author only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). characteristics used when the instance node is of type xsd:boolean or a type derived from it analogous widgets are <xhtml:input type="checkbox"/> and <xul:checkbox/> the corresponding
label can be displayed before or after the checkbox by using the
labelposition attribute. ...
...And 3 more matches
CSS and JavaScript accessibility best practices - Learn web development
you can be creative with link styles, as long as you keep giving users feedback when they interact with the links. something should definitely happen when states change, and you shouldn't get rid of the pointer cursor or the outline — both are very important accessibility aids for those using keyboard controls. form elements elements to allow users to input data into websites: <div> <
label for="name">enter your name</
label> <input type="text" id="name" name="name"> </div> you can see some good example css in our form-css.html example (see it live also). most of the css you'll write for forms will be for sizing the elements, lining up
labels and inputs, and getting them looking neat and tidy. you shouldn't however deviate too much from the expected visual feedback form elements...
...xt, images, tables, forms and push button that activate functions. as we looked at in our html: a good basis for accessibility article, the key considerations are: good semantics: using the right element for the right job. for example, making sure you use headings and paragraphs, and <button> and <a> elements making sure content is available as text, either directly as text content, good text
labels for form elements, or text alternatives, e.g. alt text for images. we also looked at an example of how to use javascript to build in functionality where it is missing — see building keyboard accessibility back in. this is not ideal — really you should just use the right element for the right job — but it shows that it is possible in situations where for some reason you can't control the ...
... browser). the client-side validation is still really useful for reporting errors — users can know about mistakes they make instantly, rather than having to wait for a round trip to the server and a page reload. this is a definite usability advantage. note: server-side validation has not been implemented in this simple demo. we've made this form validation pretty accessible too. ...
...And 3 more matches
Practical positioning examples - Learn web development
ou can see the finished example running live at hidden-info-panel.html (source code). check it out to get an idea of what you will be building in this section of the article. as a starting point, make a local copy of hidden-info-panel-start.html from our github repo. this doesn't follow on from the previous example, so a fresh start file is required. let's have a look at the html in the file: <
label for="toggle">❔</
label> <input type="checkbox" id="toggle"> <aside> ... </aside> to start with here we've got a <
label> element and an <input> element — <
label> elements are normally used to associate a text
label with a form element for accessibility purposes (allowing a screen user to see what description goes with what form element). here it is associated with the <input> checkbox usin...
... description goes with what form element). here it is associated with the <input> checkbox using the for and id attributes. note: we've put a special question mark character into our html to act as our info icon — this represents the button that will be pressed to show/hide the panel. here we are going to use these elements for a slightly different purpose — another useful side effect of <
label> elements is that you can click a checkbox's
label to check the checkbox, as well as just the checkbox itself. this has led to the well-known checkbox hack, which provides a javascript-free way of controlling an element by toggling a button. the element we'll be controlling is the <aside> element that follows the other two (we've left its contents out of the above code listing for brevity). in t...
...vascript-free way of controlling an element by toggling a button. the element we'll be controlling is the <aside> element that follows the other two (we've left its contents out of the above code listing for brevity). in the below sections we'll explain how this all works. styling the form elements first let's deal with the form elements — add the following css in between your <style> tags:
label[for="toggle"] { font-size: 3rem; position: absolute; top: 4px; right: 5px; z-index: 1; cursor: pointer; } input[type="checkbox"] { position: absolute; top: -100px; } the first rule styles the <
label>; here we've: set a large font-size to make the icon nice and big. set position absolute on it, and used top and right to position it nicely in the top-right corner. set a z-ind...
...And 3 more matches
Styling web forms - Learn web development
remain when using css with forms. these problems can be divided into three categories: the good some elements can be styled with few if any problems across platforms. these include the following elements: <form> <fieldset> and <legend> single-line text <input>s (e.g. type text, url, email...), except for <input type="search">. multi-line <textarea>s buttons (both <input> and <button>s) <
label> <output> the bad some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> we describe how to handle these more specific features in the article advanced form styling. the ugly some elements can't be styled thoroughly using css. these include: <input type="color"> date-related controls su...
...the legend contents will still be spoken in the same way; it is just the visual position that has changed. note: you could also use the transform property to help you with positioning your <legend>. however, when you position it with for example a transform: translatey();, it moves but leaves an ugly ...
...tcard" contact form; see here for the finished version. if you want to follow along with this example, make a local copy of our postcard-start.html file, and follow the below instructions. the html the html is only slightly more involved than the example we used in the first article of this guide; it just has a few extra ids and a heading. ...
...And 3 more matches
Advanced text formatting - Learn web development
t it appears as a description list in the output field. you could try using your own terms and descriptions if you like. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> bacon the glue that binds the world together. eggs the glue that binds the cake together. coffee the drink that gets the world running in the morning. a light brown color.</textarea> <div class="playable-buttons"> <input id="reset" type="...
...con the glue that binds the world together. eggs the glue that binds the cake together. coffee the drink that gets the world running in the morning. ...
...r the confucius quote http://www.affirmationsforpositivethinking.com for "the need to eliminate negative self talk". if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. playable code 2 <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 150px; width: 95%"> <p>hello and welcome to my motivation page. as confucius' quotes site says:</p> <p>it does not matter how slowly you go as long as you do not stop.</p> <p>i also love the concept of positive thinking, and the need to eliminate negative self ...
...And 3 more matches
Getting started with HTML - Learn web development
end of the line. doing this should give the line italic text formatting! see your changes update live in the output area. if you make a mistake, you can clear your work using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="min-height: 100px;width: 95%"> this is my text. </textarea> <div class="controls"> <input id="reset" type="button" value="reset" /> <input id="solution" type="button" value="show solution" /> </div> html { font-family: 'open sans light',helvetica,arial,s...
...ea (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="min-height: 100px;width: 95%"> this is my text. ...
... in the href attribute. remember that you need to include a space between the element name, and between each attribute. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. ...
...And 3 more matches
Useful string methods - Learn web development
is the thing on the left equal to the thing on the right? or in this case, does the method call on the left return the result on the right? hint: in this case it is probably more useful to test whether the method call isn't equal to a certain result. ...
...g 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; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeven...
...e value of the result variable to equal to the final result, not the input. note: a hint — the parameters of the string methods don't have to be string literals; they can also be variables, or even variables with a method being invoked on them. ...
...And 3 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
! {/each} </ul> go back to the app; you'll see something like this: now we've seen that this is working, let's generate a complete todo item with each loop of the {#each} directive, and inside embed the information from the todos array: id, name, and completed. ...
...om the todos array: id, name, and completed. ...
...eted. ...
...And 3 more matches
Handling common accessibility problems - Learn web development
ant to provide text alternatives for audio or support older browsers, a simple text transcript presented somewhere on the page or on a separate page might be a good idea. element relationships and context there are certain features and best practices in html designed to provide context and relationships between elements where none otherwise exists. the three most common examples are links, form
labels, and data tables. the key to accessible link text is that people using screen readers will often use a common feature whereby they pull up a list of all the links on the page. in this case, the link text needs to make sense out of context. for example, a list of links
labeled "click here", "click here", etc. is really bad for accessibility. it is better for link text to make sense in context an...
... text is that people using screen readers will often use a common feature whereby they pull up a list of all the links on the page. in this case, the link text needs to make sense out of context. for example, a list of links
labeled "click here", "click here", etc. is really bad for accessibility. it is better for link text to make sense in context and out of context. next on our list, the form <
label> element is one of the central features that allows us to make forms accessible. ...
...age. in this case, the link text needs to make sense out of context. for example, a list of links
labeled "click here", "click here", etc. is really bad for accessibility. it is better for link text to make sense in context and out of context. next on our list, the form <
label> element is one of the central features that allows us to make forms accessible. the trouble with forms is that you need
labels to say what data should be entered into each form input. each
label needs to be included inside a <
label> to link it unambiguously to its partner form input (each <
label> for attribute value needs to match the form element id value), and it will make sense even if the source order is not completely logical (which to be fair it should be). note: for more information about link text and form lab...
...And 3 more matches
Handling common HTML and CSS problems - Learn web development
forms, such as times, dates, colors, numbers, etc. these are very useful, particularly on mobile platforms, where providing a pain-free way of entering data is very important for the user experience. supporting platforms provide special ui widgets when these input types are used, such as a calendar widget for entering dates. ...
...lors, numbers, etc. these are very useful, particularly on mobile platforms, where providing a pain-free way of entering data is very important for the user experience. supporting platforms provide special ui widgets when these input types are used, such as a calendar widget for entering dates. ...
...le platforms, where providing a pain-free way of entering data is very important for the user experience. supporting platforms provide special ui widgets when these input types are used, such as a calendar widget for entering dates. ...
...And 3 more matches
Gecko info for Windows accessibility vendors
erences with internet explorer for the most part, where we support an msaa feature, we have tried to duplicate internet explorer's use of it. please let us know if you find any differences not listed here: accessible relations are supported the accnavigate() method can be used with new constants defined for gecko. the results are always returned via vt_dispatch. enum { navrelation_
label_for = 0x1002 }; enum { navrelation_description_for = 0x100f }; these two relations can be used on object to determine what form control is being
labelled or desribed. enum { navrelation_
labelled_by = 0x1003 }; enum { navrelation_described_by = 0x100e }; these two relations are they inverse; they can be used on form controls. if the form control has an accname, you can get the iacces...
...num { navrelation_description_for = 0x100f }; these two relations can be used on object to determine what form control is being
labelled or desribed. enum { navrelation_
labelled_by = 0x1003 }; enum { navrelation_described_by = 0x100e }; these two relations are they inverse; they can be used on form controls. if the form control has an accname, you can get the iaccessible that it was
labelled by in order to get more formatting information. it is also useful to check for a description. note that the
label and description relations may be used to prevent redundant information from being presented by the screen reader, since the
label and description can occur both on their own, and in the name or description fields of an iaccessible. enum { navrelation_default_button = 0x100d...
...ferences with ie role_cell html: <td> dhtml: role="wairole:gridcell" sets state_readonly in normal table. sets state_focusable in data grids and spreadsheets clears state_readonly in spreadsheets. sets state_selected in spreadsheets when a cell has selection. role_link xul: <
label class="text-link"> -- this should be changed, we need a real <link> widget for xul html: <a> and <area> sets state_linked if it is pointing somewhere. sets state_traversed if link has been visited. sets state_selectable if it is an html named anchor accvalue() exposes the url that is pointed to role_helpballoon not suppor...
...And 3 more matches
Profiling with the Firefox Profiler
lable in b2g repository. $ gecko_objdir=<objdir> product_out=<objdir> target_tools_prefix= \ ./scripts/profile-symbolicate.py -o run.symb.cleo run.cleo clone cleopatra and start the server with ./run_webserver.sh. access cleopatra from your web browser by loading the page localhost:8000, and upload run.symb.cleo to render the profile with most of the symbol information. native stack vs.
label stack the profiler periodically samples the stack of the selected threads in firefox and collects a stack trace. this stack trace is the combined stack of three different stacks: the native stack, the javascript stack, and the
label stack. native stack the native stack is the regular c / c++ / rust function stack that you know from your debugger. it's only collected if the "stack walk" checkbo...
... the stacks you see in the ui are chains of these tags. this is good for highlighting particularly interesting parts of the code, but they miss out on un-annotated areas of the code base, and give no visibility into system libraries or drivers. ...
...ck. native stack the native stack is the regular c / c++ / rust function stack that you know from your debugger. it's only collected if the "stack walk" checkbox in the gecko profiler add-on's settings is checked. javascript stack the javascript stack is collected by the js engine. this is controlled by the "javascript" checkbox in the gecko profiler add-on's settings panel.
label stack the
label stack (formerly called "pseudo stack") uses function entry/exit tags added by hand to important points in the code base. the stacks you see in the ui are chains of these tags. this is good for highlighting particularly interesting parts of the code, but they miss out on un-annotated areas of the code base, and give no visibility into system libraries or drivers. tagging is done by adding macro...
...And 3 more matches
Key Values - Web APIs
of "super" and "hyper". [5] chrome 67 and firefox 63 now correctly interpret the right alt key for keyboard layouts which map that key to altgr. see firefox bug bug 900750 and chrome bug 25503 for further details. whitespace keys keyboardevent.key value description virtual keycode windows mac linux android "enter" the enter or ↵ key (sometimes
labeled return). vk_return (0x0d) kvk_return (0x24) kvk_ansi_keypadenter (0x4c) kvk_powerbook_keypadenter (0x34) gdk_key_return (0xff0d) gdk_key_kp_enter (0xff8d) gdk_key_iso_enter (0xfe34) gdk_key_3270_enter (0xfd1e) qt::key_return (0x01000004) qt::key_enter (0x01000005) keycode_enter (66) keycode_numpad_enter (160) keycode_dpad_center (23) "tab...
...016) keycode_page_up (92) [1] internet explorer, edge (16 and earlier), and firefox (36 and earlier) use "left", "right", "up", and "down" instead of "arrowleft", "arrowright", "arrowup", and "arrowdown". editing keys keyboardevent.key value description virtual keycode windows mac linux android "backspace" the backspace key. this key is
labeled delete on mac keyboards. vk_back (0x08) kvk_delete (0x33) gdk_key_backspace (0xff08) qt::key_backspace (0x01000003) keycode_del (67) "clear" the clear key. removes the currently selected input. vk_clear (0x0c) vk_oem_clear (0xfe) kvk_ansi_keypadclear (0x47) gdk_key_clear (0xff0b) qt::key_clear (0x0100000b) keycode_clear (28) "copy" the...
...ior to firefox 37, this key generated the key value "unidentified". application selector keys some keyboards offer special keys for launching or switching to certain common applications. key values for those are listed here. keyboardevent.key value description virtual keycode windows mac linux android "launchcalculator" [5] the calculator key, often
labeled with an icon. this is often used as a generic application launcher key (appcommand_launch_app2). appcommand_launch_app2 gdk_key_calculator (0x1008ff1d) qt::key_calculator (0x010000cb) keycode_calculator (210) "launchcalendar" [5] the calendar key. often
labeled with an icon. gdk_key_calendar (0x1008ff20) qt::key_calendar (0x010000e4) keycode_calend...
...And 3 more matches
Using the MediaStream Recording API - Web APIs
px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9. ...
...eckbox hack for showing/hiding this is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <
label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
...s the fact that you can click on the <
label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
...And 3 more matches
Using the aria-required attribute - Accessibility
ssistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...s should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...ly change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...And 3 more matches
Operable - Accessibility
sible, then use css features like positioning to handle the layout. 2.4.4 link purpose (in context) (a) the purpose/destination of a link can be determined from the link text, or from its surroundings (e.g. the surrounding text). exceptions are where the link purpose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this). see meaningful text
labels. also note that you should minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screenreader users, who will often bring up a list of the links out of context — several links all
labelled "click here", "click here", "click here" would be confusing. 2.4.5 multiple navigation mechanisms (aa) you should provide at l...
..., breadcrumb trail, site search, site map, list of related links, etc. the only exception to this is where a page is one step in a process, so should only logically have links to the previous and next steps. most of these mechanisms can be created using simple html features, for example see search field, creating a navigation menu, styling links as buttons. 2.4.6 headings and
labels (aa) heading (e.g. <h2>) and <
label> elements clearly describe the purpose of the content and form elements they are supposed to be describing. see ui controls, meaningful text
labels, the basics of headings and paragraphs, the <
label> element. note that you should avoid duplicating headings or
labels (e.g. multiple instances of "further information"), unless the structure allows...
...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 different places. this can cause problems for screenreader users, who will often bring up a list of the links out of context — several links all
labelled "click here", "click here", "click here" would be confusing. 2.4.10 section headings (aaa) as well as creating a useful docume...
...And 3 more matches
:placeholder-shown - CSS: Cascading Style Sheets
the way overflowing text is displayed. html <input id="input1" placeholder="name, rank, and serial number"> <br><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input field the following example highlights the branch and id code fields with a custom style. ...
... html <input id="input1" placeholder="name, rank, and serial number"> <br><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input field the following example highlights the branch and id code fields with a custom style. ...
...><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input field the following example highlights the branch and id code fields with a custom style. ...
...And 3 more matches
Box-shadow generator - CSS: Cascading Style Sheets
fore"> :before <span class="delete" data-type="disable"></span> </div> <div class="button" id="after" data-type="subject" data-title=":after"> :after <span class="delete" data-type="disable"></span> </div> <div class="ui-checkbox" data-topic='before' data-
label=":before"></div> <div class="ui-checkbox" data-topic='after' data-
label=":after"></div> </div> <div id="preview"> <div id="obj-element"> <div class="content"> </div> <div id="obj-before"> </div> <div id="obj-after"> </div> </div> </div> </div> ...
...webkit-box-sizing: border-box; box-sizing: border-box; } /* * ui button */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox >
label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: ce...
...mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox >
label:hover { cursor: pointer; } .ui-checkbox > input:checked +
label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } /* * box shadow generator tool */ body { max-width: 1000px; height: 800px; margin: 20px auto 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box...
...And 3 more matches
Constraint validation - Developer guides
land), but some countries have postal codes with only a fixed number of digits; others, like the uk, have more complex structures, allowing letters at some specific positions. note: this is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. ...
...s have postal codes with only a fixed number of digits; others, like the uk, have more complex structures, allowing letters at some specific positions. note: this is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. ...
...of digits; others, like the uk, have more complex structures, allowing letters at some specific positions. note: this is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. ...
...And 3 more matches
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
this technique is useful for situations where there is mor...
...ss criterion 2.4.1 | w3c understanding wcag 2.0 understanding success criterion 2.4.6 | w3c understanding wcag 2.0 understanding success criterion 2.4.10 | w3c understanding wcag 2.0
labeling section content another common navigation technique for users of screen reading software is to generate a list of sectioning content and use it to determine the page's layout. sectioning content can be
labeled using a combination of the aria-
labelledby and id attributes, with the
label concisely describing the purpose of the section. ...
...ading software is to generate a list of sectioning content and use it to determine the page's layout. sectioning 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. ...
...And 3 more matches
<input type="submit"> - HTML: Hypertext Markup Language
<input> elements of type submit are rendered as buttons. when the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server. ...
... to submit the form to the server. <input type="submit" value="send request"> value a domstring used as the button's
label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's
label. buttons do not have a true value otherwise. <input type="submit" value="send request"> if you don't specify a value, the button will have a default
label, chosen by the user agent. ...
...tes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's
label. buttons do not have a true value otherwise. <input type="submit" value="send request"> if you don't specify a value, the button will have a default
label, chosen by the user agent. ...
...And 3 more matches
continue - JavaScript
the continue statement terminates execution of the statements in the current iteration of the current or
labeled loop, and continues execution of the loop with the next iteration. the source for this interactive example is stored in a github repository. if 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 continue [
label];
label identifier associated with the
label of the statement. description in contrast to the break statement, continue does not terminate the execution of the loop entirely: instead, in a while loop, it jumps back to the condition. ...
... examples using continue with while the following example shows a while loop that has a continue statement that executes when the value of i is 3. ...
... examples using continue with while the following example shows a while loop that has a continue statement that executes when the value of i is 3. thus, n takes on the values 1, 3, 7, and 12. ...
...And 3 more matches
Localization - Archive of obsolete content
calized strings from html, add a data-l10n-id attribute to the html tag where you want the localized string to appear, and assign the identifier to it: <html> <body> <h1 data-l10n-id="hello_id"></h1> </body> </html> then you can use this html file to build your interface, for example inside a panel: var button = require("sdk/ui/button/action").actionbutton({ id: "localized-hello",
label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which provide translations of hello_id, the panel will now display "hello!" or "bonjour !", according to the current locale: t...
...l using a statement like: # does not work. html tags are inserted as text. ...
..._id= <blink>hello!</blink> localizing element attributes this feature is new in firefox 39 you can localize certain attributes of elements with an l10n-id by setting its value with l10n-id.attributename in the properties file like: hello_id.accesskey= h the following attributes are supported: accesskey alt
label title placeholder further the localization of the aria attributes aria-
label, aria-valuetext and aria-moz-hint are supported with the same aliases as on firefox os: aria
label ariavaluetext ariamozhint using localized strings in javascript to reference localized strings from your main add-on code, you do this: var _ = require("sdk/l10n").get; console.log(_("hello_id")); assigning to "_" in particular is not required, but is a convention from the gettext tools and...
...And 2 more matches
Custom XUL Elements with XBL - Archive of obsolete content
ip with each other, it makes sense to keep them together. as for the css file, it's usually good to have a single file declaring all bindings in your extension. content under the content tag you define the xul content that will be displayed for your element. ...
...s in your extension. content under the content tag you define the xul content that will be displayed for your element. <content> <xul:hbox> <xul:image class="xulshoolhello-person-image" xbl:inherits="src=image" /> <xul:vbox flex="1"> <xul:
label xbl:inherits="value=name" /> <xul:description xbl:inherits="value=greeting" /> </xul:vbox> <xul:vbox> <xul:button
label="&xulshoolhello.remove.
label;" accesskey="&xulshoolhello.remove.accesskey;" oncommand="document.getbindingparent(this).remove(event);" /> </xul:vbox> </xul:hbox> </content> our element is very simple, displaying an image, a couple of text lines and a button. here are a couple of important things to notice: the "xul:" namespace must be used for all xul tags you have in ...
...to notice: the "xul:" namespace must be used for all xul tags you have in your content. the xbl:inherits attribute lets your inner xul use the attributes that are set on the node. so, if you have this: <xshelloperson name="pete" greeting="good morning" image="" />, then those attribute values are "inherited" to the content nodes that have this special attribute. the value attribute of the xul:
label element would be "pete". the oncommand attribute of the button has some code you've probably never seen before: document.getbindingparent(this). this code gets the dom object that corresponds to the xshelloperson tag, allowing you access to its methods and properties. in this case we're calling the remove method, which we will discuss later on. if you need to create a container element, or any...
...And 2 more matches
Settings - Archive of obsolete content
k will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...ers of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
... open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...And 2 more matches
Settings - Archive of obsolete content
will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...rs of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
... open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...And 2 more matches
Positioning - Archive of obsolete content
y 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_before' location, which will cause the popup t...
...there are several possible values for the position attribute, described here, along with images which show how a popup would be aligned in each case. the following assumes a left to right user interface. for right to left user interfaces, the same values should be used, but will cause the popup to appear and be aligned on the opposite side. ...
... if the menupopup did not have a position attribute, the popup would appear at its default position, in this case, the mouse position. when opening a popup via a script using the openpopup method, the second argument may be used to specify the position instead of using the position attribute. for example, the following might be used with the above example to open the popup: menupopup.openpopup(
label, "end_before", 0, 0, false, false); note that the position has been set to 'end_before', as above. when both are used, the value supplied to openpopup overrides the attribute. however, if the attributesoverride argument to openpopup (the last argument, false in the example above) was true, the attribute would override the value supplied to openpopup. this allows the script and xul code to coord...
...And 2 more matches
Building Hierarchical Trees - Archive of obsolete content
examined for results using the photo as the starting point instead of the top level ref value. ...
... point instead of the top level ref value. ...
...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.1/title"/> </treerow> </treeitem> </t...
...And 2 more matches
Sorting Results - Archive of obsolete content
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 ?date variable. when the sort is ascending, the tree rows will be sorted in alphabetical order. when the sort is descending, the tree rows will be sorted in the reverse order. for natural sorting, the rows will ...
... sorted by other means. if you don't want to allow sorting by a certain column, you can leave out the sort attribute. only specify this attribute on columns that you wish to allow the user to sort by. here is a complete example of sorting a tree. the sort attribute should be set to the variable that holds the values to sort by. usually, this would be the same variable that is used to generate the
label for the cells in that column, however this is not actually necessary. for instance, in the example the second column sorts by date, but if you were to use a different variable such as ?description, the tree would sort by the value of the description variable for each row. in almost all situations however, you would normally sort using the same variable used for the
label value. however, one situa...
.../rdf:rdf> you can also specify parsetype="integer" for numbers which will allow sorting numerically. by specifing different types for different values, you can sort alphabetically, numerically or by date. if you are using the simple rdf query syntax, there are no variables, so you need to specify the full predicate including the rdf: prefix in the sort attribute. for instance: <treecol id="name"
label="name" sort="rdf:http://purl.org/dc/elements/1.1/title" flex="1"/> note that all of this discussion about sorting only applies to tree builders. for other elements or content trees, sorting is done by placing the attributes on the root element. content sorting for content builders (templates that do not use flags="dont-build-content"), sorting is done by placing the sort and sortdirection attrib...
...And 2 more matches
Static Content - Archive of obsolete content
ontent 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 menulist would have one i...
...ue="?country"/> </menupopup> </action> </template> </menulist> the only difference between the previous example and this one is that the menulist element has some additional content added before 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 menulist would have one item in it, with the
label 'all'. the template generates two results as before, one for each country, and appends a menuitem for each one. one interesting thing about this example is that only one menupopup will be created, even though there are two in the code, one outside the template and another one inside the action body. this demonstrates how the template builder generates content, and the specifics of how this is don...
...And 2 more matches
XML Templates - Archive of obsolete content
n 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 each result, whic...
...s 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. for an rdf query, the uri attribute specifies the member variable; for an xml query the member variable is always '?' so the value of the uri attribute for xml templates should always be the single question mark character as in this example. the
label attribute has been set to a special value ?name. when a question mark character followed by a string appears in an attribute value, the
label value is not directly, but instead the value of an attribute for the source xml is used. for each node generated by the xpath expression used in the query, the attribute on the generated xml node is taken and substituted for the question mark and following ...
...
label value is not directly, but instead the value of an attribute for the source xml is used. for each node generated by the xpath expression used in the query, the attribute on the generated xml node is taken and substituted for the question mark and following string. in the above example, the use of the ?name value, causes the name attribute on each result node to be used as the value of the
label. you can see the name attributes in the original xml data above. this substitution occurs for any attribute within the action body, so you can also set other attributes with this technique. in this example, an hbox element containing a button and a
label is generated for each result. <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> ...
...And 2 more matches
Adding Event Handlers - Archive of obsolete content
ld be the event name preceded by the word 'on'. for example, the corresponding attribute for the 'command' event is 'oncommand'. the value of the attribute should be some script that should be executed when the event occurs. typically, this code will be short or just call a function defined in a separate script. ...
...if a second listener (the oncommand attribute) were placed on the button, its code will be called first, followed by the handler on the vbox. ...
...if a second listener (the oncommand attribute) were placed on the button, its code will be called first, followed by the handler on the vbox. event handlers are passed the event object as an implied argument called 'event'. ...
...And 2 more matches
Adding Style Sheets - Archive of obsolete content
manifest file and install the skin. our find files dialog example let's modify the find files 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"?> ... ...
...log 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"?> ... ...
...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"?> ... ...
...And 2 more matches
Creating Dialogs - Archive of obsolete content
is pressed and the docancel() function is called when the cancel button is pressed. the two functions dook() and docancel() both return true, which indicates that the dialog should be closed. if the dialog shouldn't be closed, false should be returned instead. this would be used, for example, if an invalid value was entered in a field in the dialog. amongst other useful attributes are button
labelaccept -
label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the
label attributes are required by remote sites and are probably missing in the above examples due to bug 224996. example dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chro...
...re probably missing in the above examples due to bug 224996. ...
...> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" button
labelaccept="set favourite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" button
labelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption
label="select favourite fruit"/> <radio id="orange"
label="oranges because they are fruity"/> <r...
...And 2 more matches
Groupboxes - Archive of obsolete content
describes a way to include elements into groups groupboxes the groupbox element is used to group related xul elements together, much like the html fieldset element is used to group html elements. the groupbox is a type of box, and the elements it contains are aligned according to the xul box rules. however, there are several differences between groupboxes and regular boxes: the groupbox can be
labeled using the caption element. the groupbox is displayed in a special way—usually with a beveled border and a caption, although you can change the appearance using css. you can create a caption for your groupbox by inserting a caption element as the first child. groupboxes are box elements, so you can use the box attributes, such as orient and flex. a simple groupbox example the example below ...
......
...the text elements stack in a single column. more complex captions you can also add child elements inside the caption element to create a more complex caption. for example, mozilla's font preferences panel uses a drop-down menu as a caption. although any content can be used, usually you would use a checkbox or dropdown menu. example 2 : source view <groupbox flex="1"> <caption> <checkbox
label="enable backups"/> </caption> <hbox> <
label control="dir" value="directory:"/> <textbox id="dir" flex="1"/> </hbox> <checkbox
label="compress archived files"/> </groupbox> in this example, a checkbox has been used as a caption. we might use a script to enable and disable the contents of the groupbox when the checkbox is checked and unchecked. the groupbox contains a horizontal...
...And 2 more matches
box - Archive of obsolete content
f the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. if orient is set to vertical, the child elements are laid out from top to bottom. child elements do not overlap. the default orientation is horizontal. more information is available in the xul tutorial. ...
...izontal, the child elements are laid out from left to right in the order that they appear in the box. if orient is set to vertical, the child elements are laid out from top to bottom. child elements do not overlap. the default orientation is horizontal. more information is available in the xul tutorial. ...
...ts are laid out from left to right in the order that they appear in the box. if orient is set to vertical, the child elements are laid out from top to bottom. child elements do not overlap. the default orientation is horizontal. more information is available in the xul tutorial. ...
...And 2 more matches
grid - Archive of obsolete content
ements within the rows and use the columns only to define their flexibility and width. whichever of the columns and rows is last in the grid is displayed on top; commonly the columns element appears in the grid first. more information is available in the xul tutorial. example <!-- groupbox containing a grid. ...
...id is displayed on top; commonly the columns element appears in the grid first. more information is available in the xul tutorial. example <!-- groupbox containing a grid. ...
...ormation is available in the xul tutorial. example <!-- groupbox containing a grid. ...
...And 2 more matches
menubar - Archive of obsolete content
g the top of the screen, and all non-menu related elements inside 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. ...
...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. ...
...o 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. ...
...And 2 more matches
tab - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element. the user may click a tab to bring the associated page of the tabbox to the front. more information is available in the xul tutorial. attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image,
label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image,
label, linkedpanel, selected, tabindex, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the character...
... afterselected type: boolean this is set to true if the tab is immediately after the currently selected tab. this is automatically set when needed and you shouldn't adjust it manually. ...
...nd the selected tab. beforeselected type: boolean this is set to true if the tab is immediately before the currently selected tab. this is set automatically set when needed and you shouldn't adjust it manually. this is primarily useful for themes so that they can adjust the appearance of the area around the selected tab. crop type: one of the values below if the
label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
...And 2 more matches
tabbox - Archive of obsolete content
d the second a tabpanels element which contains the contents of the pages. more information is available in the xul tutorial. ...
...t which contains the contents of the pages. more information is available in the xul tutorial. ...
...of the pages. more information is available in the xul tutorial. ...
...And 2 more matches
Theme changes in Firefox 2 - Archive of obsolete content
ected="true"] you may of course wish to change other styles as well. feeds/addfeedreader.css this is a new file in firefox 2. it's used to skin the window displayed to add a new feed reader, which is defined in the file browser/feeds/addfeedreader.xul. #imagebox the box that displays the feed icon. #content style information for the content area of the window. #site
label style information for the site
label. feeds/subscribe.css this is a new file in firefox 2. it skins the window displayed to subscribe to an rss feed, which is at browser/feeds/subscribe.xhtml. #application #feedbody #feedchangesubscribeoptions #feederror #feedheader #feedheader[firstrun="true"] #feedheader[firstrun="true"] #feedintrotext #feedheader[firstrun="true"] #feeds...
...mode="text"] .toolbarbutton-1 > stack > toolbarbutton > .toolbarbutton-text toolbar[mode="text"] .toolbarbutton-icon you may wish to change other styles as well. ...
...ors #extensioncontributors #extensioncreator
label the following styles were added: .indent .sectiontitle you may wish to make changes to other styles as well. ...
...And 2 more matches
::-ms-check - Archive of obsolete content
*/ color: red; /* this will make the circle red when the button is checked.
...*/ color: red; /* this will make the circle red when the button is checked. */ } input[type=checkbox]...
...*/ color: red; /* this will make the circle red when the button is checked. */ } input[type=checkbox]::-ms-check { border-color: green; /* this will ma...
...And 2 more matches
::-ms-clear - Archive of obsolete content
*/ /* the cross can be...
...*/ /* the cross can be hidden by setting the display attr...
...*/ /* the cross can be hidden by setting the display attribute as "none" */ } result the following screenshot shows what the feature will look like: ...
...And 2 more matches
Video and Audio APIs - Learn web development
tml open the html index file. ...
... the <video> element contain...
... the <video> element contains two <source> elements so that different formats can be loaded depending on the b...
...And 2 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
iew" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far. the "editing" template, when we are editing a todo. we're about to create this. ...
... are just viewing a todo; this is what we’ve used in rest of the tutorial so far. the "editing" template, when we are editing a todo. we're about to create this. ...
...torial so far. the "editing" template, when we are editing a todo. we're about to create this. ...
...And 2 more matches
Using Vue computed properties - Learn web development
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 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...
...d todoitems, and return a string reporting this. computed: { listsummary() { const numberfinisheditems = this.todoitems.filter(item =>item.done).length return `${numberfinisheditems} out of ${this.todoitems.length} items completed` } } now we can add {{listsummary}} directly to our template; we'll add this inside an <h2> element, just above our <ul>. ...
...d: { listsummary() { const numberfinisheditems = this.todoitems.filter(item =>item.done).length return `${numberfinisheditems} out of ${this.todoitems.length} items completed` } } now we can add {{listsummary}} directly to our template; we'll add this inside an <h2> element, just above our <ul>. we'll also add an id and an aria-
labelledby attribute to assign the <h2> contents to be a
label for the <ul> element. ...
...And 2 more matches
Accessibility API cross-reference
specific kind of button that drops down a menu, msaa only buttonmenu n/a n/a expressed with aria-haspopup on an element with a button role represents the system's caret caret n/a n/a n/a a brief portion of text describing a table or figure. ...
...of button that drops down a menu, msaa only buttonmenu n/a n/a expressed with aria-haspopup on an element with a button role represents the system's caret caret n/a n/a n/a a brief portion of text describing a table or figure. ...
... expressed with aria-haspopup on an element with a button role represents the system's caret caret n/a n/a n/a a brief portion of text describing a table or figure. ...
...And 2 more matches
Application Translation with Mercurial
w to revert changes and also pull changes and reapply your local changes. go back to the localization directory: cd /c/mozilla/de-mozilla-aurora initiate mercurial queues: hg qinit get to know the translation style for having good chances that the translation suggestions get accepted, they should match the translation style of the texts in the application already translated. in general, the
labels in the applications should have the same style like the operating system, e.g. use the same order of subject, verb and objects; decline verbs or not like the operating system does. the following resources can help figuring out the translation style and translate according to them: check your localization team's page by clicking on the team with your language code (e.g. "de" for german) for a...
...(e.g. "de" for german) for a style guide (e.g. style guide for german). transvision offers searching for texts and text ids ("entities" or "keys"), allowing to quickly find translations for already translated texts. microsoft's terminology search allows fast lookups of localized technical terms. choosing what to translate go to the localization status page and click on the '<number> missing'
label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar holding information about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local. the interesting part follows below as list of missing texts. the first line shows the locale for which t...
....learnmore and the line <!-- to be removed post-australis --> to the localized file. this text is a comment (which in .dtd files always can be found between <!-- and -->). there is no need to translate this text. ...
...And 2 more matches
Localization content best practices
nd don't have problems working with vcs systems. it's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details. localization files choose good key ids the ids (names) chosen for your keys, regardless of the file format, should always be descriptive of the string, and its role in the interface (button
label, title, etc.). think of them as long variable names. when you have to change a key id, adding a progressive number to the existing key should always be used as a last resort. for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is definitely a better choice for the new string than new-event-header1. if a string is t...
...ng a progressive number to the existing key should always be used as a last resort. for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is definitely a better choice for the new string than new-event-header1. if a string is tied to an accesskey or a tooltip, use string ids that highlight this relation: neweventbtn.
label = add event neweventbtn.accesskey = a neweventbtn.tooltip = add a new event don't duplicate ids if you're adding new strings, check that you're not duplicating an existing id. depending on the parser logic, one of these two translations will be ignored. add localization notes localizers usually work on the localizable files without the context of the source files including the localized stri...
...ings 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 "bookmark" in the button to add a bookmark, and in the header for the next dialog. this won't work in some languages. avoid unnecessary complexity in strings consider this string: privacy-link = <p>by p...
...And 2 more matches
PKCS11 Implement
okeninfo if a token is a permanent device (that is, if the ckf_removable_device flag is not set), nss calls c_gettokeninfo only on startup or when it loads a new module. if the token is a removable device, nss may call c_gettokeninfo anytime it's looking for a new token to check whether the token is write protected, whether it can generate random numbers, and so on. the nss expects ck_token_info.
label to contain the name of the token. if the ckf_write_protected flag is set, nss won't use the token to generate keys. the nss interprets the combination of the ckf_login_required and ckf_user_pin_initialized flags as shown in table 1.1. nss's interpretation of the ckf_login_required and ckf_user_pin_initialized flags cfk_login_required cfk_user_pin_initialized nss assumes that: false fal...
...xample, if a particular token can't do des encryption, nss decrypts the key, then copies it over to the token that can do des encryption. the nss creates certificates as token objects. it loads the token object only if the private key for that certificate exists on the token and was generated by nss. all the fields defined by pkcs #11 for certificates are set. the nss also sets the cka_id and cka_
label attributes for the token. currently, the cka_id attribute is set to the modulus for rsa or to the public value on dsa. the nss may hash this value in the future. in either case, nss does set the cka_id attribute and expects it to remain the same. if a certificate is loaded, the value of the certificate's cka_id attribute must match the value of the cka_id attribute for the corresponding private k...
...ka_id attribute is set to the modulus for rsa or to the public value on dsa. the nss may hash this value in the future. in either case, nss does set the cka_id attribute and expects it to remain the same. if a certificate is loaded, the value of the certificate's cka_id attribute must match the value of the cka_id attribute for the corresponding private key, and the value of the certificate's cka_
label attribute must also match the value of the cka_
label attribute for the private key. for private keys that don't include certificates, nss doesn't set the cka_
label attribute, or sets it to null, until it receives the certificate. c_copyobject the nss rarely calls c_copyobject but may sometimes do so for non-token private keys. c_destroyobject the nss calls c_destroyobject to destroy certifi...
...And 2 more matches
nsIAccessibleRelation
ly. constants constant value description relation_nul 0x00 relation_controlled_by 0x01 some attribute of this object is affected by a target object. relation_controller_for 0x02 this object is interactive and controls some attribute of a target object. ...
...tant value description relation_nul 0x00 relation_controlled_by 0x01 some attribute of this object is affected by a target object. relation_controller_for 0x02 this object is interactive and controls some attribute of a target object. relation_
label_for 0x03 this object is
label for a target object. ...
...elation_nul 0x00 relation_controlled_by 0x01 some attribute of this object is affected by a target object. relation_controller_for 0x02 this object is interactive and controls some attribute of a target object. relation_
label_for 0x03 this object is
label for a target object. relation_
labelled_by 0x04 this object is
labelled by a target object. ...
...And 2 more matches
nsIAccessibleRole
different kinds of information. it is used for xul:statusbar. role_table 24 represents a table that contains rows and columns of cells, and optionally, row headers and column headers. it is used for html:table, role="grid". also refer to the following roles: role_columnheader, role_rowheader, role_column, role_row, role_cell. role_columnheader 25 represents a column header, providing a visual
label for a column in a table. it is used for xul tree column headers, html:th, role="colheader". also refer to role_table. role_rowheader 26 represents a row header, which provides a visual
label for a table row. it is used for role="rowheader". also, see role_table. role_column 27 represents a column of cells within a table. also, see role_table. role_row 28 represents a row of cells within a t...
...mn of cells within a table. also, see role_table. role_row 28 represents a row of cells within a table. also, see role_table. role_cell 29 represents a cell within a table. it is used for html:td, xul:tree cell and xul:listcell. also, see role_table. role_link 30 represents a link to something else. this object might look like text or a graphic, but it acts like a button. it is used for xul:
label@class="text-link", html:a, html:area, xforms:trigger@appearance="minimal". role_helpballoon 31 displays a help topic in the form of a tooltip or help balloon. role_character 32 represents a cartoon-like graphic object, such as microsoft office assistant, which is displayed to provide help to users of an application. role_list 33 represents a list box, allowing the user to select one or more...
...ed for xul:tab, role="treeitem". also refer to role_pagetablist. role_propertypage 38 represents a property sheet. it is used for xul:tabpanel, role="tabpanel". role_indicator 39 represents an indicator, such as a pointer graphic, that points to the current item. role_graphic 40 represents a picture. is is used for xul:image, html:img. role_statictext 41 represents read-only text, such as
labels for other controls or instructions in a dialog box. static text cannot be modified or selected. is is used for xul:
label, xul:description, html:
label, role="
label", or xforms:output. role_text_leaf 42 represents selectable text that allows edits or is designated read-only. role_pushbutton 43 represents a push button control. it is used for xul:button, html:button, role="button", xforms:trigg...
...And 2 more matches
nsIMsgFilter
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder.. ...
...defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri;
label // target
label. ...
... public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri;
label // target
label. ...
...And 2 more matches
Dominators view - Firefox Developer Tools
nators view consists of two panels: the dominators tree panel shows you which nodes in the snapshot are retaining the most memory the retaining paths panel (new in firefox 47) shows the 5 shortest retaining paths for a single node. dominators tree panel the dominators tree tells you which objects in the snapshot are retaining the most memory. in the main part of the ui, the first row is
labeled "gc roots". immediately underneath that is an entry for: every gc root node. in gecko, there is more than one memory graph, and therefore more than one root. there may be many (often temporary) roots. for example: variables allocated on the stack need to be rooted, or internal caches may need to root their elements. any other node that's referenced from two different roots (since in this...
...is very small: almost all of its retained size is in the nodes that it dominates. by clicking on the disclosure arrow next to the function, we can see those nodes. in this way you can quickly get a sense of which objects retain the most memory in the snapshot. you can use alt + click to expand the whole graph under a node. ...
...you can use alt + click to expand the whole graph under a node. call stack in the toolbar at the top of the tool is a dropdown called "
label by": by default, this is set to "type". however, you can set it instead to "call stack" to see exactly where in your code the objects are being allocated. this option is called "allocation stack" in firefox 46. to enable this, you must check the box
labeled "record call stacks" before you run the code that allocates the objects. then take a snapshot, then select "call stack" in the "
label by" drop-down. now the node's name will contain the name of the function that allocated it, and the file, line number and character position of the exact spot where the function allocated it. clicking the file name will take you to that spot in the debugger. ...
...And 2 more matches
HTMLFormElement - Web APIs
info'].value would also work } function setforminfo(f){ // argument should be a form element reference. ...
...(f){ // argument should be a form element reference. ...
...should be a form element reference. ...
...And 2 more matches
The HTML DOM API - Web APIs
htmlbodyelement htmlbuttonelement htmlcanvaselement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldirectoryelement htmldivelement htmlelement htmlembedelement htmlfieldsetelement htmlformelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmliframeelement htmlimageelement htmlinputelement htmllielement html
labelelement htmllegendelement htmllinkelement htmlmapelement htmlmediaelement htmlmenuelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement html...
... 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. ...
...herwise, 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. ...
...And 2 more matches
Using IndexedDB - Web APIs
://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <h1>indexeddb demo: storing blobs, e-publication example</h1> <div class="note"> <p> works and tested with: </p> <div id="compat"> </div> </div> <div id="msg"> </div> <form id="register-form"> <table> <tbody> <tr> <td> <
label for="pub-title" class="required"> title: </
label> </td> <td> <input type="text" id="pub-title" name="pub-title" /> </td> </tr> <tr> <td> <
label for="pub-biblioid" class="required"> bibliographic id:<br/> <span class="note">(isbn, issn, etc.)...
...required"> title: </
label> </td> <td> <input type="text" id="pub-title" name="pub-title" /> </td> </tr> <tr> <td> <
label for="pub-biblioid" class="required"> bibliographic id:<br/> <span class="note">(isbn, issn, etc.)</span> </
label> </td> <td> <input type="text" id="pub-biblioid" name="pub-biblioid"/> </td> </tr> <tr> <td> <
label for="pub-year"> year: </
label> </td> <td> <input type="number" id="pub-year" name="pub-year" /> </td> </tr> ...
...ub-biblioid" name="pub-biblioid"/> </td> </tr> <tr> <td> <
label for="pub-year"> year: </
label> </td> <td> <input type="number" id="pub-year" name="pub-year" /> </td> </tr> </tbody> <tbody> <tr> <td> <
label for="pub-file"> file image: </
label> </td> <td> <input type="file" id="pub-file"/> </td> </tr> <tr> <td> <
label for="pub-file-url"> online-file image url:<br/> <span class="note">(same origin url)</span> </
label> </...
...And 2 more matches
Intersection Observer API - Web APIs
old for each percentage point of visibility; that is, the intersectionobserver.thresholds array is [0.00, 0.01, 0.02, ..., 0.99, 1.00]. the second box has a single threshold, at the 50% mark. the third box has thresholds every 10% of visibility (0%, 10%, 20%, etc.). the last box has thresholds each 25%. ...
...ility; that is, the intersectionobserver.thresholds array is [0.00, 0.01, 0.02, ..., 0.99, 1.00]. the second box has a single threshold, at the 50% mark. the third box has thresholds every 10% of visibility (0%, 10%, 20%, etc.). the last box has thresholds each 25%. ...
...r.thresholds array is [0.00, 0.01, 0.02, ..., 0.99, 1.00]. the second box has a single threshold, at the 50% mark. the third box has thresholds every 10% of visibility (0%, 10%, 20%, etc.). the last box has thresholds each 25%. ...
...And 2 more matches
ARIA live regions - Accessibility
ing because of rapid updates or other reasons, silence them with aria-live="off". dropdown box updates useful onscreen information a website specializing in providing information about planets provides a dropdown box. when a planet is selected from the dropdown, a region on the page is updated with information about the selected planet. ...
...er reasons, silence them with aria-live="off". dropdown box updates useful onscreen information a website specializing in providing information about planets provides a dropdown box. when a planet is selected from the dropdown, a region on the page is updated with information about the selected planet. ...
...uld always present the live region as a whole, even if only part of the region changes. the possible settings are: false or true. the default setting is false. aria-relevant: the aria-relevant=[list_of_changes] is used to set what types of changes are relevant to a live region. the possible settings are one or more of: additions, removals, text, all. the default setting is: additions text. aria-
labelledby: the aria-
labelledby=[idlist] is used to associate a region with its
labels, similar to aria-controls but instead associating
labels to the region. and
label identifiers are separated with a space. aria-describedby: the aria-describedby=[idlist] is used to associate a region with its descriptions, similar to aria-controls but instead associating descriptions to the region and description id...
...And 2 more matches
ARIA: Complementary role - Accessibility
roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <aside> element will automatically communicate a section has a role of complementary. if at all possible, prefer using it instead. ...
...ise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <aside> element will automatically communicate a section has a role of complementary. if at all possible, prefer using it instead. ...
...cult to understand the overall layout of the page. best practices prefer html using the <aside> element will automatically communicate a section has a role of complementary. if at all possible, prefer using it instead.
labeling landmarks multiple landmarks if there is more than one complementary landmark role or <aside> element in a document, provide a
label for each landmark using the aria-
label attribute, or, if the aside has an appropriately descriptive title, point to it with the aria-
labelledby attribute. ...
...And 2 more matches
ARIA: contentinfo role - Accessibility
making it difficult to understand the overall layout of the page. one contentinfo landmark per page the <body> element there should be only one contentinfo landmark per document, used as the immediate descendant of the <body> element. mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer. use other content sectioning elements instead. ...
... only one contentinfo landmark per document, used as the immediate descendant of the <body> element. mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer. use other content sectioning elements instead.
labeling landmarks multiple landmarks if there is more than one contentinfo landmark role or <footer> element in a document, provide a
label with the aria-
label attribute for each landmark. ...
...ediate descendant of the <body> element. mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer. use other content sectioning elements instead.
labeling landmarks multiple landmarks if there is more than one contentinfo landmark role or <footer> element in a document, provide a
label with the aria-
label attribute for each landmark. this
label will allow assitive technology users to quickly understand the purpose of each landmark. <body> ... ...
...And 2 more matches
:default - CSS: Cascading Style Sheets
<input type="radio"> match if they have the checked attribute. <button> matches if it is a <form>’s default submission button: the first <button> in dom order that belongs to the form. this also applies to <input> types that submit forms, like image or submit. ...
...if they have the checked attribute. <button> matches if it is a <form>’s default submission button: the first <button> in dom order that belongs to the form. this also applies to <input> types that submit forms, like image or submit. ...
...rm>’s default submission button: the first <button> in dom order that belongs to the form. this also applies to <input> types that submit forms, like image or submit. ...
...And 2 more matches
:invalid - CSS: Cascading Style Sheets
s any <input> or other <form> element whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
...t whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
...d { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
...And 2 more matches
Border-radius generator - CSS: Cascading Style Sheets
over { background-color: #379b4a; cursor: pointer; } /* * ui component */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox >
label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: ce...
...mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox >
label:hover { cursor: pointer; } .ui-checkbox > input:checked +
label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } body { max-width: 1000px; margin: 0 auto; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -web...
...***************************************************/ /******************************************************************************/ #radius-lock { width: 200px; height: 75px; margin: 30px 0 0 30px; padding: 30px; border: 3px solid #555; border-radius: 10px; position: relative; float: left; } #radius-lock .ui-checkbox { color: #fff; position: absolute; } #radius-lock .ui-checkbox >
label { height: 20px; width: 34px; padding: 0; } #radius-lock .info { height: 20%; width: 100%; line-height: 20%; font-size: 20px; text-align: center; position: relative; top: 40%; } #radius-lock [data-topic="top-left"] { top: 10px; left: 10px; } #radius-lock [data-topic="top-right"] { top: 10px; right: 10px; } #radius-lock [data-topic="bottom-right"] { bottom: 10px; right: 10px; } ...
...And 2 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
orem</div> firefox chrome safari edge checkbox-container div { color: black; -moz-appearance: checkbox-container; -webkit-appearance: checkbox-container; } <div>lorem</div> firefox the element is drawn like a container for a checkbox, which may include a prelighting background effect under certain platforms. ...
...afari edge checkbox-container div { color: black; -moz-appearance: checkbox-container; -webkit-appearance: checkbox-container; } <div>lorem</div> 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. ...
...or: black; -moz-appearance: checkbox-container; -webkit-appearance: checkbox-container; } <div>lorem</div> 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. ...
...And 2 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
d against the value, must have its start anchored to the start of the string and its end anchored to the end of the string, which is slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. ...
...slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. ...
...the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. examples given the following: <p> <
label>enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-
label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-
label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-
label="4-digit number" size="3"/> </
label> </p> here we have 3 sections for a north american phone number with an implicit
label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each. i...
...And 2 more matches
<optgroup> - HTML: Hypertext Markup Language
es 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. ...
... 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. ...
...lean 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. ...
...And 2 more matches
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
able for users who are deaf or when the sound is muted. descriptions textual description of the video content. suitable for users who are blind or where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user.
label a user-readable title of the text track which is used by the browser when listing available text tracks. src address of the track (.vtt file). must be a valid url. this attribute must be specified and its url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text dat...
...ed. usage notes track data types the type of data that track adds to the media is set in the kind attribute, which can take values of subtitles, captions, descriptions, chapters or metadata. the element points to a source file containing timed text that the browser exposes when the user requests additional data. a media element cannot have more than one track with the same kind, srclang, and
label. detecting cue changes the underlying texttrack, indicated by the track property, receives a cuechange event every time the currently-presented cue is changed. this happens even if the track isn't associated with a media element. if the track is associated with a media element, using the <track> element as a child of the <audio> or <video> element, the cuechange event is also sent to the htmlt...
...</video> specifications specification status comment html living standardthe definition of 'track element' in that specification. living standard ...
...And 2 more matches
Example - SVG: Scalable Vector Graphics
very natural-looking behavior. this is done completely in w3c standards–xhtml, svg, and javascript–no flash or any vendor-specific extensions. this example should work in firefox 1.5 and above. ...
...t–no flash or any vendor-specific extensions. this example should work in firefox 1.5 and above. view the example <?xml version='1.0'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>a swarm of motes</title> <style type='text/css'> <![cdata[
label, input { width: 150px; display: block; float: left; margin-bottom: 10px; }
label { text-align: right; width: 75px; padding-right: 20px; } br { clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill-opacity='0.5'/> </svg:svg> <p>a swarm of motes, governed by two simple principles. first, each mote tries to move towards ...
...ilme' href='#'>nick johnson</a> <script type='text/javascript'> <![cdata[ // foil spam bots var email = '@riovia.net'; email ='nick' + email; document.getelementbyid('emailme').href = 'mailto:'+email; ]]> </script> this software is free for you to use in any way whatsoever, and comes with no warranty at all. ...
...And 2 more matches
XUL Migration Guide - Archive of obsolete content
accessing tabbrowser this example uses the action button api, which is only available from firefox 29 onwards. the tabs/utils module gives you direct access to the tabbrowser object and the xul tab ob...
...this is useful, because it means that if a malicious web page is able to inject code into your add-on's context, it is only able to use the apis you have imported. for e...
...rect access to the components object, which you can then use to load and access any xpcom object. the following complete add-on uses nsipromptservice to display an alert dialog: var {cc, ci} = require("chrome"); var promptsvc = cc["@mozilla.org/embedcomp/prompt-service;1"]. getservice(ci.nsipromptservice); require("sdk/ui/button/action").actionbutton({ id: "xpcom-example",
label: "hello from xpcom", icon: "./icon-16.png", onclick: function() { promptsvc.alert(null, "my add-on", "hello from xpcom"); } }); it's good practice to encapsulate code which uses xpcom by packaging it in its own module. for example, we could package the alert feature implemented above using a script like: var {cc, ci} = require("chrome"); var promptsvc = cc["@mozilla.org/embedcomp/pr...
... ci} = require("chrome"); var promptsvc = cc["@mozilla.org/embedcomp/prompt-service;1"]. getservice(ci.nsipromptservice); exports.alert = function(title, text) { promptsvc.alert(null, title, text); }; if we save this as "alert.js" in our add-on's lib directory, we can rewrite main.js to use it as follows: require("sdk/ui/button/action").actionbutton({ id: "xpcom-example",
label: "hello from xpcom", icon: "./icon-16.png", onclick: function() { require("./alert").alert("my add-on", "hello from xpcom"); } }); one of the benefits of this is that we can control which parts of the add-on are granted chrome privileges, making it easier to review and secure the code. security implications we saw above that using powerful low-level modules like tab-browser increase...
simple-storage - Archive of obsolete content
onstruct array objects conditionally in your code, or you may zero them each time the construction code runs. for example, this add-on tries to store the urls of pages the user visits: var ss = require("sdk/simple-storage"); ss.storage.pages = []; require("sdk/tabs").on("ready", function(tab) { ss.storage.pages.push(tab.url); }); require("sdk/ui/button/action").actionbutton({ id: "read",
label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started). line 2 needs to be made conditional, so the array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; deleting data you c...
...ine 2 needs to be made conditional, so the array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; deleting data you can delete properties using the delete operator. ...
... the delete operator. ...
...").actionbutton({ id: "write",
label: "write", icon: "./write.png", onclick: function() { ss.storage.value = 1; console.log("setting value"); } }); require("sdk/ui/button/action").actionbutton({ id: "read",
label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.value); } }); require("sdk/ui/button/action").actionbutton({ id: "delete",
label: "delete", icon: "./delete.png", onclick: function() { delete ss.storage.value; console.log("deleting value"); } }); if you run it, you'll see that after clicking "read" after clicking "delete" gives you the expected output: info: undefined note that to run this add-on you'll have to save icon files named "write.png", "read.png", and "delete.png" to the add-on's "data" directory...
ui - Archive of obsolete content
o button, toolbar, and sidebar ui objects. this module exports constructors for the following: actionbutton togglebutton frame toolbar sidebar each object has its own reference page, linked above: for all the details please refer to the reference page. this page just provides a quick overview. actionbutton an action button is a button in the main firefox toolbar. you give it an icon, a
label, and a click handler: var ui = require("sdk/ui"); var action_button = ui.actionbutton({ id: "my-button",
label: "action button!", icon: "./icon.png", onclick: function(state) { console.log("you clicked '" + state.
label + "'"); } }); you can make a button standalone or add it to a toolbar. if it's standalone, it appears in the toolbar at the top right of the browser window: tog...
...a toolbar gives you a horizontal strip of space which you can use for presenting a more complex user interface. ...
... interface. ...
...you initialize a sidebar with a url pointing to an html docum...
Add a Context Menu Item - Archive of obsolete content
rned 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. ...
...appear: click it, and the selection is logged to the console (or the shell, if you're running an instance of firefox from the command line): info: elephantine lizard details all this add-on does is to construct a context menu item. you don't need to add it: once you have constructed the item, it is automatically added in the correct context. the constructor in this case takes four options:
label, context, contentscript, and onmessage.
label the
label is just the string that's displayed. context the context describes the circumstances in which the item should be shown. the context-menu module provides a number of simple built-in contexts, including this selectioncontext(), which means: display the item when something on the page is selected. if these simple contexts aren't enough, yo...
...age you can add an image to a context menu item with the image option. this is a url pointing to a 16x16 icon that's displayed at the left side of the context menu item. ...
...16.png"), onmessage: function (selectiontext) { console.log(selectiontext); } }); adding an access key new in firefox 35. from firefox 35 you can specify an access key using the accesskey option. this must be a single-character string. ...
Modifying the Page Hosted by a Tab - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to modify the page hosted by a particular tab, load one or more content scripts into it using attach() method of tab object. the job of these scripts is to interact with web content. here's a simple example: var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab",
label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory. you could download this icon: . this add-on creates a button with mozilla favicon as an icon. it has a click handler which fetches the active tab and ...
...he code easier to maintain, debug, and review. to do this, provide option contentscriptfile not contentscript, whose value is a url pointing to one or more content script files. for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab",
label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other. so you can load jquery, and then your content script can use that. loading several content script files the data assigned to con...
... be loaded in the same order as the vector. in the following example, we are loading two scripts, first.js & second.js. both scripts will be executed in the same context, so everything publicly defined in first.js will be accessible from second.js. ...
... injecting css unlike the page-mod api, tab.attach() doesn't enable yo...
Dialogs and Prompts - Archive of obsolete content
ur script. if they return anything but false, the dialog will be closed. buttons in <dialog> predefined there are six button types you can use in the buttons attribute of dialog. they are: accept — ok button. cancel — cancel button. disclosure — more info button. help — help button (doesn't work in thunderbird 1.0 bug 256915) extra1, extra2 — two buttons without any predefined
labels or meaning. extra2 is positioned at the left side of the dialog (by default). for each of these buttons you can set their
label, accesskey and oncommand handler by adding button
label<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.or...
...d handler by adding button
label<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." buttons="accept,cancel,extra1" ondialogaccept="onaccept();" ondialogextra1="onapply();" button
labelextra1="apply" buttonaccesskeyextra1="a"> <!-- content --> </dialog> you can even get the element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types listed above. explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your x...
...nd on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ondialogaccept="alert('ok!');"> <hbox> <
label value="hey!"/> <spacer flex="1"/> <vbox> <button dlgtype="accept"/> <button dlgtype="cancel"/> </vbox> </hbox> </dialog> default button since firefox 1.5, there are defaultbutton attributes and properties on the <dialog> element bug 284776. the possible values for the attribute are the names of buttons listed above, and the default is "accept", for compatibility with previous ver...
...//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="mydialogid" title="my dialog" ondialogaccept="return onok();" onload="onload();" persist="screenx screeny width height" windowtype="mydialogwindowtype"> <script type="application/javascript" src="chrome://myext/content/mydialog.js"/> <grid> <columns><column/><column/></columns> <rows> <row align="center"><
label value="name:"/><textbox id="name"/></row> <row align="center"><
label value="description:"/><textbox id="description"/></row> <row align="center"><spacer/><checkbox id="enabled"
label="check to enable"/></row> </rows> </grid> </dialog> mydialog.js: // called once when the dialog displays function onload() { // use the arguments passed to us by the caller document.getelemen...
Adding Events and Commands - Archive of obsolete content
newest (and preferred) one introduced in firefox 3.5. event handlers can take an event argument, which is an event object that holds information on the event. you can get information on key modifiers (in case the user was holding a modifier key like alt while performing the event), screen coordinates for mouse events, and most importantly, the target element for the event. for example: <button
label="&xulschoolhello.defaultgreeting.
label;" oncommand="xulschoolchrome.browseroverlay.changegreeting(event);" /> then on the javascript code you would have something like this: changegreeting : function(aevent) { // more stuff aevent.target.setattribute("
label", somenewgreeting); } the target in this example is the button element, so clicking on it will change its text. the advantage of u...
... 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 as you wa...
...that this element will observe all attribute changes that happen in the broadcaster. you can have as many elements as you want observing a broadcaster. with that set, all you need to do now is set or remove attributes in the broadcaster using javascript. all nodes observing it will automatically have those attribute values set or removed as well. you can override pre-existing values, such as the
label attribute value in the example. let onlinebroadcaster = document.getelementbyid("xulschoolhello-online-broadcaster"); onlinebroadcaster.setattribute("
label", "something"); you can also have finer-grained control to this behavior by adding the observes element as a child to your observer node. this allows you to choose which attributes you want it to observe. broadcasters allow you to easily ...
...ut they should be used when oncommand is one of the shared attributes. our menu example is in fact better suited for a command. <commandset id="xulschoolhello-commandset"> <command id="xulschoolhello-hello-command" oncommand="xulschoolchrome.browseroverlay.sayhello(event);" /> <!-- more commands. --> </commandset> <!-- more code here... --> <menuitem id="xulschoolhello-hello-menu-item"
label="&xulschoolhello.hello.
label;" accesskey="&xulschoolhello.helloitem.accesskey;" command="xulschoolhello-hello-command" /> commands allow you to keep your javascript calls in a single place, avoiding code repetition and possible bugs. your ui can easily scale this way. you can create an extension that adds toolbar buttons, statusbar buttons and menu items, all with equivalent behavior, and w...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
ause 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. ...
...ect 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. ...
...ider the following xul fragment throughout the rest of this section. <menuitem id="mymenu" oncommand="executesomething(); executesomethingelse();"/> <
label id="my
label" 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("my
label").getattribute("onclick")); alternative: dispatch real events dispatching real events has the added bonus that all other event listeners for that element (and the corresponding bubbling/capturing chain) will fire as well, so this method will have the closed resemblance to a real user event. // fake a command event var event = document.createevent("events"); event.initevent("command", true, tr...
...lance to a real user event. // fake a command event var event = document.createevent("events"); event.initevent("command", true, true); document.getelementbyid("mymenu").dispatchevent(event); // fake a mouse click var mouseevent = document.createevent("mouseevents"); event.initmouseevent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); document.getelementbyid("my
label").dispatchevent(mouseevent); please see the corresponding documentation on how to use and initialize particular event types. alternative: element.click() xul and html elements have a pre-defined .click() method that will fire a synthesized click event. document.getelementbyid("mybutton").click(); alternative: element.docommand() xul elements that have a command (oncommand or command attri...
Monitoring downloads - Archive of obsolete content
ll items in table try { while (statement.executestep()) { var row = document.createelement('listitem'); // add the cells to the row var cell = document.createelement('listcell'); var sourcestr = statement.getstring(0); row.setattribute("tooltiptext", sourcestr); sourcestr = sourcestr.slice(sourcestr.lastindexof("/")+1); cell.setattribute("
label", sourcestr); // source row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute("
label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); // start time cell = document.creat...
...'listcell'); cell.setattribute("
label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); // start time cell = document.createelement('listcell'); var datestr = thedate.tolocalestring(); cell.setattribute("
label", datestr); row.appendchild(cell); thedate = new date(statement.getint64(3)); // end time cell = document.createelement('listcell'); datestr = thedate.tolocalestring(); cell.setattribute("
label", datestr); row.appendchild(cell); var speed = statement.getdouble(4) / 1024.0; cell = document.createelement('listcell'); cell.s...
... row.appendchild(cell); thedate = new date(statement.getint64(3)); // end time cell = document.createelement('listcell'); datestr = thedate.tolocalestring(); cell.setattribute("
label", datestr); row.appendchild(cell); var speed = statement.getdouble(4) / 1024.0; cell = document.createelement('listcell'); cell.setattribute("
label", speed.tofixed(1) + "kb/sec"); cell.setattribute("style", "text-align:right"); row.appendchild(cell); var status = statement.getint32(5); var style = "color:black"; cell = document.createelement('listcell'); var statusstr; switch(status) { case 0: statusstr = "downloading"; break; case 1: statu...
...it starts by opening the sqlite database containing the log information, then creates a select sql statement to pull all entries from the database. to iterate over the result...
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. ...
...ame as put into a group. only one menuitem in each radio group can be checked at a time. ...
statustext - Archive of obsolete content
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. ...
...s 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. ...
...nu bar. ...
...r" 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"/> </statusbar> <script> function setstatusmessage(obj){ document.getelementbyid('mystatuspanel').
label = obj.getattribute('statustext'); } function clearstatusmessage(obj){ document.getelementbyid('mystatuspanel').
label = ''; } </script> see also statusbar and statusbarpanel ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
n 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. ...
...ed 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. ...
...t in the document. appendchild() appends the node after all other nodes, while insertbefore() inserts the node before the node referenced by its second parameter. ...
...anonymous content (xbl) xbl is the language used in mozilla to define new widgets. ...
How to implement a custom XUL query processor component - Archive of obsolete content
we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is i...
...we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. it is used to create an instance ...
...we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. it is used to create an instance of our xpcom object. the contract id of ou...
...<column flex="1"/> <column flex="3"/> <column flex="2"/> <column flex="1"/> </columns> <rows datasources="dummy" ref="." querytype="simpledata"> <template> <row uri="?"> <
label value="?name"/> <
label value="?age"/> <
label value="?hair"/> <
label value="?eye"/> </row> </template> </rows> </grid> </window> a few things to note. we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. it is used to create an instance of our xpcom object. the contract id of our xpcom component should be of the form "@m...
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. ...
......
...l, 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. ...
...you may optionally set a value. the function returns the newly created element. ...
appendNotification - Archive of obsolete content
this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. keep in mind that this is all xul so using html elements for styling might still need additional css in order to work as you might expect. value - value used to identify the notification image - url of image to appear on the notification. ...
...hen the button is activated. this function is passed three arguments: the <notification> the button is associated with the button description as passed to appendnotification. the element which was the target of the button press event. if the return value from this function is not true, then the notification is closed. the notification is also not closed if an error is thrown.
label - the
label to appear on the button popup - the id of a popup for the button. if null, the button is not a button popup (e.g. a menu). the type property must also be set to "menu", or "menu-button". isdefault - if true, this is the default button. there can be only one default button. if no button has this set, the first button in the array is the default. type - a string. valid values are "me...
...thenotification, buttoninfo, eventtarget) { window.alert("button 2 pressed"); //do not prevent notification from closing: }; function testnotificationcallback(reason) { window.alert("reason is: " + reason); }; let notifybox = gbrowser.getnotificationbox(); let buttons = []; let button1 = { isdefault: false, accesskey: "1",
label: "button 1", callback: testnotificationbutton1callback, type: "", // if a popup, then must be: "menu-button" or "menu". popup: null }; buttons.push(button1); let button2 = { isdefault: true, accesskey: "2",
label: "button 2", callback: testnotificationbutton2callback, type: "", // if a popup, then must be: "menu-button"...
...up, then must be: "menu-button" or "menu". popup: null }; buttons.push(button1); let button2 = { isdefault: true, accesskey: "2",
label: "button 2", callback: testnotificationbutton2callback, type: "", // if a popup, then must be: "menu-button" or "menu". ...
Multiple Rules - Archive of obsolete content
the query generates a list of the photos and assigns the title of each photo to the variable '?title'. note that the full query syntax must be used to use conditions within rul...
...this photo is that of the first rule with the button, whereas the content for the other photos is that of the second rule with the normal images. here is another example for an xml source: <radiogroup datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <rule> <where subject="?gender" rel="equals" value="male"/> <action> <radio uri="?"
label="?name is male"/> </action> </rule> <rule> <action> <radio uri="?"
label="?name is female" disabled="true"/> </action> </rule> </template> </radiogroup> in this example, all male people are matched with the first rule, and a radio button is generated for each one. we assume that anyone that isn't male is female and use the second rule to create a disabled ...
...people with only a single name, as 'cleopatra' in this example, won't match any rule so won't have...
...bove, used to calculate the '?letters' variable from the length of the name, minus one for the space character. naturally, this won't work for people with more than two names (joan of arc for instance), but rule conditions allow a number of useful ways to filter results. <rule> <where subject="?name" rel="contains" value=" "/> <where subject="?letters" rel="less" value="15"/> <action> <
label uri="?" value="?name has two names for a total length of ?letters"/> </action> </rule> negating a condition you can reverse a where clause by using the negate attribute. by setting the negate attribute to true, the condition matches only those that don't match the condition, reversing the results that match. for example, these two conditions have the opposite effect. the first matches only r...
Result Generation - Archive of obsolete content
since it's a graph, arrows can point all over the place and nodes can have any number of arrows pointing out of them and pointing at them. and also because it is a graph, there is no real starting point or root node so you can just start anywhere. ...
...since it's a graph, arrows can point all over the place and nodes can have any number of arrows pointing out of them and pointing at them. and also because it is a graph, there is no real starting point or root node so you can just start anywhere. ...
...lowing the arrows to b, c or d. or you could start at b and go to a and then go to c and d, etc. no requirement exists to follow the arrows in the direction they point; you can easily go the other way (though in only one direction within a given series of iterations). the picture was generated from the w3c's rdf validator, a good place to go to check if your rdf is valid. the text in red are the
labels for the arrows, called predicates. in this example, all the arrows have the same
label. usually, this won'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. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://...
...for example, the name of the thing, such as 'fred'. a resource's value is a uri which for your own rdf data you can just make up (though if you plan to use your model with others, it should be unique, preferably a url for a site you own, so as to avoid future conflicts with mixing of other types). we'll use the uri of the resource nodes in a template. in the image, the resource uri's are the blue
labels of each node. there are no literals in this example, but we'll see some later. let's say we want the starting point to be a from the above example graph. we will use a's uri (http://www.xulplanet.com/rdf/a) as the reference starting point. in a xul template, you specify the starting point using the 'ref' attribute. here is an example: <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ...
Simple Query Syntax - Archive of obsolete content
a <query> element is present, the full syntax is used instead. in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated. since the photos list iterates over the children of a container, we can use the simple syntax. here is what it might look like: <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <
label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </template> there is no <query> or <action> element used. instead, the builder uses a default query, and the action is placed directly inside the <template> element. you can see that this code is much simpler than the full syntax. to understand how this works, let's examine how the builder processes a simple query. first, it evaluates...
...matches have been found so the content will be duplicated three times. there are several attributes in the example xul content above that have values prefixed with 'rdf:'. since you can't declare variables in the simple syntax, a different way is used to grab rdf data. the 'rdf:' prefix means look up a predicate pointing out of the node for that result (the child or member node). for example, the
label's value attribute has a value of rdf:http://purl.org/dc/elements/1.1/title'. this means look up the value of the predicate http://purl.org/dc/elements/1.1/title' pointing out of the current result. of course, it should be obvious that this causes the value attribute to be set to the photo's title. you can get other predicates in the same way, just by using the predicate uri and prefixing it with ...
...s/1.1/title' pointing out of the current result. of course, it should be obvious that this causes the value attribute to be set to the photo's title. you can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. you can also combine two in one attribute by separating them with a space or a caret (^) just as you can with the full syntax. for example: <
label value="rdf:http://purl.org/dc/elements/1.1/title http://www.xulplanet.com/rdf/country"/> the 'rdf:' form is really equivalent to the <binding> tag in the full syntax. the subject of the binding is the result member resource, the predicate is the string that comes after 'rdf:' and the object isn't necessary as the value is replaced directly in the attribute. as with bindings, the value is not req...
... to be accepted. for example, to filter for photos with a specific country: <hbox id="photoslist" datasources="template-guide-photos4.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:r="http://www.xulplanet.com/rdf/"> <template> <rule r:country="http://www.daml.org/2001/09/countries/iso#it"> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <
label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </rule> </template> </hbox> this example shows how a single attribute may be used to filter for only those results that have a country set to 'http://www.daml.org/2001/09/countries/iso#it'. photos that do not have this country will not have any content generated for them. the attribute has a namespace that, when expanded, be...
Using Multiple Queries to Generate More Results - Archive of obsolete content
result for each person. a header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
... multiple queries with xml sources you can also use more than query when using an xml source. here is an example which generates two sets of results and shows them together. <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <queryset> <query expr="group[@na...
... </queryset> </template> you can view the example. multiple queries with xml sources you can also use more than query when using an xml source. here is an example which generates two sets of results and shows them together. ...
...g an xml source. here is an example which generates two sets of results and shows them together. ...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
or extensions to add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar. the latter is possible, but is not recommended and is harder to implement. adding a button to the toolbar palette is very easy. just add code like this to your overlay: <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="myextension-button" class="toolbarbutton-1"
label="&toolbarbutton.
label;" tooltiptext="&toolbarbutton.tooltip;" oncommand="myextension.ontoolbarbuttoncommand(event);"/> </toolbarpalette> notes: the id of the palette (browsertoolbarpalette in the example) depends on the window (the parent window of the toolbar you wish to insert a button). see below for the list of common palette ids. class="toolbarbutton-1" makes the toolbar button ap...
...he button is clicked in the oncommand attribute. if you need to handle middle-click, add this line after the oncommand line. onclick="checkformiddleclick(this, event)" you can also handle middle-click and right-click using onclick handler and check event.button in it like this: <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="myextension-button" class="toolbarbutton-1"
label="&toolbarbutton.
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 <toolbarbut...
... 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. ...
...ontent/addressbo...ddressbook.xul thunderbird - 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. ...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
tton_box"> <toolbarbutton id="custom-button-1" position="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 --...
...change the text between double-quote characters on those lines. ...
...change the text between double-quote characters on those lines. optionally remove the sections for toolbars that you do not need. save the file. ...
...r changes take effect when you restart the application. adding more buttons to add another button, edit button.xul. for each toolbar, duplicate the line that specifies custom-button-1, change the new line to specify custom-button-2, and change its position attribute to position the new button in the toolbar. duplicate the last section. in the id and oncommand attributes, change 1 to 2. change the
label, accesskey and tooltiptext attributes to whatever you want. do not change the class attribute. now edit button.css. duplicate the first two lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the curly brace on the last line of the file. for example, you could add this code for testing: 2: function () {...
Advanced Rules - Archive of obsolete content
this will be the variable assigned in the child attribute of the member element. complete tree example the following example shows a complete tree with conditions and an action. ...
...he member element. complete tree example the following example shows a complete tree with conditions and an action. ...
... if using the dont-build-content flag on a tree, replace the content element with ...
... if using the dont-build-content flag on a tree, replace the content element with a treeitem element. adding additional b...
Custom Tree Views - Archive of obsolete content
e 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 to be displayed in the tree, the view object needs to be created which is used to indicate the value of each cell, the total number of rows plus other optional information. the tree will call methods of the view to get the information that it needs to display. in general, ...
...the setview() function has been called in the onload() handler for the window, but you could also set the view later if you wish. you can change the view at any time. one thing to note...
...the setview() function has been called in the onload() handler for the window, but you could also set the view later if you wish. you can change the view at any time. one thing to note is that the getcelltext() function is only called...
...at are currently displayed. in the image, only seven rows are displayed, the last only partially, so getcelltext() will be called only 14 times, one for each row and column. it is called for other rows when the user scrolls through them. this makes the tree much more efficient. note that the view object is also available for trees using the built-in content view. you can use this to get the cell
labels and other information. the nsitreeview interface lists all of the properties and methods that you can implement for the tree view. we'll look at more of these in the next section. next, we'll look at more features of tree views. « previousnext » ...
Keyboard Shortcuts - Archive of obsolete content
bute 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 view <menubar id="sample-menubar"> <menu id="file-menu"
label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem id="close-command"
label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. 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 clipboa...
...sociate the key element directly with the menu command. to do this, also add a key attribute on the menuitem. set its value to the id of the key that you want to use. the example below demonstrates this. example 2 : source view <keyset> <key id="paste-key" modifiers="accel" key="v" oncommand="alert('paste invoked')"/> </keyset> <menubar id="sample-menubar"> <menu id="edit-menu"
label="edit" accesskey="e"> <menupopup id="edit-popup"> <menuitem id="paste-command" accesskey="p" key="paste-key"
label="paste" oncommand="alert('paste invoked')"/> </menupopup> </menu> </menubar> the menuitem's key attribute, which here is paste-key is equal to the id of the defined key. you can use this for additional keys as well to define keyboard shortcuts for ...
...w xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <keyset> <key id="cut_cmd" modifiers="accel" key="x"/> <key id="copy_cmd" modifiers="accel" key="c"/> <key id="paste_cmd" modifiers="accel" key="v"/> <key id="close_cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu"
label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem
label="open search..." accesskey="o"/> <menuitem
label="save search..." accesskey="s"/> <menuseparator/> <menuitem
label="close" accesskey="c" key="close_cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu"
label="edit" accesskey="e"> <menupopup id="edit-popup"...
..."f"> <menupopup id="file-popup"> <menuitem
label="open search..." accesskey="o"/> <menuitem
label="save search..." accesskey="s"/> <menuseparator/> <menuitem
label="close" accesskey="c" key="close_cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu"
label="edit" accesskey="e"> <menupopup id="edit-popup"> <menuitem
label="cut" accesskey="t" key="cut_cmd"/> <menuitem
label="copy" accesskey="c" key="copy_cmd"/> <menuitem
label="paste" accesskey="p" key="paste_cmd" disabled="true"/> </menupopup> </menu> </menubar> </toolbox> </vbox> </window> now we can use those shortcuts to activate the commands. of course, the clipboard commands don't do anything anyway, as we haven't written those scr...
More Event Handlers - Archive of obsolete content
a reference to the element where the event occurred. a similar property currenttarget holds the element that is currently having its event listeners handled. in the example below, currenttarget is always the vbox, whereas target would be the specific element, either the button or checkbox, that was activated. example 1 : source view <vbox oncommand="alert(event.currenttarget.tagname);"> <button
label="ok"/> <checkbox
label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from continuing. depending on how you attach the event listener to an element, there are different ways of doing this...
...s will trigger before any bubbling listeners. if a capturing event stops the event propagation, none of the later capturing listeners, nor any of the bubbling listeners will ever receive notification about the events. to manually stop event propagation, call the event object's stoppropagation method, as in the following example. ...
...at will happen depends on the event and the type of element. for example, the 'popupshowing' 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 ha...
...operties and are relative to the top left corner of the screen. the second set, clientx and clienty, are relative to the top left corner of the document. here is an example which displays the current mouse coordinates: example 4 : source view <script> function updatemousecoordinates(e){ var text = "x:" + e.clientx + " y:" + e.clienty; document.getelementbyid("xy").value = text; } </script> <
label id="xy"/> <hbox width="400" height="400" onmousemove="updatemousecoordinates(event);"/> in this example, the size of the box has been set explicitly so the effect is easier to see. the event handler gets the clientx and clienty properties and creates a string from them. this string is then assigned to the value property of the
label. note that the event argument must be passed to the updatemouse...
XPCOM Examples - Archive of obsolete content
ave already had that knowledge. creating a window menu the list of currently open mozilla windows can be used as an rdf datasource. this allows you 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 bro...
...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. ...
...this value to getwindowforresource() to get a window object. switch the focus to this window. ...
...ce an enumerator just returns a generic object, we need to queryinterface() it to an nsicookie before we can use it. in this case, we just use the instanceof operator to accomplish this. finally, an item is added to the menu for the cookie. the host, name and value properties of the cookie are used for this. menus have an appenditem() function which can be used to add an item to the menu, given a
label and a value. see also more examples are available below. code snippets http://kb.mozillazine.org/category:xpcom_example_code next, we'll look at how to create trees. « previousnext » ...
Using multiple DTDs - Archive of obsolete content
dgets used in all your xul files, additionally to the ones specific to the file. single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element. ...
...o make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element. ...
...our xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element. ...
... with your xul file, you can simply list all of the dtds inside your dtd declaration: <!doctype window [ <!entity % commondtd system "chrome://myextensions/locale/common.dtd"> %commondtd; <!entity % mainwindowdtd system "chrome://myextension/locale/mainwindow.dtd"> %mainwindowdtd; ]> you can now access the entities declared in the dtds as shown above. assume you have an entity okbutton.
label defined in file common.dtd. then accessing entities from both dtds would look like this: <button id="somebutton"
label="&somebutton.
label"> ... <button id="okbutton"
label="&okbutton.
label"> note that there is no such thing as namespaces with multiple dtds. you have to make sure by yourself that the entities defined in the various dtds do not clash. ...
XUL Accesskey FAQ and Policies - Archive of obsolete content
mulating a click on that element. for example, an apply button may have the letter a underlined. on windows and unix, pressing alt+a is a convenient way to push that button. on macintosh, accesskeys are available only in html not in xul, and they are activated using ctrl+letter instead of alt. how is an accesskey added to a form control? an accesskey can be added to an html or xul form control or
label by using the accesskey attribute. for example, here's how we add an accesskey to a xul button: <button
label="apply instantly" accesskey="a" /> apply instantly - or - <button
label="apply instantly" accesskey="a" /> apply instantly in mozilla, we use dtd's for one more layer of abstraction, for purposes of internationalization. the above example should say: ...
...if methods like confirm(), confirmex() or prompt() are being used to create a dialog, use an & before the button or checkbox text to make the next character an accesskey. ...
...e same window. be especially careful of drop down menus in the same window. for example, in the manage bookmarks dialog, don't use f, e, v, t or h (file, edit, view, tasks, help). help wanted: it would be useful to have an automated tool to check for duplicate and missing accesskeys in xul files. make it easy to see use letters at the beginning of the first or second word of the
label. use a distinctive consonant or a vowel in the
label. use letters with wide widths, such as w, m, and capital letters. avoid: letters with descenders, such as p, g, q, or y. example: p, g, q, y. letters next to a letter with a descender. letters that are only one pixel wide, such as i or l. example: i, l. make it easy to remember do the most impor...
...d in windows as well, like properties. 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 ...
caption - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a groupbox. it may contain either a text
label, using the
label attribute, or child elements for a more complex caption. more information is available in the xul tutorial. attributes accesskey, crop, image,
label, tabindex properties accesskey, crop, image,
label, tabindex examples <groupbox> <caption
label="my groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox
label="a checked groupbox"/> </caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the
label attribute for the element. ...
...an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. ...
...e. 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 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. 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...
... user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. crop type: string gets and sets the value of the crop attribute. image type: image url gets and sets the value of the image attribute.
label type: string gets and sets the value of the
label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(...
command - Archive of obsolete content
and 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 broadcaster, commands forward attributes to other elements. more information is available in the xul tutorial. ...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. ...
...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 is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard ...
groupbox - Archive of obsolete content
ng the top of the groupbox. typically, the groupbox will be drawn with a border around it and the caption either above or over the top border, however the actual appearance will be platform specific. on linux, for instance, only the caption appears with no border around the group. more information is available in the xul tutorial. ...
...oupbox will be drawn with a border around it and the caption either above or over the top border, however the actual appearance will be platform specific. on linux, for instance, only the caption appears with no border around the group. more information is available in the xul tutorial. ...
...ound it and the caption either above or over the top border, however the actual appearance will be platform specific. on linux, for instance, only the caption appears with no border around the group. more information is available in the xul tutorial. ...
...the top border, however the actual appearance will be platform specific. on linux, for instance, only the caption appears with no border around the group. more information is available in the xul tutorial. ...
listcols - Archive of obsolete content
ethods | 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. ...
...iner 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. ...
...ed 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. ...
...there should be only one listcols element in a list box. if there is no listcols element, the list box has a single column. ...
notificationbox - Archive of obsolete content
this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. ...
...this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. ...
...this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. ...
...hen the button is activated. this function is passed three arguments: the <notification> the button is associated with the button description as passed to appendnotification. the element which was the target of the button press event. if the return value from this function is not true, then the notification is closed. the notification is also not closed if an error is thrown.
label - the
label to appear on the button popup - the id of a popup for the button. if null, the button is not a button popup (e.g. a menu). the type property must also be set to "menu", or "menu-button". isdefault - if true, this is the default button. there can be only one default button. if no button has this set, the first button in the array is the default. type - a string. valid values are "me...
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. ...
...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. ...
...| 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. ...
richlistbox - Archive of obsolete content
you can click on any richlistitem element and use the keyboard to move the selection around. attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elem...
...eave 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 disabled by setting this attribute to true. 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. seltype type: one of the valu...
...ueryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata additemtoselection( item ) return type: no return value selects the given item, without deselecting any other items that are already selected. 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. clearselection() return type: no return value deselects all of the items. a select event is sent before the items are deselected. ensureelementisvisible( element ) return type: no return value...
...ows are displayed. 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). 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. invertselection() return type: no return value reverses the selected state of all items. selected items become deselected, and deselected items become selected. movebyoffset( offset , isselecting, isselecting...
richlistitem - Archive of obsolete content
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. ...
...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. ...
...wed 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. search
label type: string text used for 'find-as-you-type' (fayt) searching. in situations where the search text is ambiguous or missing, search
label can be used to give context to fayt. if search
label 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 s...
...te("value") do not access or affect the contents displayed to the user. properties accessible type: nsiaccessible returns the accessibility object for the element. control type: element id gets and sets the value of the control attribute. disabled type: boolean gets and sets the value of the disabled attribute.
label type: string gets the concatentation of text from any child
label elements. does not support setting
label values. use the child elements directly to set
label text. search
label type: string gets and sets the value of the search
label attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property i...
toolbar - Archive of obsolete content
when set to false, the default, the toolbar is visible. this only has an effect on...
...when set to false, the default, the toolbar is visible. this only has an effect on windows and needs to be combined with type="menubar" and a menub...
...when set to false, the default, the toolbar is visible. this only has an effect on windows and needs to be combined with type="menubar" and a menubar element. currentset not in seamonkey 1.x type: comma-se...
...from the toolbarpalette. for example, back-button,forward-button,print-button. grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. when set to false, the default, the grippy will be shown. grippytooltiptext seamonkey only type: string the text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed. this would be used to
label the grippy so that the user knows which toolbar it represents. height type: string (representing an integer) the preferred height of the element in pixels. the actual displayed height may be different if the element or its contents have a minimum or maximum height. the css height property may also be used. iconsize type: string indicates whether the toolbar should display large ...
treecell - Archive of obsolete content
also useful for disabling editing of individual treecells. ...
...also useful for disabling editing of individual treecells. ...
...n to be changed, especially useful when <treecol type="checkbox">. also useful for disabling editing of individual treecells. when the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. the tree and treecol must also be marked as editable in order for this to work. the tree must be a content tree for this to work on treecells.
label type: string the
label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value 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 mete...
...ts, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the value of an about attribute on an rdf container. this attribute should be placed alongside the datasources attribute. src type: uri set this to the uri of an image to appear in the tree cell. if this attribute is left out, no image appears. you can have both an image and a
label. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "dat...
XForms Switch Module - Archive of obsolete content
esignated as an event handler using xml events or may also be contained in an action element. in either scenario, it would be triggered by an event. attributes events special case - the idref of a case element to select representations the case element doesn't have a visual representation. ...
...ing xml events or may also be contained in an action element. in either scenario, it would be triggered by an event. attributes events special case - the idref of a case element to select representations the case element doesn't have a visual representation. ...
...ect representations the case element doesn't have a visual representation. ...
... representations the case element doesn't have a visual representation. ...
Audio for Web games - Game development
uerying the playing track's current time gives you enough information to synchronize separate pieces of audio. ...
...me gives you enough information to synchronize separate pieces of audio. ...
...uitar</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-decribedby="guitar-play-
label"> <span id="guitar-play-
label">play</span> </button> </li> <li data-loading="true"> <a href="bassguitar.mp3" class="track">bass guitar</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="bass-play-
label"> <span id="bass-play-
label">play</span> </button> </li> <li data-loading="true"> <a href="drums.mp3" class="track">drums</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="drums-play-
label"> <span id="drums-play-
label">play</span> </button> </li> <li data-loading="true"> <a href="horns.mp3"...
...ss="track">drums</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="drums-play-
label"> <span id="drums-play-
label">play</span> </button> </li> <li data-loading="true"> <a href="horns.mp3" class="track">horns</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="horns-play-
label"> <span id="horns-play-
label">play</span> </button> </li> <li data-loading="true"> <a href="clav.mp3" class="track">clavi</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="clavi-play-
label"> <span id="clavi-play-
label">play</span> </button> </li> </ul> <p class="sourced">all tracks sourced from <...
What is a Domain Name? - Learn web development
supposed to indicate a resource in a particular language or country. tlds containing .gov are only allowed to be used by government departments. the .edu tld is only for use by educational and academic institutions. tlds can contain special as well as latin characters. a tld's maximum length is 63 characters, although most are around 2–3. the full list of tlds is maintained by icann. ...
...ource in a particular language or country. tlds containing .gov are only allowed to be used by government departments. the .edu tld is only for use by educational and academic institutions. tlds can contain special as well as latin characters. a tld's maximum length is 63 characters, although most are around 2–3. the full list of tlds is maintained by icann.
label (or component) the
labels are what follow the tld. ...
...country. tlds containing .gov are only allowed to be used by government departments. the .edu tld is only for use by educational and academic institutions. tlds can contain special as well as latin characters. a tld's maximum length is 63 characters, although most are around 2–3. the full list of tlds is maintained by icann.
label (or component) the
labels are what follow the tld. ...
...gth is 63 characters, although most are around 2–3. the full list of tlds is maintained by icann.
label (or component) the
labels are what follow the tld. a
label is a case-insensitive character sequence anywhere from one to sixty-three characters in length, containing only the letters a through z, digits 0 through 9, and the - character (which may not be the first or last character in the
label). a, 97, and hello-strange-person-16-how-are-you are all examples of valid
labels. the
label located right before the tld is also called a secondary level domain (sld). a domain name can have many
labels (or components). it is not mandatory nor necessary to have 3
labels to form a domain name. for instance, www.inf.ed.ac.uk is a valid domain name. for any domain you control (e.g. mozilla.org), ...
Images in HTML - Learn web development
t is 200px wide and 171px high), then experiment with other values to see what the effect is. set a title on the image. if you make a mistake, you can always reset it using the reset button. ...
...abel">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> <img> </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: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() ...
...ut of the title attribute, remove the title attribute, and put the text inside a <figcaption> element below the image. if you make a mistake, you can always reset it using the reset button. ...
...a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> </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: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() ...
A first splash into JavaScript - Learn web development
min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing game</h1> <p>we have selected a random number between 1 and 100. see if you can guess it in 10 turns or fewer. ...
...argin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing game</h1> <p>we have selected a random number between 1 and 100. see if you can guess it in 10 turns or fewer. ...
... code (note how they are inside a <div> element, which is itself used to select all three later on for resetting, when we restart the game): <div class="resultparas"> <p class="guesses"></p> <p class="lastresult"></p> <p class="loworhi"></p> </div> the next two constants store references to the form text input and submit button and are used to control submitting the guess later on. <
label for="guessfield">enter a guess: </
label><input type="text" id="guessfield" class="guessfield"> <input type="submit" value="submit guess" class="guesssubmit"> our final two variables store a guess count of 1 (used to keep track of how many guesses the player has had), and a reference to a reset button that doesn't exist yet (but will later). note: you'll learn a lot more about variables/cons...
...me'; document.body.append(resetbutton); resetbutton.addeventlistener('click', resetgame); } the first two lines disable the form text input and button by setting their disabled properties to true. this is necessary, because if we didn't, the user could submit more guesses after the game is over, which would mess things up. the next three lines generate a new <button> element, set its text
label to "start new game", and add it to the bottom of our existing html. the final line sets an event listener on our new button so that when it is clicked, a function called resetgame() is run. now we need to define this function too! add the following code, again to the bottom of your javascript: function resetgame() { guesscount = 1; const resetparas = document.queryselectorall('.resultpar...
Arrays - Learn web development
equal to "current item name — $current item price", for example "shoes — $23.99" in each case, so the correct information for each item is printed on the invoice. this is just simple string concatenation, which should be familiar to you. ...
...in an animated scene for example, you might have an array of objects representing the background graphics ...
...e entered into the search input to the start of the array. this can be retrieved using searchinput.value. add a line below the // number 2 comment that removes the value currently at the end of the array. ...
...{ // number 2 } // empty the search input and focus it, ready for the next term to be entered searchinput.value = ''; searchinput.focus(); } } </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: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeven...
Focus management with Vue refs - Learn web development
he 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. update it like this: <button type="button" class="btn" ref="editbutton" @click="toggletoitemeditform"> edit <span class="visually-hidden">{{
label}}</span> </button> to access the value associated with our ref, we use the $refs property provided on our component instance. to see the value of the ref when we click our "edit" button, add a console.log() to our toggletoitemeditform() method, like so: toggletoitemeditform() { console.log(this.$refs.editbutton); this.isediting = true; } if you activate the "edit" button at this point, you...
... tag. runs after the component is deactivated. note: the vue docs provide a nice diagram for visualizing when these hooks happen. this article from the digital ocean community blog dives into the lifecycle methods more deeply. now that we’ve gone over the lifecycle methods, let's use one to trigger focus when our todoitemeditform component is mounted. in todoitemeditform.vue, attach ref="
labelinput" to the <input> element, like so: <input :id="id" ref="
labelinput" type="text" autocomplete="off" v-model.lazy.trim="newname" /> next, add a mounted() property just inside your component object — note that this should not be put inside the methods property, but rather at the same hierarchy level as props, data(), and methods. lifecycle methods are special methods that sit on their own, n...
... property just inside your component object — note that this should not be put inside the methods property, but rather at the same hierarchy level as props, data(), and methods. lifecycle methods are special methods that sit on their own, not alongside the user-defined methods. this should take no inputs. ...
...e put inside the methods property, but rather at the same hierarchy level as props, data(), and methods. lifecycle methods are special methods that sit on their own, not alongside the user-defined methods. this should take no inputs. note that you cannot use an arrow function here since we need access to this to access our
labelinput ref. mounted() { } inside your mounted() method, assign your
labelinput ref to a variable, and then call the focus() function of the ref. you don't have to use $nexttick here because the component has already been added to the dom when mounted() is called. mounted() { const
labelinputref = this.$refs.
labelinput;
labelinputref.focus(); } now when you activate the "edit" button with your keyboard, focus should immediately be moved to the edit <input>. han...
How to implement a custom autocomplete search component
* @return {string} the comment of the result at the given index */ getcommentat: function(index) { if (this._comments) return this._comments[index]; else return ''; }, /** * @return {string} the style hint for the result at the given index */ getstyleat: function(index) { if (!this._comments || !this._comments[index]) return null; // not a category
label, so no special styling if (index == 0) return 'suggestfirst'; // category
label on first line of results return 'suggesthint'; // category
label on any other line of results }, /** * gets the image for the result at the given index * * @return {string} the uri to the image to display */ getimageat : function (index) { return ''; }, /** * get the f...
...n(index) { return this.getvalueat(index); }, /** * removes the value at the given index from the autocomplete results. * if removefromdb is set to true, the value should be removed from * persistent storage as well. ...
...iven index */ getvalueat: function(index) { return this._results[index]; }, /** * get the comment of the result at the given index */ getcommentat: function(index) { return this._comments[index]; }, /** * get the style hint for the result at the given index */ getstyleat: function(index) { if (!this._comments[index]) return null; // not a category
label, so no special styling if (index == 0) return "suggestfirst"; // category
label on first line of results return "suggesthint"; // category
label on any other line of results }, /** * get the image for the result at the given index * the return value is expected to be an uri to the image to display */ getimageat : function (index) { return ""; }, /** ...
...} return simpleautocompletesearchfactory; } you need to explicitly register the component by adding these lines into your chrome.manifest file: component {6224daa1-71x2-4d1a-ad90-01ca1c08e323} components/.js contract @mozilla.org/autocomplete/search;1?name=simple-autocomplete {6224daa1-71x2-4d1a-ad90-01ca1c08e323} you need to add the following method: get
labelat: function(index) { return this._results[index]; } to simpleautocompleteresult use this newly available component in a xul file like this: <textbox id="text1" type="autocomplete" autocompletesearch="simple-autocomplete" showcommentcolumn="true" autocompletesearchparam='[{"value":"mark","comment":"cool dude"},{"value":"mary","comment":"nice lady"},{"value":"jimmy","comm...
Localizing with Koala
n koala file view sidebar filter field and click "search". this will filter the list of files down to the files with "search" in the name. right-click searchbar.dtd file in the sidebar and choose "open file". this file does not yet exist in your locale file structure, so koala will ask if you want to create it. click "ok". when the file is created and opens in a new tab, right-click searchendcap.
label in the sidebar (it's listed under the searchbar.dtd file) and choose "add entity". we're starting by the second entity in this file on purpose, you'll see in a moment how koala nicely handles entity order. the entity was added to the file and the english string is automatically highlighted, so that you can translate it right away. this entity is used in the tooltip that appears when you hover ...
...e starting by the second entity in this file on purpose, you'll see in a moment how koala nicely handles entity order. the entity was added to the file and the english string is automatically highlighted, so that you can translate it right away. this entity is used in the tooltip that appears when you hover over the magnifying glass icon in the search bar. once you translated the searchendcap.
label entity, add the other one from this file, i.e. cmd_enginemanager.
label. you can right-click it and choose "add entity" as you did previously, or just double-click the entity name to add it to the file. note how koala is smart enough to insert this entity before searchendcap.
label. this is helpful for keeping the localization files clean and tidy at all times. the string to translated is selected...
...now let's create the other file. double-click on search.properties and click "ok" when koala asks if you want to create this file. ...
...etail, including the exact list of missing (green "+" icon), obsolete and translated (white circle icon) entities. now that you've translated these 3 strings, let's commit your work to the local hg repository that you created in the "creating a new project" section. committing your work hopefully by now, you have translated 3 strings in the following 2 files: searchbar.dtd: cmd_enginemanager.
label searchendcap.
label search.properties: cmd_addfoundengine it's time to put these files under mercurial's version control system. this will allow you to track changes, export them to remote repositories (first on bitbucket, later on hg.mozilla.org) and revert files to earlier versions in case of errors. version control systems add a lot of transparency to your work and allow others to get i...
Creating localizable web applications
ry, $tab, $page) = explode('/', $path); to get this information directly from the url. after that, it is tempting to use the $category or $tab variables in the interface. however, this is problematic for localization. you probably don't want to localize the urls to keep them uniform across locales as well as to avoid issues with non-latin and/or rtl characters. ...
...on't want to localize the urls to keep them uniform across locales as well as to avoid issues with non-latin and/or rtl characters. so in order to display a localized
label of a category or a tab, you should create a mapping between the non-localizable english names used in the urls and the localizable english strings used in the interface. consider the following example: snippet 1. ...
...for english, add hreflang="en" to links to resources that are not going to be localized or are external to your web application. ...
...part\n" " third part\n" msgstr "" in order to indent your code, you must use string concatenation. see snippet 4 above for an example of how to do this. use gettext contexts depending on context in which it is used, one english string might require two or more different translations. this is particularly true for short strings, like "file" or "log in". for instance, "log in" as a button
label might be translated by a localizer as the imperative, but for a dialog title, the localizer may choose to use a different form, like gerund (much like "logging in"). gettext's context feature allows the developer to distinguish between two identical english strings and disambiguate the translation. use gettext plurals whenever you put numbers in your messages, make it possible to use different ...
NSS Key Log Format
are not affected). distributors can re-enable it at compile time though (using the nss_allow_sslkeylogfile=1 make variable) which is done for the official firefox binaries. (see bug 1188657.) notably, debian does not have this option enabled, see debian bug 842292. this key log file is a series of lines. comment lines begin with a sharp character ('#') and are ignored. ...
...e time though (using the nss_allow_sslkeylogfile=1 make variable) which is done for the official firefox binaries. (see bug 1188657.) notably, debian does not have this option enabled, see debian bug 842292. this key log file is a series of lines. comment lines begin with a sharp character ('#') and are ignored. secrets follow the format <
label> <space> <clientrandom> <space> <secret> where: <
label> describes the following secret. ...
...n enabled, see debian bug 842292. this key log file is a series of lines. comment lines begin with a sharp character ('#') and are ignored. secrets follow the format <
label> <space> <clientrandom> <space> <secret> where: <
label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the
label (see below). ...
...this key log file is a series of lines. comment lines begin with a sharp character ('#') and are ignored. secrets follow the format <
label> <space> <clientrandom> <space> <secret> where: <
label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the
label (see below). ...
nss tech note5
ingsymkey, tobewrappedpvtkey, wrapmech, secparam, &wrappedkey, null);</big> <big><big>transport/store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.</big></big> prepare the args for the unwrap function. ...
... secparam, &wrappedkey, null);</big> <big><big>transport/store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.</big></big> prepare the args for the unwrap function. ...
... secparam, &wrappedkey, null);</big> <big><big>transport/store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.</big></big> prepare the args for the unwrap function. ...
..._unwrap; numattribs = 4; } else if(keytype == ckk_dsa) { attribs[0] = cka_sign; numattribs = 1; } <big>do the unwrap</big> seckeyprivatekey *unwrappedpvtkey = pk11_unwrapprivkey(slot, wrappingsymkey, wrapmech, secparam, &wrappedkey, &
label, pubvalue, token, pr_true /* sensitive */ keytype, attribs, numattribs, null /*wincx*/); clean up pk11_freesymkey(wrappingsymkey); <big>if (secparam) secitem_freeitem(secparam, pr_true);</big> <big>secitem_freeitem(&wrappedkey, pr_true);</big> if (pubvalue) secitem_freeitem(pubvalue, pr_true);...
Parser API
statements surrounded by braces. interface expressionstatement <: statement { type: "expressionstatement"; expression: expression; } an expression statement, i.e., a statement consisting of a single expression. interface ifstatement <: statement { type: "ifstatement"; test: expression; consequent: statement; alternate: statement | null; } an if statement. ...
...e expressionstatement <: statement { type: "expressionstatement"; expression: expression; } an expression statement, i.e., a statement consisting of a single expression. interface ifstatement <: statement { type: "ifstatement"; test: expression; consequent: statement; alternate: statement | null; } an if statement. interface
labeledstatement <: statement { type: "
labeledstatement";
label: identifier; body: statement; } a
labeled statement, i.e., a statement prefixed by a break/continue
label. interface breakstatement <: statement { type: "breakstatement";
label: identifier | null; } a break statement. interface continuestatement <: statement { type: "continuestatement";
label: identifier | null; } a continue statement. interface...
...cation returns: customstatement callback to produce a custom empty statement node. blockstatement(body[, loc]) body: customstatement loc: sourcelocation returns: customstatement callback to produce a custom block statement node. expressionstatement(expr[, loc]) expr: customexpression loc: sourcelocation returns: customstatement callback to produce a custom expression statement node.
labeledstatement(
label, body[, loc])
label: customidentifier body: customstatement loc: sourcelocation returns: customstatement callback to produce a custom
labeled statement node. ifstatement(test, cons, alt[, loc]) test: customexpression cons: customstatement alt: customstatement | null loc: sourcelocation returns: customstatement callback to produce a custom if statement node. switchstatem...
...ck to produce a custom for statement node. forinstatement(left, right, body, isforeach[, loc]) left: customvariabledeclaration | customexpression right: customexpression body: customstatement isforeach: boolean loc: sourcelocation returns: customstatement callback to produce a custom for-in statement node. the isforeach flag indicates whether the node is a for each statement. breakstatement(
label[, loc])
label: customidentifier | null loc: sourcelocation returns: customstatement callback to produce a custom break statement node. continuestatement(
label[, loc])
label: customidentifier | null loc: sourcelocation returns: customstatement callback to produce a custom continue statement node. withstatement(obj, body[, loc]) obj: customexpression body: customstatement loc: sourceloca...
Gecko Roles
ttom of a window that displays information about the current operation, state of the application, or selected object. the status bar has multiple fields, which display different kinds of information. role_table represents a table that contains rows and columns of cells, and optionally, row headers and column headers. role_columnheader represents a column header, providing a visual
label for a column in a table. role_rowheader represents a row header, which provides a visual
label for a table row. role_column represents a column of cells within a table. role_row represents a row of cells within a table. role_cell represents a cell within a table. role_link represents a link to something else. this object might look like text or a graphic, b...
... represents an item in an outline or tree structure. role_pagetab represents a page tab, it is a child of a page tab list. role_propertypage represents a property sheet. role_indicator represents an indicator, such as a pointer graphic, that points to the current item. role_graphic represents a picture. role_statictext represents read-only text, such as
labels for other controls or instructions in a dialog box. static text cannot be modified or selected. role_text_leaf represents selectable text that allows edits or is designated read-only. role_pushbutton represents a push button control. role_checkbutton represents a check box control. role_radiobutton represents an option button, also called a radio button. it is one...
... page tab controls. role_clock represents a control that displays time. role_splitbutton represents a button on a toolbar that has a drop-down list icon directly adjacent to the button. role_ipaddress represents an edit control designed for an internet protocol (ip) address. the edit control is divided into sections for the different parts of the ip address. role_accel_
label represents a
label control that has an accelerator. role_arrow represents an arrow in one of the four cardinal directions. role_canvas represents a control that can be drawn into and is used to trap events. role_check_menu_item represents a menu item with a check box. role_color_chooser represents a specialized dialog that lets the user choose a color. role...
...le bar, border, menu bar, etc. it is often used as the primary window for an application. role_glass_pane a glass pane. a pane that is guaranteed to be painted on top of all panes beneath it. role_html_container a document container for html, whose children represent the document content. role_icon a small fixed size picture, typically used to decorate components. role_
label presents an icon or short string in an interface. role_layered_pane a layered pane. a specialized pane that allows its children to be drawn in layers, providing a form of stacking order. this is usually the pane that holds the menu bar as well as the pane that contains most of the visual components in a window. role_option_pane a specialized pane whose primary use is inside a ...
Building the WebLock UI
user to toggle a particulart state, as the figure above illustrates. in xul individual <radio/> elements are contained within a parent element called <radiogroup/>. grouping radio elements together creates the toggling ui by requiring that one or another of the elements be selected, but not both. the xul that defines the radiogroup in the web lock manager dialog is this: <radiogroup> <radio
label="lock"/> <radio
label="unlock" selected="true"/> </radiogroup> since the weblock component always starts up in the unlocked position, you can add the selected="true" attribute and value on the unlock radio button and reset it dynamically as the user takes action. site adding ui the next step is to create that part of the user interface that lets you add a new site to the white list. there ...
...o include some ui that lets you view the white list or edit it as a list. in this part of the tutorial, however, we only provide the means of adding an url provided as a string (which is not checked for validity) and passing it through to the addsite api we defined in the earlier part of the tutorial. <separator class="thin"/> <hbox align="center"> <textbox id="url.input" flex="1"/> <button
label="add this url" oncommand="addthissite();"/> </hbox> this snippet introduces a couple of new general layout widgets in xul. the separator that appears at the top of this snippet creates a little divider between widgets like the kind you see in menus that divide sets of functionality available there. the parent of the textbox that users enter an url into is something called an <hbox/>, which is a...
...r/there.is.only.xul" title="web lock manager" style="width: 30em;" persist="screenx screeny" screenx="24" screeny="24"> <script src="chrome://weblock/content/weblock.js"/> <hbox> <separator orient="vertical" class="thin"/> <vbox flex="1"> <separator class="thin"/> <hbox align="center"> <textbox id="dialog.input" flex="1"/> <button
label="add this url" oncommand="addthissite();"/> </hbox> <hbox align="center"> <radiogroup onchange="togglelock();"> <radio
label="lock"/> <radio
label="unlock"/> </radiogroup> <spacer flex="1"/> </hbox> </vbox> </hbox> </dialog> overlaying new user interface into mozilla you've got a dialog that will interact with...
...rpanel) and the ui already defined within that browser <statusbar/> at runtime. other resources this chapter describes the remaining files that must be added to and packaged up with the weblock component to provide user interface for web locking. other front end resources in some ui packages, localization resources are also defined. these include dtds in which the language in which the ui is
labelled can be extracted into external files, which are swapped with dtds for other languages. for example, user interface packages often include an english dtd that defines
labels and strings for button and menus and other elements in the interface. when the user selects a different language pack, all of the english that's been externalized in these files is dynamically replaced with the new choice. ...
nsIDOMXULSelectControlElement
dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method overview nsidomxulselectcontrolitemelement appenditem(in domstring
label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring
label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only. selectedindex long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxul...
...ment insertitemat(in long index, in domstring
label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only. ...
...g
label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only. ...
... in domstring value ); parameters
label value return value getindexofitem() long getindexofitem( in nsidomxulselectcontrolitemelement item ); parameters item return value getitematindex() nsidomxulselectcontrolitemelement getitematindex( in long index ); parameters index return value insertitemat() nsidomxulselectcontrolitemelement insertitemat( in long index, in domstring
label, in domstring value ); parameters index
label value return value removeitemat() nsidomxulselectcontrolitemelement removeitemat( in long index ); parameters index return value ...
nsIMsgRuleAction
msgfilter.idl [scriptable, uuid(190a2a18-d245-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target
label. ...
...-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target
label. ...
...)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target
label. ...
...e nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target
label. ...
Working with windows in chrome code
you can find the window's opene...
...you can find the window's opener using its window.opener property or via a callback function passed to the window in a way described in the previo...
...s add code to the previous example to notify the opener when the user presses cancel on the progress dialog. using window.opener. the opener property returns its window's opener; that is, the window object that opened it. if we're sure the window that opened the progress dialog declares the canceloperation function, we can use window.opener.canceloperation() to notify it, like this: <button
label="cancel" oncommand="opener.canceloperation(); close();" /> using a callback function. alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ... window.opendialog( "chrome://test/content/progress.xul", "myprogress", "chrome,centersc...
... the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ... window.opendialog( "chrome://test/content/progress.xul", "myprogress", "chrome,centerscreen", {status: "reading remote data", maxprogress: 50, progress: 10}, oncancel ); the progress dialog can then run the callback like this: <button
label="cancel" oncommand="window.arguments[1](); close();" /> example 3: using nsiwindowmediator when opener is not enough the window.opener property is very easy to use, but it's only useful when you're sure that your window was opened from one of a few well-known places. in more complicated cases you need to use the nsiwindowmediator interface, introduced above. one case in which you might want t...
Accessibility Inspector - Firefox Developer Tools
...
...ent accessibility-relevant states that can apply to the current item. for example, one of the links in one demo has states of focusable, linked, selectable text, opaque, enabled, and sensitive. for a full list of internal states, see gecko states. relations — a list of the accessiblity-relevant relationships between this item and other items. for example, in a form, an entry item could have a "
labelled by" relation with a
label item, which in turn has a "
label for" relation to the entry item. attributes — a list of all the accessibility-relevant attributes that are applied to the item. this can include style-related attributes such as margin-left and text-indent, and other useful states for accessibility information, such as draggable and level (e.g., what heading level is it, in the case...
...tab in the viewer. check for accessibility issues you can check for accessibility issues by clicking the drop-down menu next to: check for issues. the available menu items include: none — don't show the possible list of issues all issues — check for all types of issues contrast — check for issues with visual contrast keyboard — check for issues with navigating via a keyboard text
labels — check for issues with missing text
labels when you one of the menu items, firefox scans your document for the type of issues you selected. depending on the size and complexity of your document, this may take a few seconds. when the scan is complete, the left side of the accessibility inspector panel displays only the items that have that type of issue. in the right side of the panel, the c...
...ase the shift key. when the picker is activated, you can also deactivate it by pressing the picker button a second time, or pressing the esc key. typical use cases the accessibility inspector is very useful for spotting accessibility problems at a glance. for a start, you can investigate items that don't have a proper text equivalent — images without alt text and form elements without proper
labels have a name property of null, for example. it is also very handy for verifying semantics — you can use the inspect accessibility properties context menu option to quickly see whether an item has the correct role set on it (e.g., whether a button is really a button, or a link is really a link). ...
Browser Console - Firefox Developer Tools
d by a pane that display messages. at the top, a toolbar enables you to filter the messages that appear. at the bottom, a command line interpreter enables you to evaluate javascript expressions. beginning with firefox 68, the browser console allows you to show or hide messages from the content process (i.e. the messages from scripts in all the opened pages) by setting or clearing the checkbox
labeled show content messages. the following image shows the browser console focused on the same page as above after clicking on the show content messages checkbox. browser console logging the browser console logs the same sorts of messages as the web console: http requests warnings and errors (including javascript, css, security warnings and errors, and messages explicitly logged by javascript...
...document.queryselector('.webconsole-clear-console-button'); clearbtn.addeventlistener('mouseover', function() { hud.jsterm.clearoutput(true); }, false); bonus features available for add-on sdk add-ons, the console api is available automatically. here's an example add-on that just logs an error when the user clicks a widget: widget = require("sdk/widget").widget({ id: "an-error-happened",
label: "error!", width: 40, content: "error!", onclick: logerror }); function logerror() { console.error("something went wrong!"); } if you build this as an xpi file, then open the browser console, then open the xpi file in firefox and install it, you'll see a widget
labeled "error!" in the add-on bar: click the icon. you'll see output like this in the browser console: for add-on sdk-base...
...owser's chrome window, you can also modify the browser's user interface. ...
...ethetea.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); ...
Using files from web applications - Web APIs
id="fileselect">select some files</button> the code that handles the click event can look like this: const fileselect = document.getelementbyid("fileselect"), fileelem = document.getelementbyid("fileelem"); fileselect.addeventlistener("click", function (e) { if (fileelem) { fileelem.click(); } }, false); you can style the new button for opening the file picker as you wish. using a
label element to trigger a hidden file input element to allow opening the file picker without using javascript (the click() method), a <
label> element can be used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the
label would not be keyboard-accessible. use the visually-hidden technique instead. consider this html: <input type="fi...
...file picker without using javascript (the click() method), a <
label> element can be used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the
label would not be keyboard-accessible. use the visually-hidden technique instead. ...
...e click() method), a <
label> element can be used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the
label would not be keyboard-accessible. use the visually-hidden technique instead. ...
...e="file" id="fileelem" multiple accept="image/*" class="visually-hidden"> <
label for="fileelem">select some files</
label> and this css: .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); } /* separate rule for compatibility, :focus-within is required on modern firefox and chrome */ input.visually-hidden:focus +
label { outline: thin dotted; } input.visually-hidden:focus-within +
label { outline: thin dotted; } there is no need to add javascript code to call fileelem.click(). also in this case you can style the
label element as you wish. you need to provide a visual cue for the focus status of the hidden input field on its
label, be it an outline as shown above, or background-color or box-shadow. (as of ...
FileReader: abort event - Web APIs
the abort event is fired when a read has been aborted: for instance because the program called filereader.abort(). ...
...the abort event is fired when a read has been aborted: for instance because the program called filereader.abort(). ...
...eader.onabort examples live example html <div class="example"> <div class="file-select"> <
label for="avatar">choose a profile picture:</
label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid...
... </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>
label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} b...
FileReader: load event - Web APIs
the load event is fired when a file has been read successfully. ...
... the load event is fired when a file has been read successfully. ...
...reader.onload examples live example html <div class="example"> <div class="file-select"> <
label for="avatar">choose a profile picture:</
label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid...
... </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>
label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} b...
FileReader: loadend event - Web APIs
the loadend event is fired when a file read has completed, successfully or not. ...
... the loadend event is fired when a file read has completed, successfully or not. ...
...der.onloadend examples live example html <div class="example"> <div class="file-select"> <
label for="avatar">choose a profile picture:</
label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid...
... </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>
label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} b...
FileReader: loadstart event - Web APIs
the loadstart event is fired when a file read operation has begun. ...
... the loadstart event is fired when a file read operation has begun. ...
...r.onloadstart examples live example html <div class="example"> <div class="file-select"> <
label for="avatar">choose a profile picture:</
label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid...
... </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>
label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} b...
FileReader: progress event - Web APIs
the progress event is fired periodically as the filereader reads data. ...
... the progress event is fired periodically as the filereader reads data. ...
...er.onprogress examples live example html <div class="example"> <div class="file-select"> <
label for="avatar">choose a profile picture:</
label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid...
... </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>
label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} b...
HTMLInputElement.stepDown() - Web APIs
stepdecrement the optional stepdecrement paremeter is a numeric value. if no parameter is passed, stepdecrement defaults to 1. if the value is a float, the value will increment as if math.floor(stepdecrement) was passed. if the value is negative, the value will be incremented instead of decremented. ...
... the value is a float, the value will increment as if math.floor(stepdecrement) was passed. if the value is negative, the value will be incremented instead of decremented. ...
...at, the value will increment as if math.floor(stepdecrement) was passed. if the value is negative, the value will be incremented instead of decremented. ...
...ple click the button in this example to increment the number input type: html <p> <
label>enter a number between 0 and 400 that is divisible by 5: <input type="number" step="5" id="thenumber" min="0" max="400"> </
label> </p> <p> <
label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="decrementer" min="-2" max="15"> </
label> </p> <input type="button" value="decrement" id="thebutton"> javascript /* make the button call the function */ let button = document.getelementbyid('thebutton'); button.addeventlistener('click', function() { stepondown();} ); function stepondown() { let input = document.getelementbyid('thenumber'); let val = document.getelementbyid('decrementer').value; if (val) { /* increment with...
HTMLInputElement.stepUp() - Web APIs
in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. syntax element.stepup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. ...
...pup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. ...
...t ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. ...
...mple click the button in this example to increment the number input type: html <p> <
label>enter a number between 0 and 400 that is divisible by 5: <input type="number" step="5" id="thenumber" min="0" max="400"> </
label> </p> <p> <
label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="incrementer" min="0" max="25"> </
label> </p> <input type="button" value="increment" id="thebutton"> javascript /* make the button call the function */ let button = document.getelementbyid('thebutton') button.addeventlistener('click', function() { steponup() }) function steponup() { let input = document.getelementbyid('thenumber') let val = document.getelementbyid('incrementer').value if (val) { /* increment with a parame...
HTMLSelectElement.disabled - Web APIs
the htmlselectelement.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. a disabled element is unusable and un-clickable. ...
... the htmlselectelement.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. a disabled element is unusable and un-clickable. ...
... the htmlselectelement.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. a disabled element is unusable and un-clickable. ...
...nt.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. a disabled element is unusable and un-clickable. ...
HTMLSelectElement.options - Web APIs
the htmlselectelement.options read-only property returns a htmloptionscollection of the <option> elements contained by the <select> element. syntax var options = select.options; return value a htmloptionscollection containing the <option> elements contained by the <select> element. ...
... the htmlselectelement.options read-only property returns a htmloptionscollection of the <option> elements contained by the <select> element. syntax var options = select.options; return value a htmloptionscollection containing the <option> elements contained by the <select> element. ...
... the htmlselectelement.options read-only property returns a htmloptionscollection of the <option> elements contained by the <select> element. syntax var options = select.options; return value a htmloptionscollection containing the <option> elements contained by the <select> element. ...
...ments contained by the <select> element. example html <
label for="test">
label</
label> <select id="test"> <option value="1">option 1</option> <option value="2">option 2</option> </select> javascript window.addeventlistener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.options.length; i++) { console.log(select.options[i].
label); // "option 1" and "option 2" } }); specifications specification status comment html living standardthe definition of 'options' in that specification. living standard no change html5the definition of 'options' in that specification. recommendation initial definition ...
Using the Payment Request API - Web APIs
this returns a promise that fulfills with a paymentresponse ob...
...this returns a promise that fulfills with a paymentresponse object if the payment is successful: request.show().then(function(paymentresponse) { // here we would pro...
...knowing about. paymentrequest.canmakepayment() can be used to check whether the paymentrequest object is capable of making a payment before you start the payment process. ...
...entrequest 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 manual // web form checkout? const supportedpaymentmethods = ... let shouldcallpaymentrequest = true; let fallbacktolegacyonpaymentrequestfailure = false; (new paymentrequest(supportedpaymentmethods, {total: {
label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { shouldcallpaymentrequest = result; }).catch(function(error) { console.log(error); // the user 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; fallbacktol...
RadioNodeList.value - Web APIs
d as a string. if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
...o buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
...or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
...cked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. syntax value = radionodelist.value; radionodelist.value = string; example html <form> <
label><input type="radio" name="color" value="blue">blue</
label> <
label><input type="radio" name="color" value="red">red</
label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html living standardthe definition of 'radionodelist.value' in that specification. living standard initial definitio...
Selection.setBaseAndExtent() - Web APIs
he setbaseandextent() method with the specified offsets, and copies the selection into the output paragraph at the very bottom of the html. ...
...he specified offsets, and copies the selection into the output paragraph at the very bottom of the html. ...
...om of the html. ...
...ent example</h1> <div> <p class="one"><span>fish</span><span>dog</span><span>cat</span><span>bird</span></p> <p>middle</p> <p class="two"><span>car</span><span>bike</span><span>boat</span><span>plane</span></p> </div> <div> <p> <
label for="aoffset">anchor offset</
label> <input id="aoffset" name="aoffset" type="number" value="0"> </p> <p> <
label for="foffset">focus offset</
label> <input id="foffset" name="foffset" type="number" value="0"> </p> <p><button>capture selection</button></p> </div> <p><strong>output</strong>: <span class="output"></span></p> the javascript looks like so: var one = document.queryselector('.one'); var two = document.queryselector('.two'); var aoffset = document.getelementbyid('aoffset'); var foffset = document.getelementbyid('foffset'...
Using XMLHttpRequest - Web APIs
rm-data</h3> <form action="register.php" method="post" enctype="multipart/form-data" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>upload example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type="text" name="lastname" /><br /> sex: <input id="sex_male" type="radio" name="sex" value="male" /> <
label for="sex_male">male</
label> <input id="sex_female" type="radio" name="sex" value="female" /> <
label for="sex_female">female</
label><br /> password: <input type="password" name="secret" /><br /> what do you prefer: <select name="image_type"> <option>books</option> <option>cinema</option> <option>tv</option> </select> </p> <p> ...
...ype="password" name="secret" /><br /> what do you prefer: <select name="image_type"> <option>books</option> <option>cinema</option> <option>tv</option> </select> </p> <p> post your photos: <input type="file" multiple name="photos[]"> </p> <p> <input id="vehicle_bike" type="checkbox" name="vehicle[]" value="bike" /> <
label for="vehicle_bike">i have a bike</
label><br /> <input id="vehicle_car" type="checkbox" name="vehicle[]" value="car" /> <
label for="vehicle_car">i have a car</
label> </p> <p> describe yourself:<br /> <textarea name="description" cols="50" rows="8"></textarea> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> </body> </html...
...rm-data</h3> <form action="register.php" method="post" enctype="multipart/form-data" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>upload example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type="text" name="lastname" /><br /> sex: <input id="sex_male" type="radio" name="sex" value="male" /> <
label for="sex_male">male</
label> <input id="sex_female" type="radio" name="sex" value="female" /> <
label for="sex_female">female</
label><br /> password: <input type="password" name="secret" /><br /> what do you prefer: <select name="image_type"> <option>books</option> <option>cinema</option> <option>tv</option> </select> </p> <p> ...
...ype="password" name="secret" /><br /> what do you prefer: <select name="image_type"> <option>books</option> <option>cinema</option> <option>tv</option> </select> </p> <p> post your photos: <input type="file" multiple name="photos[]"> </p> <p> <input id="vehicle_bike" type="checkbox" name="vehicle[]" value="bike" /> <
label for="vehicle_bike">i have a bike</
label><br /> <input id="vehicle_car" type="checkbox" name="vehicle[]" value="car" /> <
label for="vehicle_car">i have a car</
label> </p> <p> describe yourself:<br /> <textarea name="description" cols="50" rows="8"></textarea> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> </body> </html>...
Using the alertdialog role - Accessibility
rtdialog role. the alertdialog role is used to notify the user of urgent information that demands the user's immediate attention. as the name implies, alertdialog is a type of dialog. this means that most of the instructions provided in the 'using the dialog role' technique are applicable to the alertdialog role as well: the alert dialog must always be given an accessible name (through aria-
labelledby or aria-
label) , and in most cases the alert text will have to be marked up as the alert dialog's accessible description (using aria-describedby). unlike regular alerts, an alert dialog must have at least one focusable control and focus must be moved to that control when the alert dialog appears. generally alert dialogs have at least a confirmation, close or cancel button that can be used t...
...er agents and assistive technology when the alertdialog role is used, the user agent should do the following: expose the element as a dialog in the operating system's accessibility api. fire an accessible alert event using the operating system's accessibility api if it supports it. when the alert dialog appears, screen readers should announce the alert. when the alert dialog is correctly
labeled and focus is moved to a control inside the dialog, screen readers should announce the dialog's accessible role, name and optionally description before announcing the focused element. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: a basic alert dialog ...
...cription before announcing the focused element. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: a basic alert dialog the code snippet below shows how to mark up an alert dialog that only provides a message and an ok button. ...
... and an ok button. ...
Using the aria-describedby attribute - Accessibility
description the aria-describedby attribute is used to indicate the ids of the elements that describe the object. it is used to establish a relationship between widgets or groups and text that described them. this is very similar to aria-
labelledby: a
label describes the essence of an object, while a description provides more information that the user might need. the aria-describedby attribute is not used only for form elements; it is also used to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and more. the examples section below provides more information about how to use the attribute in these cases. this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. v...
...fer on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: application landmark descriptions in the example below, an introductory paragraph describes a calendar application. aria-describedby is used to associate the paragraph with the application container. <div role="application" aria-
labelledby="calendar" aria-describedby="info"> <h1 id="calendar">calendar</h1> <p id="info"> this calendar shows the game schedule for the boston red sox. </p> <div role="grid"> ... </div> </div> example 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. the aria-describedby attribu...
...dar</h1> <p id="info"> this calendar shows the game schedule for the boston red sox. </p> <div role="grid"> ... </div> </div> example 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. the aria-describedby attribute is used to associate the description with the link. <button aria-
label="close" aria-describedby="descriptionclose" onclick="mydialog.close()">x</button> ... <div id="descriptionclose">closing this window will discard any information entered and return you back to the main page</div> working examples: checkbox example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descri...
...ain page</div> working examples: checkbox example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document. used by aria roles all elements of the base markup related aria techniques using the aria-
labelledby attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-describedby ...
ARIA: feed role - Accessibility
eed. see keyboard interactions below. if the number of articles is known, set aria-setsize on the articles themselves. however, if the total number is extremely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known. another feature of the feed pattern is skim reading: articles within a feed can contain both an accessible name with the aria-
label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the
label when navigating by article. by identifying the elements inside of an article that provide the title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read. the fee...
... 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 title, the feed element has aria-
labelledby referring to the element containing the title. if not, add an aria-
label. aria-busy when busy, such as when articles are being added or removed from the feed, set aria-busy="true" du...
...each article should preferably have aria-describedby referring to one or more elements inside the article that serve as the primary content of the article. ...
...from the feed, set aria-busy="true" during the update operation. make sure it's reset to false when the operation is complete or the changes may not become visible. article each section of content in a feed should be contained in an <article> or element with role article. each article should have an aria-
labelledby referring to the article title or other child that can serve as a distinguishing
label. each article should preferably have aria-describedby referring to one or more elements inside the article that serve as the primary content of the article. each article element has aria-posinset set to a value that represents its position in the feed and an aria-setsize set to a value that represents either the total number of articles that have been loaded or the total number in the feed, depen...
ARIA: tab role - Accessibility
the common user experience pattern is a group of visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more prominent than the other tabs. ...
...thout javascript, there are no substitute combination of html and css only that will provide the same set of functionality that's required above for accessible tabs with content. example this example combines the role tab with tablist and elements with tabpanel to create an interactive group of tabbed content. here we are enclosing our group of content in a div, with our tablist having an aria-
label to
label it for assistive technology. each tab is a button with the attributes previously mentioned. the first tab has tabindex=0 on it, which we will later change to whatever tab has aria-selected=true. all of the tabpanel elements have tabindex=0 to make them tabbable, and all but the currently active one have the hidden attribute, which we will change with javascript. there is some basic styli...
...nd all but the currently active one have the hidden attribute, which we will change with javascript. there is some basic styling applied that restyles the buttons and changes the z-index to of tab elements to give the illusion of it connecting to the tabpanel for active elements, and the illusion that inactive elements are behind the active tabpanel. ...
...nel-1" id="tab-1" tabindex="0"> first tab </button> <button role="tab" aria-selected="false" aria-controls="panel-2" id="tab-2" tabindex="-1"> second tab </button> <button role="tab" aria-selected="false" aria-controls="panel-3" id="tab-3" tabindex="-1"> third tab </button> </div> <div id="panel-1" role="tabpanel" tabindex="0" aria-
labelledby="tab-1"> <p>content for the first panel</p> </div> <div id="panel-2" role="tabpanel" tabindex="0" aria-
labelledby="tab-2" hidden> <p>content for the second panel</p> </div> <div id="panel-3" role="tabpanel" tabindex="0" aria-
labelledby="tab-3" hidden> <p>content for the third panel</p> </div> </div> .tabs { padding: 1em; } [role="tablist"] { margin-bottom: -1px; ...
ARIA: table role - Accessibility
the table value of the aria role attribute identifies the element containing the role as having a non-interactive table structure containing data arranged in rows and columns, similar to the native <table> html element. ...
...igation, or allows the user to rearrange cell order use grid or treegrid instead. to create an aria table, add role="table" to the container element. within that container, each row has role="row" set and contains child cells. each cell has a role of either columnheader, rowheader, or simply cell. rows can be children of the table or within a rowgroup. the table caption can be defined via aria-
labelledby or aria-
label. all other semantic table elements, such as <tbody>, <thead>, <tr>, <th>, and <td> need to be added via associated roles, such as rowgroup, row, columnheader, and cell. if the table contains sortable columns or rows, the aria-sort attribute should be added on the header cell element (not the table itself). if any rows or columns are hidden, the aria-colcount or aria-rowcount ...
...ies role="rowgroup" an optional child of the table, the row group encapsulates a group of rows, similar to thead, tbody, and tfoot. role="row" a row within the table, and optionally within a rowgroup, that is a container for one or more cells, columnheaders, or rowheaders. aria-describedby attribute takes as its value the id of the element that serves as a description for the table. aria-
label attribute the aria-
label provides an accessible name for the table. aria-colcount attribute this attribute is only required if the columns are not present in the dom all the time. it provides an explicit indication of the number of columns in the full table. set the value to the total number of columns in the full table. if unknown, set aria-colcount="-1". aria-rowcount attribute this at...
...columns, see the columnheader aria role. the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. employ the html <table> element instead of the aria role of table whenever possible. ...
An overview of accessible web applications and widgets - Accessibility
technology. the problem dynamic content on a web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of. that's where aria comes in. example 1: markup for a tabs widget built without aria
labeling. there's no information in the markup to describe the widget's form and function. <!-- this is a tabs widget. how would you know, looking only at the markup? --> <ol> <li id="ch1tab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <div id="ch1panel">ch...
.... <!-- now *these* are tabs! --> <!-- we've added role attributes to describe the tab list and each tab. ...
...--> <ol role="tablist"> <li id="ch1tab" role="tab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab" role="tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab" role="tab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <!-- notice the role and aria-
labelledby attributes we've added to describe these panels. --> <div id="ch1panel" role="tabpanel" aria-
labelledby="ch1tab">chapter 1 content goes here</div> <div id="ch2panel" role="tabpanel" aria-
labelledby="ch2tab">chapter 2 content goes here</div> <div id="quizpanel" role="tabpanel" aria-
labelledby="quiztab">quiz content goes here</div> </div> aria is well supported by all major browsers, including firefox, safari, opera, chrome, and internet explorer, and many assistive technologies. presenta...
...ng display:none. here is an example of a tooltip that uses aria-hidden to control the visibility of the tooltip. the example shows a simple web form with tooltips containing instructions associated with the entry fields. in this example, the html for the tooltip has the form shown in example 2a. line 9 sets the aria-hidden state to true. example 2a. html for a tooltip <div class="text"> <
label id="tp1-
label" for="first">first name:</
label> <input type="text" id="first" name="first" size="20" aria-
labelledby="tp1-
label" aria-describedby="tp1" aria-required="false" /> <div id="tp1" class="tooltip" role="tooltip" aria-hidden="true">your first name is optional</div> </div> the css for this markup is shown in example 2b. note that...
HTML To MSAA - Accessibility
em_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a
labelled_by (1003), points to legend 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 ...
...em_ 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 @type=password role_system_ text n/a n/a state_system_ readonly if @readonly attribute is used state_system_ pro...
...stem_ checked if checked property of dom element returns true n/a "check"/"uncheck"/"cycle" depending on state event_object_ statechange when state is changed input type="radio" role_system_ radiobutton 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 ...
.../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_ selectionadd if selected event_object_ selectionremove if unselected select @size > 1 role_system_ list n/a n/a state_system_ multiselectable if multiselectable n/a n/a n/a select @size = 1 role_system_ combobox n/a name of focused option state_syst...
Perceivable - Accessibility
gument against longdesc. multimedia content (i.e., audio or video) should at least have a descriptive identification available, such as a caption or similar. see text alternatives for static caption options, and audio transcripts, video text tracks, and other multimedia content for other alternatives. ui controls such as form elements and buttons should have text
labels that describe their purpose. buttons are simple—you should make sure the button text describes the function of the button (e.g., <button>upload image</button>). for more information on other ui controls, see ui controls. implement decorative (non-content) images, video, etc., in a way that is invisible to assistive technology, so it doesn't confuse users. decorative images ...
...multiple ways, accomodating their differing needs. success criteria how to conform to the criteria practical resource 1.3.1 info and relationships (a) any content structure—or visual relationship made between content—can also be determined programmatically, or be inferred from text description. the main situations in which this is relevant are: text
labels and the form elements they describe. these are associated unambiguously using the <
label> element, which can be picked up by screenreaders, 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...
...a good basis for accessibility. 1.3.3 sensory characteristics (a) instructions for operating controls or understanding content do not rely on a single sense. this may prove inaccessible to people with a disability related to that sense, or a device that does not support that sense. so, for example: "click the round button to continue" the button should be clearly
labelled so that it is obvious that it is the button you need to press. if there are multiple buttons, make sure they are all clearly
labelled to distinguish their function. "listen to the audio instructions for guidance" this is obviously problematic—audio will be inaccessible to those with hearing impairments, whereas text can be read, but also spoken by a screenreader if required. ...
... convey instructions), but it applies in other situations too. success criteria how to conform to the criteria practical resource 1.4.1 use of color (a) color should not be solely relied upon to convey information. for example, in forms, you should never mark required fields purely with a color (like red). instead (or as well as), something like an asterisk with a
label of "required" would be more appropriate. see color and color contrast and multiple
labels. 1.4.2 audio controls (a) for any audio that plays for longer than three seconds, provide accessible controls to play and pause the audio/video, and mute/adjust volume. use native <button>s to provide accessible keyboard controls, as shown in video player styling basics. 1.4.3 ...
Understandable - Accessibility
see also styling links as buttons for a useful accessible navigation menu example. 3.2.4 consistent identification (aa) controls or components that have the same functionality should be identified in the same way across different pages or views. a currency converter appearing on every page of a world travel site for example should be exactly the same, semantically and in terms of
labels. again, sensible design! "
labels" can refer to descriptive information in text content, or html form
labels. see meaningful text
labels for more information. 3.2.5 change on request (aaa) changes in context that could possibly confuse or disorient users should only occur only when requested by the user, or the user should be able to turn them off. if you need to...
...the user to a change on the page. note: server-side validation should *always* be used alongside client-side validation. client-side validation is too easy to turn off or otherwise get around, so it can't be relied on alone. see form data validation for comprehensive validation information, and wai-aria: dynamic content updates for information on live regions. 3.3.2
labels or instructions (a) clear instructions should be provided when data input is required. when a simple instruction or prompt is required, you can use <
label> elements for single inputs like name or age, a combination or <
label>s and <fieldset>s/<legend>s for multiple inputs that go together (like the elements of a date of birth or postal address). when more complex explanation is requ...
...suggesting alternatives when the user is choosing a user name and has selected one that is already taken), unless doing so would cause a security issue (e.g. ...
...suggesting alternatives when the user is choosing a user name and has selected one that is already taken), unless doing so would cause a security issue (e.g. when entering a password) or context problem (e.g. ...
::placeholder - CSS: Cascading Style Sheets
e of the input in close visual proximity, then use aria-describedby to programmatically associate the <input> with its hint. with this implementation, the hint content is available even if information is entered into the input field, and the input appears free of preexisting input when the page is loaded. ...
...with this implementation, the hint content is available even if information is entered into the input field, and the input appears free of preexisting input when the page is loaded. most screen reading technology will use aria-describedby to read the hint after the input's
label text is announced, and the person using the screen reader can mute it if they find the extra information unnecessary. ...
...is available even if information is entered into the input field, and the input appears free of preexisting input when the page is loaded. most screen reading technology will use aria-describedby to read the hint after the input's
label text is announced, and the person using the screen reader can mute it if they find the extra information unnecessary. <
label for="user-email">your email address</
label> <span id="user-email-hint" class="input-hint">example: jane@sample.com</span> <input id="user-email" aria-describedby="user-email-hint" name="email" type="email"> placeholders in form fields are harmful — nielsen norman group windows high contrast mode placeholder text will appear with the same styling as user-entered text content when rendered in windows high contrast mode. this will m...
...laceholders in form fields are harmful — nielsen norman group windows high contrast mode placeholder text will appear with the same styling as user-entered text content when rendered in windows high contrast mode. this will make it difficult for some people to determine which content has been entered, and which content is placeholder text. greg whitworth — how to use -ms-high-contrast
labels placeholders are not a replacement for the <
label> element. without a
label that has been programmatically associated with an input using a combination of the for and id attributes, assistive technology such as screen readers cannot parse <input> elements. mdn basic form hints placeholders in form fields are harmful — nielsen norman group examples red text html <input placeholder="t...
:enabled - CSS: Cascading Style Sheets
e element also has a disabled state, in which it can't be activated or accept focus. /* selects any enabled <input> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
...t can't be activated or accept focus. /* selects any enabled <input> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
...t> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
...nabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. html <form action="url_of_form"> <
label for="firstfield">first field (enabled):</
label> <input type="text" id="firstfield" value="lorem"><br> <
label for="secondfield">second field (disabled):</
label> <input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html living standardthe definition of ':enabled' in that specification. living standard no change. ...
:in-range - CSS: Cascading Style Sheets
do-class only applies to elements that have (and can take) a range limitation. in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :in-range examples html <form action="" id="form1"> <ul>values between 1 and 10 are valid. ...
...hat have (and can take) a range limitation. in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :in-range examples html <form action="" id="form1"> <ul>values between 1 and 10 are valid. ...
... living standard defines when :in-range matches elements in html. ...
... living standard defines when :in-range matches elements in html. selectors level 4the definition of ':in-range' in that specification. working draft initial specification. ...
:out-of-range - CSS: Cascading Style Sheets
applies to elements that have (and can take) a range limitation. ...
... can take) a range limitation. ...
... living standard defines when :out-of-range matches elements in html. ...
... living standard defines when :out-of-range matches elements in html. selectors level 4the definition of ':out-of-range' in that specification. ...
Linear-gradient Generator - CSS: Cascading Style Sheets
, subscribe : subscribe, unsubscribe : unsubscribe, setpickermode : setpickermode }; })(); /** * ui-dropdown select */ var dropdownmanager = (function dropdownmanager() { 'use strict'; var subscribers = {}; var dropdowns = []; var active = null; var visbility = ["hidden", "visible"]; var dropdown = function dropdown(node) { var topic = node.getattribute('data-topic'); var
label = node.getattribute('data-
label'); var selected = node.getattribute('data-selected') | 0; var select = document.createelement('div'); var list = document.createelement('div'); var uval = 0; var option = null; var option_value = null; list.classname = 'ui-dropdown-list'; select.classname = 'ui-dropdown-select'; while (node.firstelementchild !== null) { option = node.firstel...
...0 : 1; else this.state = 1 ^ this.state; if (active !== this) { if (active) active.toggle(false); active = this; } if (this.state ===...
...0 : 1; else this.state = 1 ^ this.state; if (active !== this) { if (active) active.toggle(false); active = this; } if (this.state === 0) this.dropmenu.setattribu...
...ack); }; var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic,
label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (
label !== undefined) slider.setattribute('data-info',
label); new inputslider(slider); return slider; }; var init = function init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; ...
border-image-slice - CSS: Cascading Style Sheets
s the border to look somewhat irregular, but can have some interesting effects. border-width: changes the width of the border. the sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixellated (unless of course you use an svg image). ...
...teresting effects. border-width: changes the width of the border. the sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixellated (unless of course you use an svg image). ...
... which means that if the width is bigger than the slice, the image can start to look somewhat pixellated (unless of course you use an svg image). ...
...can start to look somewhat pixellated (unless of course you use an svg image). ...
font-style - CSS: Cascading Style Sheets
d to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. see font-variation-settings. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-style: oblique can accept an <angle>. ...
...ant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. see font-variation-settings. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-style: oblique can accept an <angle>. ...
...tine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); font-family:'amstelvaralpha'; font-style: normal; }
label { font: 1rem monospace; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'amstelvaralpha', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; }...
...; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'amstelvaralpha', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let slant
label = document.queryselector('
label[for="slant"]'); let slantinput = document.queryselector('#slant'); let sampletext = document.queryselector('.sample'); function update() { let slant = `oblique ${slantinput.value}deg`; slant
label.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slantinput.addeventlistener('input', update); update(); accessibility concerns la...
font-weight - CSS: Cascading Style Sheets
loser degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-weight can be any number between 1 and 1000. ...
...r the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-weight can be any number between 1 and 1000. ...
...g like an elephantine lizard up holborn hill.</p> </div> css /* mutator sans is created by letterror (https://github.com/letterror/mutatorsans) and is used here under the terms of its license: https://github.com/letterror/mutatorsans/blob/master/license */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; font-style: normal; }
label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .cont...
...ht: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let weight
label = document.queryselector('
label[for="weight"]'); let weightinput = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); function update() { weight
label.textcontent = `font-weight: ${weightinput.value};`; sampletext.style.fontweight = weightinput.value; } weightinput.addeventlistener('input', update); update(); accessibility concerns people experiencing...
min() - CSS: Cascading Style Sheets
mension> | <percentage> | ( <calc-sum> ) accessibility concerns when using min() to set a maximum font size, ensure that the font can still be scaled at least 200% for readability (without assistive technology like a zoom function). ...
... font can still be scaled at least 200% for readability (without assistive technology like a zoom function). mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a
label and input another use case for css functions is to set a maximum size on responsive form controls: enabling the width of
labels and inputs to shrink as the width of the form shrinks. let's look at some css: input,
label { padding: 2px; box-sizing: border-box; display: inline-block; width: min(40%, 400px); background-color: pink; } form { margin: 4px; border: 1px solid black; padding: 4px; } here, the form itself, along with the margin, border, and padding, will be 100% of its parent's width. we decla...
...hrink as the width of the form shrinks. let's look at some css: input,
label { padding: 2px; box-sizing: border-box; display: inline-block; width: min(40%, 400px); background-color: pink; } form { margin: 4px; border: 1px solid black; padding: 4px; } here, the form itself, along with the margin, border, and padding, will be 100% of its parent's width. we declare the input and
label to be the lesser of 40% of the form width up to the padding or 400px wide, whichever is smaller. in other words, the widest that the
label and input can be is 400px. the narrowest they will be is 40% of the form's width, which on a smartwatch's screen is very small. ...
...rm itself, along with the margin, border, and padding, will be 100% of its parent's width. we declare the input and
label to be the lesser of 40% of the form width up to the padding or 400px wide, whichever is smaller. in other words, the widest that the
label and input can be is 400px. the narrowest they will be is 40% of the form's width, which on a smartwatch's screen is very small. <form> <
label>type something:</
label> <input type="text"> </form> specifications specification status comment css values and units module level 4the definition of 'min()' in that specification. editor's draft initial definition. ...
Content categories - Developer guides
embedded content. they are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <
label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <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 fu...
...n and is at least partially supported by most browsers. phrasing content phrasing content defines the text and the mark-up it contains. runs of phrasing content make up paragraphs. elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <
label>, <mark>, <math>, <meter>, <noscript>, <object>, <output>, <picture>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <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...
...k-up language or namespace into the document. elements that belong to this category include: <audio>, <canvas>, <embed>, <iframe>, <img>, <math>, <object>, <picture>, <svg>, <video>. interactive content interactive content includes elements that are specifically designed for user interaction. elements that belong to this category include: <a>, <button>, <details>, <embed>, <iframe>, <keygen>, <
label>, <select>, and <textarea>. some elements belong to this category only under specific conditions: <audio>, if the controls attribute is present <img>, if the usemap attribute is present <input>, if the type attribute is not in the hidden state <menu>, if the type attribute is in the toolbar state <object>, if the usemap attribute is present <video>, if the controls attribute is present ...
...substantive. elements whose model is flow content or phrasing content should have at least one node which is palpable. form-associated content form-associated content comprises elements that have a form owner, exposed by a form attribute. a form owner is either the containing <form> element or the element whose id is specified in the form attribute. <button> <fieldset> <input> <keygen> <
label> <meter> <object> <output> <progress> <select> <textarea> this category contains several sub-categories: listed elements that are listed in the form.elements and fieldset.elements idl collections. contains <button>, <fieldset>, <input>, <keygen>, <object>, <output>, <select>, and <textarea>.
labelable elements that can be associated with <
label> elements. contains <button>, <input>...
HTML attribute: accept - HTML: Hypertext Markup Language
d select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requirement is validated server-side. examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. most operating systems lighten the files that don't match the criteria and aren't selectable. ...
...incorrect file types. because of this, you should make sure that expected requirement is validated server-side. examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. most operating systems lighten the files that don't match the criteria and aren't selectable. <p> <
label for="soundfile">select an audio file:</
label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <
label for="videofile">select a video file:</
label> <input type="file" id="videofile" accept="video/*"> </p> <p> <
label for="imagefile">select some images:</
label> <input type="file" id="imagefile" accept="image/*" multiple> </p> note the last example allows you to select multiple iamges. see the multiple attribute for mor...
... its value a string containing one or more of these unique file type specifiers, separated by commas. for example, a file picker that needs content that can be presented as an image, including both standard image formats and pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <
label for="file">choose file to upload</
label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live. regardless of the user's device or operating system, the file input ...
...e with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <
label for="profile_pic">choose file to upload</
label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } specifications specification status html living standardthe definition of 'accept attribute' in that specification. living sta...
HTML attribute: size - HTML: Hypertext Markup Language
ontrol will be the default width based on the user agent. if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. ...
...based on the user agent. if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. ...
...nt with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. ...
...ss takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. ...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the common use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states. the default closed state displays only the triangle and the
label inside <summary> (or a user agent-defined default string if no <summary>). this might look like the following: here we see a standard disclosure widget with the
label "system requirements", in its default closed state. when the user clicks on the widget or focuses it then presses the space bar, it "twists" open, revealing its contents: from there, you can use css to style the disclosure wid...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as the example above shows, the <fieldset> element provides a grouping for a part of an html form, with a nested <legend> element providing a caption for the <fieldset>. ...
.... otherwise, it establishes a block formatting context. you can feel free to style the <fieldset> and <legend> in any way you want to suit your page design. examples simple fieldset this example shows a really simple <fieldset> example, with a <legend>, and a single control inside it. ...
... formatting context. you can feel free to style the <fieldset> and <legend> in any way you want to suit your page design. examples simple fieldset this example shows a really simple <fieldset> example, with a <legend>, and a single control inside it. ...
...mple fieldset</legend> <input type="radio" id="radio"> <
label for="radio">spirit of radio</
label> </fieldset> </form> disabled fieldset this example shows a disabled <fieldset> with two controls inside it. note how both the controls are disabled due to being inside a disabled <fieldset>. <form action="#"> <fieldset disabled> <legend>disabled fieldset</legend> <div> <
label for="name">name: </
label> <input type="text" id="name" value="chris"> </div> <div> <
label for="pwd">archetype: </
label> <input type="password" id="pwd" value="wookie"> </div> </fieldset> </form> technical summary content categories flow content, sectioning root, listed, form-associated element, palpable content. permitted content an opti...
<form> - HTML: Hypertext Markup Language
_top: load into the top-level browsing context (i.e., the browsing context that is an ancestor of the current one and has no parent). if no parent, behaves the same as _self. this value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element. ...
...ontext that is an ancestor of the current one and has no parent). if no parent, behaves the same as _self. this value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element. ...
... overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element. ...
...it">, or <input type="image"> element. examples html <!-- form which will send a get request to the current url --> <form> <
label>name: <input name="submitted-name" autocomplete="name"> </
label> <button>save</button> </form> <!-- form which will send a post request to the current url --> <form method="post"> <
label>name: <input name="submitted-name" autocomplete="name"> </
label> <button>save</button> </form> <!-- form with fieldset, legend, and
label --> <form method="post"> <fieldset> <legend>title</legend> <
label><input type="radio" name="radio"> select me</
label> </fieldset> </form> specifications specification status comment html living standardthe definition of '<form>' in that specification. living standard ...
<input type="button"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. ...
...e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s
label text is inserted between the opening and closing tags, you can include html in the
label, even images. value a domstring used as the button's
label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's
label. <input type="button" value="click me"> if you don't specify...
...have no real value to be constrained. examples the below example shows a very simple drawing app created using a <canvas> element and some simple css and javascript (we'll hide the css for brevity). the top two controls allow you to choose the color and size of the drawing pen. the button, when clicked, invokes a function that clears the canvas. ...
...imple drawing app created using a <canvas> element and some simple css and javascript (we'll hide the css for brevity). the top two controls allow you to choose the color and size of the drawing pen. the button, when clicked, invokes a function that clears the canvas. ...
<input type="range"> - HTML: Hypertext Markup Language
t type="range" min="5" max="10" step="0.01"> if you want to accept any value regardless of how many decimal places it extends to, you can specify a value of any for the step attribute: <input type="range" min="0" max="3.14" step="any"> this example lets the user select any value between 0 and π without any restriction on the fractional part of the value selected. adding hash marks and
labels the html specification gives browsers some flexibility on how to present the range control. nowhere is this flexibility more apparent than in the area of hash marks and, to a lesser degree,
labels. the specification describes how to add custom points to the range control using the list attribute and a <datalist> element, but does not have any requirements or even recommendations for standardize...
..."></option> <option value="20"></option> <option value="30"></option> <option value="40"></option> <option value="50"></option> <option value="60"></option> <option value="70"></option> <option value="80"></option> <option value="90"></option> <option value="100"></option> </datalist> screenshot live a range control with hash marks and
labels you can add
labels to your range control by adding the
label attribute to the <option> elements corresponding to the tick marks you wish to have
labels for. html examples <input type="range" list="tickmarks"> <datalist id="tickmarks"> <option value="0"
label="0%"></option> <option value="10"></option> <option value="20"></option> <option value="30"></option>...
... the
label attribute to the <option> elements corresponding to the tick marks you wish to have
labels for. html examples <input type="range" list="tickmarks"> <datalist id="tickmarks"> <option value="0"
label="0%"></option> <option value="10"></option> <option value="20"></option> <option value="30"></option> <option value="40"></option> <option value="50"
label="50%"></option> <option value="60"></option> <option value="70"></option> <option value="80"></option> <option value="90"></option> <option value="100"
label="100%"></option> </datalist> screenshot live note: currently, no browser fully supports these features. ...
...e="40"></option> <option value="50"
label="50%"></option> <option value="60"></option> <option value="70"></option> <option value="80"></option> <option value="90"></option> <option value="100"
label="100%"></option> </datalist> screenshot live note: currently, no browser fully supports these features. firefox doesn't support hash marks and
labels at all, for example, while chrome supports hash marks but doesn't support
labels. version 66 (66.0.3359.181) of chrome supports
labels but the <datalist> tag has to be styled with css as its display property is set to none by default, hiding the
labels. change the orientation by default, if a browser renders a range input as a slider, it will render it so that the knob slides left and right.
<input type="reset"> - HTML: Hypertext Markup Language
to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. you should usually avoid including reset buttons in your forms. they're rarely useful, and are instead more likely to frustrate users who click them by mistake (often while trying to click the submit button). value a domstring used as the button's
label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's
label. buttons such as reset don't have a value otherwise. <input type="reset" value="reset the form"> if you don't specify a value, you get ...
... supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's
label. buttons such as reset don't have a value otherwise. <input type="reset" value="reset the form"> if you don't specify a value, you get an button with the default
label (typically "reset," but this will vary depending on the user agent): <input type="reset"> using reset buttons <input type="reset"> buttons are used to reset forms. if you want to create a custom button and then customize the behaviour using javascript, you need to use <input type="button">, or better still, a <button> element. a simple reset button we'll begin by creating a simple reset ...
... will vary depending on the user agent): <input type="reset"> using reset buttons <input type="reset"> buttons are used to reset forms. if you want to create a custom button and then customize the behaviour using javascript, you need to use <input type="button">, or better still, a <button> element. a simple reset button we'll begin by creating a simple reset button: <form> <div> <
label for="example">type in some sample text</
label> <input id="example" type="text"> </div> <div> <input type="reset" value="reset the form"> </div> </form> this renders like so: try entering some text into the text field, and then pressing the reset button. adding a reset keyboard shortcut to add a keyboard shortcut to a submit button — just as you would with any <input> for wh...
...ton. adding a reset keyboard shortcut to add a keyboard shortcut to a submit button — just as you would with any <input> for which it makes sense — you use the accesskey global attribute. in this example, r is specified as the access key (you'll need to press r plus the particular modifier keys for your browser/os combination; see accesskey for a useful list of those). <form> <div> <
label for="example">type in some sample text</
label> <input id="example" type="text"> </div> <div> <input type="reset" value="reset the form" accesskey="r"> </div> </form> the problem with the above example is that there's no way for the user to know what the access key is! this is especially true since the modifiers are typically non-standard to avoid conflicts. when building a s...
<menu> - HTML: Hypertext Markup Language
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 attributes this element includes the global attributes.
label the name of the menu as shown to the user. used within nested menus, to provide a
label through which the submenu can be accessed. must only be specified when the parent element is a <menu> in the context menu state. type this attribute indicates the kind of menu being declared, and can be one of two values. context : indicates the popup menu state, which represents a group of commands...
...m>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> result toolbar toolbar menus haven't been implemented in any known browsers yet. html <!-- a context menu for a simple editor, - containing two menu buttons. ...
...rated action</menuitem> </menu> result toolbar toolbar menus haven't been implemented in any known browsers yet. html <!-- a context menu for a simple editor, - containing two menu buttons. ...
...taining two menu buttons. --> <menu type="toolbar"> <li> <button type="menu" menu="file-menu">file</button> <menu type="context" id="file-menu"> <menuitem
label="new..." onclick="newfile()"> <menuitem
label="save..." onclick="savefile()"> </menu> </li> <li> <button type="menu" menu="edit-menu">edit</button> <menu type="context" id="edit-menu"> <menuitem
label="cut..." onclick="cutedit()"> <menuitem
label="copy..." onclick="copyedit()"> <menuitem
label="paste..." onclick="pasteedit()"> </menu> </li> </menu> result specifications specification status comment html living standardthe definition of '<menu>' in that specification. living standard no change from latest snapshot, unknown html ...
<menuitem> - HTML: Hypertext Markup Language
commands can also optionally include a checkbox or be grouped to share radio buttons. ...
...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 be used within a menu item that also includes the attributes checked, disabled, icon,
label, radiogroup or type. default this boolean attribute indicates use of the same command as the menu's subject element (such as a button or input). disabled boolean attribute which indicates that the command is not available in the current state. note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the comma...
...mand as the menu's subject element (such as a button or input). disabled boolean attribute which indicates that the command is not available in the current state. note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the command relevant. icon image url, used to provide a picture to represent the command.
label the name of the command as shown to the user. required when a command attribute is not present. radiogroup this attribute specifies the name of a group of commands to be toggled as radio buttons when selected. may only be used where the type attribute is radio. type this attribute indicates the kind of command, and can be one of three values. command: a regular command with an associated...
...fferent states. radio: represent one selection from a group of commands that can be toggled as radio buttons. example html content <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem type="checkbox" checked>checkbox</menuitem> <hr> <menuitem type="command"
label="this command does nothing" icon="https://developer.cdn.mozilla.net/static/img/favicon144.png"> commands don't render their contents. </menuitem> <menuitem type="command"
label="this command has javascript" onclick="alert('command clicked')"> commands don't render their contents. </menuitem> <hr> <menuitem type="radio" radiogroup="group1">radio button 1</menuitem> <menuitem ty...
<select>: The HTML Select element - HTML: Hypertext Markup Language
nt represents a control that provides a menu of options: the source for this interactive example is stored in a github repository. if 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 above example shows typical <select> usage. it is given an id attribute to enable it to be associated with a <
label> for accessibility purposes, as well as a name attribute to represent the name of the associated data point submitted to the server. each menu option is defined by an <option> element nested inside the <select>. each <option> element should have a value attribute containing the data value to submit to the server when that option is selected. if no value attribute is included, the value defaults ...
...is selected by default. ...
...hoice"> <option value="first">first value</option> <option value="second" selected>second value</option> <option value="third">third value</option> </select> advanced select with multiple features the follow example is more complex, showing off more features you can use on a <select> element: <
label>please choose one or more pets: <select name="pets" multiple size="4"> <optgroup
label="4-legged pets"> <option value="dog">dog</option> <option value="cat">cat</option> <option value="hamster" disabled>hamster</option> </optgroup> <optgroup
label="flying pets"> <option value="parrot">parrot</option> <option value="macaw">macaw</option> <option value="albatross">albatross</option> </optgroup> </select> </
label> you'll see that: ...
...p> elements to divide the options up into different groups. this is a purely visual grouping, its visualization generally consists of the group name being bolded, and the options being indented. the "hamster" option includes a disabled attribute and therefore can't be selected at all. technical summary content categories flow content, phrasing content, interactive content, listed,
labelable, resettable, and submittable form-associated element permitted content zero or more <option> or <optgroup> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role combobox with no multiple attribute and no size attribute greater than 1, otherwise...
<textarea> - HTML: Hypertext Markup Language
mment on a review or feedback form. the source for this interactive example is stored in a github repository. if 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 above example demonstrates a number of features of <textarea>: an id attribute to allow the <textarea> to be associated with a <
label> element for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and closing tags. <textarea> does...
...at the user should enter. name the name of the control. placeholder a hint to the user of what can be entered in the control. carriage returns or line-feeds within the placeholder text must be treated as line breaks when rendering the hint. note: placeholders should only be used to show an example of the type of data that should be entered into a form; they are not a substitute for a proper <
label> element tied to the input. see
labels and placeholders in <input>: the input (form input) element for a full explanation. readonly this boolean attribute indicates that the user cannot modify the value of the control. unlike the disabled attribute, the readonly attribute does not prevent the user from clicking or selecting in the control. the value of a read-only control is still submitted w...
... also have the required attribute set. placeholder this example has a placeholder set. notice how it disappears when you start typing into the box. <textarea name="textarea" rows="5" cols="30" placeholder="comment text."></textarea> note: placeholders should only be used to show an example of the type of data that should be entered into a form; they are not a substitute for a proper <
label> element tied to the input. see
labels and placeholders in <input>: the input (form input) element for a full explanation. disabled and readonly this example shows two <textarea>s — one of which is disabled, and one of which is readonly. have a play with both and you'll see the difference in behavior — the disabled element is not selectable in any way (and its value is not submitted), wher...
...han firefox, such as chrome, the disabled textarea content may be selectable and copyable. <textarea name="textarea" rows="5" cols="30" disabled>i am a disabled textarea</textarea> <textarea name="textarea" rows="5" cols="30" readonly>i am a readonly textarea</textarea> technical summary content categories flow content, phrasing content, interactive content, listed,
labelable, resettable, and submittable form-associated element. permitted content text tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role textbox permitted aria roles no role permitted dom interface htmltextareaelement specificati...
contextmenu - HTML: Hypertext Markup Language
m all browsers the contextmenu 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 spec...
... anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu. ...
...facebook using the share menu from your context menu. ...
...i am learning contextmenu from mdn via mozilla"); } function shareviafacebook() { window.open("https://facebook.com/sharer/sharer.php?u=" + "https://developer.mozilla.org/en/html/eleme...
Control flow and error handling - JavaScript
and returns false. function checkdata() { if (document.form1.threechar.value.length == 3) { return true; } else { alert( 'enter exactly three characters. ' + `${document.form1.threechar.value} is not valid.`); return false; } } switch statement a switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case
label. ...
... 'enter exactly three characters. ' + `${document.form1.threechar.value} is not valid.`); return false; } } switch statement a switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case
label. if a match is found, the program executes the associated statement. ...
...`${document.form1.threechar.value} is not valid.`); return false; } } switch statement a switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case
label. if a match is found, the program executes the associated statement. ...
... case
label. if a match is found, the program executes the associated statement. a switch statement looks like this: switch (expression) { case
label_1: statements_1 [break;] case
label_2: statements_2 [break;] … default: statements_def [break;] } javascript evaluates the above switch statement as follows: the program first looks for a case clause with a
label matching the value of expression and then transfers control to that clause, executing the associated statements. if no matching
label is found, the program looks for the optional default clause: if a default clause is found, the program transfers control to that clause, executing the associated statements. if no default clause is found, the program resumes execution at the statement fol...
FinalizationRegistry.prototype.unregister() - JavaScript
is no longer registered in the registry. there is no need to all unregister in your cleanup callback. only call unregister if you haven't received a cleanup callback and no longer need to receive one. ...
...allback and no longer need to receive one. examples using unregister this example shows registering a target object using that same object as the unregister token, then later unregistering it via unregister: class thingy { #cleanup =
label => { // ^^^^^−−−−− held value console.error( `the \`release\` method was never called for the object with the
label "${
label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance. ...
...s thingy { #cleanup =
label => { // ^^^^^−−−−− held value console.error( `the \`release\` method was never called for the object with the
label "${
label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance. be sure to call `release` when you're done with it. * * @param
label a
label for the `thingy`. */ constructor(
label) { // vvvvv−−−−− held value this.#registry.register(this,
label, this); // target −−−−−^^^^ ^^^^−−−−− unregister token } /** * releases resources held by this `thingy` instance. */ release() { this.#registry.
... finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file. be sure to call `release` when you're done with it. * * @param filename the name of the file. */ constructor(filename) { this.#file = file.open(filename); // vvvvv−−−−− held value this.#registry.register(this,
label, this.#file); // target −−−−−^^^^ ^^^^^^^^^^−−−−− unregister token } /** * releases resources held by this `thingy` instance. */ release() { if (this.#file) { this.#registry.unregister(this.#file); // ^^^^^^^^^^−−−−− unregister token file.close(this.#fil...
Working with Events - Archive of obsolete content
adding listeners in constructors event emitters may be modules, as is the case for the ready event above, or they may be objects returned by constructors. in the latter case the opt...
...alternative to calling the object's on() method. for example: the actionbutton object emits an event when the button is clicked. the following add-on creates a button and assigns a listener to the onclick property of the options object supplied to the button's constructor. ...
...quire("sdk/ui/button/action").actionbutton({ id: "visit-mozilla",
label: "visit mozilla", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").open("https://developer.mozilla.org/"); } }); this is exactly equivalent to constructing the button and then calling the button's on() method: var button = require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla",
label: "visit mozilla", icon: "./icon-16.png" }); button.on("click", function() { require("sdk/tabs").open("https://developer.mozilla.org/"); }); removing event listeners event listeners can be removed by calling removelistener(type, listener), supplying the type of event and the listener to remove. the listener must have been previously been added using one of the methods described above. in...
panel - Archive of obsolete content
e panel's constructor or to its show() method. ...
..."sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var textentrypanel = require("sdk/panel").panel({ contenturl: data.url("text-entry.html"), contentscriptfile: data.url("get-text.js") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel",
label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button. function handleclick(state) { textentrypanel.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event t...
... attach a content script: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var textentrypanel = require("sdk/panel").panel({ contenturl: data.url("text-entry.html") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel",
label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button. function handleclick(state) { textentrypanel.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event t...
passwords - Archive of obsolete content
rty should match the url property. usernamefield the value of the "name" attribute for the form's username field. passwordfield the value of the "name" attribute for the form's password field. ...
...the url property. usernamefield the value of the "name" attribute for the form's username field. passwordfield the value of the "name" attribute for the form's password field. ...
... value of the "name" attribute for the form's username field. passwordfield the value of the "name" attribute for the form's password field. so: given a form at http://www.example.com/login with the following html: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <
label>username:</
label> <input type="text" name="uname"> <
label>password:</
label> <input type="password" name="pword"> </form> the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" formsubmiturl: "http://login.example.com" usernamefield: "uname" passwordfield: "pword" note that for both url and formsubmiturl, the portion of the url after the hostname is omitted. http authenticatio...
jpm - Archive of obsolete content
he current directory (or --addon-dir). jpm sign --api-key ${jwt_issuer} --api-secret ${jwt_secret} this submits an xpi it to the addons.mozilla.org signing api, then downloads a signed xpi to the working directory if it passes validation. to get values for --api-key and --api-secret, you will need to create api credentials on addons.mozilla.org. on the amo key management page, these values are
labeled "jwt_issuer" and "jwt_secret". here are some possible outcomes of running the sign command: your add-on passed validation, was signed by mozilla, and a new signed xpi was downloaded to your working directory. your add-on failed validation, was not signed, and you got a link to a detailed report. after fixing the validation errors, you can run the command again. you add-on passed validatio...
...e a listed add-on, just submit it directly to addons.mozilla.org where it is signed automatically. see the debugging section if you are experiencing difficulty installing a signed add-on. jpm sign accepts the following options: --api-key=jwt_issuer api access key (string) generated on the addons.mozilla.org key management page. on the amo key management page, this value is
labeled "jwt issuer". --api-secret=jwt_secret api access secret (string) generated on the addons.mozilla.org key management page. this value should be guarded with care and never checked into version control. if your secret is compromised, another developer could upload add-ons to your account. you should revoke and regenerate compromised api credentials immediately. on the am...
...ecret=jwt_secret api access secret (string) generated on the addons.mozilla.org key management page. this value should be guarded with care and never checked into version control. if your secret is compromised, another developer could upload add-ons to your account. you should revoke and regenerate compromised api credentials immediately. on the amo key management page, this value is
labeled "jwt secret". --api-url-prefix=http://.../api an optional api url prefix in case you'd like to use a pre-production signing api. for example, you could pass https://addons-dev.allizom.org/api/v3 to use the dev instance of addons.mozilla.org. --xpi=/path/to/file.xpi an xpi file to sign. when no file is specified, a new xpi will be generated from the...
Alerts and Notifications - Archive of obsolete content
, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.arguments = [image, title, msg, false, '']; } using notification box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly). ...
... box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly). however it is possible to use only buttons and a
label there. ...
... interaction with users is using of xul elements notificationbox and notification (implicitly). however it is possible to use only buttons and a
label there. ...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
d 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 chromeclass-toolbar-additional"
label="&xulschoolhello.helloworld.
label;" tooltiptext="&xulschoolhello.helloworld.tooltip;" oncommand="xulschoolchrome.browseroverlay.dosomething(event);" /> <!-- more buttons here. --> </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 toolbarpal...
...schoolchrome.browseroverlay.dosomething(event);" /> <!-- more buttons here. --> </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-wo...
...s this is not what you want as default behavior, because it would be very hard for the user to discover your buttons. keep in mind most users don't know how to customize toolbars in firefox. let's add our own toolbar. this is done in the overlay as well. ...
Creating a dynamic status bar extension - Archive of obsolete content
our extension will refresh the stock information display when the use...
...ar samplepanel = document.getelementbyid('stockwatcher'); var output = httprequest.responsetext; if (output.length) { // remove whitespace from the end of the string; // this gets rid of the end-of-line characters output = output.replace(/\w*$/, ''); // build the tooltip string var fieldarray = output.split(','); // assert that fieldarray[0] == 'goog' samplepanel.
label = 'goog: ' + fieldarray[1]; samplepanel.tooltiptext = 'chg: ' + fieldarray[4] + ' | ' + 'open: ' + fieldarray[5] + ' | ' + 'low: ' + fieldarray[6] + ' | ' + 'high: ' + fieldarray[7] + ' | ' + 'vol: ' + fieldarray[8]; } } the first thing we do here is get the status bar panel into the variable samplepanel by calling the document.getelementbyid() dom funct...
...like this: "goog",414.20,"5/1/2006","1:36pm",-3.74,417.85,419.44,412.19,4760215 we then parse the text. we use the split() string function to split the comma-separated value string into its individual parts, with each field in a separate element in the array fieldarray. at index 0 is the ticker symbol itself, which we don't need since we know which stock we're looking at. the status bar panel's
label is set to indicate the current value of the stock, which is stored in fieldarray, by setting the samplepanel.
label property. we then set the tooltip for the status bar panel by assigning an appropriate string to the samplepanel.tooltiptext property. the string is built from a combination of static strings and various elements from the fieldarray array. see it in action now you can install it and ...
JXON - Archive of obsolete content
ame": "name", "@value": "captured" }], "table": { "tr": [{ "th": { "@style": "text-align: right;", "keyvalue": "product:" }, "td": { "span": [{ "input": { "@type": "radio", "@name": "nome", "@id": "rel_tshirt", "@value": "tshirt" }, "
label": { "@for": "rel_tshirt", "keyvalue": "t-shirt" }, "@class": "product" }, { "input": { "@type": "radio", "@name": "nome", "@id": "rel_trousers", "@value": "trousers" }, "
label": { "@for": "rel_trousers", "keyvalue": "...
...s", "@value": "trousers" }, "
label": { "@for": "rel_trousers", "keyvalue": "trousers" }, "@class": "product" }, { "input": { "@type": "radio", "@name": "nome", "@id": "rel_pullover", "@value": "pullover" }, "
label": { "@for": "rel_pullover", "keyvalue": "pullover" }, "@class": "product" }] } }, { "th": { "@style": "text-align: right;", "keyvalue": "quantity:" }, "td": { "input": { "@type": "text", "@name": "myinput", "@onkeypress": "return num...
...ipt> <input type="hidden" name="instid" value="1234" /> <input type="hidden" name="currency" value="gbp" /> <input type="hidden" name="amount" value="0" /> <input type="hidden" name="name" value="captured" /> <table> <tr> <th style="text-align: right;">product:</th> <td><span class="product"><input type="radio" name="nome" id="rel_tshirt" value="tshirt"/><
label for="rel_tshirt">t-shirt</
label></span><span class="product"><input type="radio" name="nome" id="rel_trousers" value="trousers"/><
label for="rel_trousers">trousers</
label></span><span class="product"><input type="radio" name="nome" id="rel_pullover" value="pullover"/><
label for="rel_pullover">pullover</
label></span> </td> </tr> <tr> <th style="text-align: right;">quant...
Localizing an extension - Archive of obsolete content
l file that comprises the user interface for your extension should have a locale file in its locale directory. each locale file maps entity names referenced in the xul files to the strings themselves. ...
...his: <!entity options_window_title "stockwatcher 2 preferences"> <!entity options_symbol.
label "stock to watch: "> the "options_window_title" entity maps to the string "stockwatcher 2 preferences", which is used as the title of the preference window. the stockwatcher2.dtd file contains the mappings for the stockwatcher2.xul file: <!entity panel_loading "loading..."> <!entity menu_refresh_now.
label "refresh now"> <!entity menu_apple.
label "apple (aapl)"> <!entity menu_google.
label "google (goog)"> <!entity menu_microsoft.
label "microsoft (msft)"> <!entity menu_yahoo.
label "yahoo (yhoo)"> update the xul files each xul file needs to reference its corresponding locale file. we also need to update the code to use the entities instead of the strings, so that the substitutions take place bas...
...bes 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 stockwatcher2 en-u...
Creating a Firefox sidebar extension - Archive of obsolete content
ated. it is listed in example 2. the locale includes the name and shortcut keys for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity emptysidebar.title "emptysidebar"> <!entity openemptysidebar.commandkey "e"> <!entity openemptysidebar.modifierskey "shift accel"> the content folder includes our sidebar, the emptysidebar.xul is shown in example 3. it creates a page holding one
label. other elements can be included, please read the xul tutorials for more information. example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!doctype page system "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbemptysidebar" title=...
...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"?
...armenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> <keyset id="mainkeyset"> <key id="key_openemptysidebar" command="viewemptysidebar" key="&openemptysidebar.commandkey;" modifiers="&openemptysidebar.modifierskey;" /> </keyset> <broadcasterset id="mainbroadcasterset"> <broadcaster id="viewemptysidebar"
label="&emptysidebar.title;" autocheck="false" type="checkbox" group="sidebar" sidebarurl="chrome://emptysidebar/content/emptysidebar.xul" sidebartitle="&emptysidebar.title;" oncommand="togglesidebar('viewemptysidebar');" /> </broadcasterset> </overlay> the overlay file consists of three entries, ...
Nanojit - Archive of obsolete content
| lc_assembly; #else lc.lcbits = 0; #endif // set up the basic nanojit objects. allocator *alloc = new vmallocator(); codealloc *codealloc = new codealloc(); assembler *assm = new (&gc) assembler(*codealloc, *alloc, &core, &lc); fragmento *fragmento = new (&gc) fragmento(&core, &lc, cache_size_log2, codealloc); lirbuffer *buf = new (*alloc) lirbuffer(*alloc); #ifdef debug fragmento->
labels = new (*alloc)
labelmap(*alloc, &lc); buf->names = new (*alloc) lirnamemap(*alloc, fragmento->
labels); #endif // create a fragment to hold some native code. fragment *f = fragmento->getanchor((void *)0xdeadbeef); f->lirbuf = buf; f->root = f; // create a lir writer lirbufwriter out(buf); // write a few lir instructions to the buffer: add the first parameter // to the constant 2. ou...
...ojit). lins *rec_ins = out.insskip(sizeof(guardrecord) + sizeof(sideexit)); guardrecord *guard = (guardrecord *) rec_ins->payload(); memset(guard, 0, sizeof(*guard)); sideexit *exit = (sideexit *)(guard + 1); guard->exit = exit; guard->exit->target = f; f->lastins = out.insguard(lir_loop, out.insimm(1), rec_ins); // compile the fragment. compile(assm, f, *alloc verbose_only(, fragmento->
labels)); if (assm->error() != none) { fprintf(stderr, "error compiling fragment\n"); return 1; } printf("compilation successful.\n"); // call the compiled function. typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(5)); return 0; } code explanation interesting part are the lines 46-50: // write a few lir in...
..._ret, result); basically, what the code provided above is doing is feeding raw lir into the lir buffer, using the lirwriter's writer object. from an operational point of view, it is creating a function, which takes an integer input, and adds it to two, and outputs the result. the function is created here on lines 57-69: // compile the fragment. compile(assm, f, *alloc verbose_only(, fragmento->
labels)); if (assm->error() != none) { fprintf(stderr, "error compiling fragment\n"); return 1; } printf("compilation successful.\n"); // call the compiled function. typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(5)); return 0;</addtwofn> this upper half of this snippet includes code where the...
Creating XPI Installer Modules - Archive of obsolete content
a very simple one, but it uses the new packaging scheme and the chrome registry to make itself a piece of self-contained and redistributable software. once you have created a package like the one described 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: mozill...
...note that the stylesheet processing instruction at the top of the xul file does not refer to any new skin, but imports communicator.css to make use of that skin's basic widget styles. the javascript file barley.js contains a single functi...
...note that the stylesheet processing instruction at the top of the xul file does not refer to any new skin, but imports communicator.css to make use of that skin's basic widget styles. the javascript file barley.js contains a single function, bar(), defined as follows: functi...
Attribute (XUL) - Archive of obsolete content
s alternatingbackground alwaysopenpopup attribute autocheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autofill autofillaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept button
labelaccept button
labelcancel button
labeldisclosure button
labelextra1 button
labelextra2 button
labelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control...
...oup handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightnonmatches homepage href icon id ignoreblurwhilesearching ignorecase ignoreincolumnpicker ignorekeys image inactivetitlebarcolor increment index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext
label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchan...
... onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions search
label selected selectedindex seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext toolti...
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. ...
...note: you cannot insert an item to an index that does not exist, eg: trying to insert an item at the end with element.getrowcount() + 1 example <!-- this example inserts at the selected item or appends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some
labels and values var somedate = new date(); if(mylistbox.selectedindex == -1){ // no item was selected in list so append to the end mylistbox.appenditem( somedate.tolocaletimestring(), somedate.gettime() ); var newindex = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var newindex = mylistbox.selectedindex; ...
...tring(), somedate.gettime() ); var newindex = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var newindex = mylistbox.selectedindex; mylistbox.insertitemat(newindex, somedate.tolocaletimestring(), somedate.gettime()); } // select the newly created item mylistbox.selectedindex = newindex; } </script> <button
label="insert item at selected" oncommand="insertitemtolist()"/> <listbox id="mylistbox"> <listitem
label="foo"/> </listbox> see also appenditem() removeitemat() ...
Floating Panels - Archive of obsolete content
floating panels a floating panel is used for secondary popups such as tool palettes and property inspector panels. it will have a titlebar which the user may use to move the panel around on the screen. a floating panel can be created using the panel element with at least two additional attributes as in the following example: <panel id="tools-panel" noautohide="true" titlebar="normal"> <
label control="name" value="name:"/> <textbox id="name"/> </panel> the noautohide attribute is used to indicate that the panel is not temporary. when set to true, the popup will not close when the user clicks outside of it, nor when the user presses the escape key. the titlebar attribute creates a panel with a titlebar. currently, only the value normal is supported, which creates a default titlebar. in the ...
... distinction will be available to support titlebars of differing styles. the floating panel can be placed and moved independently of the main window, however it will always appear above the main window. on mac, floating panels are invisible when another application is made active, and become visible again when the xul application is made active. a floating panel may contain any type of element. a
label for the titlebar may be set using the
label attribute, as in the following example: <panel id="info-panel" noautohide="true" titlebar="normal"
label="image properties"> closing a floating panel unlike other panels, a floating panel does not close when clicking outside of it. you can use the close attribute to have a close button on the titlebar. when the user presses it, the popup will be closed...
...see closing a popup for more information about this. ...
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. for instance, this is the proper place to put the menu items which open the applica...
...pt this one. menu_mac_show_all selecting this item will show the windows for all applications. checkforupdates the item that opens the update dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item). the last five items aren't normally used but are listed for completeness. here is an example: <menubar> <menu
label="tools"> <menupopup> <menuitem
label="spell check"/> <menuitem id="menu_preferences"
label="preferences" oncommand="window.opendialog('options.xul', '_new', 'chrome');"/> </menupopup> </menu> </menubar> this menu item will be placed on the application menu on the macintosh but left in the tools menu on other platforms. when moved to the application menu, ...
...however, regardless of the platform, the command event will be fired on the menu item when it is activated by the user. ...
Sorting and filtering a custom tree view - Archive of obsolete content
code will only work from privileged script. ...
...ort.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!doctype window> <window title="sorting a custom tree view example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="init()"> <script type="application/javascript" src="sort.js"/> <hbox align="center" id="search-box"> <
label accesskey="f" control="filter">filter</
label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()"
label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name"
label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" ...
...clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name"
label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator" sortdirection="ascending"/> <splitter class="tree-splitter"/> <treecol id="description"
label="description" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator"/> <splitter class="tree-splitter"/> <treecol id="weapon"
label="weapon" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator"/> </treecols> <treechildren id="tree-children"/> </tree> </window> sort.js var table = null; var data = null; var tr...
Multiple Queries - Archive of obsolete content
ide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> <action> <button uri="?photo" image="?photo"
label="view" orient="vertical"/> </action> </queryset> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> <action> <image uri="?photo" src="?photo"/> </action> </queryset> </template> </hbox> this template contains two queries, the first contains a <triple> which matches only the photo with...
...ax you can also use multiple queries with rdf datasources using the simple query syntax. here is the previous example rewritten using the simple syntax: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template> <rule dc:title="canal"> <button uri="rdf:*" image="rdf:*"
label="view" orient="vertical"/> </rule> <rule> <image uri="rdf:*" src="rdf:*"/> </rule> </template> </hbox> the result to the user in this example is the same as the previous example. you can also mix simple and extended queries in one template, although you may prefer to use the same style in all queries for consistency. however, if you are going to be using a number of queries, ...
...orthand. you can remove the <rule> element and place the rule's conditions directly on the <template>. there's no performance benefit, but it does save some typing. <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:title="canal"> <button uri="rdf:*" image="rdf:*"
label="view" orient="vertical"/> </template> </hbox> this example shows only a single photo since a condition is used to filter out the other two photos. note that in this shorthand, the query conditions are placed directly on the <template> element. « previousnext » ...
SQLite Templates - Archive of obsolete content
sed. 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 is similar as w...
...lace this with the value of the name column. the effect is a listbox containing the names from the database. you can return multiple columns or filtered data by using a more complex query. <vbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name, email from myfriends where age >= 30 </query> <action> <hbox uri="?"> <
label value="?name"/> <
label value="?email"/> </hbox> </action> </template> </vbox> this template displays the results of two columns. any occurance of a question mark in the action body is replaced with the value from the query results. here, this is used two times, once to display the name and the second to display the email. the uri attribute on the hbox element is required on o...
...uld 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 with a short scri...
Things I've tried to do with XUL - Archive of obsolete content
; height: 100%;"> <box style="height: 30%" flex="1" style="background: green;"/> <box style="height: 20%" flex="1" style="background: green;"/> <box style="height: 50%" flex="1" style="background: green;"/> </html:div> using flex="3" flex="2" flex="5" would give the right display visually for the empty boxes; however, flex only applies to how empty space is allocated. so, as soon as you add a
label or some other element inside, there will be a different amount of "empty space" to allocate in different boxes. enn: percentages won't have any effect in these examples though, since the actual height of the container isn't known, and 30% of an unknown number is still an unknown number. vlad: sure; the snippets assume that there's some enclosing structure that will provide the actual height. wra...
...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 added it breaks and stops displaying the first cell (the one specified by the appenditem call). instead, you must build up your own listit...
...r a number of rows have been added it breaks and stops displaying the first cell (the one specified by the appenditem call). instead, you must build up your own listitem full of listcells, and then add that listitem to the listbox, using generic dom calls: var row = document.createelement('listitem'); // create and attach 1st cell var cell = document.createelement('listcell'); cell.setattribute('
label',
label ); cell.setattribute('value', value ); row.appendchild( cell ); // create and attach 2nd cell cell = document.createelement('listcell'); cell.setattribute('
label',
label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... // attach row mylistbox.appendchild( row ); ...
Custom toolbar button - Archive of obsolete content
change the text between double-quote characters on these two lines. optionally remove the sections for toolbars that you do not need. sav...
...change the text between double-quote characters on these two lines. optionally remove the sections for toolbars that you do not need. save the file. ...
...out any knowledge of programming, see this page: code samples your changes take effect when you restart the application. adding more buttons to add another button, edit button.xul. for each application, duplicate the line that specifies custom-button-1, and change the new line to specify custom-button-2. duplicate the last section. in the id and oncommand attributes, change 1 to 2. change the
label and tooltiptext attributes to whatever you want. do not change the class attribute. now edit button.css. duplicate the first three lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the curly brace on the last line of the file. for example, you could add this code for testing: 2: function () { ale...
Creating a Wizard - Archive of obsolete content
ted automatically. ...
...f="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"/> <radio val...
...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"/> <radio value="large"
label="large"/> </radiogroup> <radiogroup> <caption
label="gender"/> <radio value="male"
label="male"/> <radio value="female"
label="female"/> </radiogroup> </wizardpage> </wizard> this wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons. the wizard will be formatted automatically, with a title across the top and a set of bu...
XUL Reference - Archive of obsolete content
eference « alphabetical list of all xul elements action arrowscrollbox 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 sc...
...izardpage 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 prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuit...
...utton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radiogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker description
label image listbox listitem listcell listcol listcols listhead listheader richlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where s...
XUL Template Primer - Bindings - Archive of obsolete content
we'll use a the following data model to illustrate how bindings work. see the rdf/xml file friends.rdf, below, a simple database with name and address inf...
... we'll use a the following data model to illustrate how bindings work. see the rdf/xml file friends.rdf, below, a simple database with name and address information for some of my good friend...
...) in our example, the <rule> will be instantiated three times: once each for alison, jack, and lumpy. however, in lumpy's case, we won't be able to bind the ?addr variable because lumpy has no home! (well, there are no statements with lumpy as the subject and a nc:address as the predicate, anyway.) nevertheless, the rule still matches. in the content that's built for lumpy's <hbox>, the second <
label>'s value attribute (which should contain the value of ?street) is just left blank. related documents xul template primer xul template basics. xul template primer - multiple rules illustrates how to write templates with multiple <rule> elements. xul template primer - nested content illustrates how a template can be used recursively to build nested content. xul template primer - outliner ...
iframe - Archive of obsolete content
tension without security issues. more information is available in the xul tutorial. ...
...able in the xul tutorial. ...
..., 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: boolean...
radiogroup - Archive of obsolete content
ertical 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 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 focuse...
...you may optionally set a value. the function returns the newly created element. checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it. if the argument dir is true, the next radio b...
...rue, the next radio button is selected. if it is false, the previous radio button is selected. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index,
label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. related interfaces nsiaccessibleprovider, nsi...
splitter - Archive of obsolete content
e element directly since they will fit more naturally with the user's selected theme. tree-splitter this splitter is intended to be used in tree columns (in-between treecol elements). the splitter will be drawn with no width so that it isn't visible, however, the columns may still be resized. ...
...e. tree-splitter this splitter is intended to be used in tree columns (in-between treecol elements). the splitter will be drawn with no width so that it isn't visible, however, the columns may still be resized. ...
...en treecol elements). the splitter will be drawn with no width so that it isn't visible, however, the columns may still be resized. ...
vbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to vertical orientation. more information is available in the xul tutorial. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to vertical orientation. more information is available in the xul tutorial. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to vertical orientation. more information is available in the xul tutorial. ...
window - Archive of obsolete content
ditor: https://github.com/km-200/xul --> <!-- extremely recommended to keep this css include!! ...
...s include!! ...
...box> <image src="application_form.png"/> <description>register online!</description> </hbox> <groupbox align="start"> <caption
label="your information"/> <radiogroup> <vbox> <hbox> <
label control="your-fname" value="enter first name:"/> <textbox id="your-fname" value="johan"/> </hbox> <hbox> <
label control="your-lname" value="enter last name:"/> <textbox id="your-lname" value="hernandez"/> </hbox> <hbox> <button oncommand="alert('save!')"> <description>save</description> </button> </hbox> </vbox> </radiogroup> </groupbox> </vbox> </window> attributes accelerated type: booleanset this attr...
wizard - Archive of obsolete content
moreover this hides separator between titlebar and window...
...moreover this hides separator between titlebar and window contents. this only affects mac os x. firstpage type: boolean true if the wizard is on the first page. inactivetitl...
...tep type: integer this property returns the number of pages that the user has navigated through so far, meaning that the user would press the back button this many times to go back to the beginning. this property is different than pageindex, because pages are not necessarily navigated in order. title type: string the title that appears at the top of the wizard. this is overridden by the
label attribute on the individual pages. wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), get...
E4X for templating - Archive of obsolete content
var strs = cc['@mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice). ...
...mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice). ...
...function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <
label>no data</
label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account secu...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
btn_comments = new ext.button({ text: "submit", ...
...runat="both" src="/jaxer_examples/js/validatecomments.js"/> <script> var txt_name; var txt_email; var txt_message; var btn_comments; var form_comments; ext.onready( function() { // create the name text field txt_name = new ext.form.textfield({ name: "name", field
label: "name", width: 200 }); // create the e-mail text field txt_email = new ext.form.textfield({ name: "email", field
label: "e-mail", width: 200 }); // create the message text field txt_message = new ext.form.textarea({ name: "message", field
label: "message", width: 200 }); // create a button used to send the form details. btn_comments = new ext.button({ text: "submit", field
label: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel(...
...-mail", width: 200 }); // create the message text field txt_message = new ext.form.textarea({ name: "message", field
label: "message", width: 200 }); // create a button used to send the form details. btn_comments = new ext.button({ text: "submit", field
label: "", 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...
XForms Custom Controls - Archive of obsolete content
le where base bindings for a control are placed is controlfile.xml. controlfile-xhtml.xml contains the xhtml implementation bindings for the control and controlfile-xul.xml contains the implementation bindings for when this control is hosted in a xul document. the following list shows where the base bindings for our xforms controls are defined: xforms.xml - contains the base bindings for output,
label, trigger, submit, case, message, hint, help, alert, upload and repeat xforms controls. input.xml - contains the base bindings for input, secret and textarea xforms controls. select.xml - contains the base bindings for select and select1 xforms controls (except minimal/default select1 that is hosted in select1.xml file) range.xml - contains the base bindings for the range xforms control. xforms.x...
...content of the instance node bound to this control --> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return true; </body> </method> </implementation> </binding> </bindings> <xf:model> <xf:instance xmlns=""> <data> <curimg></curimg> <img
label="firefox">http://www.mozilla.com/images/firefox-logo-64x64.png</img> <img
label="thunderbird">http://www.mozilla.com/images/thunderbird-logo-64x64.png</img> <img
label="bugzilla">http://www.mozilla.org/images/p-bugz.gif</img> <img
label="mozilla">http://www.mozilla.org/images/mozhead-80x64.gif</img> </data> </xf:instance> </xf:model> <style type="text/css"> @namespa...
...abel="mozilla">http://www.mozilla.org/images/mozhead-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> ...
Implementation Status - Archive of obsolete content
297083; 343443; 8.3.4 help supported 8.3.5 hint partial problems with hints in xul-hosted documents and ephemeral message positioning 349667; ...
... 297083; 343443; 8.3.4 help supported 8.3.5 hint partial problems with hints in xul-hosted documents and ephemeral message positioning 349667; 8.3.6 alert ...
....2 item supported 8.2.3 value supported 8.3.1 filename supported 8.3.2 mediatype supported 8.3.3
label partial
labels for items inside a choices element has bind problems. we'd like to expand how we render
labels bound to different, unique types. 297083; 343443; 8.3.4 help supported 8.3.5 hint partial problems with hints in xul-hosted documents and ephemeral message positioning 349667; 8.3.6 alert supported 9. container form controls section t...
XForms Alert Element - Archive of obsolete content
tyle. ...
...you should type only numbers!</xforms:alert> </xforms:input> ...
...ce xforms url("http://www.w3.org/2002/xforms"); xforms|input:invalid xforms|alert.inline { display: inline; font-style: italic; width: 40%; } } </style> <xforms:input bind="x"> <xforms:
label>you can type only numbers (validation happens on blur): </xforms:
label> <xforms:alert>wrong value! you should type only numbers!</xforms:alert> </xforms:input> <xforms:input bind="x"> <xforms:
label>you can type only numbers (validation happens on blur): </xforms:
label> <xforms:alert class="inline">wrong value! you should type only numbers!</xforms:alert> </xforms:input> ...
Accessible multimedia - Learn web development
ything by default; to add functionality, we will use javascript. we will first need to store references to each of the controls — add the following to the top of your javascript file: const playpausebtn = document.queryselector('.playpause'); const stopbtn = document.queryselector('.stop'); const rwdbtn = document.queryselector('.rwd'); const fwdbtn = document.queryselector('.fwd'); const time
label = document.queryselector('.time'); next, we need to grab a reference to the video/audio player itself — add this line below the previous lines: const player = document.queryselector('video'); this holds a reference to a htmlmediaelement object, which has several useful properties and methods available on it that can be used to wire up functionality to our buttons. before moving onto creatin...
... further reading this gives you a basic idea of how to add...
... further reading this gives you a basic idea of how to add custom player functionality to video/audio player instances. ...
The HTML5 input types - Learn web development
e. the slider-thumb can be moved via mouse or touch, or with the arrows of the keypad. it's important to properly configure your slider. to that end, it's highly recommended that you set the min, max, and step attributes which set the minimum, maximum and increment values, respectively. let's look at the code behind the above example, so you can see how its done. first of all, the basic html: <
label for="price">choose a maximum house price: </
label> <input type="range" name="price" id="price" min="50000" max="500000" step="100" value="250000"> <output class="price-output" for="price"></output> this example creates a slider whose value may range between 50000 and 500000, which increments/decrements by 100 at a time. we've given it default value of 250000, using the value attribute. one prob...
...250000, using the value attribute. one problem with sliders is that they don't offer any kind of visual feedback as to what the current value is. this is why we've included an <output> element — to contain the current value (we'll also look at this element in the next article). you could display an input value or the output of a calculation inside any element, but <output> is special — like <
label>, it can take a for attribute that allows you to associate it with the element or elements that the output value came from. to actually display the current value, and update it as it changed, you must use javascript, but this is relatively easy to do: const price = document.queryselector('#price'); const output = document.queryselector('.price-output'); output.textcontent = price.value; price...
... the first thursday of that year—which may not include the first day of the year, or may include the last few days of the previous year. <input type="week" name="week" id="week"> constraining date/time values all date and time controls can be constrained using the min and max attributes, with further constraining possible via the step attribute (whose value varies according to input type). <
label for="mydate">when are you available this summer?</
label> <input type="date" name="mydate" min="2013-06-01" max="2013-08-31" step="7" id="mydate"> browser support for date/time inputs you should be warned that the date and time widgets don't have the best browser support. at the moment, chrome, edge, and opera support them well, but there is no support in internet explorer, safari has some mobil...
Sending forms through JavaScript - Learn web development
r formdata object; http headers are set automatically xhr.send( fd ); } btn.addeventlistener( 'click', function() { senddata( {test:'ok'} ); } ) here's the live result: using formdata bound to a form element you can also bind a formdata object to an <form> element. this creates a formdata object that represents the data contained in the form. ...
... automatically xhr.send( fd ); } btn.addeventlistener( 'click', function() { senddata( {test:'ok'} ); } ) here's the live result: using formdata bound to a form element you can also bind a formdata object to an <form> element. this creates a formdata object that represents the data contained in the form. ...
.... to learn more about the filereader api, see using files from web applications. the least complicated way of sending binary data is by using formdata's append() method, demonstrated above. if you have to do it by hand, it's trickier. in the following example, we use the filereader api to access binary data and then build the multi-part form data request by hand: <form id="theform"> <p> <
label for="thetext">text data:</
label> <input id="thetext" name="mytext" value="some text data" type="text"> </p> <p> <
label for="thefile">file data:</
label> <input id="thefile" name="myfile" type="file"> </p> <button>send me!</button> </form> as you see, the html is a standard <form>. there's nothing magical going on. the "magic" is in the javascript: // because we want to access...
Test your skills: Other controls - Learn web development
e 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. other controls 1 in our first "other controls" assessment, we'll get you to create a multi-line text input. create a basic multi-line text input. associate it semantically with the provided "comment"
label. give the input 35 columns, and 10 rows of space in which to add comments. give the comments a maximum length of 100 characters. 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. other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a use...
...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. other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a user to pick their favourite food from the choices provided. create your basic select box structure. associate it semantically with the provided "comment"
label. inside the list, split the choices up into 2 subgroups — "mains" and "snacks". 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. other controls 3 in our final task of this set, we start with much the same list of food choices. however, this time we want to do things different...
... 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. other controls 3 in our final task of this set, we start with much the same list of food choices. however, this time we want to do things differently: create a basic text input that is semantically associated with the provided
label. put the food choices into a list that can be associated with a form input. associate the list with your text input, so that when you type characters, any of the list options that match the character sequence are given in a dropdown list as autocomplete suggestions. try updating the live code below to recreate the finished example: download the starting point for this task to work in your...
Introduction to events - Learn web development
he server and give an error message saying what's wrong and what needs to be done to put things right. some browsers support automatic form data validation features, but since many don't, you are advised to not rely on those and implement your own validation checks. let's look at a simple example. ...
...age saying what's wrong and what needs to be done to put things right. some browsers support automatic form data validation features, but since many don't, you are advised to not rely on those and implement your own validation checks. let's look at a simple example. ...
...right. some browsers support automatic form data validation features, but since many don't, you are advised to not rely on those and implement your own validation checks. let's look at a simple example. first, a simple html form that requires you to enter your first and last name: <form> <div> <
label for="fname">first name: </
label> <input id="fname" type="text"> </div> <div> <
label for="lname">last name: </
label> <input id="lname" type="text"> </div> <div> <input id="submit" type="submit"> </div> </form> <p></p> div { margin-bottom: 10px; } now some javascript — here we implement a very simple check inside an onsubmit event handler (the submit event is fired on a form when it is submitted) that tests whether the text fields are empty. if they are, we...
What is JavaScript? - Learn web development
nd fonts, and laying out our content in multiple columns. javascript is a scripting language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else. (okay, not everything, but it is amazing what you can achieve with a few lines of javascript code.) the three layers build on top of one another nicely. let's take a simple text
label as an example. we can mark it up using html to give it structure and purpose: <p>player 1: chris</p> then we can add some css into the mix to get it looking nice: p { font-family: 'helvetica neue', helvetica, sans-serif; letter-spacing: 1px; text-transform: uppercase; text-align: center; border: 2px solid rgba(0,0,200,0.6); background: rgba(0,0,200,0.3); color: rgba(0,0,200,0.6...
... so what can it really do? the core client-side javascript language consists of some common programming features that allow you to do things like: store useful values inside variables. in the above example...
...mon programming features that allow you to do things like: store useful values inside variables. in the above example for instance, we ask for a new name to be entered then store that name in a variable called name. operations on pieces of text (known as "strings" in programming). in the above example we take the string "player 1: " and join it to the name variable to create the complete text
label, e.g. ''player 1: chris". running code in response to certain events occurring on a web page. we used a click event in our example above to detect when the button is clicked and then run the code that updates the text
label. and much more! what is even more exciting however is the functionality built on top of the client-side javascript language. so-called application programming interfaces (...
Displaying Places information using views
ery uris for information on query uris. the following example uses the built-in tree view to display bookmarks whose titles or urls contain "mozilla". remember that, because xul is xml, any ampersands in query uris must be written as entity reference & and not simply &. <tree type="places" place="place:terms=mozilla&onlybookmarked=1&querytype=1"> <treecols> <treecol id="title"
label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the last but uses javascript to set the tree's place attribute: var histserv = cc["@mozilla.org/browser/nav-history-service;1"]. getservice(ci.nsinavhistoryservice); var query = histserv.getnewquery(); query.searchterms = "mozilla"; query.onlybookmarked = true; var opts = ...
...v.placesroot], 1); var result = histserv.executequery(query, opts); // hook up the result's viewer and the tree's nsitreeview to our custom view. ...
...ee's nsitreeview to our custom view. var treeview = document.getelementbyid("mytreeview"); result.addobserver(view); treeview.view = view; the following xul defines the mytreeview element referenced in the javascript: <tree id="mytreeview" flex="1"> <treecols> <treecol id="title"
label="title" flex="1" primary="true" /> <splitter class="tree-splitter" /> <treecol anonid="fulluri"
label="fulluri" flex="1" /> <splitter class="tree-splitter" /> <treecol id="indexinparent"
label="indexinparent" /> <splitter class="tree-splitter" /> <treecol id="parity"
label="parity" /> </treecols> <treechildren /> </tree> the full code listing is available in the files section of the page below. note that the tree element above does not have the special type attribute common...
IPDL Tutorial
temporary objects, so copy them if you need to keep their data around. direction each message type includes a "direction." the message direction specifies whether the message can be sent from-parent-to-child, from-child-to-parent, or both ways. three keywords serve as direction specifiers; child was introduced above. the second is parent, which means that the messages declared under the parent
label can only be sent from-child-to-parent. the third is both, which means that the declared messages can be sent in both directions. the following artificial example shows how these specifiers are used and how these specifiers change the generated abstract actor classes. // pdirection.ipdl async protocol pdirection { child: async foo(); // can be sent from-parent-to-child parent: async bar(); ...
... parameters message declarations allow any number of parameters. parameters specify data that are sent with the message. their values are serialized by the sender and deserialized by the receiver. ipdl supports built-in and custom primitive types, as well as unions and arrays. the bui...
... parameters message declarations allow any number of parameters. ...
Widget Wrappers
type of the widget's current area isgroup true, will be false for wrappers around single widget nodes source for api-provided widgets, whether they are built-in to firefox or add-on-provided disabled for api-provided widgets, whether the widget is currently disabled. nb: this property is writable, and will toggle all the widgets' nodes' disabled states
label for api-provided widgets, the
label of the widget tooltiptext for api-provided widgets, the tooltip of the widget showinprivatebrowsing for api-provided widgets, whether the widget is visible in private browsing single wrapper properties all of a wrapper's properties are read-only unless otherwise indicated. attribute description id the wid...
...note that you may prefer to use the group wrapper's getter/setter instead...
...note that you may prefer to use the group wrapper's getter/setter instead. ...
CustomizableUI.jsm
s that span the entire menu panel. panel_column_count number 3, the (constant) number of columns in the menu panel. examples createwidget - button type this is likely the code you need for your widget. only rare need a type:custom widget. ...
...so if we register listener first, then it catches the initial adds. when the button is in the panel area, it needs a 32x32 icon, and when in other p...
...ter a style sheet for that. this example here uses nsistylesheetservice to do so. ...
Interfacing with the Add-on Repository
installing the add-on the shownotification() routine displays a notification box offering to install the recommended add-on, if one was found, or reports an error if the search failed: shownotification: function(prompt, button, installobj) { ...
...e shownotification() routine displays a notification box offering to install the recommended add-on, if one was found, or reports an error if the search failed: shownotification: function(prompt, button, installobj) { this.install = installobj; var box = popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", prompt, null, /* anchor id */ {
label: button, accesskey: "i", callback: function() { if (popupnotifications.install) { popupnotifications.install.install(); } else { popupnotifications.remove(box); } } }, null /* secondary action */ ); } the code here starts by stashing the passed-in addonins...
... the pop-up callback function that gets called when the user clicks the button looks to see if there's a non-null addoninstall object reference; if it's null, then the pop-up is displaying an error notification, so clicking the button simply dismisses the pop-up. otherwise, the addoninstall object's install() method is called to install the add-on. this doesn't display ...
nss tech note2
display verbose information, including template values, array values, etc. to enable this mode, set: nspr_log_modules=nss_mod_log:4 nspr_log_file=<logfile> the output format is the same as above, but with more information. ...
...collect performance data. this mode is most useful in ...
...collect performance data. this mode is most useful in optimized builds. the number of calls to each pkcs #11 function will be counted, and the time spent in each function as well. ...
PKCS #11 Module Specs
ationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). librarydescription override the default librarydescription value for the module returned in the ck_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). cryptotokendescription override the default
label value for the internal crypto token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). dbtokendescription override the default
label value for the internal db token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 by...
...this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). ...
... fipsslotdescription, optimizespace, certprefix, keyprefix, flags, and minpwlen are copied from the parameters above. parameters: configdir the location of the databases for this token. if configdir is not specified, the default configdir specified earlier will be used. certprefix cert prefix for this token. keyprefix prefix for the key database for this token. tokendescription the
label value for this token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). slotdescription the slotdescription value for this token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partial utf8 characters...
Index
is 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 accesskey name, such as alt+d (alt +...
...ed_node_iterator_type or ordered_node_iterator_type result. 531 nsidomxulcontrolelement interfaces, interfaces:scriptable, reference, référence(2), xpcom interface reference no summary! 532 nsidomxulelement interfaces, interfaces:scriptable, needscontent, xpcom, xpcom interface reference attempts to remove focus from the element. ...
... base/ public/ nsmsgfolderflags.idl 1125 nsmsgjunkstatus interfaces, interfaces:scriptable, xpcom, xpcom interface reference, thunderbird defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl 1126 nsmsgkey xpcom, xpcom interface reference, thunderbird defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl 1127 nsmsg
labelvalue xpcom, xpcom interface reference, thunderbird defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl 1128 nsmsgpriorityvalue xpcom, xpcom interface reference, thunderbird defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl 1129 nsmsgruleactiontype interfaces, interfaces:scriptable, xpcom, xpcom interface reference, ...
nsIMacDockSupport
ort:', 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.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) macmenu.appendchild(macmenuitem); var mainpopupset = win.document.getelementbyi...
...check and wait for the window to be loaded. this can be done by adding a event listenr for load of the hidden window. this is the recommended way to add to the native menu, just maniuplate the default menu dom element. ...
... ...
nsIMsgDatabase
; void deleteheader(in nsimsgdbhdr msghdr, in nsidbchangelistener instigator,in boolean commit, in boolean notify); void removeheadermdbrow(in nsimsgdbhdr msghdr); void undodelete(in nsimsgdbhdr msghdr); void markmarked(in nsmsgkey key, in boolean mark, in nsidbchangelistener instigator); void markoffline(in nsmsgkey key, in boolean offline, in nsidbchangelistener instigator); void set
label(in nsmsgkey key, in nsmsg
labelvalue
label); void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adeleteviafolder); boolean hasnew(); void clearnewlist(in boolean notify); void...
...essage counts. ...
...oid removeheadermdbrow(in nsimsgdbhdr msghdr); undodelete() void undodelete(in nsimsgdbhdr msghdr); markmarked() void markmarked(in nsmsgkey key, in boolean mark, in nsidbchangelistener instigator); markoffline() void markoffline(in nsmsgkey key, in boolean offline, in nsidbchangelistener instigator); set
label() void set
label(in nsmsgkey key, in nsmsg
labelvalue
label); setstringproperty() void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); markimapdeleted() void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); applyretentionsettings() purge...
nsPIPromptService
underbird 3.1 / fennec 1.0) implemented by: the contract id isn't defined. this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++. the indexes for getstring() and setstring() are: emsg the value is 0. this is the message text of the dialog. echeckboxmsg the value is 1. this is the
label text of a checkbox on the dialog. eiconclass the value is 2. this is the class attribute value of the icon image. etitlemessage the value is 3. this is the heading of the message. eeditfield1msg the value is 4. this is the
label text of the first text field on the dialog. eeditfield2msg the value is 5. this is the
label text of the second text field on the dialog. eeditfield1value the value is 6.
...edialogtitle the value is 12. this is the title of the dialog. ...
...the dialog. eeditfield1value the value is 6. this is the default value of the first text field. this is also used for the result of the dialog. eeditfield2value the value is 7. this is the default value of the second text field. this is also used for the result of the dialog. ebutton0text the value is 8. this is the
label of the first button on the dialog. ebutton1text the value is 9. this is the
label of the second button on the dialog. ebutton2text the value is 10. this is the
label of the third button on the dialog. ebutton3text the value is 11. this is the
label of the forth button on the dialog. edialogtitle the value is 12. this is the title of the dialog. eopeningsound obsolete since gecko 1.9.2 the value is 13. this is the system sound name which should be played when the dialog is sho...
Add Option to Context Menu
erlay chrome://messenger/content/mailwindowoverlay.xul chrome://myext/content/thunderbird-overlay.xul add the next in thunderbird-overlay.xul. ...
...t/mailwindowoverlay.xul chrome://myext/content/thunderbird-overlay.xul add the next in thunderbird-overlay.xul. ...
... <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/mailwindowoverlay.xul chrome://myaddon/content/tbov...
Using popup notifications
eated using the popupnotifications.jsm javascript code module. this code module is imported by the browser, so you don't need to do it explicitly yourself. then you can create the popup notification at the appropriate time like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ {
label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, null /* secondary action */ ); in this case, we aren't providing any secondary actions; that is, actions provided to the user through the drop-down menu. this notification looks like this: that's not very pretty; where's the icon?
...s/skin/mozlogo.png"); } with this css in place, the result is the look we want: adding secondary options to provide options in the drop-down menu, add an array of notification actions to the call to the show() method, like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ {
label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, [ {
label: "first secondary option", accesskey: "1", callback: function() { alert("first secondary option selected."); } }, {
label: "second ...
... ...
Responsive Design Mode - Firefox Developer Tools
are no longer automatic, and informed about how you can make them automatic. for example: developer toolbox with rdm you can show or hide the developer tools toolbox independently of toggling responsive design mode itself: while responsive design mode is enabled, you can continue browsing as you normally would in the resized content area. device selection just above the viewport there is a
label "no device selected"; click this to see a list of device names. select a device, and responsive design mode sets the following properties to match the selected device: screen size device pixel ratio (the ratio of device physical pixels to device-independent pixels) touch event simulation additionally, firefox sets the user-agent http request header to identify itself as the default browser...
..., 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 responsi...
.../s 500 regular 2g 250 kb/s 50 kb/s 300 good 2g 450 kb/s 150 kb/s 150 regular 3g 750 kb/s 250 kb/s 100 good 3g 1.5 mb/s 750 kb/s 40 regular 4g/lte 4 mb/s 3 mb/s 20 dsl 2 mb/s 1 mb/s 5 wi-fi 30 mb/s 15 mb/s 2 to select a network, click the list box that's initially
labeled "no throttling": ...
Console messages - Firefox Developer Tools
into when reflow events are being triggered, how long they take to execute and, if the reflows are synchronous reflows triggered from javascript, which code triggered them. reflow events are logged as "reflow" messages, as distinct from css errors or warnings. by default, they are disabled. you can enable them by clicking the "css" button in the toolbar and selecting "reflows". each message is
labeled "reflow" and shows the time taken to execute the reflow. if the reflow is a synchronous reflow triggered from javascript, it also shows a link to the line of code that triggered the reflow. click the link to open the file in the debugger. synchronous and asynchronous reflows if a change is made that invalidates the current layout — for example, the browser window is resized or some javascr...
... temp1, etc.) whose value is the selected object. the name of the variable appears as an input to the interpreter, and its value appears as a response. copy object copies the selected object to the clipboard. filtering and searching filtering by category you can use the toolbar along the top to constrain the results displayed. to see only messages of particular categories, click the button
labeled with that category (errors, css, and so on). for errors and warnings, when you turn off display of the category, a number appears next to the button text to indicate how many messages of that type are available. for example, "warnings (25)". network requests with response codes in the 400-499 (client error) or 500-599 (server error) ranges are considered errors. their display is controlled by...
...to the button text to indicate how many messages of that type are available. for example, "warnings (25)". network requests with response codes in the 400-499 (client error) or 500-599 (server error) ranges are considered errors. their display is controlled by the errors button, not the requests button. filtering by text to see only messages that contain a specific string, type in the text box
labeled "filter output". 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, ...
AddressErrors - Web APIs
we declare the variables supportedhandlers, which is compatible with paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object. ...
...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 handler is supported, ...
...e } ] }; supportedhandlers describes the supported 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(supportedhandle...
AudioTrack - Web APIs
an be used to locate a specific track within an audio track list by calling audiotracklist.gettrackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main".
label read only a domstring providing a human-readable
label for the track. for example, an audio commentary track for a movie might have a
label of "commentary with director john q. public and actors john doe and jane eod." this string is empty if no
label is provided. language read only a domstring specifying the audio track's primary language, or an empty string if unknown. the language is spec...
...the user's preferred language (taken from a variable userlanguage) and disabling any others. tracks.foreach(function(track) { if (track.language === userlanguage) { track.enabled = true; } else { track.enabled = false; } }); the language is in standard (rfc 5646) format. for us english, this would be "en-us", for example. example this example returns an array of track kinds and
labels for potential use in a user interface to select audio tracks for a specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { ...
...ified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind,
label: track.
label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, with each entry providing the track's id, kind, and
label. specifications specification status comment html living standardthe definition of 'audiotrack' in that specification. living standard ...
Background Tasks API - Web APIs
r know how long decoding "quantum filament tachyon emissions" will take, after all) as well as a second main box (with the id "logbox"), which is used to display textual output. <p> demonstration of using <a href="/docs/web/api/background_tasks_api"> cooperatively scheduled background tasks</a> using the <code>requestidlecallback()</code> method. ...
...> demonstration of using <a href="/docs/web/api/background_tasks_api"> cooperatively scheduled background tasks</a> using the <code>requestidlecallback()</code> method. </p> <div class="container"> <div class="
label">decoding quantum filament tachyon emissions...</div> <progress id="progress" value="0"></progress> <div class="button" id="startbutton"> start </div> <div class="
label counter"> task <span id="currenttasknumber">0</span> of <span id="totaltaskcount">0</span> </div> </div> <div class="logbox"> <div class="logheader"> log </div> <div id="log"> </div> </div> the progress box uses a <progress> element to show the progress, along with a
label with sections that are changed to present numeric information about the progress. in addition, there's a ...
... background-color: lightblue; border-bottom: 1px solid black; border-radius: 6px 6px 0 0; } #log { font: 12px "courier", monospace; padding: 6px; overflow: auto; overflow-y: scroll; width: 388px; height: 460px; } .container { width: 400px; padding: 6px; border-radius: 6px; border: 1px solid black; box-shadow: 4px 4px 2px black; display: block; overflow: auto; } .
label { display: inline-block; } .counter { text-align: right; padding-top: 4px; float: right; } .button { padding-top: 2px; padding-bottom: 4px; width: 100px; display: inline-block; float: left; border: 1px solid black; cursor: pointer; text-align: center; margin-top: 0; color: white; background-color: darkgreen; } #progress { width: 100%; padding-top: 6px; } jav...
BasicCardRequest - Web APIs
these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
... conform to the structure defined by the basiccardrequest dictionary. ...
... // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the res...
BasicCardResponse - Web APIs
e example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
... basiccardrequest dictionary. ...
... // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the res...
BroadcastChannel: message event - Web APIs
no cancelable no interface messageevent event handler property onmessage examples live example in this example there's a "sender" <iframe> that broadcasts the contents of a <textarea> when the user clicks a button. there are two "receiver" iframes that listen to the broadcast message and write the result into a <div> element. ...
... messageevent event handler property onmessage examples live example in this example there's a "sender" <iframe> that broadcasts the contents of a <textarea> when the user clicks a button. there are two "receiver" iframes that listen to the broadcast message and write the result into a <div> element. ...
...adcast:</
label><br/> <textarea id="message" name="message" rows="1" cols="40">hello</textarea> <button id="broadcast-message" type="button">broadcast message</button> body { border: 1px solid black; padding: .5rem; height: 150px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } textarea { padding: .2rem; }
label, br { margin: .5rem 0; } button { vertical-align: top; height: 1.5rem; } const channel = new broadcastchannel('example-channel'); const messagecontrol = document.queryselector('#message'); const broadcastmessagebutton = document.queryselector('#broadcast-message'); broadcastmessagebutton.addeventlistener('click', () => { channel.postmessage(messagecontrol.value); }) receiver...
Console.table() - Web APIs
displays tabular data as a table. this function takes one mandatory argument data, which must be an array or an object, and one additional optional parameter columns. it logs data as a table. each element in the array (or enumerable property if data is an object) will be a row in the table. the first column in the table will be
labeled (index). if data is an array, then its values will be the array indices. if data is an object, then its values will be the property names. note that (in firefox) console.table is limited to displaying 1000 rows (first row is the
labeled index). note: this feature is available in web workers. collections of primitive types the data argument may be an array or an object. // an array of strings console.table(["apples", "oranges", "bananas"]); // an objec...
... // an object whose properties are objects var family = {}; family.mother = new person("jane", "smith"); family.father = new person("john", "smith"); family.daughter = new person("emily", "smith"); console.table(family); restricting the columns displayed by default, console.table() lists all elements in each row. you can use the optional columns parameter to sel...
...objects, logging only firstname function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var john = new person("john", "smith"); var jane = new person("jane", "doe"); var emily = new person("emily", "jones"); console.table([john, jane, emily], ["firstname"]); sorting columns you can sort the table by a particular column by clicking on that column's
label. syntax console.table(data [, columns]); parameters data the data to display. this must be either an array or an object. columns an array containing the names of columns to include in the output. specifications specification status comment console apithe definition of 'console.table()' in that specification. living standard initial definition ...
Document: readystatechange event - Web APIs
the readystatechange event is fired when the readystate attribute of a document has changed. ...
... the readystatechange event is fired when the readystate attribute of a document has changed. ...
...> </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(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcon...
Element: compositionend event - Web APIs
a pinyin ime. ...
...dler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionend', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <
label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</
label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; }...
...xample"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; }
label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textco...
Element: compositionstart event - Web APIs
pinyin ime. ...
...er property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionstart', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <
label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</
label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; }...
...xample"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; }
label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textco...
Element: compositionupdate event - Web APIs
inyin ime. ...
...r property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionupdate', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <
label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</
label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; }...
...xample"> </div> <div class="event-log"> <
label>event log:</
label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-template-areas: "control log"; } .control { grid-area: control; } .event-log { grid-area: log; } .event-log-contents { resize: none; }
label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textco...
Element: error event - Web APIs
no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise. ...
...rface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise. ...
...> </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) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = documen...
HTMLMediaElement: loadstart event - Web APIs
the loadstart event is fired when the browser has started to load a resource. ...
...adstart event is fired when the browser has started to load a resource. ...
...> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { grid-area: video; } .event-log { grid-area: log; } .event-log>
label { display: block; } js const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', ...
HTMLMediaElement: progress event - Web APIs
the progress event is fired periodically as the browser loads a resource. ...
...he progress event is fired periodically as the browser loads a resource. ...
...> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { grid-area: video; } .event-log { grid-area: log; } .event-log>
label { display: block; } javascript const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('pro...
HTMLMediaElement.textTracks - Web APIs
here we print all the properties of each english track to the console. var tracks = document.queryselector('video').texttracks; ...
... here we print all the properties of each english track to the console. var tracks = document.queryselector('video').texttracks; for (var i = 0, l = tracks.length; i < l; i++) { /* tracks.length == 10 */ i...
...s" src="samplesubtitles_en.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_ja.vtt" srclang="ja"> <track kind="subtitles" src="samplesubtitles_oz.vtt" srclang="oz"> <track kind="metadata" src="keystage1.vtt" srclang="en"
label="key stage 1"> <track kind="metadata" src="keystage2.vtt" srclang="en"
label="key stage 2"> <track kind="metadata" src="keystage3.vtt" srclang="en"
label="key stage 3"> </video> the htmlmediaelement.texttracks returns a texttrackslist thru which we can iterate. here we print all the properties of each english track to the console. var tracks = document.queryselector('video').texttracks; for (var i = 0, l = tracks.length; i < l; i++) { /* tracks.length == 10 */ if (tracks[i].language == 'en') { console.dir(tracks[i]); } } prope...
HTMLSelectElement.selectedOptions - Web APIs
e 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. ...
...d 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. ...
...order"); let itemlist = document.getelementbyid("foods"); let outputbox = document.getelementbyid("output"); orderbutton.addeventlistener("click", function() { let collection = itemlist.selectedoptions; let output = ""; for (let i=0; i<collection.length; i++) { if (output === "") { output = "your order for the following items has been placed: "; } output += collection[i].
label; if (i === (collection.length - 2) && (collection.length < 3)) { output += " and "; } else if (i < (collection.length - 2)) { output += ", "; } else if (i === (collection.length - 2)) { output += ", and "; } } if (output === "") { output = "you didn't order anything!"; } outputbox.innerhtml = output; }, false); this script sets up a click event l...
Using the Media Capabilities API - Web APIs
uration. ...
...ies.decodinginfo(videoconfiguration).then( console.log('it worked') ).catch(error => console.log('it failed: ' + error) ); media capabilities live example css li { margin : 1em; } html <form> <p>select your video configuration and find out if this browser supports the codec, and whether decoding will be smooth and power efficient:</p> <ul> <li> <
label for="codec">select a codec</
label> <select id="codec"> <option>video/webm; codecs=vp8</option> <option>video/webm; codecs=vp9</option> <option>video/mp4; codecs=avc1</option> <option>video/mp4; codecs=avc1.420034</option> <option>video/ogg; codecs=theora</option> <option>invalid</option> </select> </li> <li> <
label for="size">select a size</
label> <select id="size"> <o...
...bel for="size">select a size</
label> <select id="size"> <option>7680x4320</option> <option>3840x2160</option> <option>2560x1440</option> <option>1920x1080</option> <option>1280x720</option> <option selected>800x600</option> <option>640x480</option> <option>320x240</option> <option value=" x ">none</option> </select> </li> <li> <
label for="framerate">select a framerate</
label> <select id="framerate"> <option>60</option> <option>50</option> <option>30</option> <option>24</option> <option selected>15</option> </select> </li> <li> <
label for="bitrate">select a bitrate</
label> <select id="bitrate"> <option>4000</option> <option>2500</option> <option>800</option>...
ParentNode.replaceChildren() - Web APIs
nt specified: mynode.replacechildren(); transferring nodes between parents replacechildren() enables you to easily transfer nodes between parents, without having to resort to verbose looping code. for example, say we have a simple application allowing you to choose what food you want for your party. ...
...cechildren(); transferring nodes between parents replacechildren() enables you to easily transfer nodes between parents, without having to resort to verbose looping code. for example, say we have a simple application allowing you to choose what food you want for your party. ...
... cream</option> <option>jelly</option> <option>carrot sticks and houmous</option> <option>margherita pizza</option> <option>pepperoni pizza</option> <option>vegan veggie pizza</option> </select> </div> <div class="buttons"> <button id="to-yes">transfer to "yes" --></button> <button id="to-no"><-- transfer to "no"</button> </div> <div> <
label for="yes">yes please!</
label> <select id="yes" multiple size="10"> </select> </div> </main> it would make sense to use some simple css to lay out the two select lists in a line alongside one another, with the control buttons in between them: main { display: flex; } div { margin-right: 20px; }
label, button { display: block; } .buttons { display: flex; flex-flow: column;...
PaymentAddress - Web APIs
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. ...
... 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. ...
...ined by the basiccardrequest dictionary. const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { 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, }, ], }; const options = { requestshipping: true }; async function dopaymentrequest() { const request = new paymentrequest(supportedinstruments, details, options); // add event listeners here. // call show() to trigger the browser's payment flow. const response = await request.show(); /...
PaymentRequest.PaymentRequest() - Web APIs
t parameters. examples the following example shows minimal functionality and focuses instead on showing the complete context of instantiating a paymentrequest object. ...
...d on showing the complete context of instantiating a paymentrequest object. ...
... // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the res...
TextDecoder() - Web APIs
the textdecoder() constructor returns a newly created textdecoder object for the encoding specified in parameter. if the value for utf
label is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utf
label, options); parameters utf
labeloptional is a domstring, defaulting to "utf-8", containing the
label of the encoder. ...
... specified in parameter. if the value for utf
label is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utf
label, options); parameters utf
labeloptional is a domstring, defaulting to "utf-8", containing the
label of the encoder. ...
...alues leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utf
label, options); parameters utf
labeloptional is a domstring, defaulting to "utf-8", containing the
label of the encoder. ...
ValidityState.patternMismatch - Web APIs
traints set by the element's pattern attribute. if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true. ...
...xt, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true. ...
...lue don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true. examples given the following: <p> <
label>enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-
label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-
label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-
label="4-digit number" size="3"/> </
label> </p> here we have 3 sections for a north american phone number with an implicit
label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each. i...
Movement, orientation, and motion: A WebXR example - Web APIs
ession_type constant. function setupxrbutton() { if (navigator.xr.issessionsupported) { navigator.xr.issessionsupported(session_type) .then((supported) => { xrbutton.disabled = !supported; }); } else { navigator.xr.supportssession(session_type) .then(() => { xrbutton.disabled = false; }) .catch(() => { xrbutton.disabled = true; }); } } the
label of the button gets adjusted in the code that handles actuallys ttarting and stopping the webxr session; we'll see that below. the webxr session is toggled on and off by the handler for click events on the button, whose
label is appropriately set to either "enter webxr" or "exit webxr". this is done by the onxrbuttonclick() event handler. async function onxrbuttonclick(event) { if (!xrsession)...
... then we get a reference to the <canvas> found in our html—as well as its webgl rendering context—which will be used as the drawing surface for the scene. the xrcompatible property is requested when calling getcon...
...t; we have set this up to call a function called sessionended(). function sessionended() { xrbutton.innertext = "enter webxr"; if (animationframerequestid) { xrsession.cancelanimationframe(animationframerequestid); animationframerequestid = 0; } xrsession = null; } we can also call sessionended() directly if we wish to programmatically end the webxr session. in either case, the
label of the button is updated to indicate that a click will start a session, and then, if there is a pending request for an animation frame, we cancel it by calling cancelanimationframe once that's done, the value of xrsession is changed to null to indicate that we're done with the session. implementing the controls now let's take a look at the code that handles turning keyboard and mouse events in...
Using the Web Speech API - Web APIs
trivial, simply containing a title, some instructions for use, and a form with some simple controls. the <select> element is initially empty, but is populated with <option>s via javascript (see later on.) <h1>speech synthesiser</h1> <p>enter some text in the input below and press return to hear it. ...
...ing a title, some instructions for use, and a form with some simple controls. the <select> element is initially empty, but is populated with <option>s via javascript (see later on.) <h1>speech synthesiser</h1> <p>enter some text in the input below and press return to hear it. ...
...see later on.) <h1>speech synthesiser</h1> <p>enter some text in the input below and press return to hear it. change voices using the dropdown menu.</p> <form> <input type="text" class="txt"> <div> <
label for="rate">rate</
label><input type="range" min="0.5" max="2" value="1" step="0.1" id="rate"> <div class="rate-value">1</div> <div class="clearfix"></div> </div> <div> <
label for="pitch">pitch</
label><input type="range" min="0" max="2" value="1" step="0.1" id="pitch"> <div class="pitch-value">1</div> <div class="clearfix"></div> </div> <select> </select> </form> javascript let's investigate the javascript that powers this app. setting variables first of all, we capture references to all the dom elements involved in the ui, but more interestingly, we...
Window: error event - Web APIs
interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise. ...
...e event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise. ...
...> </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}: ${event.message}\n`; console.log(event) }); const scripterror = document.queryselector('#script-error'); scripterror...
Using the radio role - Accessibility
o use the radio role and describes the effect it has on browsers and assistive technology. possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
...hnology. possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
...le effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: example from the basic form hints mdn page. ...
ARIA: row role - Accessibility
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 optionally within a rowgroup. ...
...le columns, see the columnheader aria role. the first rule of aria use is you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. employ the html <table> element instead of the aria role of table whenever possible. ...
...ata table structure. you can add these aria roles to ensure accessibility should the native semantics of the table be removed, such as with css. a relevant use case for the aria table role is when the native semantics of a table are overridden by css's display property, such as by display: grid. in this case, you can use the aria table roles to add the semantics back in. ...
ARIA: rowgroup role - Accessibility
an element with role="rowgroup" is a group of rows within a tabular structure. a rowgroup contains one or more rows of cells, grid cells, column headers, or row headers within a grid, table or treegrid. ...
...one required javascript features none. the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. employ the html <table> element instead of the aria role of table whenever possible. ...
... on for data table structure. you can add these aria roles to ensure accessibility should the native semantics of the table be removed, such as with css. a relevant use case for the aria table role is when the css's display property overrides the native semantics of a table, such as by display: grid. in this case, you can use the aria table roles to add in the semantics. ...
ARIA: switch role - Accessibility
o the checkbox role, except that instead of representing "checked" and "unchecked" states, which are fairly generic in meaning, the switch role represents the states "on" and "off." this example creates a widget and assigns the aria switch role to it. <button type="button" role="switch" aria-checked="true" id="speakerpower" class="switch"> <span>off</span> <span>on</span> </button> <
label for="speakerpower" class="switch">speaker power</
label> description the aria switch role is identical to the checkbox role, except instead of being "checked" or "unchecked", it is either "on" and "off." like the checkbox role, the aria-checked attribute is required. the two possible values are true and false. unlike a <checkbox> or role="checkbox", there is no indeterminate or mixed state. the...
... this simple example just creates a widget and assigns the aria switch role to it. the button is styled with an appearance reminiscent of an on/off power switch. html the html is fairly simple here. the switch is implemented as a <button> element which is initially checked courtesy of its aria-checked attribute being set to "true". the switch has two child elements containing the "off" and "on"
labels and is followed by a <
label> identifying the switch. <button role="switch" aria-checked="true" id="speakerpower" class="switch"> <span>off</span> <span>on</span> </button> <
label for="speakerpower" class="switch">speaker power</
label> javascript this javascript code defines and applies a function to handle click events on switch widgets. the function changes the aria-checked attrib...
...dle; text-align: center; font: 12px "open sans", "arial", serif; } button.switch span { padding: 0 4px; pointer-events: none; } [role="switch"][aria-checked="false"] :first-child, [role="switch"][aria-checked="true"] :last-child { background: #262; color: #eef; } [role="switch"][aria-checked="false"] :last-child, [role="switch"][aria-checked="true"] :first-child { color: #bbd; }
label.switch { font: 16px "open sans", "arial", sans-serif; line-height: 20px; user-select: none; vertical-align: middle; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; -o-user-select: none; } the most interesting part is probably the use of attribute selectors and the :first-child and :last-child pseudo-classes to do all the heavy lifting of changing the app...
:focus-within - CSS: Cascading Style Sheets
cendants is focused */ div:focus-within { background: cyan; } this selector is useful, to take a common example, for highlighting an entire <form> container when the user focuses on one of its <input> fields. syntax :focus-within examples in this example, the form will receive special coloring styles when either text input receives focus. ...
...hin { background: cyan; } this selector is useful, to take a common example, for highlighting an entire <form> container when the user focuses on one of its <input> fields. syntax :focus-within examples in this example, the form will receive special coloring styles when either text input receives focus. ...
...o take a common example, for highlighting an entire <form> container when the user focuses on one of its <input> fields. syntax :focus-within examples in this example, the form will receive special coloring styles when either text input receives focus. html <p>try typing into this form.</p> <form> <
label for="given_name">given name:</
label> <input id="given_name" type="text"> <br> <
label for="family_name">family name:</
label> <input id="family_name" type="text"> </form> css form { border: 1px solid; color: gray; padding: 4px; } form:focus-within { background: #ff8; color: black; } input { margin: 4px; } result specifications specification status comment selectors level 4the definition of ':focus-within' in that specification. ...
:valid - CSS: Cascading Style Sheets
erly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...to position: relative so that we can position the generated content relative to them. we then absolutely position different generated content depending on whether the form's data is valid or invalid — a green check or a red cross, respectively. to add a bit of extra urgency to the invalid data, we've also given the inputs a thick red border when invalid. note: we've used ::before to add these
labels, as we were already using ::after for the "required"
labels. you can try it below: notice how the required text inputs are invalid when empty, but valid when they have something filled in. the email input on the other hand is valid when empty, as it is not required, but invalid when it contains something that is not a proper email address. accessibility concerns the color green is commonl...
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <form> <
label for="x1">x1 = </
label><input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <
label for="y1">y1 = </
label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <
label for="x2">x2 = </
label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <
label for="y2">y2 = </
label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <output id="output">log</output> </form> </html> .field { width: 40px; } function updatecanvas() { var x1 = ...
... ctx.moveto(-2 * basic_scale_size + cx(0), ly(i)); ctx.filltext(math.round(i * 10) / 10, -3 * basic_scale_size + cx(0), cy(i) + 4); // limitation the constant 4 should be font size dependant } ctx.lineto(cx(0), ly(i)); } ctx.stroke(); ctx.closepath(); ctx.beginpath(); // draw the y axis
label ctx.save(); ctx.rotate(-math.pi / 2); ctx.textalign = "left"; ctx.filltext("output (value ratio)", -cy(0), -3 * basic_scale_size + cx(0)); ctx.restore(); // draw the x axis ctx.moveto(cx(0), cy(0)); ctx.lineto(cx(0), cy(1)); ctx.textalign = "center"; for (i = 0.1; i <= 1; i = i + 0.1) { ctx.moveto(lx(i), ...
... basic_scale_size + cy(0)); if ((i == 0.5) || (i > 0.9)) { ctx.moveto(lx(i), 2 * basic_scale_size + cy(0)); ctx.filltext(math.round(i * 10) / 10, cx(i), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size } ctx.lineto(lx(i), cy(0)); } // draw the x axis
label ctx.textalign = "left"; ctx.filltext("input (time duration ratio)", cx(0), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size ctx.stroke(); ctx.closepath(); // draw the bézier curve ctx.beginpath(); ctx.moveto(cx(0), cy(0)); ctx.strokestyle = 'blue'; ctx.beziercurveto(cx...
<display-internal> - CSS: Cascading Style Sheets
ke <rb> html elements. ruby-text these elements behave like <rt> html elements. ruby-base-container these elements behave like <rbc> html elements generated as anonymous boxes. ruby-text-container these elements behave like <rtc> html elements. examples css tables example the following example demonstrates laying out a simple form using css table layout. ...
... ruby-text these elements behave like <rt> html elements. ruby-base-container these elements behave like <rbc> html elements generated as anonymous boxes. ruby-text-container these elements behave like <rtc> html elements. examples css tables example the following example demonstrates laying out a simple form using css table layout. ...
...tainer these elements behave like <rbc> html elements generated as anonymous boxes. ruby-text-container these elements behave like <rtc> html elements. examples css tables example the following example demonstrates laying out a simple form using css table layout. html <main> <div> <
label for="name">name</
label> <input type="text" id="name" name="name"> </div> <div> <
label for="age">age</
label> <input type="text" id="age" name="age"> </div> </main> css main { display: table; } div { display: table-row; }
label, input { display: table-cell; margin: 5px; } result specifications specification status css display module level 3the definition of 'display-internal' in that specification. candidate recommendation ...
<length> - CSS: Cascading Style Sheets
ith the animation. examples length unit comparison the following demo provides you with an input field in which you can enter a <length> value (e.g. 300px, 50%, 30vw) to set the width of a result bar that will appear below it once you've pressed return. this allows you to compare and contrast the effect of different length units. ...
...examples length unit comparison the following demo provides you with an input field in which you can enter a <length> value (e.g. 300px, 50%, 30vw) to set the width of a result bar that will appear below it once you've pressed return. this allows you to compare and contrast the effect of different length units. ...
... 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('input'); const resultsdiv = document.queryselector('.results'); inputelem.addeventlistener('change', () => { inputdiv.style.width = inputelem.value; const result = document.createelement('div'); result.classname = 'result'; result.style.width = inputelem...
Rich-Text Editing in Mozilla - Developer guides
ml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode
label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</op...
... resources mozilla.org's rich-text editing specification mozilla.org's rich-text editing demo converting an app using document...
... resources mozilla.org's rich-text editing specification mozilla.org's rich-text editing demo converting an app using document.designmode from ie to mozilla at...
Making content editable - Developer guides
ml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode
label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</op...
... ...
... ...
HTML attribute: capture - HTML: Hypertext Markup Language
note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. ...
... if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. ...
...phone be used instead of requesting a file input. examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. <p> <
label for="soundfile">what does your voice sound like?:</
label> <input type="file" id="soundfile" capture="user" accept="audio/*"> </p> <p> <
label for="videofile">upload a video:</
label> <input type="file" id="videofile" capture="environment" accept="video/*"> </p> <p> <
label for="imagefile">upload a photo of yourself:</
label> <input type="file" id="imagefile" capture="user" accept="image/*"> </p> note these work better on mobile devices; if your device is a desktop computer, you'll likely get a typical file picker. specifications...
HTML attribute: required - HTML: Hypertext Markup Language
accessibility concerns provide an indication to users informing them the form control is required. ...
...y concerns provide an indication to users informing them the form control is required. ...
... ensure the messaging is multi-faceted, such as thru text, color, markings, and attribute, so that all users understand the requirements whether they have color blindness, cognitive differences, or are using a screen reader. example html <form> <div class="group"> <input type="text"> <
label>normal</
label> </div> <div class="group"> <input type="text" required="required"> <
label>required</
label> </div> <input type="submit"> </form> result ...
HTML attribute reference - HTML: Hypertext Markup Language
resource. draggable global attribute defines whether the element can be dragged. dropzone global attribute indicates that the element accepts the dropping of content onto it. enctype <form> defines the content type of the form data when the method is post. ...
...e content type of the form data when the method is post. enterkeyhint <textarea>, contenteditable the enterkeyhint specifies what action
label (or icon) to present for the enter key on virtual keyboards. 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). for <
label>, <output> describes elements which belongs to this one. form <button>, <fieldset>, <input>, <keygen>, <
label>, <meter>, <object>, <output>, <progress>, <select>, <textarea> indicates the form that is the owner of the element. formaction <input>, <button> indicates the action of the element, overriding the action defined in the <form>. formenctype <but...
...orm 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 used in the element. loading <img>, <iframe> indicates if the element should be loaded lazily (loading="lazy") or loaded immediately (loading="eager"). wi...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
contents can be any heading content, plain text, or html that can be used within a paragraph. a <summary> element may only be used as the first child of a <details> element. when the user clicks on the summary, the parent <details> element is toggled open or closed, and then a toggle event is sent to the <details> element, which can be used to let you know when this state change occurs. ...
...ild of a <details> element. when the user clicks on the summary, the parent <details> element is toggled open or closed, and then a toggle 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 compat...
...g css. warning: because the <summary> element has a default role of button (which strips all roles from child elements), this example will not work for users of assistive technologies such as screen readers. the <h4> will have its role removed and thus will not be treated as a heading for these users. html in summaries this example adds some semantics to the <summary> element to indicate the
label as important: <details open> <summary><strong>overview</strong></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> specifications specification status comment html living standardthe definition of '<summary>' in that specification. living standard html 5.1the d...
HTML elements reference - HTML: Hypertext Markup Language
lickable button, used to submit forms or anywhere in a document for accessible, standard button functionality. <datalist> the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls. <fieldset> the html <fieldset> element is used to group several controls as well as
labels (<
label>) within a web form. <form> the html <form> element represents a document section 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...
... <form> the html <form> element represents a document section 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 optio...
...popup menu. this includes context menus, as well as menus that might be attached to a menu button. <multicol> the html multi-column layout element (<multicol>) was an experimental element designed to allow multi-column layouts and must not be used. <nextid> <nextid> is an obsolete html element that served to enable the next web designing tool to generate automatic name
labels for its anchors. <nobr> the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text. <noembed> the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for b...
HTML documentation index - HTML: Hypertext Markup Language
embed the html <embed> element embeds external content at the specified point in the document. this content is provided by an external application or other source of interactive content such as a browser plug-in. 99 <fieldset>: the field set element element, forms, html, html forms, reference, web the html <fieldset> element is used to group several controls as well as
labels (<
label>) within a web form. 100 <figcaption>: the figure caption element element, html, html grouping content, reference the html <figcaption> or figure caption element represents a caption or legend describing the rest of the contents of its parent <figure> element. 101 <figure>: the figure with optional caption element element, html, html grouping content, ...
...cilitate generation of key material, and submission of the public key as part of an html form. this mechanism is designed for use with web-based certificate management systems. it is expected that the <keygen> element will be used in an html form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate. 146 <
label> element, forms, html, html forms, reference, web the html <
label> element represents a caption for an item in a user interface. 147 <legend> element, forms, html, html forms, reference, web the html <legend> element represents a caption for the content of its parent <fieldset>. 148 <li> element, html, html grouping content, reference the html <...
...urpose is to provide navigation links, either within the current document or to other documents. common examples of navigation sections are menus, tables of contents, and indexes. 163 <nextid>: the next id element (obsolete) element, html, obsolete, reference, web <nextid> is an obsolete html element that served to enable the next web designing tool to generate automatic name
labels for its anchors. 164 <nobr>: the non-breaking text element (obsolete) element, html, non-standard, obsolete, reference, web, nobr the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text. 165 <no...
MathML attribute reference - MathML
<math> visual and textual fall-back options. bevelled <mfrac> specifies the style how the fraction should be displayed. deprecated. use u+2044 (fraction slash) instead. unimplemented charalign <mstack> specifies the horizontal alignment of digits. close <mfenced> a string for the closing delimiter. columnalign <mtable>, <mtd>, <mtr>, <m
labeledtr> specifies the horizontal alignment of table cells. columnlines <mtable> specifies table column borders. columnspacing <mtable> specifies the space between table columns. columnspan <mtd> a non-negative integer value that indicates over how many table columns the cell extends. unimplemented columnwidth <mtable> specifies the width...
... color names. mathcolor all the text color. you can use #rgb, #rrggbb and html color names. mathsize <mi>, <mn>, <mo>, <ms>, <mtext> the size of the content. mathvariant <mi>, <mn>, <mo>, <ms>, <mtext> the logical class of the identifier, which varies in typography. maxsize <mo> the maximum size of the operator. unimplemented min
labelspacing <mtable> a length value specifing the minimum space between a
label and the adjacent cell in the row. minsize <mo> the minimum size of the operator. movablelimits <mo> specifies whether attached under- and overscripts move to sub- and superscript positions. notation <menclose> a list of notations, separated by white space, to apply to the ...
...ressed by the action. separator <mo> there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). separators <mfenced> a sequence of zero or more characters to be used for different separators. unimplemented shift <msgroup> unimplemented side <mtable> specifies the position where <m
labeledtr>
label elements should be placed. unimplemented src <mglyph> the location of the image resource. unimplemented stackalign <mstack> stretchy <mo> specifies whether the operator stretches to the size of the adjacent element. subscriptshift <mmultiscripts>, <msub>, <msubsup> the minimum space by which to shift the subscript below the...
Content Scripts - Archive of obsolete content
a button to firefox: when the user clicks the button, the add-on attaches a content script to the active tab, sends the content script a message called "my-addon-message", and listens for a response called "my-script-response": //main.js var tabs = require("sdk/tabs"); var buttons = require("sdk/ui/button/action"); var self = require("sdk/self"); buttons.actionbutton({ id: "attach-script",
label: "attach the script", icon: "./icon-16.png", onclick: attachscript }); function attachscript() { var worker = tabs.activetab.attach({ contentscriptfile: self.data.url("content-script.js") }); worker.port.on("my-script-response", function(response) { console.log(response); }); worker.port.emit("my-addon-message", "message from the add-on"); } // content-script.js self.por...
...({ 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(event);' ...
indexed-db - Archive of obsolete content
r all the details. the database created will be unique and private per add-on, and is not linked to any website database. the module cannot be used to interact with a given website database. 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(...
...tore.opencursor(keyrange); cursorrequest.onsuccess = function(e) { var result = e.target.result; if(!!result == false) return; items.push(result.value.name); result.continue(); }; cursorrequest.onerror = database.onerror; }; function listitems(itemlist) { console.log(itemlist); } open("1"); var add = require("sdk/ui/button/action").actionbutton({ id: "add",
label: "add", icon: "./add.png", onclick: function() { additem(require("sdk/tabs").activetab.title); } }); var list = require("sdk/ui/button/action").actionbutton({ id: "list",
label: "list", icon: "./list.png", onclick: function() { getitems(listitems); } }); note that to run this add-on you'll need to provide icons named "add.png" and "list.png" in the add-on's "data" direc...
ui/sidebar - Archive of obsolete content
h: function (worker) { console.log("attaching"); }, onshow: function () { console.log("showing"); }, onhide: function () { console.log("hiding"); }, ondetach: function () { console.log("detaching"); } }); parameters options : object required options: name type title string a title for the sidebar. this will be used for the
label for your sidebar in the "sidebar" submenu in firefox, and will be shown at the top of your sidebar when it is open. url string the url of the content to load in the sidebar. this must be a local url (typically, loaded from the "data" folder using self.data.url()). from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html"). ...
...ener(type, listener) unregisters/removes an event listener from the sidebar. parameters type : string the type of event for which listener was registered. listener : function the listener function that was registered. properties id the id of the sidebar. this used to identify this sidebar in its chrome window. it must be unique. title the title of the sidebar. this will be used for the
label for your sidebar in the "sidebar" submenu in firefox, and will be shown at the top of your sidebar when it is open. url the url of the content to load in the sidebar. this must be a local url (typically, loaded from the "data" folder using self.data.url()). events attach this event is emitted when a worker is attached to a sidebar, as a result of any of the following: calling the sidebar'...
ui/toolbar - Archive of obsolete content
action buttons toggle buttons frames this add-on builds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { actionbutton } = require('sdk/ui/button/action'); var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var previous = actionbutton({ id: "previous",
label: "previous", icon: "./icons/previous.png" }); var next = actionbutton({ id: "next",
label: "next", icon: "./icons/next.png" }); var play = actionbutton({ id: "play",
label: "play", icon: "./icons/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just ab...
...ion is title, but for the toolbar to contain any actual content, the items parameter must also be supplied, and must contain at least object. ...
Creating Reusable Modules - Archive of obsolete content
.filtertext); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string. note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returned nsilocalfile... } return path; } require("sdk/ui/button/action").actionbutton({ id: "show-panel",
label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5file(promptforfile())); } }); this works , but index.js is now getting longer and its logic is harder to understand. let's factor the file picker and hashing code into separate modules. creating separate modules filepicker.js first create a new file in "lib" called "filepicker.js". copy the f...
...ert the binary hash data to a hex string. var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } exports.hashfile = md5file; index.js finally, update index.js to import these two new modules and use them: var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel",
label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules 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. to ...
Getting Started (jpm) - Archive of obsolete content
now you can write the add-on's code. unless you've changed the value of "entry point" ("main" in package.json), this goes in "index.js" file in the root of your add-on. this file was created for you in the previous step. open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link",
label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, meaning that your main file is "index.js", and it is found directly in your add-on's root. in cfx, the entry point defaults to ...
... perform basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. try editing this file. for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link",
label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute jpm run again. this time clicking it takes you to https://developer.mozilla.org/. packaging the add-on when you've finished the add-on and are re...
Getting started (cfx) - Archive of obsolete content
g: try "cfx test" and then "cfx run". have fun!" implementing the add-on now you can write the add-on's code, which goes in the "main.js" file in your "lib" directory. this file was created for you in the previous step. open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link",
label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } save the file. next, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command promp...
... perform basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. try editing this file. for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link",
label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute cfx run again. this time clicking it takes you to https://developer.mozilla.org/. packaging the add-on when you've finished the add-on and are re...
List Open Tabs - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to list the open tabs, you can iterate over the tabs object itself. the following add-on adds an action button that logs the urls of open tabs when the user clicks it: require("sdk/ui/button/action").actionbutton({ id: "list-tabs",
label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) console.log(tab.url); } note: to get this working, you will need to save an icon for the button to your add-on's "data" directory as "icon-16.png". you can download the icon here: . run the add-on, load a couple of tabs and click the button. you'll see output in the command line console that looks something like this: info: http:...
...omething like this: info: http://www.mozilla.org/about/ info: http://www.bbc.co.uk/ you don't get direct access to any content hosted in the tab. to access tab content, you need to attach a script to the tab using tab.attach(). this add-on attaches a script to all open tabs. the script adds a red border to the tab's document: require("sdk/ui/button/action").actionbutton({ id: "list-tabs",
label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) runscript(tab); } function runscript(tab) { tab.attach({ contentscript: "document.body.style.border = '5px solid red';" }); } learning more to learn more about working with tabs in the sdk, see the tabs api reference. to learn more about...
HTML in XUL for rich tooltips - Archive of obsolete content
al 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"/> </tooltip> </popupset> ...
...sh to have a rich tooltip with. you should write the html straight into the xul. ...
How to convert an overlay extension to restartless - Archive of obsolete content
that way you build elements hierarchy with not much interaction with dom, plus you can see tag properties and it children ...
...description({'value': this.stringbundle.getstringfromname('firexpixel.opacity')}), htmlinput({'id': 'opacity-range', 'type': 'range', 'min': '0', 'max': '10'}) ), hbox({'id': 'pixel-coords', 'class': 'pixel-hbox'},
label({'control': 'coord-x', 'value': 'x:'}), textbox({'id': 'coord-x', 'class': 'coord-box', 'placeholder' : '0'}),
label({'control': 'coord-y', 'value': 'y:'}), textbox({'id': 'coord-y', 'class': 'coord-box', 'placeholder': '0'}) ... that way you build elements hierarchy with not much interaction with dom, plus you can see tag properties and it children in a nice, structured way, just like in overlay.xul. you can find working example here. it involves using of firebug.sdk xul.js with few modi...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
ls to the dom with different levels of functionality. gecko supports nearly all of dom level 2 and some of dom level 3. with the dom, the contents of an xml document are handled as a "dom tree," a collection of element nodes and other nodes. ...
...ement as a substitute, and sets a
label attribute. we do not go into the details of the various apis in the dom. to learn more about the dom, please take a look at the mdc documentation. ...
Adding windows and dialogs - Archive of obsolete content
uttons="accept,cancel" ondialogaccept="return xulschoolchrome.hellodialog.accept();" ondialogcancel="return xulschoolchrome.hellodialog.cancel();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element. you'll see that you can choose from a wide variety of buttons, associate any action you need to them, override their
labels, and even add completely customized extra buttons. all of this without having to worry about your dialog looking odd in some operating systems. the only constant rule is that clicking on ok and cancel will close the dialog unless your associated function returns false. you should avoid returning false, though, specially with the cancel button. dialogs in general should be easy to dismiss. you...
...me way of remembering the user-manipulated attribute values so that the window reloads it last state when opened. most xul elements support the persist attribute, which has this exact function. you set the persist attribute with a space-separated list of attribute names, indicating which attribute values must be persisted across window "sessions". <checkbox id="xulschoolhello-some-checkbox"
label="&xulschoolhello.sometext.
label;" checked="false" persist="checked" /> setting the id attribute of the element is mandatory if you want the persist attribute to work. you can also set persistence programatically using the document.persist function: document.persist("xulschoolhello-some-checkbox", "checked"); persistent data is stored in the user profile, in the file localstore.rdf. you...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
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", tooltiptext: "test button tooltip", removable: true, key: "mytestbutton123" }, [ "m...
...'}], ['html:button', {id:'mybtn'}, 'button text content'] ], ['html:form', {id:'mysecondform'}, ['html:input', {type:'text', value:'my field for second form'}], ['html:div', {}, 'sub div with textcontent and siblings', ['html:br', {}], ['html:input', {type:'checkbox', id:'mycheck'}], ['html:
label', {for:'mycheck'}, 'here is text of
label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to me...
User Notifications and Alerts - Archive of obsolete content
e when they are related to the page currently being displayed, such as a page trying to install an add-on, or a site you just entered a password on. notification boxes are very easy to create, and are very customizable: let nb = gbrowser.getnotificationbox(); let acceptbutton = new object(); let declinebutton = new object(); let message = this._bundle.getstring("xulschoolhello.friendmessage.
label"); let that = this; acceptbutton.
label = this._bundle.getstring("xulschoolhello.acceptbutton.
label"); acceptbutton.accesskey = this._bundle.getstring("xulschoolhello.acceptbutton.accesskey"); acceptbutton.popup = null; acceptbutton.callback = function() { that.acceptrequest(); }; // similarly for decline button. nb.appendnotification( message, "xulschoolhello-friend-notification", "chrom...
...ily trigger alerts from chrome and non-chrome code. on the other hand, alerts are displayed only temporarily using the alerts service is similar to using notification boxes: let alertsservice = cc["@mozilla.org/alerts-service;1"].getservice(ci.nsialertsservice); let title = this._bundle.getstring("xulschoolhello.greeting.title"); let message = this._bundle.getstring("xulschoolhello.greeting.
label"); alertsservice.showalertnotification( "chrome://xulschoolhello/skin/hello-notification.png", title, message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver. we do this when we need to handle clicks on the alert box. the image can have any size, but it is recommended that you use a medium, fixed size. ...
Tabbed browser - Archive of obsolete content
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. the code given is for a menuitem, but will work equally well for other xul elements. this will only work in an overlay of browser.xul. ...
... note: starting in gecko 1.9.1, there's an easy way to listen on progress events on all tabs. notification when a tab's attributes change requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) starting in gecko 2.0, you can detect when a tab's attributes change by listening for the tabattrmodified event. ...
Creating a status bar extension - Archive of obsolete content
ription of the user interface we want to add to firefox. our overlay file, status-bar-sample-1.xul, looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype overlay > <overlay id="status-bar-sample-1-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="status-bar-sample-1"
label="hello world" tooltiptext="sample status bar item" /> </statusbar> </overlay> the first order of business in the status-bar-sample-1.xul file is to establish that this is in fact a xul file, and to set up a unique id for the overlay. this is accomplished by the following line of xml: <overlay id="status-bar-sample-1-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.i...
... user interface. in this case, we're simply inserting a new panel into the status bar at 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 » ...
Index of archived content - Archive of obsolete content
cles file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js xpcom javascript debugger service javascript timers javascript daemons management
label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window preferences progress listeners queryselector rosetta running applications svg animation svg general scr...
...forms community developing mozilla xforms implementation status mozilla xforms specials mozilla xforms user interface xforms alert element xforms group element xforms help element xforms hint element xforms input element xforms
label element xforms message element xforms output element xforms range element xforms repeat element xforms secret element xforms select element xforms select1 element xforms submit element xforms switch module xforms textarea element xforms trigger ...
Making it into a static overlay - Archive of obsolete content
me://navigator/content/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js"/> <!-- hook for stringbundle overlays --> ... ...
...ent/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js"/> <!-- hook for stringbundle overlays --> ... ...
Creating a Microsummary - Archive of obsolete content
nt of a page. web pages can reference generators via <link 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. in this tutorial we're going to create a microsummary generator for the spread firefox home page that displays the current firefox download count along with the
label fx downloads; for example: 174475447 fx downloads. we'll build the xslt transform sheet that converts that page into its microsummary, learn how to specify that the generator applies to that page, and find out how to make the generator available for download and installation. in each step of revising the transform sheet and other code in this tutorial, new material added will be shown in boldfa...
... add a <text> element to the xslt template with the content fx downloads: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="ht...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
bject stored in the variable nsdraganddrop. the object contains a series of functions, one for each event handler (except for dragenter where it has nothing special to do). each of the functions takes two parameters, the first is the event object and the second is an observer object that you create. more on that in a moment. the following is an example of calling the nsdraganddrop object. <button
label="drag me" ondraggesture="nsdraganddrop.startdrag(event,buttonobserver);" /> the function startdrag will be called when a drag starts on the button. the first parameter is the event object, available in all event handlers. the second parameter to this function is the observer, which we'll create soon. in this case we only do anything special when the button drag is started. if we wanted to handle...
...will be used instead. usually you will want to provide a text version of the data so that more applications can accept the data. the order that you define the flavours should be from the best match to the weakest match. in this case above, the html flavour (text/html) comes first and then the text flavour (text/unicode). the example below shows how to set the data to be dragged from the element's
label attribute. in this case we only provide the data in one flavour. var textobserver = { ondragstart: function (event) { var txt = event.target.getattribute("
label"); transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/unicode",txt); } } this might be useful when implementing drag and drop for cells in a tree. you can use the value of a cell, or some re...
Simple Storage - Archive of obsolete content
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 all. we'll limit the number of notes to 20. old notes// will...
...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 all. we'll limit the number of notes to 20. old notes// will be forgotten. ...
Simple Storage - Archive of obsolete content
t 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 all. we'll limit the number of notes to 20. old not...
...ue }]) }); } // 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 all. we'll limit the number of notes to 20. old notes // will be forgotten. :( jetpack.menu.context.page.beforeshow = function (menu) { menu.reset(); if (jetpack.selection.text) menu.add({
label: "note", command: function () { notes.unshift(jetpack.selection.text); if (notes.length > 20) notes.pop(); updatejetpackmenu(); } }); }; // initialize the jetpack menu with the current notes. updatejetpackmenu(); see also settings jep 11 ...
command - Archive of obsolete content
« xul reference home command type: id set to the id of a command element that is being observed by the element. ...
... « xul reference home command type: id set to the id of a command element that is being observed by the element. ...
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. ...
... « 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. ...
width - Archive of obsolete content
lement or its contents have a minimum or maximum width, or the size is adjusted by the flexibility or alignment of its parent. the css width property may also be used. in this example, the preferred width of the inner hbox will be displayed at 40 pixels. the displayed width is also 40 pixels as no flexibility or alignment applies. ...
...idth of the inner hbox will be displayed at 40 pixels. the displayed width is also 40 pixels as no flexibility or alignment applies. <hbox> <hbox width="40" style="background-color: red;"> <
label value="40"/> </hbox> </hbox> however, in the following example, despite that the preferred width of the box is 30 pixels, the displayed size of the box will be larger to accommodate the larger
label. <vbox width="30" align="start" style="background-color: red;"> <
label value="vbox xul width 10px red"/> </vbox> note: when used on treecol objects, the width attribute can be used to allow a tree to be scrolled horizontally if the column widths add up to be wider than the containing object. ...
OpenClose - Archive of obsolete content
opening and closing popups popups and menus may be opened and closed by a script. opening menus menus will display themselves automatically when needed without extra work. for instance, a menu's popup will open when the menu
label is clicked, and a submenu will open when the mouse is hovered over the parent menu element. however, there may be situations when you wish to open a menu manually. the menu element has an open property which may be set to true to open the menu, or false to close the menu. ...
...enu manually. the menu element has an open property which may be set to true to open the menu, or false to close the menu. a simple example: somemenu.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 u...
currentIndex - Archive of obsolete content
of retrieving the text of a cell. ...
... <script language ="javascript"> function treerowclicked(){ 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 ...
disabled - Archive of obsolete content
« xul reference disabled type: boolean gets and sets the value of the disabled attribute. ...
... « xul reference disabled type: boolean gets and sets the value of the disabled attribute. ...
Property - Archive of obsolete content
ndrag 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 listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage ...
... pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount search
label 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 stringbund...
Containment Properties - Archive of obsolete content
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 container. if the starting node (or ref) has...
...or 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 » ...
Multiple Rule Example - Archive of obsolete content
="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <
label value="?title"/> <image src="?photo"/> </vbox> <groupbox> <caption
label="photo details"/> <
label value="?description"/> <
label value="date: ?date"/> </groupbox> </hbox> </action> </rule> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> ...
...the second rule matches those photos with a title. if a photo did not have a title, it would not match any rule. in the example data, only the first photo has been given all ...
RDF Query Syntax - Archive of obsolete content
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 direction, but only one direction per statement. it determines which direction to use by examining which data is known and which data is not known yet. rec...
...of the variables using the known data. the ?start variable has a value 'http://www.xulplanet.com/rdf/a', so that is filled in. the ?relateditem variable doesn't have any known value, so it will be left as is. once the variables are filled in, the builder can query the rdf graph. the query will look for all arrows that start at the node 'http://www.xulplanet.com/rdf/a' with the predicate (or arrow
label) 'http://www.xulplanet.com/rdf/relateditem'. since ?relateditem isn't known, the builder will allow any value for the node the arrow points to, and will look in the datasource for all possible values. in a triple statement, the subject is always the start of an arc, while the object is what it points to. for this triple, the builder will follow the arrows in the forward direction. here is the rdf...
The Joy of XUL - Archive of obsolete content
case study of a calendar application written in xul will reinforce the benefits of building applications with mozilla. key features and benefits powerful widget-based markup language the goal of xul is to build cross platform applications, in contrast with dhtml which is intended for developing web pages. for this reason, xul is oriented toward application artifacts such as windows,
labels, and buttons instead of pages, heading levels, and hypertext links. in fact, many developers invest a significant amount of effort to achieve these results in their dhtml web applications but at the cost of complexity and performance and without any supporting standards. based on existing standards xul is an xml language based on w3c standard xml 1.0. applications written in ...
... application logic. this poses a significant problem in team environments because the skills required to develop these two parts are often satisfied by different people. xul provides a clear separation among the client application definition and programmatic logic ("content" consisting of xul, xbl, and javascript), presentation ("skin" consisting of css and images), and language-specific text
labels ("locale" consisting of dtds and string bundles in .properties files). the layout and appearance of xul applications can be altered independently of the application definition and logic. further, the application can be localized for different languages and regions independently of its logic or presentation. this degree of separation results in applications that are easier to maintain by pro...
Tree Widget Changes - Archive of obsolete content
the checkbox type. previously the value existed but was not implemented. now it is. you can create a checkbox column by setting the type attribute of a column to checkbox. <treecol type="checkbox"> you can then set or clear the checkbox for a particular cell in that column by setting the value attribute to true, or leaving out the attribute. note that it's the value attribute you use, not the
label attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns su...
...m views, return false from the iseditable method. currently, only checkbox columns support editing, although the content-based tree handles the nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells. for instance: var col = tree.columns.getprimarycolumn(); treecell.setcelltext(5, col, "banana"); this will change the
label of the cell in row 5 and the primary column to banana. however, this paves the way in the future for more general tree editing features. style improvements you can now specify the cursor to use for a cell using the css cursor property. treechildren::-moz-tree-cell-text { cursor: pointer; } this allows you to create separate cursors for cells. the :-moz-tree-separator pseudo has been imp...
Adding Properties to XBL-defined Elements - Archive of obsolete content
<property name="property-name-1"/> <property name="property-name-2"/> <property name="property-name-3"/> . . . <method name="method-name-1"> -- method content goes here -- </method> . . . </implementation> </binding> fields each field is defined using the field element. often, fields would correspond to an attribute placed on the element such as
label or disabled, but they do not have to. the name attribute on the field element is used to indicate the name of the field. you can use the name from a script to get and set the value. the example below creates a button which generates and stores a random number. you can retrieve this same number multiple times by getting the number property from the button. most of the work here is done in the onco...
.... you can use the name from a script to get and set the value. the example below creates a button which generates and stores a random number. you can retrieve this same number multiple times by getting the number property from the button. most of the work here is done in the oncommand handlers. later, we'll find out how to move this to xbl. xul: <box id="random-box" class="randomizer"/> <button
label="generate" oncommand="document.getelementbyid('random-box').number=math.random();"/> <button
label="show" oncommand="alert(document.getelementbyid('random-box').number)"/> xbl: <binding id="randomizer"> <implementation> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which stores the random number. the two extra ...
Introduction to XBL - Archive of obsolete content
the box has been declared to have a class of okcancelbuttons. the style sheet associated with the file says that boxes with the class okcancelbuttons have a specialized binding, defined in the xbl file. you may use other elements besides the box, even your own custom ...
...the box has been declared to have a class of okcancelbuttons. the style sheet associated with the file says that boxes with the class okcancelbuttons have a specialized binding, defined in the xbl file. you may use other elements besides the box, even your own custom tags. we'll look more at the de...
More Wizards - Archive of obsolete content
both properties are adjusted automatically as you switch pages. thus, the back button wi...
...both properties are adjusted automatically as you switch pages. thus, the back button will be disabled on the first page so you don't have to set it yourself. another useful property of the wizard is currentpage, which hold...
Skinning XUL Files by Hand - Archive of obsolete content
uttons exhibit comes from styles and an event model based on javascript that dynamically switches between these styles. mozilla's current global skin defines this basic behavior for several classes of button. a button is styled by the global skin when its class attribute is set to a class which is defined in the global skin. for example, when a button is defined as follows: <button class="plain"
label="push me" /> then the following very simple style definition applies to that button. button.plain { border: 0px !important; } the global skin, in which styles for these several button classes and dozens of other elements are defined, is described in the following section. if you want to use the classes already defined in mozilla's global skin to style your elements, you may do so. but you ma...
...first definition, the selector "toolbar.nav-bar" is used to define style information for all xul toolbars of the class "nav-bar." unlike an id -- which is also often used as a selector but must be unique -- a class attribute can be used on multiple xul elements you want to pick up the specified style information. a toolbar elements defined as: <toolbar class="nav-bar" id="nav3"> <toolbarbutton
label="click me" /> <toolbarbutton
label="don't click me" /> ... </toolbar> will be styled with the css rules that appear in the block after the toolbar.nav-bar selector in the css example above. similarly, the next item uses the id selector to apply style information to a single xul element. since id attribute must be unique in a document, there can only be a single element with the id "navbar",...
Stacks and Decks - Archive of obsolete content
each other rather than from side to side. the size of the stack is determined by its largest child, but you can use the css properties width, height, min-width and other related properties on both the stack and its children. the stack element might be used for cases where a status indicator needs to be added over an existing element. for example, a progress bar might be created using a bar and a
label overlaid on top of it. shadowing with stacks one convenient use of the stack element however is that you could emulate a number of css properties with it. for example, you could create an effect similar to the text-shadow property with the following: example 1 : source view <stack> <description value="shadowed" style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/> <description va...
... children. the displayed page of the deck can be changed by setting an selectedindex attribute on the deck element. the index is a number that identifies which page to display. pages are numbered starting from zero. so, the first child of the deck is page 0, the second is page 1 and so on. example 3 : source view <deck 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> three pages exist here, the default being the third one. the third page is a box with two elements inside it. both the box and the elements inside it make up the page. the deck will be as large as the largest child, which here should be the thi...
Toolbars - Archive of obsolete content
s are just boxes they can actually go anywhere you want, even in the middle of a window. typically however, a set of toolbars would appear along the top of a window. when more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'. a simple toolbar inside a toolbox source view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton
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 ...
... our find files example let's add a toolbar to the find files dialog. we don't really need one but we'll add one anyway to demonstrate its use. two buttons will be added, an open button and a save button. presumably, they would allow the user to save search results and re-open them later. <vbox flex="1"> <toolbox> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch"
label="open"/> <toolbarbutton id="savesearch"
label="save"/> </toolbar> </toolbox> <tabbox> a toolbar with two buttons has been added here. in the image, you can see them appear horizontally along the top. notice that the toolbar has been placed inside the vertical box just above the tabbox. this is because we need the vertical orientation so that the toolbar will appear above ...
XUL element attributes - Archive of obsolete content
placed in the center of the box. end child elements are placed on the right or bottom edge of the box. if the box is larger than the total size of the children, the extra space is placed on the left or top side. baseline this value applies to horizontally oriented boxes only. it causes the child elements to be aligned so that their text
labels are lined up. stretch this is the default value. the child elements are stretched to fit the size of the box. for a horizontal box, the children are stretched to be the height of the box. for a vertical box, the children are stretched to be the width of the box. if the size of the box changes, the children stretch to fit. use the flex attribute to create elements th...
...s attribute is set to '_child', the first tooltip child element inside the element is used. tooltiptext type: string used to set the text which appears in the tooltip when the user moves the mouse over the element. this can be used instead of setting the tooltip to a popup for the common case where it contains only text. the tooltip is displayed in a default tooltip which displays only a
label, however the default tooltip may be changed by setting the default attribute on a tooltip element. top type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the top edge of the element relative to the top edge of the stack. uri type: string for template-generated content, the attribute should be placed on the element ...
XUL Event Propagation - Archive of obsolete content
ider the following xul file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://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" /> ...
...ommand="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" /> </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 t...
description - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
...ass used for headings. ...
hbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to horizontal orientation. more information is available in the xul tutorial. ...
...l reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to horizontal orientation. more information is available in the xul tutorial. ...
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 g...
...s 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, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmen...
notification - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notification is used to display an informative message. it will normally be used as part of a notificationbox. the box includes a button which the user can use to close the box. attributes image,
label, priority, persistence, type, value properties accessibletype, control, image,
label, priority, persistence, type, value methods close examples <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...
...st.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. 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. persistence type: integer gets and sets the value of the persistence attribute. priority type: string gets and sets the value of the priority attribute. type type: string gets and sets the value of the type attribute. value type: string gets and sets the value of the v...
spacer - Archive of obsolete content
| properties | methods | related ] an element that takes up space but does not display anything. it is usually used to place spacing within a container. if you don't specify that the spacer has a size or is flexible, the spacer does not occupy any space. if you want a small gap, consider using a separator instead. more information is available in the xul tutorial. ...
...ment that takes up space but does not display anything. it is usually used to place spacing within a container. if you don't specify that the spacer has a size or is flexible, the spacer does not occupy any space. if you want a small gap, consider using a separator instead. more information is available in the xul tutorial. ...
statusbar - Archive of obsolete content
i suggest using the add-on bar instead. « xul reference home [ examples | attributes | properties | methods | related ] an element used to create a status bar, usually placed along the bottom of a window. it is virtually equivalent to a standard box, but may be rendered differently. contains statusbarpanels. ...
...rties | methods | related ] an element used to create a status bar, usually placed along the bottom of a window. it is virtually equivalent to a standard box, but may be rendered differently. contains statusbarpanels. ...
tabs - Archive of obsolete content
), setattributens(), setuserdata advanceselectedtab( dir, wrap ) return type: no return value if the argument dir is set to 1, the currently selected tab changes to the next tab. if the argument dir is set to -1, the currently selected tab changes to the previous tab. if the wrap argument is true, the adjustment will wrap around when the first or last tab is reached. appenditem(
label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) r...
...list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index,
label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. related elements tabbox, tab, tabpanels, tabp...
toolbarpalette - Archive of obsolete content
ded to the toolbar. do not add the various spacing items, as those are added automatically. you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... toolbar. do not add the various spacing items, as those are added automatically. you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
toolbarseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a separator between groups of toolbar items. it is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
...« xul reference home [ examples | attributes | properties | methods | related ] creates a separator between groups of toolbar items. it is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
treeitem - Archive of obsolete content
ee. the treeitem contains a single row and all of what appear to the user as that row's descendants. in a template condition, you should use a treeitem instead of a content element when the dont-build-content flag is specified. set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. attributes container, empty,
label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements. this would be used for folders. this will be set by the template builder as needed. empty type: boolean set to true if the element is a container that contains no children. this will be set by the template builder as neede...
...i examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements. this would be used for folders. this will be set by the template builder as needed. empty type: boolean set to true if the element is a container that contains no children. this will be set by the template builder as needed.
label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro. 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 close...
How to enable locale switching in a XULRunner application - Archive of obsolete content
tems, 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. ...
...code to update the locale user preference and restart the application mozilla xulrunner doesn't allow runtime switchin...
Common Firefox theme issues and solutions - Archive of obsolete content
oolbars and menus firefox application button application button doesn't change styling for private browsing mode when in private browsing mode there needs to be a visual difference to the firefox app button that is displayed when tabs are on top and the menu bar is disabled. text only toolbar buttons not aligned properly when text only toolbar buttons are selected in customize toolbars, text
labels in toolbar buttons may not align properly. the common cause of this is style rules that reference [iconsize="small"] without excluding [mode="text"]. the solution usually is to append :not ([mode="text"]) to those style rules. for instance use toolbar[iconsize="small"]:not ([mode="text"]). a little experimenting may be required to fully address this issue with your theme. address bar identity ...
...tyled. using the default theme in the latest firefox, please try tools > web developer > inspect to see how this new feature functions and how it should be styled. you'll probably want to copy the files from the folder browser/devtools/ from the default theme into your theme and then modify as necessary to achieve the desired look. style inspector's bread crumb buttons are hard to read the text
labels of breadcrumbs on the style inspector (tools > web developer > inspect) are too similar to the background colors making them very hard to read. please choose text
label colors that stand out against the background color better. the style rules for these
labels can be found near the end of chrome://browser/skin/browser.css. the color style for the following statements need to be adjusted: .inspe...
-ms-accelerator - Archive of obsolete content
e syntax /* the object is not a keyboard shortcut (the default) */ -ms-accelerator: false /* the object is a keyboard shortcut */ -ms-accelerator: true values false the object is not a keyboard shortcut. true the object is a keyboard shortcut. formal syntax false | true examples this example uses the -ms-accelerator attribute in a <u> element to specify that the "n" in the <
label> element is a keyboard shortcut. when the option to "hide keyboard navigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key. when alt + n is pressed, the <input> element that defines an accesskey attribute value of "n" receives the focus. <!doctype html> <html> <head> <title>accelerator</title>...
...hortcut. when the option to "hide keyboard navigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key. when alt + n is pressed, the <input> element that defines an accesskey attribute value of "n" receives the focus. <!doctype html> <html> <head> <title>accelerator</title> </head> <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 un...
::-ms-browse - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. ...
... browser compatibility historically supported in internet explorer and edge before version 79. ...
New in JavaScript 1.2 - Archive of obsolete content
number now converts a specified object to a number. number now produces nan rather than an error if x is a string that does not contain a well-formed numeric literal. string now converts a specifie...
... ...
XForms Message Element - Archive of obsolete content
y simple content. ...
...tations it may be represented in the following ways: modal window - if level attribute value is modal modeless window - if level attribute value is modeless tooltip window - if level attribute value is ephemeral note: message element doesn't define a default presentation. therefore you should always specify a level attribute. example <xforms:trigger> <xforms:
label>it's a button</xforms:
label> <xforms:message level="modal" ev:event="domactivate">hello</xforms:message> </xforms:trigger> ...
XForms Select Element - Archive of obsolete content
he value full there are no analogue widgets in xhtml or in xul visual grouping by choices element is supported if incremental attribute value is false then bound node is updated when item is blurred examples <xf:model> <xf:instance> <data xmlns=""> <values>g</values> </data> </xf:instance> </xf:model> <xf:select ref="/data/values" appearance="full"> <xf:choices> <xf:
label>green colors</xf:
label> <xf:item> <xf:
label>pale green</xf:
label> <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:
label>green</xf:
label> <xf:value>g</xf:value> </xf:item> </xf:choices> <xf:choices> <xf:
label>red colors</xf:
label> <xf:item> <xf:
label>red</xf:
label> <xf:value>r</xf:value> </xf:item> <xf:item> <xf:
label>m...
...rs</xf:
label> <xf:item> <xf:
label>pale green</xf:
label> <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:
label>green</xf:
label> <xf:value>g</xf:value> </xf:item> </xf:choices> <xf:choices> <xf:
label>red colors</xf:
label> <xf:item> <xf:
label>red</xf:
label> <xf:value>r</xf:value> </xf:item> <xf:item> <xf:
label>magenta</xf:
label> <xf:value>m</xf:value> </xf:item> </xf:choices> </xforms:select> ...
XForms Select1 Element - Archive of obsolete content
analogue widgets in xhtml or in xul visual grouping by choices element is supported selection="open" attribute isn't supported if incremental attribute value is false then bound node is updated when item is blurred examples <xf:model> <xf:instance> <data xmlns=""> <values>g</values> </data> </xf:instance> </xf:model> <xf:select1 ref="/data/values"> <xf:choices> <xf:
label>green colors</xf:
label> <xf:item> <xf:
label>pale green</xf:
label> <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:
label>green</xf:
label> <xf:value>g</xf:value> </xf:item> </xf:choices> <xf:choices> <xf:
label>red colors</xf:
label> <xf:item> <xf:
label>red</xf:
label> <xf:value>r</xf:value> </xf:item> <xf:item> <xf:
label>m...
...rs</xf:
label> <xf:item> <xf:
label>pale green</xf:
label> <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:
label>green</xf:
label> <xf:value>g</xf:value> </xf:item> </xf:choices> <xf:choices> <xf:
label>red colors</xf:
label> <xf:item> <xf:
label>red</xf:
label> <xf:value>r</xf:value> </xf:item> <xf:item> <xf:
label>magenta</xf:
label> <xf:value>m</xf:value> </xf:item> </xf:choices> </xf:select> ...
Building up a basic demo with PlayCanvas editor - Game development
though it's a blank new project we don't have to start entirely from scratch — the camera and directional light are prepared already, so you don't have to worry about them. now onto the creative part. to add an entity to the scene you have to click on the big plus button located in the top left area of the editor, next to the hierarchy text. when hovering over that button with your mouse the
label will say 'add entity' — that's exactly what we want to do. an entity is any object used in the scene — it cna be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. after clicking the button you'll see a dropdown list containing a lot of various entities to choose from. go ahead and click box — it will be added to the scene. the box is created with...
...he assets tab and its entity inspector will appear on the right hand side of the display. now edit the name text field to give it a unique name (we've chosen boxmaterial). a unique name will help us remember what this material is for — we will add more later! to change its color we'll use the diffuse option in the entity inspector. click diffuse, then select the colored box next to the color
label — it will open a color wheel. from here you can click your desired color or enter it in the bottom text field as a hex value. we've chosen a blue color with a hex value of 0095dd — enter this code in the text field and press return for it to be accepted. note: yes, you read that right — you need to enter the hex value without the hash/pound symbol. now we can apply the colored materia...
Extra lives - Game development
html. we can make the game enjoyable for longer by adding lives. in this article we'll implement a lives system, so that the player can continue playing until they have lost three lives, not just one. new variables add the following new variables below the existing ones in your code: var lives = 3; var livestext; var lifelosttext; these respectively will store the number of lives, the text
label that displays the number of lives that remain, and a text
label that will be shown on screen when the player loses one of their lives. defining the new text
labels defining the texts look like something we already did in the score lesson. add the following lines below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+liv...
...text and lifelosttext. if we ever want to change the font size or color we will have to do it in multiple places. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this authority as part of the hierarchy in a url - usually the most memorable part of it, for instance a brand name. 119 domain name domain name, glossary, protocol, webmechanics a domain name is a website's address on the internet. domain names are used in urls to identify to which server belong a specific webpage. the domain name consists of a hierarchial sequence of names (
labels) separated by periods (dots) and ending with an extension. 120 domain sharding dns, glossary, http, reference, web performance, latency browsers limit the number of active connections for each domain. to enable concurrent downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains. when multiple domains are used to serve multiple asset...
...ssed data. lossless compression methods are reversible. examples of lossless compression include gzip, brotli, webp, and png, 258 mime type glossary, webmechanics a mime type (now properly called "media type", but also sometimes "content type") is a string sent along with a file indicating the type of the file (describing the content format, for example, a sound file might be
labeled audio/ogg, or an image file image/png). 259 mvc glossary, infrastructure, intro, mvc, model view controller mvc (model-view-controller) is a pattern in software design commonly used to implement user interfaces, data, and controlling logic. it emphasizes a separation between the software’s business logic and display. this "separation of concerns" provides for a better div...
Assessment: Accessibility troubleshooting - Learn web development
ix this? the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. ...
...er isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. how can you allow them to still access the audio? the forms the <input> element in the search form at the top could do with a
label, but we don't want to add a visible text
label that would potentially spoil the design and isn't really needed by sighted users. how can you add a
label that is only accessible to screenreaders? the two <input> elements in the comment form have visible text
labels, but they are not unambiguously associated with their
labels — how do you achieve this? note that you'll need to update some of the css rule as well. the show/hide comment cont...
HTML forms in legacy browsers - Learn web development
way or another, on legacy browsers, you are performing graceful degradation. let's see some examples related to html forms. html input types the input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly predictable. if a browser does not know the value of the type attribute of an <input> element, it will fall back as if the value were text. ...
...e some examples related to html forms. html input types the input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly predictable. if a browser does not know the value of the type attribute of an <input> element, it will fall back as if the value were text. ...
Test your skills: Basic controls - Learn web development
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. 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. ...
... turn the first <fieldset>'s contents into a set of radio buttons — you should only be able to select one pony character at once. make it so that the first radio button is selected upon page load. turn the second <fieldset>'s content into a set of checkboxes. add a couple more hotdog choices of your own. ...
Adding vector graphics to the Web - Learn web development
rence, find out more details about other toys you can use in svg, and try those out too. this section is all about practising your research skills, and having some fun. if you get stuck and can't get your code working, you can always reset it using the reset button. ...
...> <text x="50" y="100" font-family="verdana" font-size="55" fill="white" stroke="black" stroke-width="2"> hello! ...
From object to iframe — other embedding technologies - Learn web development
ve you some <iframe> code — copy this. insert it into the input box below, and see what the result is in the output. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see an answer. ...
...a11y-
label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </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: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updat...
Basic math in JavaScript — numbers and operators - Learn web development
ors, so we recommend you use them. if you try entering some of these values in a console, you'll see that they all return true/false values — those booleans we mentioned in the last article. these are very useful, as they allow us to make decisions in our code, and they are used every time we want to make a choice of some kind. for example, booleans can be used to: display the correct text
label on a button depending on whether a feature is turned on or off display a game over message if a game is over or a victory message if the game has been won display the correct seasonal greeting depending what holiday season it is zoom a map in or out depending on what zoom level is selected we'll look at how to code such logic when we look at conditional statements in a future article. for no...
...en in new window you can see the equality operator being used just inside the updatebtn() function. in this case, we are not testing if two mathematical expressions have the same value — we are testing whether the text content of a button contains a certain string — but it is still the same principle at work. if the button is currently saying "start machine" when it is pressed, we change its
label to "stop machine", and update the
label as appropriate. if the button is currently saying "stop machine" when it is pressed, we swap the display back again. note: such a control that swaps between two states is generally referred to as a toggle. it toggles between one state and another — light on, light off, etc. test your skills! you've reached the end of this article, but can you rememb...
Ember interactivity: Events, classes and state - Learn web development
that our javascript code knows what we typed in, and we can save our todo and pass that text along to the todo list component to display. we can capture the keydown event via the on modifier, which is just ember syntactic sugar around addeventlistener and removeeventlistener (see this explanation if needed). add the new line shown below to your header.hbs file: <input class='new-todo' aria-
label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double curly braces, which tells you it is part of ember's dynamic templating syntax. the first argument passed to on is the type of event to respond to (keydown), and the last argument is the event handler — the code that will run in response to the keyd...
... allowing us to interact with the service instance directly. all — a getter on the todo-data service that returns all the todos. try starting the server again and navigating to our app, and you'll find that it works! well, sort of. whenever you enter a new todo item, a new list item appears below the text input, but unfortunately it always says "buy movie tickets". this is because the text
label inside each list item is hardcoded to that text, as seen in todo.hbs: <
label>buy movie tickets</
label> update this line to use the argument @todo — which will represent the todo that we passed in to this component when it was invoked in todo-list.hbs, in the line <todo @todo={{todo}} />: <
label>{{@todo.text}}</
label> ok, try it again. you should find that now the text submitted in the <inpu...
React interactivity: Events and state - Learn web development
an alert dialog. ...
...orm.js file should now read like this: import react, { usestate } from "react"; function form(props) { const [name, setname] = usestate(""); function handlechange(e) { setname(e.target.value); } function handlesubmit(e) { e.preventdefault(); props.addtask(name); setname(""); } return ( <form onsubmit={handlesubmit}> <h2 classname="
label-wrapper"> <
label htmlfor="new-todo-input" classname="
label__lg"> what needs to be done? </
label> </h2> <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" value={name} onchange={handlechange} /> <button type="submit" classname="btn btn__primary btn__lg"> add ...
Getting started with Svelte - Learn web development
g a style to our <h1> element. what will happen other components with <h1> elements in them? in svelte, css inside a component's <style> block will be scoped only to that component. this works by adding a class to selected elements, which is based on a hash of the component styles. you can see this in action by opening localhost:5000 in a new browser tab, right/ctrl-clicking on the hello world!
label, and choosing inspect: when compiling the app, svelte changes our h1 styles definition to h1.svelte-1tky8bj, and then modifies every <h1> element in our component to <h1 class="svelte-1tky8bj">, so that it picks up the styles as required. note: you can override this behavior and apply styles to a selector globally using the :global(...) modifier (see the svelte <style> docs for more informat...
... name = 'world' } } </script> <main> <h1>hello {name}!</h1> <button on:click={togglename}>toggle name</button> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> whenever the button is clicked, svelte executes the togglename() function, which in turn updates the value of the name variable. as you can see, the <h1>
label is automatically updated. behind the scenes, svelte created the javascript code to update the dom whenever the value of the name variable changes, without using any virtual dom or other complex reconciliation mechanism. note the use of : in on:click. that's svelte's syntax for listening to dom events. inspecting main.js: the entry point of our app let’s open src/main.js, which is where the a...
Accessibility information for UI designers and developers
ratio should be 4.5:1 for regular text and 3:1 for large text. calculating this ratio is easiest done with a tool, for example lea verou's contrast ratio. there are also plug-ins available for design software, like stark for sketch. don't rely on color alone when your interface uses color to distinguish between things, make sure the distinction is also made in other ways. for example, add text
labels or texture in addition to color differences. for example, in this chart, it helps to add
labels besides the colored chart lines:people who cannot see the difference between the colors, can use the
labels instead. or in this one, you could consider using patterns besides colored areas: again, if people are unable to distinguish the colors, they can rely on the patterns instead. see also: un...
...set spacing following paragraphs to at least 2 times the font size set letter spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface. forms in forms, provide
labels for all controls. this includes form elements like inputs and select boxes, but also buttons. for form elements, it should be clear what kind of input is expected. placeholders are best avoided for this, as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above or underneath the input. error recovery when you detect users provide une...
Localizing without a specialized tool
top/x-testing.compare open the x-testing.compare file that is on your desktop. you should see something like this: x-testing browser chrome browser aboutcerterror.dtd // add and localize this file aboutdialog.dtd +aboutlink +aboutlink.accesskey +aboutversion +closecmdgnome.accesskey +closecmdgnome.
label +copyright +copyright.accesskey +copyrightgnome.accesskey +copyrightinfo1 +copyrightinfo2 +licenselink +licenselinktext aboutprivatebrowsing.dtd // add and localize this file aboutrobots.dtd // add and localize this file ... ... ... x-testing: unchang...
...rowser/locales/chrome/browser/searchbar.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ open the file in your x-testing directory and translate the words inside the quotation marks. be sure to only translate what is in the quotation marks. for the purposes of this tutorial, we will just convert all letters to uppercase, so that the change is visible in the ui. <!entity cmd_enginemanager.
label "manage search engines..."> <!entity searchendcap.
label "search"> save the file. .properties files the property file "search.properties" contains the string "add %s". this string can easily be found in the browser ui by visiting a website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search box in the upper-right...
gettext
f n equals 10, the expression n==1 ? 0 : n==2 ? 1 : 2 is evaluated to 2, and so a msgstr[2] should be used. read more about plurals in gettext at gnu.org. using context with msgctxt depending on context in which it is used, one english string might require two or more different translations. this is particularly true for short strings, like "file" or "log in". ...
...in php, however, the default gettext functions don't support passing such additional argument. ...
TimerFirings logging
, one of fn (function), iface (interface) or obs (observer), which are the three kinds of timers that gecko supports. then comes the function kind, one of one_shot (a single-use timer), slack or precise (repeating timers of differing precision). then comes the timer period, measured in milliseconds. finally there is the identifying information for the timer. function timers have an informative
label. interface and observer timers only have an address, which is less useful, but they are uncommon enough that this usually doesn't matter much. the above example shows only timers from c++ within gecko. there are also timers for settimer or setinterval calls in javascript code, as the following sample shows. -991946880[7f46c365ba00]: [6775] fn timer (one_shot 0 ms): [content] chrome://br...
...000]: [6835] fn timer (one_shot 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 these js timers are annotated with [content] and show the javascript source location where they were created. they can come from chrome code within firefox, or from web content. the informative
labels are only present on function timers that have had their creation site annotated. for unannotated function timers, there are three possible behaviours. first, on mac the code uses dladdr to get the name immediately, and the output will look like the following. 2082435840[100445640]: [81190] fn timer (one_shot 8000 ms): [from dladdr] gfxfontinfoloader::delayedstartcallback(nsitimer*, void*) sec...
Enc Dec MAC Output Public Key as CSR
key_trailer "-----end wrapped mackey-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key
label-----" #define lab_trailer "-----end key
label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; ...
...y into intermediate header file. * reads the intermediate headerfile for wrapped keys,rsa public key and encrypted * contents and decrypts into output file. * * how this sample is different from sample 4 ? * * 1. generate same keys as sample 4, outputs public key as cert request. * 2. like sample 4, except that it reads in public key from cert request file instead * of looking it up by
label name, and writes public key into header instead of a *
label name. rest is the same. * 3. like sample 4, except that it reads in rsa public key, and then finds matching * private key (by key id). rest is the same. */ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; ploptstate *optstate; ploptstatus status; ch...
FC_GetTokenInfo
the system. syntax ck_rv fc_gettokeninfo(ck_slot_id slotid, ck_token_info_ptr pinfo); parameters fc_gettokeninfo has two parameters: slotid the id of the token's slot pinfo points to a ck_token_info structure description fc_gettokeninfo returns information about the token in the specified slot. on return, the ck_token_info structure that pinfo points to has the following information:
label: the
label of the token, assigned during token initialization, padded with spaces to 32 bytes and not null-terminated. manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. model: model of the device, "nss 3", padded with spaces to 16 characters and not null-terminated. serialnumber: the device's serial number as a str...
...to assume the nss user role). return value ckr_ok token information was successfully copied. ckr_cryptoki_not_initialized the pkcs #11 module library is not initialized. ckr_slot_id_invalid the specified slot number is out of the defined range of values. fc_gettokeninfo should return ckr_arguments_bad if pinfo is null. examples note the use of the %.32s format string to print the
label and manufacturerid members of the ck_token_info structure. see also fc_getslotinfo, nsc_gettokeninfo ...
FC_InitToken
name fc_inittoken() - initialize or re-initialize a token. syntax ck_rv fc_inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr p
label ); parameters fc_inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password p
label points to the
label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description fc_inittoken() initializes a brand new token or re-initializes a token that was initialized before. specifically, fc_inittoken() initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certifica...
...abase.) a user must be able to call fc_inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over. note: the so password should be the empty string, i.e., ulpinlen argument should be 0. fc_inittoken() ignores the p
label argument. return value fc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. application usage fc_inittoken() i...
NSC_InitToken
name nsc_inittoken() - initialize or re-initialize a token. syntax ck_rv nsc_inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr p
label ); parameters nsc_inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password p
label points to the
label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description nsc_inittoken() initializes a brand new token or re-initializes a token that was initialized before. specifically, nsc_inittoken() initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the cert...
...lized before. specifically, nsc_inittoken() initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certificates that have their associated private keys in the key database.) note: the so password should be the empty string, i.e., ulpinlen argument should be 0. nsc_inittoken() ignores the p
label argument. return value nsc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected slot id is 1. (the non-fips mode has two slots: 1 and 2. the key database is in slot 2. slot 1 doesn't have a key database.) we don't have a reference to the key database (we failed to open the key database ...
Rhino Debugger
eak on function enter will give control to the debugger whenever the execution is entered into a function or script. break on function exit selecting debug->break on function return will give control to the debugger whenever the execution is about to return from a function or script. moving up and down the stack the lower-left (dockable) pane in the debugger main window contains a combo-box
labeled "context:" which displays the current stack of the executing script. you may move up and down the stack by selecting an entry in the combo-box. when you select a stack frame the variables and watch windows are updated to reflect the names and values of the variables visible at that scope. setting and clearing breakpoints the main desktop of the debugger contains file windows which display the...
...he mouse. this action will display a pop-up menu. select the clear breakpoint menu item. simply single-click on the red dot or the line number of the line at which you want to clear a breakpoint. the red dot will disappear and the breakpoint at that location will be cleared. viewing variables the lower-left (dockable) pane in the debugger main window contains a tab-pane with two tabs,
labeled "this" and "locals". each pane contains a tree-table which displays the properties of the current object and currently visible local variables, respectively. this the properties of the current object are displayed in the this table. if a property is itself a javascript object the property may be expanded to show its sub-properties. the this table is updated each time control returns to th...
Bytecode Descriptions
d implement switch statements using jsop::ifne and jsop::pop, but that would also be awkward--putting the jsop::pop inside the switch body would complicate fallthrough. format: jof_jump default operands: (int32_t forwardoffset) stack: lval ⇒ like jsop::goto, but pop and discard an additional stack value. this appears after all cases for a non-optimized switch statement. if there's a default:
label, it jumps to that point in the body; otherwise it jumps to the next statement. format: jof_jump tableswitch operands: (int32_t defaultoffset, int32_t low, int32_t high, uint24_t firstresumeindex) stack: i ⇒ optimized switch-statement dispatch, used when all case
labels are small integer constants. if low <= i <= high, jump to the instruction at the offset given by script->resumeoffsets()[fir...
... it will reach the jsop::retsub instruction at the end, and control then "returns" to the jsop::gosub and picks up at the next instruction, like a function call but within a single script and stack frame. (it's named after the thing in basic.) we need this because a try block can terminate in several different ways: control can flow off the end, return, throw an exception, break with or without a
label, or continue. exceptions are handled separately; but all those success paths are written as bytecode, and each one needs to run the finally block before continuing with whatever they were doing. they use jsop::gosub for this. it is thus normal for multiple gosub instructions in a script to target the same finally block. rules: forwardoffset must be positive and must target a jsop::jumptarget inst...
XForms Accessibility
use tabindex. if you use xhtml2 use nextfocus. therefore since mozilla xforms works in xhtml (1.x) or xul documents only then we use tabindex instead. note, we support -moz-user-focus style neither for xhtml or xul. at api 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 acce...
... user to choose a single value from a list of pre-defined values (see the spec, the docs). it can have the following representations: combobox listbox radio group additional elements these elements may be used as child elements to the form controls described above. some of these elements are not accessible itself but they makes accessibility properties for xforms elements that hold them.
label specifies the
label for the xforms control (see the spec, the docs). every form control other than the output element must contain a
label element. the value of
label element is used as name of accessible object. help specifies contextual help for the containing form control (see the spec, the docs). the help element has role_alert role. hint similar to a tooltip (see the spec, the docs). th...
nsIAccessible
ble.childcount to navigate through the children by index accessible position you can use nsiaccessible.indexinparent to get accessible index in its parent. use nsiaccessible.groupposition() to get information about this accessible in its group. relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:
label and html control) then these accessibles are related, please refer to relations documentation for more information. you can get related accessibles by methods nsiaccessible.getaccessiblerelated() nsiaccessible.getrelations() nsiaccessible.getrelation() and nsiaccessible.relationscount. focus and selection in order to focus an accessible or get focused child accessible use nsiaccessible.ta...
...ccessible 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 this method returns an access...
nsIMsgFolder
y msgkey); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositionstate adispositionflag); void markmessagesread(in nsisupportsarray messages, in boolean markread); void markallmessagesread(); void markmessagesflagged(in nsisupportsarray messages, in boolean markflagged); void markthreadread(in nsimsgthread thread); void set
labelformessages(in nsisupportsarray messages, in nsmsg
labelvalue
label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldstoremsgoffline(in nsmsgkey msgkey); ...
...ate adispositionflag); markmessagesread() void markmessagesread(in nsisupportsarray messages, in boolean markread); markallmessagesread() void markallmessagesread(); markmessagesflagged() void markmessagesflagged(in nsisupportsarray messages, in boolean markflagged); markthreadread() void markthreadread(in nsimsgthread thread); set
labelformessages() void set
labelformessages(in nsisupportsarray messages, in nsmsg
labelvalue
label); getmsgdatabase() nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); setmsgdatabase() void setmsgdatabase(in nsimsgdatabase msgdatabase); getdbfolderinfoanddb() nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); getmessageheader() nsims...
nsIMsgSearchValue
* (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
... * (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
XPCOM Interface Reference
parsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxul
labeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcaches...
...ixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsg
labelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearchattribnsmsgsearchopnsmsgsearchscopensmsgsearchtermnsmsgsearchtypevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice see also interfaces grouped by function ...
nsIMsgSearchValue
* (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
... * (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
Using the clipboard
rtsstring(copytext), copytext.length * 2); services.clipboard.setdata(trans, null, services.clipboard.kglobalclipboard); the complete function shown below copies some text to the clipboard as html, as well as making it a clickable hyperlink. so we've added a text flavor and an html flavor of the content. the transferable object will hold both flavors. ...
...e function shown below copies some text to the clipboard as html, as well as making it a clickable hyperlink. so we've added a text flavor and an html flavor of the content. the transferable object will hold both flavors. ...
XUL Overlays
thus, given the following base: ... <menu id="file-menu"> <menupopup id="menu_filepopup"> <menuitem name="new"/> <menuitem name="open"/> <menuitem name="save"/> <menuitem name="close"/> </menupopup> </menu> ... and given the following overlay: <?xml version="1.0"?> <ov...
...hrome://global/content/dialogoverlay.xul"?> and includes an empty box with an id of okcancelbuttons in the ui. the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%" style="margin-bottom: 1em; width: 100%;"> <html:input type="checkbox" id="dialog.newwindow"/> <html:
label for="dialog.newwindow">&openwin.
label;</html:
label> <spring flex="100%"/> </box> <box id="okcancelbuttons"/> for more detail, see the ok and cancel button definitions being referenced here in the global component file platformdialogoverlay.xul. toolbars, submenus, boxes, and any other subtrees that appear in multiple places can be defined in overlays files in this way and referenced for reuse w...
Building a Thunderbird extension 5: XUL
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...
...h 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 your
label so that it shows the current date. the overlay.js file will be created in a later section and your add-on will still work if the file is missing. for now you c...
Building a Thunderbird extension 6: Adding JavaScript
name it overlay.js. window.addeventlistener("load", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.
label = "date: " + datestring; } the first part registers a new event listener that will be executed automatically when thunderbird loads. the event listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree. it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.m...
...executed automatically when thunderbird loads. the event listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree. it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd. because the month is zero-based we also need to add one to the month. finally the
label of our panel is set to "date: " and concatenated with the date string that contains the formatted date. we use the function window.setinterval to update the date in case thunderbird is left running for more than one day. this allows us to call the startup function repeatedly with an interval of 60000ms (every minute). further documentation more functions for the dom objects are listed on: d...
customDBHeaders Preference
ked-out from cvs with the thunderbird_2_0b1_release tag. there is a high probability that your experience will be different should you use an earlier release. getting started to build upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main view. the data will come from a custom header
labeled x-superfluous. setting the preferences although there are various ways to set preferences, i tend to just navigate to the directory where my profile is stored and edit the user.js file with my favorite text editor. in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while...
...gdbview.addcolumnhandler("colsuperfluous",columnhandler)). javascript code once again, other tutorials have demonstrated the general javascript code used to po...
Index - Firefox Developer Tools
's memory heap. it then provides a number of views of the heap that can show you which objects account for memory usage and exactly where in your code you are allocating memory. 38 aggregate view before firefox 48, this was the default view of a heap snapshot. after firefox 48, the default view is the tree map view, and you can switch to the aggregate view using the dropdown
labeled "view:": 39 basic operations before firefox 50, the memory tool is not enabled by default. to enable it, open the developer tool settings, and check the "memory" box under "default firefox developer tools": 40 dom allocation example this article describes a very simple web page that we'll use to illustrate some features of the memory tool. 41 ...
...period of time. the tool then shows you an overview of the things the browser was doing to render your site over the profile, and a graph of the frame rate over the profile. 83 allocations to enable the allocations view, you must check "record allocations" in the performance tool settings, before recording a profile. then record a profile as usual, and you will see a new tab
labeled "allocations" in the toolbar: 84 call tree javascript, performance, memory the call tree is a sampling profiler. it periodically samples the state of the javascript engine and records the stack for the code executing at the time. statistically, the number of samples taken in which we were executing a particular function corresponds to the amount of time the browser spent ex...
Basic operations - Firefox Developer Tools
ading snapshots if you close the memory tool, all unsaved snapshots will be discarded. to save a snapshot click "save": you'll be prompted for a name and location, and the file will be saved with an .fxsnapshot extension. to load a snapshot from an existing .fxsnapshot file, click the import button, which looks like a rectangle with an arrow rising from it (before firefox 49, this button was
labeled with the text "import..."): you'll be prompted to find a snapshot file on disk. comparing snapshots starting in firefox 45, you can diff two heap snapshots. the diff shows you where memory was allocated or freed between the two snapshots. to create a diff, click the button that looks like a venn diagram next to the camera icon (before firefox 47, this looked like a "+/-" icon): you'll ...
...nators view or the tree map view. ...
Work with animations - Firefox Developer Tools
e sure the selected element is the <div class="channel"> switch over to the "animations" tab play the animation let's take a closer look at the contents of the animation inspector here: it shows a synchronized timeline for every animation applied to the selected element or its children. the timeline starts at the start of the first animation, ends at the end of the last animation, and is
labeled with markers every 250 milliseconds (this depends on the time scale of the animations currently displayed). animation bars each animation or transition is shown as a horizontal bar laid across the timeline. the bar is: blue if a transition was used to animate a property orange if a @keyframes animation was used green if the web animations api was used the bar contains a lightning bolt ...
... using the compositor thread (see more about the cost of animating different css properties). the bar is shaped to reflect the easing effect used for the animation. in the example above you can see that the first bar is concave, representing ease-in, and the second is convex, representing ease-out. if the animation used css transitions, there is one bar for each property transitioned, and it is
labeled with the name of the property being transitioned. if the animation used css @keyframes, there is one bar for each animation,
labeled with its name. if the animation or transition had a delay, this is shown as a cross-hatched portion of the bar. delay and enddelay are both represented. if you hover over the bar, a tooltip appears, giving you more detailed information about the animation or tra...
Allocations - Firefox Developer Tools
ant mostly because allocating a lot of memory, or making a lot of allocations, can trigger garbage collection. this in turn can hurt the responsiveness of a page. the allocations view is new in firefox 46. to enable the allocations view, you must check "record allocations" in the performance tool settings, before recording a profile. then record a profile as usual, and you will see a new tab
labeled "allocations" in the toolbar: anatomy of the allocations view the allocations view looks something like this: the allocations view periodically samples allocations that are made over the recording. each row represents a function in which at least one allocation-sample was taken during the recording. it includes the following columns: self count: the number of allocation-samples that ...
...do what sort of garbage collection. in general, though: allocation pressure - allocating a lot of memory, or allocating memory at a high rate - makes spidermonkey more likely to run garbage collection, and more likely to run full, non-incremental garbage collection. if a gc event was caused by allocation pressure, then the sidebar on the right of the marker in the waterfall view contains a link
labeled "show allocation triggers". if you click this link, the devtools switches to the allocations view, and selects the region of time from the end of the last gc cycle to the start of the one you clicked on. this shows you all the allocations that collectively triggered this gc event: if you're seeing these problems, consider whether you can reduce the number or size of the allocations you're ma...
Intensive JavaScript - Firefox Developer Tools
e demo website here. there's also a video version of this walkthrough: the demo website looks like this: it has three controls: a radio button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestanimationframe(), or in another thread using a worker. a button to run the javascript,
labeled "do pointless computations!". a button to start and stop some css animations. this just gives the browser some background tasks to perform. leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exact...
...this time, the recording should look something like this: this is exactly what we might have expected to see. instead of a single solid orange block, each button-press shows up as a long sequence of very short orange blocks. the orange blocks appear one frame apart, and each one represents one of the functions called from requestanimat...
Taking screenshots - Firefox Developer Tools
you can use the developer tools to take a screenshot of the entire page, or of a single element in the page. taking a screenshot of the page use the screenshot icon: to take a full-page screenshot of the current page. by default, the screenshot icon is not enabled. to enable it: visit the settings page find the section
labeled "available toolbox buttons" check the box
labeled "take a screenshot of the entire page". you'll now see the icon in the toolbar: click the icon to take a screenshot of the current page. the screenshot is saved to your browser's "downloads" directory: taking a screenshot of an element to take a screenshot of a single element in the page, activate the context menu on that element in the inspector's html pane, and select "screenshot node". the screenshot ...
...: taking a screenshot of an element to take a screenshot of a single element in the page, activate the context menu on that element in the inspector's html pane, and select "screenshot node". the screenshot is saved to the browser's "downloads" directory: copying screenshots to the clipboard from firefox 53, you can also copy the screenshot to the clipboard. just check the box in settings
labeled "screenshot to clipboard": now, whenever you take a screenshot, the screenshot is also copied to the clipboard. taking screenshots with the web console if you need to specify a different device-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in firefox 62 you can use the :screenshot helper function in the web console. type :screenshot in the ...
Web Audio Editor - Firefox Developer Tools
f you find bugs, we'd love it if you filed them in bugzilla. if you have feedback or suggestions for new features, dev-developer-tools or twitter are great places to register them. opening the web audio editor the web audio editor is not enabled by default in firefox 32. to enable it, open the developer tool settings and check "web audio". now there should be an extra tab in the toolbox toolbar
labeled "web audio". click the tab and load a page that constructs an audio context. two good demos are: the voice-change-o-matic, which can apply various effects to the microphone input and also provides a visualisation of the result the violent theremin, which changes the pitch and volume of a sine wave as you move the mouse pointer visualizing the graph the web audio editor will now display t...
...odes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. connections to audioparams displaying connections to audioparams is new in firefox 34. connections between nodes are displayed as solid lines. if, instead, you've connected a node to an audioparam in another node, then the connection is shown as a dashed line between the nodes, and is
labeled with the name of the audioparam: inspecting and modifying audionodes if you click on a node, it's highlighted and you get a node inspector on the right hand side. this list the values of that node's audioparam properties. for example, here's what the oscillatornode looks like: with the violent theremin demo, the frequency parameter is modified as the user moves the mouse left and right, and ...
about:debugging (before Firefox 68) - Firefox Developer Tools
webextensions. this page enables you to do two things: load an add-on temporarily from disk connect the add-on debugger to any restartless add-ons connecting the add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox). next to each entry is a button
labeled "debug". if the "debug" button is disabled, check the "enable add-on debugging" box. if you click "debug", you'll see a dialog asking you to accept an incoming connection. click "ok", and the add-on debugger will start in a separate window. note that sometimes the debugger window is hidden by the main firefox window. see the page on the add-on debugger for all the things you can do with th...
...e worker is currently running. it's installed and activated, and is currently handling events. "stopped": the service worker is installed and activated, but has been terminated after being idle. this section uses a simple serviceworker demo, hosted at https://serviceworke.rs/push-simple/. debugging workers for a service worker, if it is already running, you'll see two buttons next to it,
labeled "debug" and "push". if it's not already running, you'll see one button,
labeled "start": click this to start the service worker. clicking "debug" connects the javascript debugger and console to this worker. you can set breakpoints, step through code, watch variables, evaluate code, and so on: registering workers at first, you won't see any workers listed under service workers or shared wor...
Pixel manipulation with canvas - Web APIs
10, 10, 0, 0, 200, 200); because anti-aliasing is enabled by default, we might want to disable the smoothing to see clear pixels. you can toggle the checkbox to see the effect of the imagesmoothingenabled property (which needs prefixes for different browsers). ...
...ear pixels. you can toggle the checkbox to see the effect of the imagesmoothingenabled property (which needs prefixes for different browsers). ...
console.count() - Web APIs
the console.count() method logs the number of times that this particular call to count() has been called. note: this feature is available in web workers. syntax console.count([
label]); parameters
label optional a string. if supplied, count() outputs the number of times it has been called with that
label. if omitted, count() behaves as though it was called with the "default"
label. examples for example, given code like this: let user = ""; function greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" the
label is displayed as default because no explicit
label was supplied. if we pass the user variable as th...
...r example, given code like this: let user = ""; function greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" the
label is displayed as default because no explicit
label was supplied. if we pass the user variable as the
label argument to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "alice: 3" we're now maintaining separate counts based only on the value of
label. ...
Console.countReset() - Web APIs
the console.countreset() method resets counter used with console.count(). note: this feature is available in web workers. syntax console.countreset([
label]); parameters
label optional a string. if supplied, countreset() resets the count for that
label to 0. if omitted, countreset() resets the default counter to 0. ...
...on greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console.countreset(); console output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" "default: 0" note that the call to console.counterreset() resets the value of the default counter to zero. ...
Console.timeEnd() - Web APIs
once stopped, the elapsed time is automatically displayed in the web console along with an indicator that the time has ended. ...
...once stopped, the elapsed time is automatically displayed in the web console along with an indicator that the time has ended. ...
Document: DOMContentLoaded event - Web APIs
ner. ...
...omething() { console.info('dom loaded'); } if (document.readystate === 'loading') { // loading hasn't finished yet document.addeventlistener('domcontentloaded', dosomething); } else { // `domcontentloaded` has already 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: 2re...
Element: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element. ...
...s yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element. ...
Element: overflow event - Web APIs
en overflowed by its content or has been rendered for the first time in this state (only works for elements styled with overflow != visible). it is a proprietary event specific to gecko (firefox). ...
...st time in this state (only works for elements styled with overflow != visible). it is a proprietary event specific to gecko (firefox). ...
Element.scrollHeight - Web APIs
quis placerat metus posuere. duis malesuada justo a diam vestibulum vel aliquam nisi ornare. integer laoreet nisi a odio ornare non congue turpis eleifend. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. cras vulputate libero sed arcu iaculis nec lobortis orci fermentum. ...
...e. duis malesuada justo a diam vestibulum vel aliquam nisi ornare. integer laoreet nisi a odio ornare non congue turpis eleifend. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. cras vulputate libero sed arcu iaculis nec lobortis orci fermentum. ...
Element: underflow event - Web APIs
s fired when an element is no longer overflowed by its content. this only works for elements for which overflow is not set to visible. the counterpart overflow event is fired when overflow occurs. ...
...t. this only works for elements for which overflow is not set to visible. the counterpart overflow event is fired when overflow occurs. ...
Event.eventPhase - Web APIs
for more details, see section 3.1, event dispatch and dom event flow, of the dom level 3 events specification. ...
..., event dispatch and dom event flow, of the dom level 3 events specification. ...
GlobalEventHandlers.onkeypress - Web APIs
ey inside the <input> element. html <input> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.onkeypress = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result filter keys with a regular expression this example filters the characters typed into a form field using a regular expression. ...
...<input> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.onkeypress = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result filter keys with a regular expression this example filters the characters typed into a form field using a regular expression. ...
GlobalEventHandlers.onreset - Web APIs
that processes reset events. the reset event fires when the user clicks a reset button in a form (<input type="reset">). syntax target.onreset = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. example this example logs the current event.timestamp whenever you reset the form. ...
...t event fires when the user clicks a reset button in a form (<input type="reset">). syntax target.onreset = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. example this example logs the current event.timestamp whenever you reset the form. ...
HTMLButtonElement - Web APIs
ted. if specified, this attribute overrides the novalidate attribute of the <form> element that owns this element. htmlbuttonelement.formtarget is a domstring reflecting a name or keyword indicating where to display the response that is received after submitting the form. if specified, this attribute overrides the target attribute of the <form> element that owns this element. htmlbuttonelement.
labels read only is a nodelist that represents a list of <
label> elements that are
labels for this button. htmlbuttonelement.menu is a htmlmenuelement representing the menu element to be displayed if the button is clicked and is of type="menu". htmlbuttonelement.name is a domstring representing the name of the object when submitted with a form. html5 if specified, it must not be the empty strin...
...ation the following attribute has been added: menu. the type attribute can take one more value, "menu". html5the definition of 'htmlbuttonelement' in that specification. recommendation the attributes tabindex and accesskey, are now defined on htmlelement. the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget,
labels, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). the type attribute is no more read-only. document object model (dom) level 2 html specificationthe definition of 'htmlbuttonelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document o...
HTMLDialogElement.close() - Web APIs
example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
...n clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
HTMLDialogElement.open - Web APIs
example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
...n clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
HTMLDialogElement.returnValue - Web APIs
ue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog. examples the following example displays a button to open a <dialog> containing a form via the showmodal() method. from there, either button will close the dialog. ...
...there, either button will close the dialog. ...
HTMLDialogElement.show() - Web APIs
owing example shows a simple button that, when clicked, opens a <dialog> containing a form via the show() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
..., when clicked, opens a <dialog> containing a form via the show() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
HTMLDialogElement.showModal() - Web APIs
example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
...n clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
HTMLDialogElement - Web APIs
e button that, when clicked, opens a <dialog> containing a form via the htmldialogelement.showmodal() function. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() function), or submit the form via the submit button. ...
...alog> containing a form via the htmldialogelement.showmodal() function. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() function), or submit the form via the submit button. ...
HTMLElement: change event - Web APIs
selecting a date from a date picker for <input type="date">, by selecting a file in the file picker for <input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value of <textarea> or <input type="text">). the html specification lists the <input> types that should fire the change event. ...
... the html specification lists the <input> types that should fire the change event. ...
HTMLElement - Web APIs
/a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, element, and implements those from documentandelementeventhandlers, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement and toucheventhandlers. htmlelement.accesskey is a domstring representing the access key assigned to the element. htmlelement.accesskey
label read only returns a domstring containing the element's assigned access key. htmlelement.contenteditable is a domstring, where a value of true means the element is editable and a value of false means it isn't. htmlelement.iscontenteditable read only returns a boolean that indicates whether or not the content of the element can be edited. htmlelement.contextmenu is a htmlmenuelement repr...
...e, 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, accesskey
label, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, command
label, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties. moved the id and classname properties to the element interface. document object model (dom) level 2 html specificationthe definition of 'htmlelement' in that specification. ob...
HTMLFormElement: reset event - Web APIs
a <form> is reset. bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for form resets, and logs the current event.timestamp whenever that occurs. ...
... yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for form resets, and logs the current event.timestamp whenever that occurs. ...
HTMLFormElement: submit event - Web APIs
ying to submit a form that does not pass validation triggers an invalid event. in this case, the validation prevents form submission, and thus there is no submit event. examples this example uses eventtarget.addeventlistener() to listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form. ...
...s validation triggers an invalid event. in this case, the validation prevents form submission, and thus there is no submit event. examples this example uses eventtarget.addeventlistener() to listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form. ...
HTMLInputElement: invalid event - Web APIs
he element or its owner <form> is called. it is not checked on blur. examples if a form is submitted with an invalid value, the submittable elements are checked and, if an error is found, the invalid event will fire on the invalid element. in this example, when an invalid event fires because of an invalid value in the input, the invalid value is logged. ...
... is submitted with an invalid value, the submittable elements are checked and, if an error is found, the invalid event will fire on the invalid element. in this example, when an invalid event fires because of an invalid value in the input, the invalid value is logged. ...
HTMLInputElement - Web APIs
d only htmlelement object: returns the element pointed by the list attribute. the property may be null if no html element found in the same tree. multiple boolean: returns / sets the element's multiple attribute, indicating whether more than one value is possible (e.g., multiple files). files filelist array: returns the list of selected files. htmlinputelement.
labels read only nodelist array: returns a list of <
label> elements that are
labels for this element. step string: returns / sets the element's step attribute, which works with min and max to limit the increments at which a numeric or date-time value can be set. it can be the string any or a positive floating point number. if this is not set to any, the control accepts only values at mu...
...on. recommendation technically, the tabindex and accesskey properties, as well as the blur(), click(), and focus() methods, are now defined on htmlelement. the following properties are now obsolete: align and usemap. the following properties have been added: autocomplete, autofocus, dirname, files, formaction, formenctype, formmethod, formnovalidate, formtarget, height, indeterminate,
labels, list, max, min, multiple, pattern, placeholder, required, selectiondirection, selectionend, selectionstart, step, validationmessage, validity, valueasdate, valueasnumber, width, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(), setselectionrange(), stepup(), and stepdown(). document object model (dom) level 2 html specificationthe definit...
HTMLSelectElement - Web APIs
specified. htmlselectelement.disabled a boolean reflecting the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. htmlselectelement.formread only an htmlformelement referencing the form that this element is associated with. if the element is not associated with of a <form> element, then it returns null. htmlselectelement.
labelsread 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...
...ment html living standardthe definition of 'htmlselectelement' in that specification. living standard since the latest snapshot, html5, it adds the autocomplete property and the reportvalidity() method. html5the definition of 'htmlselectelement' in that specification. recommendation is a snapshot of html living standard. it adds the autofocus, form, required,
labels, selectedoptions, willvalidate, validity and validationmessage properties. the tabindex property and the blur() and focus() methods have been moved to htmlelement. the methods item(), nameditem(), checkvalidity() and setcustomvalidity(). document object model (dom) level 2 html specificationthe definition of 'htmlselectelement' in that specification. obsolete options now r...
HTMLTextAreaElement - Web APIs
lue contained in the control. willvalidate read only boolean: returns whether the element is a candidate for constraint validation. false if any conditions bar it from constraint validation, including its readonly or disabled property is true. wrap string: returns / sets the wrap html attribute, indicating how the control wraps text. htmltextareaelement.
labelsread only nodelist: returns a list of
label elements associated with this element. the two properties tabindex and accesskey are inherited from htmlelement from html5 on, but were defined on htmltextareaelement in dom level 2 html and earlier specifications. methods blur() removes focus from the control; keystrokes will subsequently go nowhere. focus() gives f...
...of 'htmltextareaelement' in that specification. living standard html5the definition of 'htmltextareaelement' in that specification. recommendation the attributes tabindex and accesskey, as well as the methods blur() and focus() are now defined on htmlelement. the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength,
labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(), and setselectionrange(). document object model (dom) level 2 html specificationthe definition of 'htmltextareaelement' in that specification. obsolete the property defaultvalue doesn't contain the initial...
MediaDeviceInfo - Web APIs
d across sessions). mediadeviceinfo.groupidread only returns a domstring that is a group identifier. two devices have the same group identifier if they belong to the same physical device — for example a monitor with both a built-in camera and a microphone. mediadeviceinfo.kindread only returns an enumerated value that is either "videoinput", "audioinput" or "audiooutput". mediadeviceinfo.
labelread only returns a domstring that is a
label describing this device (for example "external usb webcam"). for security reasons, the
label field is always blank unless an active media stream exists or the user has granted persistent permission for media device access. the set of device
labels could otherwise be used as part of a fingerprinting mechanism to identify a user. methods none. ex...
...e here's an example that uses enumeratedevices() to get a list of devices. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones. ...
MediaDevices.enumerateDevices() - Web APIs
= navigator.mediadevices.enumeratedevices(); return value a promise that receives an array of mediadeviceinfo objects when the promise is fulfilled. each object in the array describes one of the available media input and output devices. if enumeration fails, the promise is rejected. example here's an example of using enumeratedevices(). ...
...it simply outputs a list of the device ids, with their
labels if available. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones. ...
MediaDevices.ondevicechange - Web APIs
get the updated list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevicelist(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called any time the device list changes. it displays in the browser window two lists: one of audio devices and one of video devices, with both the device's
label (name) and whether it's an input or an output device. because the example provides a handler for the devicechange event, the list is refreshed any time a media device is attached to or removed from the device running the sample. html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height=...
...es using that information. ...
MediaStream.onaddtrack - Web APIs
de 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. ...
...d. 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 media capture and streamsthe definition of 'mediastream.onaddtrack' in that specification. candidate recommendation initial specification. ...
MouseEvent - Web APIs
current state of the specified modifier key. see the keyboardevent.getmodifierstate() for details. mouseevent.initmouseevent() initializes the value of a mouseevent created. if the event has already being dispatched, this method does nothing. example this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods. ...
... keyboardevent.getmodifierstate() for details. mouseevent.initmouseevent() initializes the value of a mouseevent created. if the event has already being dispatched, this method does nothing. example this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods. ...
PaymentRequest.onshippingoptionchange - Web APIs
entrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. ...
...tions); // when user selects a shipping address request.addeventlistener('shippingaddresschange', e => { e.updatewith(((details, addr) => { var shippingoption = { id: '',
label: '', amount: { currency: 'usd', value: '0.00' }, selected: true }; // shipping to us is supported if (addr.country === 'us') { shippingoption.id = 'us'; shippingoption.
label = 'standard shipping in us'; shippingoption.amount.value = '0.00'; details.total.amount.value = '55.00'; // shipping to jp is supported } else if (addr.country === 'jp') { shippingoption.id = 'jp'; shippingoption.
label = 'international shipping'; shippingoption.amount.value = '10.00'; details.total.amount.value = '65.00'; // shipping to elsewhere is...
PaymentRequest.shippingAddress - Web APIs
, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity. ...
... console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress, resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '',
label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.
label = 'free shipping in missouri'; details.total.amount.value = '55.00'; } else { shippingoption.id = 'us'; shippingoption.
label = 'standard shipping in us'; shippingoption.amount.value = '5.00'; details.total.amount.value = '60.00'; } details.displayitems.splice(2, 1, shippingoption); details.shippingoptions = [shippingoption]; } else { delete deta...
PaymentRequest: shippingoptionchange event - Web APIs
are three options (such as "free ground shipping", "2-day air", and "next day"), each time the user chooses one of those options, this event handler is called to recalculate the total based on the changed shipping option. paymentrequest.addeventlistener("shippingoptionchange", event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur",
label: "total due", value, }; event.updatewith({ total }); }, false); after caling a custom function, calculatenewtotal(), to compute the updated total based on the newly-selected shipping option as specified by the shippingoption. the revised total is submitted back to the payment request by calling the event's updatewith() method. you can also create an event handler for shippingoptionchan...
... the revised total is submitted back to the payment request by calling the event's updatewith() method. you can also create an event handler for shippingoptionchange using its corresponding event handler property, onshippingoptionchange: paymentrequest.onshippingoptionchange = event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur",
label: "total due", value, }; event.updatewith({ total }); }; specifications specification status comment payment request apithe definition of 'shippingoptionchange' in that specification. candidate recommendation initial definition. ...
PaymentRequest.show() - Web APIs
ails contains a payment method specific response await response.complete("success"); } catch (err) { console.error("uh oh, something bad happened", err.message); } } the following example shows how to update the payment sheet as it's being presented to the end-user. async function requestpayment() { // we start with au$0 as the total. ...
...} document.getelementbyid("buybutton").onclick = requestpayment; specifications specification status comment payment request apithe definition of 'show(optional detailspromise)' in that specification. ...
PaymentResponse.shippingAddress - Web APIs
t.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. ...
... console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress, resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '',
label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.
label = 'free shipping in missouri'; details.total.amount.value = '55.00'; } else { shippingoption.id = 'us'; shippingoption.
label = 'standard shipping in us'; shippingoption.amount.value = '5.00'; details.total.amount.value = '60.00'; } details.displayitems.splice(2, 1, shippingoption); details.shippingoptions = [shippingoption]; } else { delete deta...
RTCPeerConnection.createDataChannel() - Web APIs
w channel linked with the remote peer, over which any kind of data may be transmitted. this can be useful for back-channel content such as images, file transfer, text chat, game update packets, and so forth. if the new data channel is the first one added to the connection, renegotiation is started by delivering a negotiationneeded event. syntax datachannel = rtcpeerconnection.createdatachannel(
label[, options]); parameters
label a human-readable name for the channel. this string may not be longer than 65,535 bytes. options optional an rtcdatachannelinit dictionary providing configuration options for the data channel rtcdatachannelinit dictionary the rtcdatachannelinit dictionary provides the following fields, any of which may be included in the object passed as the options paramete...
...ult: false. id optional an 16-bit numeric id for the channel; permitted values are 0-65534. if you don't include this option, the user agent will select an id for you. the options which can be configured using the rtcdatachannelinit dictionary represent the script-settable subset of the properties on the rtcdatachannel interface. return value a new rtcdatachannel object with the specified
label, configured using the options specified by options if that parameter is included; otherwise, the defaults listed above are established. exceptions invalidstateerror the rtcpeerconnection is closed. typeerror this can happen in a couple of situations: the
label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters). the id is 65535...
RTCPeerConnection.onicegatheringstatechange - Web APIs
resented to the user to let them know what's happening by examining the current value of the icegatheringstate property each time it changes and changing the contents of a status display based on the new information. ...
...gatheringstate property each time it changes and changing the contents of a status display based on the new information. the status is simply presented as text in a <div> element: <div id="icestatus"></div> the actual event handler looks like this: pc.onicegatheringstatechange = function() { let
label = "unknown"; switch(pc.icegatheringstate) { case "new": case "complete":
label = "idle"; break; case "gathering":
label = "determining route"; break; } document.getelementbyid("icestatus").innerhtml =
label; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onicegatheringstatechange' in that specification. candidate recommendation ...
Selection.modify() - Web APIs
utton to expand the selection. html <p>click somewhere in this example. then click the button below to expand the selection. watch what happens!</p> <p>et harum quidem rerum facilis est et expedita distinctio. ...
...<p>click somewhere in this example. then click the button below to expand the selection. watch what happens!</p> <p>et harum quidem rerum facilis est et expedita distinctio. ...
StorageEstimate.quota - Web APIs
ing a device using an amalgamation of the values of seemingly innocuous properties. syntax quota = storageestimate.quota; value a numeric value specifying an approximation of the total amount of storage space available for use by the application. example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. ...
...rageestimate.quota; value a numeric value specifying an approximation of the total amount of storage space available for use by the application. example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. html content <
label> you’re currently using about <output id="percent"> </output>% of your available storage. </
label> javascript content navigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'quota' in that specification. living standard initial definition ...
StorageEstimate.usage - Web APIs
duplication prevention techniques, and other methods to improve storage efficiency. syntax usage = storageestimate.usage; value a numeric value specifying an approximation of the total amount of storage space available for use by the application. example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. ...
...rageestimate.usage; value a numeric value specifying an approximation of the total amount of storage space available for use by the application. example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. html content <
label> you’re currently using about <output id="percent"> </output>% of your available storage. </
label> javascript content navigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'usage' in that specification. living standard initial definition ...
StorageManager.estimate() - Web APIs
ay find that the quota varies from origin to origin. this variance is based on factors such as: how often the user visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. ...
...ften the user visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. html content <
label> you’re currently using about <output id="percent"> </output>% of your available storage. </
label> javascript content navigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'estimate()' in that specification. living standard initial definition. ...
TrackDefault - Web APIs
a trackdefault object is provided to a sourcebuffer object by setting its sourcebuffer.trackdefaults property. constructor trackdefault() constructs and returns a new trackdefault object. properties trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. ...
...the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. trackdefault.language read only returns the default language to use when an initialization segment does not contain language information for a new track. trackdefault.
label read only returns the default
label to use when an initialization segment does not contain
label information for a new track. trackdefault.kinds read only returns the default kinds used when an initialization segment does not contain kind information for a new track. ...
ValidityState.typeMismatch - Web APIs
an empty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch. ...
...tiple attribute is present, there is a typemismatch. type attribute conformance input type value expected value email x@y or x@y.z email address, with or without tld url x: or x://y.z protocol or full url with protocol examples given the following: <p> <
label> enter an email address: <input type="email" value="example.com"/> </
label> </p> <p> <
label> enter a url: <input type="url" value="example.com"/> </
label> </p> input:invalid { border: red solid 3px; } the above each produce a typemismatch because the email address is just a domain and the url has no protocol the typemismatch occurs when there is a disconnect between the value expected via the type attribute and the data that is actually present. the ...
WebGL model view projection - Web APIs
e: gl_position = vec4(position, 1.0); the position variable was defined in the draw() method and passed in as an attribute to the shader. this is a three dimensional point, but the gl_position variable that ends up getting passed down through the pipeline is actually 4 dimensional — instead of (x, y, z) it is (x, y, z, w). there is no letter after z, so by convention this fourth dimension is
labeled w. in the above example the w coordinate is set to 1.0. the obvious question is "why the extra dimension?" it turns out that this addition allows for lots of nice techniques for manipulating 3d data. this added dimension introduces the notion of perspective into the coordinate system; with it in place, we can map 3d coordinates into 2d space—thereby allowing two parallel lines to intersect a...
...matrix(matrix); }; the shader now uses three matrices. gl_position = projection * view * model * vec4(position, 1.0); after this step, the gpu pipeline will clip the out of range vertices, and send the model down to the fragment shader for rasterization. the results view on jsfiddle relating the coordinate systems at this point it would be beneficial to take a step back and look at and
label the various coordinate systems we use. first off, the cube's vertices are defined in model space. to move the model around the scene. these vertices need to be converted into world space by applying the model matrix. model space → model matrix → world space the camera hasn't done anything yet, and the points need to be moved again. currently they are in world space, but they need to be move...
Using IIR filters - Web APIs
nt listener starts like so: playbutton.addeventlistener('click', function() { if (this.dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ... }, false); the toggle that turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="
label" disabled></button> the filter button's click handler then connects the iirfilter up to the graph, between the source and the detination: filterbutton.addeventlistener('click', function() { if (this.dataset.filteron === 'false') { srcnode.disconnect(audioctx.destination); srcnode.connect(iirfilter).connect(audioctx.destination); ... }, false); frequency response we...
...height); // set up some spacing based on size const spacing = width/16; const fontsize = math.floor(spacing/1.5); // draw our axis canvasctx.linewidth = 2; canvasctx.strokestyle = 'grey'; canvasctx.beginpath(); canvasctx.moveto(spacing, spacing); canvasctx.lineto(spacing, height-spacing); canvasctx.lineto(width-spacing, height-spacing); canvasctx.stroke(); // axis is gain by frequency -> make
labels canvasctx.font = fontsize+'px sans-serif'; canvasctx.fillstyle = 'grey'; canvasctx.filltext('1', spacing-fontsize, spacing+fontsize); canvasctx.filltext('g', spacing-fontsize, (height-spacing+fontsize)/2); canvasctx.filltext('0', spacing-fontsize, height-spacing+fontsize); canvasctx.filltext('hz', width/2, height-spacing+fontsize); canvasctx.filltext('20k', width-spacing, height-spacing+fontsize...
Using ARIA: Roles, states, and properties - Accessibility
ar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-
label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes ...
...lected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-
labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
ARIA: cell role - Accessibility
ractions none required javascript features the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of repurposing an element and adding an aria role, state or property to make it accessible, then do so. employ the html <td> element instead of the aria role of cell whenever possible. ...
... for data table structure. you can add aria roles to ensure accessibility should the native semantics of the table be removed, such as with css. a relevant use case for the aria table role is when the native semantics of a table are overridden by css's display property, such as by display: grid. in this case, you can use the aria table roles to add the semantics back in. ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
o support for document formatting or "dom" as requested by some vendors: support a custom interface that gives them the formatting information they are requesting. dueling text equivalents problem: there are three kinds of text equivalents, and it is difficult to know when to use each. different applications behave differently in this regard. for example, acrobat uses accessible value for text
labels where as most programs use accessible name. solution: be as consistent with internet explorer as possible. use accessible name for most text equivalents, and accessible value for url's. don't use accessible description unless you really do have a long description for the object you need to expose -- most assistive technology makes little use of it. dueling text roles problem: there are two di...
...or text objects, role_statictext and role_text. role_text is supposed to mean editable text, yet it is sometimes used in conjuction with state_readonly. it's difficult to know when to use which role plus readonly state combination. for example, internet explorer uses role_text without state_readonly and role_text with state_readonly for ordinary web page text. however, it uses role_statictext for
labels. solution: use role_statictext for
labels specific to dialog and ui controls, and always use role_text for document text even if the text is not editable (in that case use role_text with state_readonly). use role_text with the readonly flag cleared for editable text fields. issues with links problem: some assistive technologies have inflexible heuristics when it comes to reading links. they m...
:active - CSS: Cascading Style Sheets
mouse, "activation" typically starts when the user presses down the primary mouse button. /* selects any <a> that is being activated */ a:active { color: red; } the :active pseudo-class is commonly used on <a> and <button> elements. other common targets of this pseudo-class include elements that contain an activated element, and form elements that are being activated through their associated <
label>. styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :visited) that has at least equal specificity. to style links appropriately, put the :active rule after all other link-related rules, as defined by the lvha-order: :link — :visited — :hover — :active. note: on systems with multi-button mice, css3 specifies that th...
...agraph will get a gray background while you click on it or the link. </p> css a:link { color: blue; } /* unvisited links */ a:visited { color: purple; } /* visited links */ a:hover { background: yellow; } /* hovered links */ a:active { color: red; } /* active links */ p:active { background: #eee; } /* active paragraphs */ result active form elements html <form> <
label for="my-button">my button: </
label> <button id="my-button" type="button">try clicking me or my
label!</button> </form> css form :active { color: red; } form button { background: white; } result specifications specification status comment html living standardthe definition of ':active' in that specification. living standard selectors level ...
any-pointer - CSS: Cascading Style Sheets
the available devices have different characteristics, although none only matches when none of them are pointing devices. examples this example creates a small checkbox for users with at least one fine pointer and a large checkbox for users with at least one coarse pointer. the big checkbox takes precedence because it is declared after the small one. ...
...fferent characteristics, although none only matches when none of them are pointing devices. examples this example creates a small checkbox for users with at least one fine pointer and a large checkbox for users with at least one coarse pointer. the big checkbox takes precedence because it is declared after the small one. ...
pointer - CSS: Cascading Style Sheets
put mechanism does not include a pointing device. coarse the primary input mechanism includes a pointing device of limited accuracy. fine the primary input mechanism includes an accurate pointing device. examples this example creates a small checkbox for users with fine primary pointers and a large checkbox for users with coarse primary pointers. ...
... a pointing device. coarse the primary input mechanism includes a pointing device of limited accuracy. fine the primary input mechanism includes an accurate pointing device. examples this example creates a small checkbox for users with fine primary pointers and a large checkbox for users with coarse primary pointers. ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
duration [prefixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-
label checkmenuitem dialog groupbox listbox menuarrow menucheckbox menuimage menuitem menuitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -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-but...
...rless-glass -moz-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-upbutto...
<color> - CSS: Cascading Style Sheets
.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. examples color value tester in this example we provide a <div> and a text input. entering a valid color into the input causes the <div> to adopt that color, allowing you to test our color values. ...
...ng color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. examples color value tester in this example we provide a <div> and a text input. entering a valid color into the input causes the <div> to adopt that color, allowing you to test our color values. ...
display - CSS: Cascading Style Sheets
that it is easier to see the effect the display values are having. note: we've not included any of the modern two-value syntax, as support for that is still fairly limited. ...
...ay values are having. note: we've not included any of the modern two-value syntax, as support for that is still fairly limited. ...
<easing-function> - CSS: Cascading Style Sheets
nd stopped again using the provided button, and a select menu that can be used to switch its easing function between the available keywords, plus a couple of cubic-bezier() and steps() options. the idea is to provide an easy comparison between different easing functions. ...
...ct menu that can be used to switch its easing function between the available keywords, plus a couple of cubic-bezier() and steps() options. the idea is to provide an easy comparison between different easing functions. ...
<filter-function> - CSS: Cascading Style Sheets
lter function comparison this example provides a simple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function. updating the controls updates the filter effect in real time, allowing you to investigate the effects of different filters. ...
...ple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function. updating the controls updates the filter effect in real time, allowing you to investigate the effects of different filters. ...
transform-style - CSS: Cascading Style Sheets
ened onto the plane of their parent, and you might not be able to see them at all, depending on the browser you are using. ...
...ght not be able to see them at all, depending on the browser you are using. ...
Getting Started - Developer guides
e 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, test.php, which will take the data we send and return a "computed" string - "hello, [user data]!" - which we'll alert(). ...
......
Audio and Video Delivery - Developer guides
we instruct the video to autoplay but to be muted by default. note...
...we instruct the video to autoplay but to be muted by default. note: the autoplay attribute may be ignored by some mobile browsers. also, the auto...
<command>: The HTML Command element - HTML: Hypertext Markup Language
ot mandatory. the <colgroup> must not have a <span> as child. dom interface htmlcommandelement attributes this element includes the global attributes. checked indicates whether the command is selected. must be omitted unless the type attribute is checkbox or radio. disabled indicates that the command is not available. icon gives a picture which represents the command.
label the name of the command as shown to the user. radiogroup this attribute gives the name of the group of commands, with a type of radio, that will be toggled when the command itself is toggled. this attribute must be omitted unless the type attribute is radio. type this attribute indicates the kind of command. this can be one of three values. command or empty which is the default state...
...ribute is radio. type this attribute indicates the kind of command. this can be one of three values. command or empty which is the default state and indicates that this is a normal command. checkbox indicates that the command can be toggled using a checkbox. radio indicates that the command can be toggled using a radio button. examples <command type="command"
label="save" icon="icons/save.png" onclick="save()"> specifications specification status comment html5the definition of '<command>' in that specification. recommendation ...
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, common to all elements. ...
...are mandatory. permitted parents any element that accepts phrasing content. implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, common to all elements. ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
odal(). for example, to dim unreachable content behind the modal dialog. examples simple example <dialog open> <p>greetings, one and all!</p> </dialog> advanced example this example opens a pop-up dialog box that contains a form, when the "update details" button is clicked. ...
... pop-up dialog box that contains a form, when the "update details" button is clicked. ...
<input type="hidden"> - HTML: Hypertext Markup Language
ite. validation hidden inputs don't participate in constraint validation; they have no real value to be constrained. examples let's look at how we might implement a simple version of the edit form we described earlier (see tracking edited content), using a hidden input to remember the id of the record being edited. the edit form's html might look a little bit like this: <form> <div> <
label for="title">post title:</
label> <input type="text" id="title" name="title" value="my excellent blog post"> </div> <div> <
label for="content">post content:</
label> <textarea id="content" name="content" cols="60" rows="5"> this is the content of my excellent blog post. i hope you enjoy it! </textarea> </div> <div> <button type="submit">update post</button> </div> <in...
...ent" cols="60" rows="5"> this is the content of my excellent blog post. ...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
typically this element is rendered by default using a bold font weight. however, it should not be used simply to apply bold styling; use the css font-weight property for that purpose. use the <b> element to draw attention to certain text without indicating a higher level of importance. use the <em> element to mark text that has stress emphasis. another accepted use for <strong> is to denote the
labels of paragraphs which represent notes or warnings within the text of a page. <b> vs. <strong> it is often confusing to new developers why there are so many ways to express the same thing on a rendered website. <b> and <strong> are perhaps one of the most common sources of confusion, causing developers to ask "should i use <b> or <strong>? don't they both do the same thing?" not exactly. the <st...
... love carrots" vs. "i love carrots"), <strong> is used to give portions of a sentence added importance (e.g., "warning! this is very dangerous.") both <strong> and <em> can be nested to increase the relative degree of importance or stress emphasis, respectively. examples basic example <p>before proceeding, <strong>make sure you put on your safety goggles</strong>.</p> the resulting output:
labeling warnings <p><strong>important:</strong> before proceeding, make sure you add plenty of butter.</p> this results in: specifications specification status comment html living standardthe definition of '<strong>' in that specification. living standard html5the definition of '<strong>' in that specification. recommendation html 4.01 ...
Statements and declarations - JavaScript
occur on a single line if each statement is separated by a semicolon. this isn't a keyword, but a group of keywords. statements and declarations by category for an alphabetical listing see the sidebar on the left. control flow block a block statement is used to group zero or more statements. the block is delimited by a pair of curly brackets. break terminates the current loop, switch, or
label statement and transfers program control to the statement following the terminated statement. continue terminates execution of the statements in the current iteration of the current or
labeled loop, and continues execution of the loop with the next iteration. empty an empty statement is used to provide no statement, although the javascript syntax would expect one. if...else executes a statem...
... invokes any available debugging functionality. if no debugging functionality is available, this statement has no effect. export used to export functions to make them available for imports in external modules, and other scripts. import used to import functions exported from an external module, another script. import.meta an object exposing context-specific metadata to a javascript module.
label provides a statement with an identifier that you can refer to using a break or continue statement. with extends the scope chain for a statement. specifications specification ecmascript (ecma-262)the definition of 'ecmascript language: statements and declarations' in that specification. ...
<mtable> - MathML
e table. possible values are: none (default), solid and dashed. framespacing specifies additional space added between the table and frame. groupalign unimplemented href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. unimplemented min
labelspacing a length value specifing the minimum space between a
label and the adjacent cell in the row. rowalign specifies the vertical alignment of the cells. multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowalign="top bottom axis"). possible values are: axis, baseline (default), bottom, center and top. rowlines specifies row borders. multiple values s...
...). possible values are: axis, baseline (default), bottom, center and top. rowlines specifies row borders. multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). possible values are: none (default), solid and dashed. unimplemented rowspacing specifies the space between table rows. unimplemented side specifies the position where <m
labeledtr>
label elements should be placed. possible values are: left, right (default), leftoverlap and rightoverlap. width specifies the width of the entire table. accepts length values. examples alignment with row number rendering: <math> <mi>x</mi> <mo>=</mo> <mtable frame="solid" rowlines="solid" align="axis 3"> <mtr> <mtd><mi>a</mi></mtd> <mtd...
MathML element reference - MathML
entation elements a to z math <math> (top-level element) a <maction> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <m
labeledtr> (
labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal...
...p-level elements <math> token elements <mglyph> <mi> <mn> <mo> <ms> <mspace> <mtext> general layout <menclose> <merror> <mfenced> <mfrac> <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> script and limit elements <mmultiscripts> <mover> <mprescripts> <msub> <msubsup> <msup> <munder> <munderover> <none> tabular math <maligngroup> <malignmark> <m
labeledtr> <mtable> <mtd> <mtr> elementary math <mlongdiv> <mscarries> <mscarry> <msgroup> <msline> <msrow> <mstack> uncategorized elements <maction> semantic annotations <annotation> <annotation-xml> <semantics> ...
MathML documentation index - MathML
here existing unicode characters are not available. it may be used within token elements. 17 <mi> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. you can also have arbitrary text in it to mark up terms. ...
... 17 <mi> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. you can also have arbitrary text in it to mark up terms. 18 <m
labeledtr> mathml, mathml reference, mathml:element, mathml:tabular math the mathml <m
labeledtr> element is used to represent a
label in a row either on the left or on the right side (determined using the side attribute on the <mtable> element). child elements of <m
labeledtr> must be <mtd> elements. the first child is the
label whereas all other children are representing row contents and are treated identically to children of <mtr> elements. 19 <mmultiscripts> mathml, mat...
Cross-domain Content Scripts - Archive of obsolete content
n which shows the panel when it is clicked // main.js var data = require("sdk/self").data; var forecast_panel = require("sdk/panel").panel({ height: 50, contenturl: data.url("panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast",
label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url ...
Reddit Example - Archive of obsolete content
omplish this the add-on needs to run a content script in the context of the reddit page which intercepts mouse clicks on each title link and fetches the link's target url. the content script then needs to send the url to the add-on script. ...
port - Archive of obsolete content
n.wikipedia.org/wiki/chalk alongside a content script. the button sends the content script a message called "get-first-para" when it is clicked: // main.js pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para",
label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script listens for "get-first-para". when it receives this message, the script logs the first paragraph of the document and then calls removelistener() to stop listening. // content-script.js function getfirstparagraph(...
Communicating using "port" - Archive of obsolete content
wikipedia.org/wiki/chalk alongside a content script "listener.js". the button sends the content script a message called "get-first-para" when it is clicked: pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para",
label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script "listener.js" listens for "get-first-para". when it receives this message, the script logs the first paragraph of the document and then calls removelistener() to stop listening. function getfirstparagraph() { v...
page-mod - Archive of obsolete content
e, or to display the document's dom structure. using the attach method of the tab object, you can attach a set of content scripts to a particular tab. the scripts are executed immediately. ...
tabs - Archive of obsolete content
ve tab, and detach it again. the stylesheet is called "style.css" and is located in the add-on's "data" directory: var tabs = require("sdk/tabs"); var { attach, detach } = require('sdk/content/mod'); var { style } = require('sdk/stylesheet/style'); var { togglebutton } = require("sdk/ui/button/toggle"); var style = style({ uri: './style.css' }); var button = togglebutton({ id: "stylist",
label: "stylist", icon: "./icon-16.png", onchange: function(state) { if (state.checked) { attach(style, tabs.activetab); } else { detach(style, tabs.activetab); } } }); private windows if your add-on has not opted into private browsing, then you won't see any tabs that are hosted by private browser windows. tabs hosted by private browser windows won't be seen if you...
windows - Archive of obsolete content
a new window and set a listener for "open" event. windows.open({ url: "http://www.example.com", onopen: function(window) { // do stuff like listen for content // loading. } }); returns the window that was opened: var windows = require("sdk/windows").browserwindows; var example = windows.open("http://www.example.com"); require("sdk/ui/button/action").actionbutton({ id: "read",
label: "read", icon: "./read.png", onclick: function() { example.close(); } }); this example uses the action button api, which is only available from firefox 29 onwards. parameters options : object required options: name type url string string url to be opened in the new window. this is a required property. isprivate boolean ...
tabs/utils - Archive of obsolete content
d tab's id. on firefox it's derived from its linkedpanel property. parameters tab : tab a xul tab element. returns id : the id for this tab. gettabforid(id) get the tab identified by id. parameters id : on firefox it's derived from its linkedpanel property. returns tab : tab a xul tab element. gettabtitle(tab) get the title of the document hosted by the specified tab, or the tab's
label if the tab doesn't host a document. parameters tab : tab a xul tab element. returns string : settabtitle(tab, title) set the title of the document hosted by the specified tab, or the tab's
label if the tab doesn't host a document. parameters tab : tab a xul tab element. title : string the new title. gettabcontentwindow(tab) get the specified tab's content window. parameters tab : ...
Storing annotations - Archive of obsolete content
ent script uses jquery we will pass that in too: again, make sure the name of it matches the version of jquery you downloaded. when the panel is shown we send it the array of stored annotations. when the panel sends us a url we use the tabs module to open it in a new tab. ...
Display a Popup - Archive of obsolete content
ire("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var text_entry = require("sdk/panel").panel({ contenturl: data.url("text-entry.html"), contentscriptfile: data.url("get-text.js") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel",
label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button. function handleclick(state) { text_entry.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event to th...
Unit Testing - Archive of obsolete content
st { atob, btoa } = require("resource://gre/modules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions. to show the module in use, edit the "index.js" file as follows: var base64 = require("./base64"); var button = require("sdk/ui/button/action").actionbutton({ id: "base64",
label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory. you could download this icon: . now "index.js" imports the base64 module and calls its ...
Using third-party modules (jpm) - Archive of obsolete content
be somewhere in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem". open "index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menuitem({ id: "clickme", menuid: "menu_toolspopup",
label: "click me!", oncommand: function() { console.log("clicked"); }, insertbefore: "menu_pageinfo" }); now run the add-on: jpm run -b nightly you should see a new menu item in the tools menu
labeled "click me!". click the button, and the message "clicked" is logged. note: in more recent versions of firefox, the menu bar may not be visible by default. to show the menu bar, click on the o...
Embedding SVG - Archive of obsolete content
3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- xul and svg go here --> </window> example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <vbox> <
label value="hello"/> <svg:svg version="1.1" baseprofile="full" width="150" height="150"> <svg:rect x="10" y="10" width="100" height="100" fill="red"/> <svg:circle cx="50" cy="50" r="30" fill="blue"/> </svg:svg> <
label value="world"/> </vbox> </window> ...
Examples and demos from articles - Archive of obsolete content
eate a pure-css lightbox. [article] pure-css editable (pseudo)<select> [html] this example shows how it's possible to simulate an editable <select> through a fieldset of radioboxes and textboxes. [article] expandable elements [html] this example shows how it is possible to show/hide classes of elements in pure css. in this demo there is also an example of a "toggle button" rendered through a <
label> element. [article] code snippets and tutorials javascript complete cookies reader/writer with full unicode support this little framework consists of a complete cookies reader/writer with unicode support. xml to json conversion snippets (jxon) jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml. there are...
QuerySelector - Archive of obsolete content
= function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.prototype.$ = function (selector) { return this.queryselector(selector); }; alert(document.$('h1')); // [object htmlheadingelement] </script> xuldocument.prototype.$ = function (selector) { // only for xul return this.queryselector(selector); }; example: <
label value="test!"/> <script type="text/javascript"><![cdata[ xuldocument.prototype.$ = function (selector) { // only for xul return this.queryselector(selector); }; alert(document.$('
label')); // [object xulelement] ]]></script> document.prototype.$ = function (selector) { // only for plain xml return this.queryselector(selector); }; var foo = document.implementation.createdocument('somens'...
Code snippets - Archive of obsolete content
applies to scrollbars in browser and iframe as well. autocomplete code used to enable form autocomplete in a browser boxes tips and tricks when using boxes as containers tabbox removing and manipulating tabs in a tabbox windows-specific...
Extension Etiquette - Archive of obsolete content
will make translation of your extension to another language easier. it occurs more often than you would think. options firefox users like options. lots of options. try to include everything a user could ever want to customize in your extension, remembering more can be added later. for a large number of options for your extension, break the options window into multiple pages (tabs) that are well
labeled. don't hesitate to give long descriptions for each preference, as long as they are easy to understand, even for non-computer-savvy users. however, please make sure the default set of preferences is adequate — don't require people to tweak options in order to get your extension's core functionality. preferences' internal names internal firefox preference names for extensions or to be clear, ...
Getting Started with Firefox Extensions - Archive of obsolete content
ling add-ons require a restart to complete, with the exception of 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-pla...
JavaScript Object Management - Archive of obsolete content
i practices anyway and you should avoid them. if you really need to do something like this anyway, one way to do it is to have a timeout execute the code after a delay: init : function(aevent) { let that = this; this._stringbundle = document.getelementbyid("xs-hw-string-bundle"); window.settimeout( function() { window.alert(that._stringbundle.getstring("xulschoolhello.greeting.
label")); }, 0); } the settimeout function executes the function in the first parameter, after a delay in miliseconds specified by the second parameter. in this case we set the delay to 0, which means the function should be executed as soon as possible. firefox has a minimum delay of 10-15ms (taken from this blog post), so it won't really run instantly. it is more than enough to let the window fini...
Extensions support in SeaMonkey 2 - Archive of obsolete content
nu 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> technical note...
Creating reusable content with CSS and XBL - Archive of obsolete content
oes not support javascript in pages, so it is not possible to show the demonstration here. it looks something like this, before and after you press the button: notes about this demonstration: the html document links the document stylesheet as usual, but it does not link any javascript code. the document does not contain any buttons. it only contains the text of the button's
label. the button is added by the binding. the document stylesheet links the binding. the binding links its own stylesheet, and it supplies its own content and javascript code. so the binding is self-contained. challenges change the xbl file so that the square doubles in width when it changes color, instead of jumping to the right. use the dom inspector tool to inspect the documen...
Creating a Web based tone generator - Archive of obsolete content
in the audio stream. in order to always have samples to play, a buffer of 500 ms is created. the function mozcurrentsampleoffset() is used to know the position of the samples being played so that we can fill a 500 ms buffer of audio samples. <!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><
label for="hz">hz</
label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio output. var audio = new audio(); audio.mozsetup(1, samplerate); var currentwriteposition = 0; var prebuffersize = samplerate / 2; //...
Source Navigator - Archive of obsolete content
create project" dialog: which allows you to decide your filename of the project file (which ends in .proj) and your source directory/directories that you want to import into the project. (you can always include more by pressing the "more" button.) in my case, i inputted the followings: project file: <tt>~/snav-mozilla</tt> add directory (where your source files reside in -- i understand that the
label here is not so self-explanatory...): <tt>~/moz1.9/mozilla</tt> (because i saved my source at ~/moz1.9/mozilla.) remember to ensure that "include subdirectories" and "build cross-reference database" are checked. then click "ok". the snavigator then begins to scan your source directories. this takes a few minutes. now you can enjoy searching the mozilla code in a faster speed. using source na...
Hidden prefs - Archive of obsolete content
pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp...st&zipcode=@zi"); addressbook quick search query pref ("mail.addr_book.quicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the quick search bar in the addressbook every occurance of @v will be replaced. note, the ui has "name or email contains:". this entity (searchnameoremail.
label) is defined in messenger.dtd. so if you change the quick search query to match based on phone number, the ui will not match the query. the default (defined in mailnews.js) is: pref("mail.addr_book.quicksearchquery.format","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. see http://lxr.mozilla.org/mozilla/sourc...drdatabase.idl for the...
LIR - Archive of obsolete content
returns void 34 calli integer call subroutine that returns an int 35 callq quad 64 bit call subroutine that returns a quad 36 calld double call subroutine that returns a double branch 37 j void jump always 38 jt void jump if true 39 jf void jump if false 40 jtbl void jump to address in table 41
label void a jump target (no machine code is emitted for this) 42 not in use guards 43 x void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhib...
PyDOM - Archive of obsolete content
lick="print foo"/> should be able to reference 'foo' via globals as shown. note that you can stick arbitrary values on any dom object - this is what js calls 'expandos'. for example, let's say you have xul similar to pyxultest: top-level script code says something like: button = document.getelementbyid("some-button") button.foo = 0 and the button itself might look like: <button id="some-button"
label="click here" onclick="event.target.foo += 1; print 'foo is now', event.target.foo"/> note that (a) we have stuck an arbitrary attribute on a dom element and (b) in all cases (e.g., event handler and top-level script), the dom node needs to be explicitly specified - the globals are the window itself. the event handler could also have used getelementbyid - the point is that both the event...
Treehydra Manual - Archive of obsolete content
to get both gimple asts and cfgs in the same run of treehydra. require({ after_gcc_pass: "cfg" }); include('gcc_util.js'); // for function_decl_cfg include('gcc_print.js'); function process_tree(fn) { print("function " + decl_name(fn)); // fn is a function_decl let cfg = function_decl_cfg(fn); for (let bb in cfg_bb_iterator(cfg)) { print(" basic block " + bb_
label(cfg, bb)); for (let isn in bb_isn_iterator(bb)) { print(" " + isn_display(isn)); } } } post-inlining gimple cfgs treehydra can be positioned after any pass, allowing you access various levels of gimple. in this example, we show how to access the gimple just after function inlining is performed. (this allows a simple version of interprocedural analysis.) a...
Venkman Introduction - Archive of obsolete content
information about how scripts are loaded and accessed in venkman, see "loading scripts into the debugger"). the menubar, toolbar, and all of the views can be collapsed or hidden, giving you a lot of control over the debugging environment. the source code view is empty until you select a script, and the interactive session view starts up with basic startup information. each of the views has a
label, a float button that lets you display the view in its own window, and a close button that puts the view away until you want to display it again, as seen in figure 2. the following section describes these views and their use within the interface as a whole. getting acquainted with venkman's user interface toolbar the toolbar is located at the top of the debugger. the toolbar contains icons f...
Elements - Archive of obsolete content
t and display characteristics 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 a...
confirm - Archive of obsolete content
it is therefore recommended to only use two buttons wherever possible, and to keep in mind that button 1 has the same return value as "window closed" (see below). abutton0title custom title for button 0. abutton1title custom title for button 1. abutton2title custom title for button 2. acheckmsg a string to display as a checkbox
label. acheckstate an object with a boolean value property representing the state of the checkbox: when the dialog box is shown, its checkbox will be checked when this object's value is true. after the user presses a button (or closes the window), the value property is updated according to the checkbox. var check = { value: false }; var button = confirm("are you sure you want to instal...
Methods - Archive of obsolete content
on. methods adddirectory unpacks an entire subdirectory. addfile unpacks a single file. alert displays an alert dialog box with a message and an ok button. cancelinstall aborts the installation of the software. confirm displays a confirm dialog box with the specified message and ok and cancel buttons. also allows custom button
labels and a checkbox. deleteregisteredfile deletes the specified file and its entry in the client version registry. execute extracts a file from the xpi file to a temporary location and schedules it for later execution. gestalt retrieves information about the operating environment. (mac os only) getcomponentfolder returns an object representing t...
XTech 2006 Presentations - Archive of obsolete content
aces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. microsummaries in firefox and on the web - myk melez microsummaries are regularly-updated compilations of the most important and timely information on web pages. this talk demonstrates how firefox will incorporate microsummaries into its ui, starting with bookmark
labels. svg and canvas: graphics for web apps - vladimir vukićević this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applications. future browser graphics capabilities, both 2d and 3d, are also discussed. converging rich-client and web application development with mozilla xulrunner (open office format) -...
A XUL Bestiary - Archive of obsolete content
elationship might be that xul, xptoolkit, and xpfe are to one another what html, the actual html tags, and an html web page are to one another, respectively. xul parts people sometimes get confused about the syntax for describing the parts of a widget. for a widget like the menu that appears in the following example, menu is the element and both value and the id are attributes. <menu id="file"
label="file"> <menupopup> <menuitem
label="new" oncommand="createnewdoc()" /> <menuitem
label="open" oncommand="opendoc()" /> <menuitem
label="close" oncommand="closedoc()" /> </menupopup> </menu> element names the item, the widget, while attributes describes features of that element, such as its name, its style, and so on. in object-oriented parlance, the element is analogous to the ...
acceltext - Archive of obsolete content
« xul reference home 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 apply to menus directly on the menubar. ...
XML Assignments - Archive of obsolete content
lement allows the use of additional xpath expressions to get more data from the xml data. here is an example: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?namelength" expr="string-length(@name)"/> <assign var="?siblings" expr="count(../*) - 1"/> </query> <action> <hbox uri="?" align="center"> <button
label="?name"/> <
label value="?gender"/> <
label value="?namelength"/> <
label value="?siblings"/> </hbox> </action> </template> </vbox> two assign elements are placed as children of the query element. it allows us to declare additional variables that may be used in the action body. the expr attribute specifies the xpath expression and the var attribute specifies the ...
Content Panels - Archive of obsolete content
le. you can use a script to change the contents of the iframe without affecting the main window. in the mozilla browser window, the area where the web page is displayed is created by using an iframe. when the user enters a url or clicks on a link in a document, the source of the frame is changed. iframe example example 1 : source view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton
label="back" /> <toolbarbutton
label="forward" /> <textbox id="urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www.mozilla.org/index.html" flex="1" /> the example here has created a very simple interface for a web browser. a box has been created containing two elements: a toolbox and an iframe. a back button, a forward button and a field for typing is urls has been ...
Creating a Skin - Archive of obsolete content
this saves space that would normally be occupied by mutliple images. in the code above, we use the same image for each button, but set a different image region each one. if you look at this image (btn1.gif), you will notice that it contains a grid of smaller images, each one 16 by 16 pixels. the -moz-box-orient property is used to orient the button vertically, so that the image appears above the
label. this property has the same meaning as the orient attribute. this is convenient because the skin cannot change the xul. most of the box attributes have corresponding css properties. other changes next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from mozilla to save time. if creating your own skin, you will need to create new icons or copy the icons ...
Cross Package Overlays - Archive of obsolete content
ple 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.org/keymaster/gatekeeper/there.is.only.xul"> <toolbox id="browser-toolbox"> <toolbar id="findfile_toolbar"> <
label control="findfile_filename" value="search for files named:"/> <textbox id="findfile_filename"/> <
label control="findfile_dir" value="directory:"/> <textbox id="findfile_dir"/> <button
label="browse..."/> </toolbar> </toolbox> </overlay> you can view this by changing the overlay to a window. the only thing that is special here is the id used on the toolbox. this value (browse...
Document Object Model - Archive of obsolete content
den when it first appears. next, let's add a function that is called when the find button is pressed. we'll put scripts in a separate file findfile.js. in the last section, we added the script element in the xul file. if you haven't done this, do that now, as shown below. an oncommand handler will also be added to the find button. <script src="findfile.js"/> . . . <button id="find-button"
label="find" oncommand="dofind();"/> now, create another file called findfile.js in the same directory as findfile.xul. we'll add the dofind() function is this file. the script tag does allow code to be contained directly inside of it. however, for various reasons, including better performance, you should always put scripts in separate files, except for short fragments which can be put directly in...
Progress Meters - Archive of obsolete content
files we'll be searching or how long the search will take. however, we'll add a normal one for now as an animating one can be distracting during development. the progress meter would normally only appear while the search is taking place. we'll add a script later to turn it on and off. <textbox id="find-text"/> <html:progress value="50" max="100" style="margin: 4px;"/> <button id="find-button"
label="find" default="true"/> the value has been set to 50% so that we can see the meter on the window. a margin has been set to 4 pixels so that it is separated from the edge of the window. as was stated earlier, we only want the progress bar to be displayed while the search was occurring. a script will show and hide it as necessary. to make this work you will first have to define the namespace htm...
Scrolling Menus - Archive of obsolete content
enus. it is always a vertical box and may contain any elements inside it. you could use it to implement a list when you don't want it to be a drop-down. example - scrolling list of buttons the following example shows how to create a scrolling list of buttons (you will need to resize the window to see the arrow buttons): example 1 : source view <arrowscrollbox orient="vertical" flex="1"> <button
label="red"/> <button
label="blue"/> <button
label="green"/> <button
label="yellow"/> <button
label="orange"/> <button
label="silver"/> <button
label="lavender"/> <button
label="gold"/> <button
label="turquoise"/> <button
label="peach"/> <button
label="maroon"/> <button
label="black"/> </arrowscrollbox> if you try this example, it will first open at full size. however, if you shr...
Stack Positioning - Archive of obsolete content
the left edge and 5 pixels from the top edge. the position of a child element may be specified by placing two attributes on the element. for the horizontal position, use the left attribute and for the vertical position, use the top attribute. if you don't put these attributes on a child of a stack, the child will stretch to fit the size of the stack. example 1 : source view <stack> <button
label="goblins" left="5" top="5"/> <button
label="trolls" left="60" top="20"/> <button
label="vampires" left="10" top="60"/> </stack> the stack here contains three elements, each positioned at the coordinates given by the left and top attributes. here, all three children are buttons, but the elements do not have to be same type. they may be any element, including boxes and other stacks. the size...
Styling a Tree - Archive of obsolete content
the tree body. the inner elements are just placeholders. setting properties instead, you must use the properties attribute on the rows or cells to set one or more named properties. this can be used with trees with static content, rdf built content or with those with a custom view. let's say we want a particular row to have a blue background color. this would be used to implement mozilla mail's
labels feature. we'll use a property called 'makeitblue'. you can use whatever name you want. you can set multiple properties by separating them with spaces. set the property on a row or cell, as in the following example: <treerow properties="makeitblue"> css selectors for the tree the style sheet can take this property and use it to change the appearance of the row for unread messages or
labels. ...
Updating Commands - Archive of obsolete content
verlay.js' in a xul file, you can call the godocommand method which executes the command passed as the argument. the code for this function is only a few lines long so you could include it directly in your code if for some reason you didn't want to include the library. <script src="chrome://global/content/globaloverlay.js"/> <command id="cmd_paste" oncommand="godocommand('cmd_paste');"/> <button
label="paste" command="cmd_paste"/> the example above will implement a paste button. it is attached to the command which will invoke the command on the necessary controller when called. the code above is all you need to implement the functionality of the paste command in your application. the only other thing you need to do is ensure that the enabled status of the paste command, and therefore the butt...
XUL Changes for Firefox 1.5 - Archive of obsolete content
reate 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 this non zero-based behaviour should be changed. <stringbundle> the <stringbundle> element has a strings property whi...
The Implementation of the Application Object Model - Archive of obsolete content
on intent upon taking over the earth, although that does depend on who you ask. rdf stands for resource description framework, a rather intimidating name that doesn't do much to help the layman understand exactly what it does. rdf provides a very general mechanism for representing relationships between different disparate types of data. the relationships between data are represented as a directed
labeled graph structure. the data itself can be fed in from any number of different sources (e.g., from a local file system, from your bookmarks file, or from some remote downloadable rdf file), and can then be combined into a single graph. ok, so after that paragraph many of you probably still don't understand what rdf does, so here's the short and sweet version. rdf can suck up data from different pl...
XUL Coding Style Guidelines - Archive of obsolete content
localization notes are the xul writers' notes to the localizers/translators. they are placed above the actual entity string in the format: <!-- localization note (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpful hints to the localizers. for example: <!-- localization note homebtn.
label : do not translate the entity value "home". --> <!-- entity homebtn.
label "home" --> properties files are very similar, but use the pound sign instead of <!--<var>xxxxx</var>-->: # localization note entity name : content we recognize that translation is a subset of localization even though we've consistently referred to our notes as "localization note". files not to be localized? some files ...
attribute.align - Archive of obsolete content
h side of the child elements, resulting the children being placed in the center of the box. end child elements are placed on the right or bottom edge of the box. if the box is larger than the total size of the children, the extra space is placed on the left or top side. baseline this value applies to horizontally oriented boxes only. it causes the child elements to be aligned so that their text
labels are lined up. stretch the child elements are stretched to fit the size of the box. for a horizontal box, the children are stretched to be the height of the box. for a vertical box, the children are stretched to be the width of the box. if the size of the box changes, the children stretch to fit. use the flex attribute to create elements that stretch in the opposite direction. left: (deprecated...
broadcaster - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a broadcaster is used when you want multiple elements to share one or more attribute values, or when 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 obs...
browser - Archive of obsolete content
autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll type: boolean set to false to disable autoscro...
deck - Archive of obsolete content
attributes | properties | methods | related ] an element that displays only one of its children at a time. the selectedindex attribute determines which child is displayed. more information is available in the xul tutorial. attributes selectedindex properties 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, co...
dialogheader - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding 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...
key - Archive of obsolete content
ed 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 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 no...
progressmeter - Archive of obsolete content
to complete an operation is not known beforehand. more information is available in the xul tutorial. attributes max, mode, value properties accessibletype, max, mode, value examples <progressmeter mode="determined" value="82"/> <progressmeter mode="undetermined"/> <!-- switching modes while the mouse is over a button --> <progressmeter mode="determined" id="myprogress"/> <button
label="example" onmouseover="setloading(true)" onmouseout="setloading(false)"/> function setloading(state){ document.getelementbyid('myprogress').mode = (state) ? 'undetermined' : 'determined'; } attributes max type: integer the maximum value that progressmeter may have. the default value if not specified is 100 such that the value may be used as a per...
resizer - Archive of obsolete content
ize;"/> </vbox> <vbox width="2" style="background-color: grey; overflow: hidden;"> <resizer dir="topright" height="2" style="cursor: ne-resize;"/> <resizer dir="right" flex="1" style="cursor: e-resize;"/> <resizer dir="bottomright" height="2" style="cursor: se-resize;"/> </vbox> </hbox> </window> resizing an element <stack style="border: 1px solid black;"> <button id="button"
label="resizable" left="18" top="18" right="18" bottom="18"/> <resizer dir="topleft" style="background: black; -moz-appearance: none;" element="button" left="0" top="0" width="16" height="16"/> <resizer dir="topright" style="background: black; -moz-appearance: none;" element="button" right="0" top="0" width="16" height="16"/> <resizer dir="bottomleft" style="background: blac...
toolbox - Archive of obsolete content
ustomtoolbarcount, externaltoolbars, palette, toolbarset methods appendcustomtoolbar, collapsetoolbar, expandtoolbar examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton
label="back"/> <toolbarbutton
label="forward"/> <toolbarbutton
label="home"/> </toolbar> <toolbar> <toolbarbutton
label="stop"/> <toolbarbutton
label="reload"/> </toolbar> </toolbox> <textbox multiline="true" value="we have two toolbars inside of one toolbox above." width="20"/> </window> attributes inherited from xul element align, allowevents, allownegat...
treechildren - Archive of obsolete content
, isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), 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> ...
wizardpage - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element defines a page in a wizard. the content in the pages should be placed 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 ...
Getting started with XULRunner - Archive of obsolete content
g fancy here, just the minimum we need to make a window. no menus or anything. main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="my app" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption
label="hello world"/> <separator/> <button
label="more >>" oncommand="showmore();"/> <separator/> <description id="more-text" hidden="true">this is a simple xulrunner application. xul is simple to use and quite powerful and can even be used on mobile devices.</description> </window> note: make sure there is no extra whitespace at the beginning of the xml/xul file the application also has a ...
XULRunner tips - Archive of obsolete content
note: i use this method of installing extensions into all of my mozilla applications. this way i have one directory where i keep all my mozilla extensions, and each application (firefox, thunderbird) simply contains a few small, one line files pointing to the location of the extensions. (i ...
2006-11-22 - Archive of obsolete content
e issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he stated that he almost had it working a couple of years ago. the bug has a very old patch which will no longer be easy to apply but may provide clues as to where they are going wrong. for more information click here. discussions image
labelling for blind help machines frank hecker brought up a valid discussion about the problem of getting images tagged for use by screen. he cited some valuable resources on the topic courtesy of the washington post. read the article here meetings none ...
Extentsions FAQ - Archive of obsolete content
ith out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied. the list of "known" properties is: junkscore junkscoreorigin
label priority keywords. keywords - in the gui they are called tags. they replace the old
labels (although the
labels are still recognised). preserved properties source code - nsimapmailfolder::copymessages uaq friday, september 22 - 29, 2006 (↑ top) why extension preferences do not get changed until after it's upgrade? why extension preferences do not get changed until after it's upgrade...
What is RSS - Archive of obsolete content
way up to 2.0 because the rss-dev working group already used 1.0 with their rdf-based rss 1.0. so at this point we had netscape's rss 0.91, the rss-dev working group's rss 1.0, and userland's rss 2.0. now, the story doesn't quite end there. in november 2002 and again in january 2003, rss 2.0 was changed from its original specification by userland. and although these are each different, they all
label themselves as rss 2.0 on the <rss> element. so now, at this point, we still have netscape's rss 0.91 (since netscape never deprecated it) although most people don't use it anymore. most people use either the rdf-based rss 1.0 or the xml-based rss 2.0, with the xml-based rss 2.0 seeming to be the most popular. (this tutorial uses rss 2.0.) how rss is used today today, rss is mostly used for syn...
Proposal - Archive of obsolete content
is a list of proposals people or companies have made for rss. non of these are widely adopted standards. (so don't expect any software to support them.) but some of them could become standards in the future. note: those in the list below that are marked "in development" should not be implemented. "in development" means that they are still working on it 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 m...
Sunbird Theme Tutorial - Archive of obsolete content
all its contents, into your new <tt>chrome</tt> directory. now you have a theme, although it looks exactly the same as sunbird's classic theme. modifying your theme to modify your theme, change the css and image files in any way you like. for testing purposes, go to the <tt>calendar</tt> directory that you have just pasted. edit the file <tt>calendar.css</tt> there. add this line at the end:
label {color: red;} save the file. fixing bug 320823 if you are using the sunbird 0.3a1 release, or a test build before 2005-12-21, then you must apply a fix for bug 320823 to allow sunbird to use themes. go to sunbird's program directory, then to the <tt>defaults</tt> directory there. in the <tt>pref</tt> directory, edit the file <tt>sunbird.js</tt> and search for the <tt>pref("extensions</tt> ent...
Theme changes in Firefox 3 - Archive of obsolete content
d when presenting information notices. chrome://global/skin/icons/warning-16.png used when displaying warnings. images to remove the following images were removed: chrome://mozapps/skin/extensions/question.png no longer used. mac os x mac os x themes for firefox 3 should add these two rules to the end of chrome://global/skin/wizard.css: .wizard-buttons-btm { padding:xpx; } .wizard-
label-box { display: none; } the numeric value ofx, the number of pixels of padding in .wizard-buttons-btm, should be the same as the value of the margin for .wizard-buttons-box-2. image changes chrome://global/skin/icons/loading_16.gif was replaced with chrome://global/skin/icons/loading_16.png . changes in mozapps see also theme changes in firefox 2 ...
Developing cross-browser and cross-platform pages - Archive of obsolete content
er configurable strings. for example, firefox 1.x users and users of any/all mozilla-based browsers can customize the "general.useragent.*" string properties to any value. opera 6+ allows users to set the browser identification string via a menu internet explorer uses the windows registry safari, konqueror and icab browsers can mask their browser identity under internet explorer or netscape
labels a user or browser distributor can put what they want in the navigator.useragent string and this may trick your code into executing a "wrong" block of code. moreover, there are many cases where even the accurately-identified browser does not perform as it is reputed/expected to. so if "browser sniffing" is unreliable and difficult, then how do you code safely for different browsers and differe...
Namespaces - Archive of obsolete content
efault namespace for your e4x objects by placing the statement: default xml namespace = "http://www.w3.org/1999/xhtml"; within the same scope as your e4x. you can also change namespaces at any time, by repeating the statement. default xml namespace = "http://www.w3.org/1999/xhtml"; var a = <p>some text</p>; default xml namespace = "http://www.mozilla.org/keymaster/gat...re.is.only.xul"; var b = <
label>more text</
label>; a.appendchild(b); gives <p xmlns="http://www.w3.org/1999/xhtml"> some text <
label xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul">more text</
label> </p> name() using name() on an xml object returns a qname object (qualified name). qname is a global constructor available in javascript implementations supporting e4x. qname objects have two properties of parti...
New in JavaScript 1.3 - Archive of obsolete content
e boolean object. changes to tostring(). non-ecma-262 features of javascript 1.3 the following is a comparison between the june 1998 version of ecma-262 and javascript 1.3. the following features were not part of the standard at that time, but implemented in javascript 1.3. keywords and operators strict equality operators vertical tab (\v or \u000b) as an escape sequence. ...
XForms Custom Controls Examples - Archive of obsolete content
> <method name="refresh"> <body> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return true; </body> </method> </implementation> </binding> output showing xhtml <binding id="output-xhtml" extends="chrome://xforms/content/xforms-xhtml.xml#xformswidget-output"> <content> <children includes="
label"/> <xhtml:div class="xf-value" anonid="content"></xhtml:div> <children/> </content> <implementation implements="nsixformsuiwidget"> <field name="_domparser">null</field> <property name="domparser" readonly="true"> <getter> if (!this._domparser) this._domparser = new domparser(); return this._domparser; </getter> </property> <method name="refresh"> ...
Mozilla XForms Specials - Archive of obsolete content
shortcut. this is documented in nsixformsnsinstanceelement. custom control interface we have added a lot of functionality to our user interface, which allows the form authors to create custom controls. it involves exposing some (script) functionality on all our controls, like output, input, etc. and allowing the ui to be represented in xbl. more information can be found in xforms:custom controls.
labelposition for xforms:input elements bound to a boolean node we support an attribute
labelposition in the namespace http://www.mozilla.org/projects/xfor...009/extensions, which allows the form author to define on which side of the checkbox the
label will be shown. for details, see the input control documentation. misc cross domain submission not exactly either a limitation, or an extension, but it i...
Mozilla XForms User Interface - Archive of obsolete content
'full' select1 combobox control. allows the user to choose a single value from a list of pre-defined values (see the spec). it can have the following representations: combobox - default representation listbox - used when appearance = 'compact' radio group - used when appearance = 'full' additional elements these elements may be used as child elements to the form controls described above.
label specifies the
label for the xforms control (see the spec). every form control other than the output element must contain a
label element. it is valid for a form control to have an empty
label element. help specifies contextual help for the containing form control (see the spec). the help will be displayed if the f1 key is pressed while the containing form control has focus. hint similar to a tool...
RDF in Mozilla FAQ - Archive of obsolete content
olean hasassertion(asource, aproperty, atarget, atruthvalue). this tests the datasource to see if it has the specified tuple. nsirdfnode gettarget(asource, aproperty, atruthvalue). nsisimpleenumerator gettargets(asource, aproperty, atruthvalue). nsirdfresource getsource(aproperty, atarget, atruthvalue). nsisimpleenumerator getsources(aproperty, atarget, atruthvalue). nsisimpleenumerator arc
labelsin(atarget). nsisimpleenumerator arc
labelsout(asource). you can also use the rdf container interfaces to access information contained in rdf containers. how do i change information in the datasource? to use 'assert' to add one assertion and 'unassert' to remove one. refer to mozilla rdf back end architecture ds.assert(homepage, fv_quality, value, true); ds.unassert(homepage, fv_quality, val...
Visual JS GE - Game development
urce.test_res. resource objects contain the path data for all your images. the actual image objects will be created after you add animation to the game objects. this is good because it is memory safe. visual js.exe windows gui freeware only for windows users. contains the following tools. visual_js.exe version 1.0 — comes with source editor. ml_sys.exe — multilanguage tool for string
labels (smart xml operation; no empty tags). scriptingjs.exe — based on javascriptobfuscator.com api. makelib.exe — neede for font bug fixing. video tutorials pencil component particle virtual kayboard ...
Gecko FAQ - Gecko Redirect 1
mmended open internet standards fully except for the areas noted below and open bugs documented in bugzilla: html 4.0 - full support except for: elements: bdo, basefont attributes: shape attribute on the a element, abbr, axis, headers, scope-row, scope-col, scope-rowgroup, scope-colgroup, charoff, datasrc, datafld, dataformat, datapagesize, summary, event, dir, align on table columns,
label attribute of option, alternate text of area elements, longdesc various metadata attributes: cite, datetime, lang, hreflang bidirectional text layout, which is only used in hebrew and arabic (ibm has begun work to add bidi support in a future release) style sheets css 1 - full support, except for: the application of styles to html column elements the ability to tur...
Domain name - MDN Web Docs Glossary: Definitions of Web-related terms
a domain name is a website's address on the internet. domain names are used in urls to identify to which server belong a specific webpage. the domain name consists of a hierarchial sequence of names (
labels) separated by periods (dots) and ending with an extension. learn more general knowledge domain name on wikipedia understanding domain names ...
markup - MDN Web Docs Glossary: Definitions of Web-related terms
purpose of that part of the content. types of markup language presentational markup: used by traditional word processing sytem with wysiwyg (what you see it is what you get); this is hidden from human authors, users and editors. procedural markup: combined with text to provide instructions on text processing to programs. this text is visibly manipulated by the author. descriptive markup:
labels sections of documents as to how the program should handle them. for example, the html <td> defines a cell in a html table. ...
About Scriptable Interfaces - Interfaces
it should not be considered complete. most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating xpcom components scriptable interfaces interfaces allow xpcom components to expose their functionality to the outside world while hiding the inner details of the component implementation. interfaces are written in an interface description language. when we
label an interface as scriptable, we're saying that components exporting this interface can be referenced (through this interface) from scripts (e.g javascript), and that we can write new components implementing the interface using script languages. xpconnect xpconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts. no other scripts languages are s...
Test your skills: HTML accessibility - Learn web development
recreating the exact same look and text sizing, as long as the semantics are good. 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. html accessibility 2 in the second task, you have a form containing three input fields. you need to: semantically associate the input with their
labels. assume that these inputs will be part of a larger form, and wrap them in an element that associates them all together as a single related group. give the group a description/title that summarises all of the information as personal data. 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 ...
Test your skills: WAI-ARIA - Learn web development
task to work in your own editor or in an online editor. wai-aria 2 in our second wai-aria task, we present a simple search form, and we want you to add in a couple of wai-aria features to improve its accessibility: how can you allow the search form to be called out as a separate landmark on the page by screenreaders, to make it easily findable? how can you give the search input a suitable
label, without explicitly adding a visible text
label to the dom? 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. wai-aria 3 for this final wai-aria task, we return to an example we previously saw in the css and javascript skilltest. as before, we have a simple app that presents a li...
Images, media, and form elements - Learn web development
are a few key basics worth highlighting in this section of the article. many form controls are added to your page by way of the <input> element — this defines simple form fields such as text inputs, through to more complex fields added in html5 such as color and date pickers. there are some additional elements, such as <textarea> for multiline text input, and also elements used to contain and
label parts of 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...
CSS FAQ - Learn web development
element to style with that style, but you might want to add more later. use an id-specific style when you need to restrict the applied styling rules to one specific block or element. this style will only be used by the element with that particular id. it is generally recommended to use classes as much as possible, and to use ids only when absolutely necessary for specific uses (like to connect
label and form elements or for styling elements that must be semantically unique): using classes makes your styling extensible — even if you only have one element to style with a particular ruleset now, you might want to add more later. classes allow you to style multiple elements, therefore they can lead to shorter stylesheets, rather than having to write out the same styling information in mult...
Web fonts - Learn web development
e displayed choices. generating the required code now you'll need to generate the required code (and font formats). for each font, follow these steps: make sure you have satisfied any licensing requirement, if you are going to use this in a commercial and/or web project. go to the fontsquirrel webfont generator. upload your two font files using the upload fonts button. check the checkbox
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: m...
Test your skills: Advanced styling - Learn web development
styling. next, give the radio buttons a reasonable base style — the style they have when the page first loads. this can be anything you like, but you probably want to set a width and height (of somewhere between about 18 and 24 pixels), and a subtle border and/or background color. now give the radio buttons a different style for when they are selected. align the radio buttons nicely with the
labels. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. advanced form styling 3 in our final task for this assessment series, we provide you with a feedback form that is already nicely-styled — you've already seen something similar if you've worked through our ui pseudo-classes art...
Test your skills: Form structure - Learn web development
us for help — see the assessment or further help section at the bottom of this page. form structure 1 in this task we want you to structure the provided form features: separate out the first two and second two form fields into two distinct containers, each with a descriptive legend (use "personal details" for the first two, and "comment information" for the second two). mark up each text
label with an appropriate element so that it is semantically associated with its respective form field. add a suitable set of structural elements around the
label/field pairs to separate them out. 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 this example in the interactive editor above. if you would li...
Test your skills: HTML5 controls - Learn web development
r favourite color 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. html5 controls 2 next, we want you to implement a slider control to allow the user to choose a maximum number of people to invite to their party. implement a basic slider control to go along with the provided
label. give it a minimum value of 1, maximum value of 30, and initial value of 10. create a corresponding output element to put the current value of the slider into. give it a class of invite-output, and semantically associate it with the input. if you do this correctly, the javascript included on the page will automatically update the output value when the slider is moved. try updating the live co...
Test your skills: Styling basics - Learn web development
airly free-form, and you have a lot of flexibility over what you end up doing here. but your css should aim to fulfill the following requirements: add some kind of lightweight "reset" to make fonts, padding, margin, and sizing more consistent to begin with. on top of that, add in some nice, consistent styling for the inputs and button. use some kind of layout technique to make the inputs and
labels line up neatly. 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 editor such as codepen, jsfiddle, or glitch. you can write the code yo...
What will your website look like? - Learn web development
e your image. alternatively, copy the image's web address from your browser's address bar for later use. note that most images on the web, including in google images, are copyrighted. to reduce your likelihood of violating copyright, you can use google's license filter. click on the tools button, then on the resulting usage rights option that appears below. you should choose an option such as
labeled for reuse. font to choose a font: go to google fonts and scroll down the list until you find one you like. you can also use the controls on the right to further filter the results. click the "plus" (add to) icon next to the font you want. click the "* family selected" button in the panel at the bottom of the page ("*" depends on how many fonts you selected). in the popup box, you can ...
Creating hyperlinks - Learn web development
ugly, and sound even uglier when a screen reader reads them out letter by letter. don't say "link" or "links to" in the link text — it's just noise. screen readers tell people there's a link. visual users will also know there's a link, because links are generally styled in a different color and underlined (this convention generally shouldn't be broken, as users are used to it). keep your link
label as short as possible — this is helpful because screen readers need to interpret the entire link text. minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screen reader users, if there's a list of links out of context that are
labeled "click here", "click here", "click here". use relative links wherever possible from the descr...
Document and website structure - Learn web development
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-semantic element, which you should only use if you can't think of a better semantic text element to wrap your content, or don't want to add any specific meaning. for example: <p>the king walked drunkenly back to his room at 01:00, the beer doing nothing to aid him as he staggered through the door <span class="editor-note">[editor'...
Index - Learn web development
ave all of our app's required functionality in place. we can display, add, edit and delete todos, mark them as completed, and filter by status. 276 creating our first vue component beginner, components, frameworks, javascript, learn, client-side, props, state, vue and that will do for this article. at this point we have a nicely-working todoitem component that can be passed a
label to display, will store its checked state, and will be rendered with a unique id each time it is called. you can check if the unique ids are working by temporarily adding more <to-do-item></to-do-item> calls into app.vue, and then checking their rendered output with your browser's devtools. 277 deployment and next steps beginner, deployment, frameworks, javascript, learn, svelte, cl...
Manipulating documents - Learn web development
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 steps below, and make sure that the list behaves as described above. to start with, download a copy of our shopping-list.html starting file and make a copy of it somewhere. you'll see that it has some minimal css, a list with a
label, input, and button, and an empty list and <script> element. you'll be making all your additions inside the 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, empt...
Handling text — strings in JavaScript - Learn web development
e the web is a largely text-based medium designed to allow humans to communicate and share information, it is useful for us to have control over the words that appear on it. html provides structure and meaning to our text, css allows us to precisely style it, and javascript contains a number of features for manipulating strings, creating custom welcome messages and prompts, showing the right text
labels when needed, sorting terms into the desired order, and much more. pretty much all of the programs we've shown you so far in the course have involved some string manipulation. strings — the basics strings are dealt with similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences. let's start by entering some basic lines into the browser develope...
Client-Server Overview - Learn web development
response cycle, building on what we looked at in the last article with much more detail. in order to "keep things real" we'll use the context of a sports-team manager website where a coach can select their team name and team size in an html form and get back a suggested "best lineup" for their next game. the diagram below shows the main elements of the "team coach" website, along with numbered
labels for the sequence of operations when the coach accesses their "best team" list. the parts of the site that make it dynamic are the web application (this is how we will refer to the server-side code that processes http requests and returns http responses), the database, which contains information about players, teams, coaches and their relationships, and the html templates. after the coach subm...
Server-side web frameworks - Learn web development
orm, and refers to the object used to define the structure of a record as the model. the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g. an email field would only allow valid email addresses). the field definitions may also specify their maximum size, default values, selection list options, help text for documentation,
label text for forms etc. the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our code. the first code snippet below shows a very simple django model for a team object. this stores the team name and team level as character fields and specifies a maximum number of characters to be stored for each record. the team_lev...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
the todo, and so that on change, the togglecompletion() method on the todo service is invoked. in todo.hbs, first find the following line: <li> and replace it with this — you'll notice that here we're using some more conditional content to add the class value if appropriate: <li class="{{ if @todo.iscompleted 'completed' }}"> next, find the following line: <input aria-
label="toggle the completion of this todo" class="toggle" type="checkbox" > and replace it with this: <input class="toggle" type="checkbox" aria-
label="toggle the completion of this todo" checked={{ @todo.iscompleted }} {{ on 'change' (fn this.todos.togglecompletion @todo) }} > note: the above snippet uses a new ember-specific keyword — fn. fn allows for partial application,...
Getting started with Ember - Learn web development
app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies. finally, find app.css, located at app/styles/app.css, and paste in the following: :focus, .view
label:focus, .todo-list li .toggle:focus +
label, .toggle-all:focus +
label { /* !important needed because todomvc styles deliberately disable the outline */ outline: #d86f95 solid !important; } this css overrides some of the styles provided by the todomvc-app-css npm package, therefore allowing keyboard focus to be visible. this goes some way towards fixing one of the major accessibility disad...
Understanding client-side JavaScript frameworks - Learn web development
vue conditional rendering: editing existing todos 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. 8. focus management with vue refs we are nearly done with vue. the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility. we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes b...
Setting up your own test automation environment - Learn web development
useful common examples starting at getting text values on the webdriver docs. if we wanted to get the text inside our button, we could do this: button.gettext().then(function(text) { console.log('button text is \'' + text + '\''); }); add this to quick_test.js now. making sure you are inside your project directory, try running the test: node quick_test.js you should see the button's text
label reported inside the console. let's do something a bit more useful. delete the previous code entry, then add this line at the bottom instead: button.click(); try running your test again; the button will be clicked, and the alert() popup should appear. at least we know the button is working! you can interact with the popup too. add the following to the bottom of the code, and try testing it aga...
Continuous Integration
e extent that the state is reflected in the output shown on treeherder. when sheriffs see a build or test has been broken, they are empowered to take one of several actions, including backing out a patch which caused the problem and closing the tree (i.e., preventing any additional commits). results in treeherder are ordered by mercurial pushes. each taskcluster job is represented by a colored
label; green means a job has succeeded, while other colors represent different kinds of problems. the
label text indicates the job type. for a full list of job types, see the help menu in treeherder's upper-right corner. below is a list of the most common. builds b - normal build jobs; these jobs perform compilation and some compiled-code tests (e.g., 'make check'). be - b2g build jobs for engi...
Debugging JavaScript
rowser debugger (built-in) on firefox 19 or later, it's possible to use the built-in js debugger on the browser itself. go to about:config and set the following two prefs: devtools.chrome.enabled: true devtools.debugger.remote-enabled: true after you restart the browser, you can access the browser debugger through tools > web developer > browser toolbox. (note that before firefox 28, this was
labeled "browser debugger" and only the debugger was available, not the whole toolbox.) note that you must accept the incoming connection : (you may disable the pop-up above with the devtools.debugger.prompt-connection set to false in about:config. this can be a security risk, especially if you also set the devtools.debugger.force-local preference to false.) then, the browser toolbox displays th...
Eclipse CDT Manual Setup
correctly parse this code, eclipse cdt needs to know about these symbols. unfortunately, the build option discovery process outlined above does not pick up this information, so cdt needs to be told separately about c++11 mode. to do this, go to "preferences -> c/c++ -> build -> settings -> [discovery] tab -> cdt gcc built-in compiler settings" and add the flag "-std=c++11" at the end of the field
labeled "command to get compiler specs". in cdt 8.3 (unreleased as of august 2013), there will be a more user-friendly way to specify this (see http://wiki.eclipse.org/cdt/user/newin83#toolchains). building the index once you see the end of the build output in the console tab and the build item has disappeared from the progress tab, you can start indexing the source. if indexing started automaticall...
Reviewer Checklist
pieces of code. flag a bug with dev-doc-needed if any addon or web apis are affected. use javadocs extensively, especially on any new non-private methods. when moving files, ensure blame/annotate is preserved. accessibility for html pages, images should have the alt attribute set when appropriate. similarly, a button that is not a native html button should have role="button" and the aria-
label attribute set. [fennec: make sure contentdescription is set for parts of the ui that should be accessible] ...
Experimental features in Firefox
, a preference has been added to treat object_subrequests as active content. see bug 1190623 for more details. release channel version added enabled by default? nightly 59 no developer edition 59 no beta 59 no release 59 no preference name security.mixed_content.block_object_subrequest insecure page
labeling these two preferences add a "not secure" text
label in the address bar next to the traditional lock icon when a page is loaded insecurely (that is, using http rather than https). see bug 1335970 for more details. release channel version added enabled by default? nightly 60 no developer edition 60 no beta 60 no release ...
mozbrowsercontextmenu
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. 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 indi...
API-provided widgets
widgets (the default) view for buttons that open a panel or subview, depending on where they are placed. custom for fine-grained control over the creation of the widget. viewid only useful for views (and required there): the id of the that should be shown when clicking the widget. tooltiptext string to use for the tooltip of the widget
label string to use for the
label of the widget removable whether the widget is removable (optional, default: true). nb: if you specify false here, you must provide a defaultarea, too. overflows whether widget can overflow when in an overflowable toolbar (optional, default: true) defaultarea default area to add the widget to (optional, default: none; required ...
PopupNotifications.jsm
ing to the added notification. notification actions notification action objects describe the user interface for actions associated with the notification. the main action is used to describe the button presented in the notification panel, while secondary actions are displayed in the drop-down menu associated with the button. a notification action object must contain the following properties:
label a text
label describing the action. accesskey a string indicating the keystroke that will trigger the action. callback a javascript function to be invoked when the action is selected by the user. notification options the notification options object lets you further customize the notification panel. any combination of the following properties may be provided: persistence an integer val...
Sqlite.jsm
no more rows will be processed. }); } catch (err) { // an error occurred. console.log(err); // error, oh noes! if (callback) { callback(err); } } // all accounts returned successfully, so do something with them. console.log(result); // it worked! if (callback) { callback(null, accounts); } note: the then parameters can be anonymous functions (i.e. function() ), and only are
labeled as onstatementcomplete and onerror for readability. this example demonstrates retrieving a row without using the onrow function parameter, and instead, using the conn.execute result. this example also demonstrates retrieving the primary key row id of the last inserted row. async function () { try { conn = await sqlite.openconnection({ path: dbfile.path }); let statement = "insert ...
L10n Checks
s, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the output the output of l10n checks shows the missing and obsolete strings in a pseudo-diff format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.
label -showallbookmarkscmd2.
label migration/migration.dtd -importfromfile.accesskey -importfromfile.
label +importfromhtmlfile.accesskey +importfromhtmlfile.
label you can assume changed strings when you see entities removed and added with a similar name. the file names will be shown in a hierarchical form, so in the example above, your files are b...
Mozilla MathML Status
element [- attribute] notes mtable implemented. mtable - alignmentscope not implemented. see bug 122253. mtable - columnspacing, rowspacing, framespacing implemented. see bug 330964. mtable - columnwidth not implemented. see bug 958953. mtable - equalrows, equalcolumns not implemented. see bug 958954. mtable - side, min
labelspacing not implemented. see bug 356870. mtr implemented. m
labeledtr not implemented. see bug 689641. mtd implemented. * - groupalign. not implemented. see bug 122253. maligngroup not implemented. see bug 122253. malignmark not implemented. see bug 122253. elementary math element [- attribute] notes ...
Mozilla Web Developer FAQ
l-formedness of the served documents. mechanisms that ensure well-formed output include serializing from a document tree object model (eg. dom) and xslt transformations that do not disable output escaping. when xhtml output has been retrofitted to a content management system that was not designed for xml from the ground up, the system usually ends up discriminating gecko users by serving tag soup
labeled as xml to gecko (leading to a parse error) and serving the same soup
labeled as text/html to ie (not leading to a parse error). how is the treatment of application/xhtml+xml documents different from the treatment of text/html documents? an xml parser (expat) is used instead of the tag soup parser. most well-formedness constraints are enforced. despite common allegations to the contrar...
DMD
e options: ac_add_options --enable-dmd if building via try server, modify browser/config/mozconfigs/linux64/common-opt or a similar file before pushing. launch use mach run --dmd; use --mode to choose the mode. add --debug to run under gdb. trigger there are three ways to trigger a dmd snapshot. visit about:memory and click the dmd button (depending on how old your build is, it might be
labelled "save" or "analyze reports" or "dmd"). the button won't be present in non-dmd builds, and will be grayed out in dmd builds if dmd isn't enabled at start-up. if you wish to trigger dmd dumps from within c++ or javascript code, you can use nsimemoryinfodumper.dumpmemorytotempdir. for example, from javascript code you can do the following. const cc = components.classes; let mydumper = cc["@moz...
Reporting a Performance Problem
oolbar icon in the top right and select 'capture'. try to do this within a few seconds from reproducing the performance problem as only the last few seconds are recorded. if the timeline has a large red block it's a good sign. the data will open in a new tab. wait until the "symbolicating call stacks" notification disappears before sharing the profile. there will be a button in the top right
labeled 'publish' which will allow you to upload this profile and once completed will write out a link. before uploading, the publish button asks you what data you'd like to publish to our servers. note that while it's possible to strip profiles of potentially privacy sensitive information, the less information a profile contains, the harder it is to analyze and turn into actionable data. once upload...
javascript.options.strict
javascript warnings are generated when code is executed that doesn't cause a run-time error, but is non-standard, poorly written, or prone to cause logic errors. this preference controls whether javascript warnings are logged to the javascript console. example : <html> <head> <title>sample</title> </head> <body> <
label id="name">enter you first name</
label> <p id ="sample"></p> <script> "use strict" name1= "john" ; // this will cause and an error as variable not declared . var name2= "peter"; document.getelementbyid("sample").innerhtml = name1; </script> </body> </html> possible values and their effects: true: show javascript errors and warnings. false: show javascript errors only. (default) see also: http://kb.mozillazine.org/javascript.options.strict ...
Preferences system
available below: preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1"
label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1"
label="&check1.
label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2"
label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> ...
Patches and pushes
ude the locale code (e.g., wikipedia-es). create a patch of the searchplugins directory by entering the following command in your command-line tool, where mypatch.diff is where you give your patch a name: $ hg add mozilla/browser/searchplugins/ $ hg diff mozilla/browser/searchplugins/ > mypatch.diff attach your patch file to the bug by clicking the "add an attachment" link. once attached and
labeled as a patch, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :flod as the requestee. review, commit, & land address any review comments made by the reviewers and update the patch until it receives an r+ rating. if the r+ is "with nits" (i.e., that's short...
AsyncTestUtils extended framework
d) setread(true) marks all the messages in the set as read, setread(false) marks them as unread. setstarred(abestarred) setstarred(true) marks all the messages in the set as starred ("flagged" in imap parlance), setstarred(false) makes them not be starred. addtag(atagkey) adds the given tag to all the messages in the set. the tag key must correspond to an existing tag. the tag key is not the
label, but what is actually stored on the imap server. for example, all our default tags are actually things like $
label1 and $
label2, but that is not what we show to the user. removetag(atagkey) 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 ...
Optimizing Applications For NSPR
i/o is fully synchronous. do not depend on file i/o being synchronous. command line applications using the libc printf() and related apis behave funny on windows 3.1. read the fine print in the windows sdk for the grizzly details. watch out for printn overflow on win16. make sure all possible values of your printn variables are within 2^16. win-95 the win-95 version of nspr should really be
labeled win-32. the same library will work on either win-nt or win-95. win-95 nspr uses native threads as nspr threads. generally speaking, the native threads (on nt or '95) are quite functional. however, having lots of them (100s or even 1000s) is unrealistic. <tt>pr_interrupt()</tt> is not implemented. win-nt the win-nt port of nspr takes advantage of some of the features of nt that are not ava...
NSS 3.16 release notes
their names in ssl 3.0, with the ssl_ prefix. notable changes in nss 3.16 ecc is enabled by default. it is no longer necessary to set the environment variable nss_enable_ecc=1 when building nss. to disable ecc, set the environment variable nss_disable_ecc=1 when building nss. bug 903885: (cve-2014-1492) in a wildcard certificate, the wildcard character should not be embedded within the u-
label of an internationalized domain name. see the last bullet point in rfc 6125, section 7.2. bug 962760: libpkix should not include the common name of ca as dns names when evaluating name constraints. bug 981170: aeskeywrap_decrypt should not return secsuccess for invalid keys. bug 974693: fix a memory corruption in sec_pkcs12_new_asafe. bug 956082: if the nss_sdb_use_cache environment variable i...
NSS 3.43 release notes
this bugzilla query returns all the bugs fixed in nss 3.43: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.43 compatibility nss 3.43 shared libraries are backward compatible wit...
NSS API Guidelines
n a debug, wherever possible. pointers to user-supplied buffers, and templates, should be checked against null. pointers to context-style functions should be checked using special debug macros. these macros only define code when debug is turned on, providing a way for systems to register, deregister, and check valid pointers. secport_decl_ptr_class(classname, size) - declare a class of pointers (
labelled classname) this object file needs to check. this class is local only to this object file. size is the expected number of pointers of type classname. secport_decl_global_ptr_class(classname, size) - same as above except classname can be used in other object files. secport_add_pointer(classname, pointer) - add pointer as a valid pointer for classclassname. this is usually called by a create fu...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
iler "-----end wrapped mackey-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key
label-----" #define lab_trailer "-----end key
label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" #define ns_cert_enc_header "-----begin certificate for encryption-----" #...
sample2
ped enckey-----" #define mackey_header "-----begin wrapped mackey-----" #define mackey_trailer "-----end wrapped mackey-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key
label-----" #define lab_trailer "-----end key
label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" #define ns_cert_enc_header "-----begin certificate for encryption-----" #define ns_cert_enc_trailer "-----end certi...
NSS PKCS11 Functions
. typical parameters here are configdir, tokendescription and flags. a full list is below: configdir the location of the databases for this token. if configdir is not specified, and nocertdb and nokeydb is not specified, the load will fail. certprefix cert prefix for this token. keyprefix prefix for the key database for this token. (if not specified, certprefix will be used). tokendescription the
label value for this token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 characters dropped). you should specify a user friendly name here as this is the value the token will be refered to in most application ui's. you should make sure tokendescription is unique. slotdescription the slotdescription value f...
SpiderMonkey releases
uns our smoke tests, but we do not maintain it nor actively test its suitability for general embedding. we have periodically created "releases", but they are best-effort and incomplete. we do happily accept patches, and make some effort to keep the tip of the gecko tree minimally working as an embeddable source package. we are very limited in our ability to support older versions, including those
labeled as "releases" on this page. the easiest way to fetch the version corresponding to the current firefox release is to visit the treeherder page for the release repository and click on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded: mozjs-57.0.1.tar.bz2". past releases spidermonkey 52 spidermonkey 45 spidermonkey 38 spi...
Running Automated JavaScript Tests
at is tested against file:///{path_to_obj_dir}/dist/test-stage/jsreftest/tests/jsreftest.html?test={relative_path_to_test_from_js/src/tests} string: ./mach jstestbrowser --filter=pattern running jstests on treeherder when viewing treeherder after a push to the mozilla repositories, jstests run in the browser are shown as r(j) meaning "javascript reftests". most of the spidermonkey shell jobs,
labeled sm(...), will include js shell runs of both jstests and jit-tests. running jit-tests the jit-test suite uses a python harness that is similar to the jstests shell harness, but with some minor differences. basic usage is the same: jit_test.py path_to_js_shell developers will usually want to run like this to skip the slow tests and cover the most important options: jit_test.py --no-slow path...
compare-locales
ns, use the --help flag: $ compare-locales --help the output the output of compare-locales shows the missing and obsolete strings in a pseudo-diff format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.
label -showallbookmarkscmd2.
label migration/migration.dtd -importfromfile.accesskey -importfromfile.
label +importfromhtmlfile.accesskey +importfromhtmlfile.
label you can assume changed strings when you see entities removed and added with a similar name. the file names will be shown in a hierarchical form, so in the example above, your files are ...
Handling Mozilla Security Bugs
re not members of the mozilla security bug group or are not otherwise involved in resolving the bug. however, members of the mozilla security bug group employed by a distributor of mozilla-based products may share such information within that distributor, provided that this information is shared only with those who have a need to know, to the extent they need to know, and that such information is
labeled and treated as the organization generally treats confidential material. not to post descriptions of exploits in public forums like newsgroups. to be careful in whom they add to the cc field of a bug (since all those cc'd on a security bug potentially have access to the complete bug report). when a bug is put into the security bug group, the group members, bug reporter, and others associated...
Setting up an update server
t windows machine, you probably want the mar located at https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.complete.mar. prebuilt mars for release and beta can be found here. beta builds are those with a b in the version string. after locating the desired version, the mars will be in the update directory. you want to use the mar
labelled complete, not a partial mar. here is an example of an appropriate mar file to use: https://archive.mozilla.org/pub/firefox/releases/69.0b9/update/win64/firefox-69.0b9.complete.mar. building a mar building a mar locally is more complicated. part of the problem is that mars are signed by mozilla and so you cannot really build an "official" mar yourself. this is a security measure designed to p...
Using the Places annotation service
the annotation service, provided by the nsiannotationservice interface, is designed to store arbitrary data about a web page or about an item in the places database in firefox 3. it is usable from trusted firefox code such as extensions, but not from web pages. for an overview of the places database design, see the places database. most methods in the service are duplicated with one method
labeled as a 'page annotation' taking an nsiuri and the others
labeled as an 'item annotation' and taking the id of an item in 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...
IAccessible2
ideration 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. positioningroup 1 based, 0 indicates that th...
mozIRegistry
ture). these are placeholders for the types of components you're designing and implementing. i'll talk about them to provide examples of how you should use the other boxes. these components (indicated by the darker-colored boxes) are the services you'll be using. i'll be explaining the rationale for the design and implementation of these components in this document. lastly, there's one component (
labelled "mozrdfregistry/nsirdfdatabase") that potentially will emerge as an improved implementation of one of the moziregistry interfaces. i'll be discussing that implementation only briefly (mainly because i'm hoping i can pawn off the chore of implementing it to somebody else). there's another component that turns out to also be real important when you go to hook up your code with other mozilla co...
nsIAccessibilityService
e); nsiaccessible createhtmlcomboboxaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlhraccessible(in nsisupports aframe); nsiaccessible createhtmlimageaccessible(in nsisupports aframe); nsiaccessible createhtml
labelaccessible(in nsisupports aframe); nsiaccessible createhtml
labelaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlobjectframeaccessible(in nsobjectframe aframe); nsiaccessible createhtmlradiobuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlselectoptionaccessible(in nsidomnode anode, in nsiaccessible aaccparent, in nsiweakreference ...
GroupPosition
also used for collectons of non-text objects. void groupposition( out long agrouplevel, out long asimilaritemsingroup, out long apositioningroup ); parameters agrouplevel 1-based, similar to aria aria-level property asimilaritemsingroup 1-based, similar to aria aria-setsize property, inclusive of the current item. apositioningroup 1-based, similar to aria aria-posinset property. ...
nsIAccessibleHyperLink
note: has been replaced by the selected attribute. boolean isselected(); parameters none. return value true if the element currently has the focus. isvalid() obsolete since gecko 1.9 (firefox 3) note: has been replaced by the valid attribute. boolean isvalid(); parameters none. return value true if the hyperlink is valid. remarks anchors, image maps, xul:
labels with class="text-link" implement this interface. see also nsiaccessible nsiuri ...
nsIAccessibleProvider
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:gmonth"] xforms
label 0x00002001 used for
label element. xformsouput 0x00002002 used for output element. xformstrigger 0x00002003 used for trigger and submit elements. xformsinput 0x00002004 used for input and textarea elements. xformsinputboolean 0x00002005 used for input[xsd:boolean] element. xformsinputdate 0x00002006 used for input[xsd:date] element. xformssecret 0x00002007 used for secret element. x...
nsIFileView
n/" type="text/css" ?> <window id="test" title="test" width="640" height="480" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree flex="1" id="ftree"> <treecols> <-- the default column type is size unless an appropriate id is passed, nsifileview relies on the treecols section --> <treecol id="filenamecolumn"
label="name" flex="1" primary="true"/> <treecol id="lastmodifiedcolumn"
label="date" flex="1"/> <treecol id="size"
label="size" flex="1"/> </treecols> <treechildren/> </tree> <script> var dir="/home/"; //the directory to be opened var ftree = document.getelementbyid("ftree"); //the xul tree element var lfile = components.classes["@mozilla.org/file/local;1"] .createinstance...
Using nsILoginManager
, httprealm, username, password, usernamefield, passwordfield ); examples creating a login for a web page var formlogininfo = new nslogininfo( 'http://www.example.com', 'http://login.example.com', null, 'joe', 'secret123', 'uname', 'pword' ); this login would correspond to a html form such as: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <
label>username:</
label> <input type="text" name="uname"> <
label>password:</
label> <input type="password" name="pword"> </form> creating a site authentication login var authlogininfo = new nslogininfo( 'http://www.example.com', null, 'exampleco login', 'alice', 'secret321', "", "" ); this would correspond to a login on http://www.example.com when the server sends a reply such as: http/1.0...
nsIMsgDBHdr
subject of this message. the value here will have been decoded by the mime converter service. mime2decodedrecipients astring readonly: indicates the recipients of this message. the value here will have been decoded by the mime converter service. charset string indicates the character set of this message. this value is extracted from the content-type header.
label nsmsg
labelvalue indicates one of the old 5
label values used by old versions. new code should use keywords instead. accountkey string indicates the account that was originally used to fetch the message. may be blank if the message has not been moved or copied. folder nsimsgfolder readonly: indicates the folder in which this message is stored. propertye...
nsIMsgSearchTerm
rfc2047string boolean matchrfc2047string(in string astring, in string charset, in boolean charsetoverride); matchdate boolean matchdate(in prtime atime); matchstatus boolean matchstatus(in unsigned long astatus); matchpriority boolean matchpriority(in nsmsgpriorityvalue priority); matchage boolean matchage(in prtime days); matchsize boolean matchsize(in unsigned long size); match
label boolean match
label(in nsmsg
labelvalue a
labelvalue); matchjunkstatus boolean matchjunkstatus(in string ajunkscore); matchjunkpercent /* * test search term match for junkpercent * * @param ajunkpercent junkpercent for message (0-100, 100 is junk) * @return true if matches */ boolean matchjunkpercent(in unsigned long ajunkpercent); matchjunkscoreorigin /* * test search...
nsITelemetry
0 buckets increase exponentially. histogram_linear 1 buckets increase linearly. histogram_boolean 2 for storing 0/1 values. histogram_flag 3 for storing a single value; its count is always == 1. histogram_count 4 for storing counter values without bucketing. histogram_categorical 5 for storing enumerated values by
label. scalar types constant value description scalar_type_count 0 for storing a numeric value. scalar_type_string 1 for storing a string value. scalar_type_boolean 2 for storing a boolean value. dataset types constant value description dataset_release_channel_optout 0 the basic dataset tha...
nsMsgRuleActionType
/* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long
label=8; const long reply=9; const long forward=10; const long stopexecution=11; const long deletefrompop3server=12; const long leaveonpop3server=13; const long junkscore=14; const long fetchbodyfrompop3server=15; const long copytofolder=16; const long addtag=17; const long killsubthread=18; const long markunread=19; }; ...
nsMsgSearchAttrib
const nsmsgsearchattribvalue organization = 32; const nsmsgsearchattribvalue department = 33; // 34 - 43, reserved for ab / ldap; const nsmsgsearchattribvalue hasattachmentstatus = 44; const nsmsgsearchattribvalue junkstatus = 45; const nsmsgsearchattribvalue junkpercent = 46; const nsmsgsearchattribvalue junkscoreorigin = 47; const nsmsgsearchattribvalue
label = 48; /* mail only...can search by
label */ const nsmsgsearchattribvalue hdrproperty = 49; // uses nsimsgsearchterm::hdrproperty const nsmsgsearchattribvalue folderflag = 50; // uses nsimsgsearchterm::status const nsmsgsearchattribvalue uint32hdrproperty = 51; // uses nsimsgsearchterm::hdrproperty // 52 is for showing customize - in ui headers start from 53 onwards up until ...
nsMsgSearchValue
cify the value of a search term [ptr] native nsmsgsearchvalue(nsmsgsearchvalue); %{c++ typedef struct nsmsgsearchvalue { nsmsgsearchattribvalue attribute; union { nsmsgpriorityvalue priority; prtime date; pruint32 msgstatus; /* see msg_flag in msgcom.h */ pruint32 size; nsmsgkey key; print32 age; /* in days */ nsimsgfolder *folder; nsmsg
labelvalue
label; pruint32 junkstatus; pruint32 junkpercent; } u; char *string; } nsmsgsearchvalue; ...
nsMsgMessageFlags
the imap server mdnreportneeded 0x00400000 indicates whether or not a delivery receipt was requested. mdnreportsent 0x00800000 indicates whether or not a delivery receipt was sent. template 0x01000000 indicates whether or not the message is a template. attachment 0x10000000 indicates whether or not the message has an attachment.
labels 0x0e000000 the set of bits used to identify
labels. not returned in header.flags. runtimeonly 0x00000020 indicates the flags which are not emitted to the database. ...
nsMsgViewCommandType
ctedforoffline 16 download the selected messages for offline. downloadflaggedforoffline 17 download all flagged messages for offline. selectthread 18 select the entire thread. selectflagged 19 select all flagged messages. cmdrequiringmsgbody 20 used with nsimsgdbview.getcommandstatus() to determine if commands requiring the message body (i.e. reload or print preview) are available.
label0 21 attach a
label to the selected messages.
label1 22 attach a
label to the selected messages.
label2 23 attach a
label to the selected messages.
label3 24 attach a
label to the selected messages.
label4 25 attach a
label to the selected messages.
label5 26 attach a
label to the selected messages. last
label 26 attach a
label to the selected messages. junk 27 mark the select...
Using the Gecko SDK
tion is guaranteed to be supported by future versions of same major version of the platform. the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries. when those classes or functions are used, the component must link with the corresponding static library. every frozen interface or function will be
labeled as such in the idl or header file with "@status frozen". (note: nspr is the one exception to this rule. all nspr functions are frozen by default and are not marked as such in the respective header files.) the glue library exists to make common tasks easier. for example, the nscomptr class is defined in the xpcom glue library. if your component does not use any of the glue classes or functions, ...
Filelink Providers
eath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings, the settings xhtml page should contain a form with the id "provider-form", with its onsubmit attribute set to "return false;". example: <form id="provider-form" onsubmit="return false;"> <
label for="username">username:</
label> <input id="username" type="text" required="true" /> <
label for="server">server:</
label> <input id="server" type="text" required="true" /> <
label for="port">port:</
label> <input id="port" pattern="[0-9]+" required="true" /> </form> the form is expected to use html5 form validation. for each input event, the checkvalidity method of the form is automatica...
Index
accounts and folders. beginning in thunderbird 2, additional views on those folders ("recent folders", "favorite folders", and "unread folders") were added, accessible via the scroll-arrows at the top of the pane. 112 customdbheaders preference developing a custom column to display a 'superfluous' column within thunderbird's main view. the data will come from a custom header
labeled x-superfluous 114 using mapi with thunderbird's windows 7 developer builds thunderbird debug, thunderbird mapi (messaging application programming interface) is a windows feature that allows applications to send files via a system's default mail application. the thunderbird installer sets the installed build as the default mapi/mail client. if you want to set a debug build a...
Creating a Custom Column
unfortunately the new column doesn't have any data in it and it doesn't react to sort clicks on it... yet. the...
Add Toolbar Button
erlay file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://demo/skin/overlay.css" type="text/css" ?> <overlay id="messengerwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/x-javascript" src="overlay.js" /> <toolbarpalette id="mailtoolbarpalette"> <toolbarbutton id="demo-button" class="demo-button toolbarbutton-1"
label="demo" type="button" oncommand="demo.load();" /> </toolbarpalette> </overlay> add this to the css file you referenced in your xul file: #demo-button, [place="palette"] > #demo-button { list-style-image: url("chrome://demo/skin/icon.png") !important; } ...
Preferences System
available below: preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1"
label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1"
label="&check1.
label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2"
label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> ...
DOM Inspector internals - Firefox Developer Tools
selection in the first panel. these are the document panel and the object panel, respectively. (internally, a panel may be loosely referred to as a "pane", but a panelset is always referred to as a "panelset".) a panel's purpose is to manage available viewers. at the top of each panel is a toolbar which contains a menu button allowing you to choose which viewer to display from the viewer list, a
label displaying the name of the currently active viewer, and another menu button allowing you to issue viewer-specific commands. viewers are dynamically loaded; when the panel is made to switch from one viewer to another, the old viewer is destroyed, and the new viewer is loaded in its place. in this way, the panelset and panels function like a frameset and frames. this comparison turns out to be qui...
UI Tour - Firefox Developer Tools
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, in the case of page scripts) appears last. within the scopes pane, you can create watchpoints that pause the debugger when a va...
Aggregate view - Firefox Developer Tools
before firefox 48, this was the default view of a heap snapshot. after firefox 48, the default view is the tree map view, and you can switch to the aggregate view using the dropdown
labeled "view:": the aggregate view looks something like this: it presents a breakdown of the heap's contents, as a table. there are three main ways to group the data: type call stack inverted call stack you can switch between them using the dropdown menu
labeled "group by:" located at the top of the panel: there's also a box
labeled "filter" at the top-right of the pane. you can use this to filter the contents of the snapshot that are displayed, so you can quickly see, for example, how many objects of a specific class were allocated. type this is the default view, which looks something like ...
Network monitor toolbar - Firefox Developer Tools
.) it provides: an icon to clear the network request list. a box enabling you to filter requests by url and by properties. a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (
labeled ws) other requests a checkbox that allows you to disable caching. throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you navigate to a new page or reload the current page. when you select persist logs, the log is not cleared on page load. import har imports a har (http archive) fil...
Network request details - Firefox Developer Tools
er 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 the rc4 cipher stack trace tab stack traces are shown in the stack trace tab, for responses that have a stack trace...
Network request list - Firefox Developer Tools
ew. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets the width of the columns to the default values. clicking the column header
label sorts the request list by that column. you can reset the sort to the default by selecting "reset sorting" from the context menu. here is a list of all available columns: status: the http status code returned. the numeric code is displayed on a colored background, to help unusual ones stand out. if there was no response, this column is empty. or you might see a red circle with a diagonal sl...
Edit fonts - Firefox Developer Tools
pen the page inspector. select the fonts tab; the last of the tabs shown in the right-hand side of the css pane. the fonts tab has three major sections: "fonts used" by the currently inspected element. the new fonts editor. in firefox 61 and 62, this section does not exist. "all fonts on page" — this section lists all of the fonts in use on the page. in firefox 61 and 62, this area is
labeled "other fonts in page" and doesn't include the fonts mentioned in the "fonts used" section. fonts used the top section of the font editor shows the fonts used by the currently inspected element, grouped by font family. fonts are considered "used" when there is text content in the inspected element that has the font applied to it. empty elements will not have any fonts used and will display...
Examine and edit CSS - Firefox Developer Tools
mber contains the prefix (user agent): element {} rule the element {} rule at the top of the rules list isn't actually a css rule. it represents the css properties assigned to the element via its style attribute. this also gets the target icon: , giving you a convenient way to highlight the currently selected element in the page. filtering rules there's a box at the top of the rules view
labeled "filter styles": as you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlighted click the "x" at the end of the search box to remove the filter. while in the rules view, you can press ctrl / cmd + f to focus the search field. once you've typed in a filter, you can press esc to remove it again. strict sea...
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
your grid preferences such as overlay color and display settings choices are persisted across page loads for each separate page. let's examine these features in more detail. overlay grid each grid present on a page has an entry in the "overlay grid" section: each entry consists of (from left to right): a checkbox allowing you to toggle the grid overlay for that grid on and off. a name
label to represent the grid, consisting of a selector identifying the html element that has the grid applied to it. clicking this also toggles the grid overlay on and off. a target icon that when clicked immediately selects the html element that this grid entry relates to, inside the html pane. a color picker icon that allows you to change the primary color of the grid overlay. this is useful for sel...
Paint Flashing Tool - Firefox Developer Tools
er more repaints, and for more of the screen, than necessary. this can then cause a site to be slow responding to user input (also known as "janky"). that's where the paint flashing tool helps: by showing you the areas that the browser repaints in response to an event, you can see whether it is repainting more than it needs to. using the paint flashing tool open the toolbox, then click the icon
labeled "highlight painted area": then try using the page. after moving the mouse around and scrolling a bit, the above page looks like this: in this example, there are two main sources of repaints: moving the mouse over links makes the browser repaint them, because they have a style applied using the :hover pseudo-class scrolling makes the browser repaint the new part of the page coming into v...
Call Tree - Firefox Developer Tools
these represent internal browser calls. this can be useful information too. if your site is making the browser work hard, this might not show up as samples recorded in your code, but it is still your problem. in our example, there are 679 samples assigned to gecko - the second-largest group after bubblesort(). let's expand that: this result is telling us t...
Flame Chart - Firefox Developer Tools
erneath that, like the teeth of a comb, are all the calls being made to each sorting algorithm. let's zoom in: this slice is about 140 ms long, and shows us more details of the functions being called by sort(). the sort() code is just this: function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(quicksort(unsorted)); } the markers
labeled "bubb..." and colored olive-green are presumably bubblesort(). the ones colored plain green are presumably the other sort functions. even at a glance, we can see that the bubble sort blocks are much wider (of a longer duration) than the others. we can also see some functions being called from bubblesort(), colored purple. let's zoom in one more time: this slice is about 20ms long. we can s...
How to - Firefox Developer Tools
you display the menu bar or are on os x) select "performance" from tools button, in the toolbar, if you have one: record a profile to start a new recording, press the stopwatch icon in the recordings pane. to stop, press it again: you can also start and stop recording from the web console, using console.profile() and console.profileend(). save a profile to save a profile, click the link
labeled "save" in the recordings pane: load a profile to load a profile, click "import..." and choose the file: clear all loaded profiles to clear all loaded profiles, click "clear". if you do this, you'll lose any loaded profiles that you have not saved. select a tool to switch between the waterfall, call tree, and flame chart tools, use the buttons in the toolbar: configure markers ...
Animating CSS properties - Firefox Developer Tools
all the process the browser uses to update the page when a css property has changed can be described as a waterfall consisting of the following steps: recalculate style: every time a css property for an element changes, the browser must recalculate computed styles. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is
labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's co...
Toolbox - Firefox Developer Tools
he window, or make it a standalone window, using buttons in the toolbar. toolbar the toolbar contains controls to activate a particular tool, to dock/float the window, and to close the window. node picker on the far left there's a button to activate the node picker. this lets you select a page element for inspection. see "selecting elements". toolbox-hosted tools then there is an array of
labeled buttons which enables you to switch between the different tools hosted by the toolbox. the array may include the following tools: web console javascript debugger page inspector style editor profiler network monitor note that not all the hosted tools are always listed here: only the tools actually available in this context are shown (for example, not all tools support remote debugging ...
View Source - Firefox Developer Tools
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 to be ...
The JavaScript input interpreter - Firefox Developer Tools
plete 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 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 h...
about:debugging - Firefox Developer Tools
does with temporarily loaded extensions, the link next to manifest url opens the loaded manifest in a new tab. note: it's recommended that you use the browser toolbox, not the add-on debugger, for debugging webextensions. see debugging webextensions for all the details. the add-ons section in about:debugging lists all web extensions that are currently installed. next to each entry is a button
labeled inspect. note: this list may include add-ons that came preinstalled with firefox. if you click inspect, the add-on debugger will start in a new tab. see the page on the add-on debugger for all the things you can do with this tool. workers the workers section shows all the workers you've got registered on your firefox, categorised as follows: all registered service workers all regis...
AudioContext.resume() - Web APIs
a promise that resolves when the context has resumed. the promise is rejected if the context has already been closed. example the following snippet is taken from our audiocontext states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.state is queried — if it is running, suspend() is called; if it is suspended, resume() is called. in each case, the text
label of the button is updated as appropriate once the promise resolves. susresbtn.onclick = function() { if(audioctx.state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specificati...
AudioContext.suspend() - Web APIs
... }); returns a promise that resolves with void. the promise is rejected if the context has already been closed. example the following snippet is taken from our audiocontext states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.state is queried — if it is running, suspend() is called; if it is suspended, resume() is called. in each case, the text
label of the button is updated as appropriate once the promise resolves. susresbtn.onclick = function() { if(audioctx.state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specificati...
AudioTrackList: addtrack event - Web APIs
ack event is fired when a track is added to an audiotracklist. bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('addtrack', (event) => { console.log(`audio track: ${event.track.
label} added`); }); using the onaddtrack event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onaddtrack = (event) => { console.log(`audio track: ${event.track.
label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification. living standard ...
AudioTrackList: removetrack event - Web APIs
is fired when a track is removed from an audiotracklist. bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('removetrack', (event) => { console.log(`audio track: ${event.track.
label} removed`); }); using the onremovetrack event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onremovetrack = (event) => { console.log(`audio track: ${event.track.
label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specification. living standard ...
CanvasRenderingContext2D.addHitRegion() - Web APIs
r use in events, for example. parentid the id of the parent region for cursor fallback and navigation by accessibility tools. cursor the cursor to use when the mouse is over this region (defaults to inherit). inherits the cursor of the parent hit region, if any, or the canvas element's cursor. control an element (descendant of the canvas) to which events are to be routed. defaults to null.
label a text
label for accessibility tools to use as a description of the region, if there is no control. defaults to null. role an aria role for accessibility tools to determine how to represent this region, if there is no control. defaults to null. examples using the addhitregion method this example demonstrates the addhitregion() method. html <canvas id="canvas"></canvas> javascript cons...
Hit regions and accessibility - Web APIs
is example by steve faulkner. aria rules accessible rich internet applications (aria) defines ways to make web content and web applications more accessible to people with disabilities. you can use aria attributes to describe the behavior and purpose of the canvas element. see aria and aria techniques for more information. <canvas id="button" tabindex="0" role="button" aria-pressed="false" aria-
label="start game"></canvas> hit regions whether the mouse coordinates are within a particular area on the canvas, is a common problem to solve. the hit region api allows you to define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools. it allows you to make hit detection easier and lets you route events to dom elements. the api h...
Console.group() - Web APIs
optional. (chrome 59 tested) does not work with console.groupend(). using groups in the console requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) you can use nested groups to help organize your output by visually associating related messages. ...
Console.groupCollapsed() - Web APIs
.group(), however, the new group is created collapsed. the user will need to use the disclosure button next to it to expand it, revealing the entries created in the group. call console.groupend() to back out to the parent group. see using groups in the console in the console documentation for details and examples. note: this feature is available in web workers. syntax console.groupcollapsed([
label]); parameters
label label for the group. optional. specifications specification status comment console apithe definition of 'console.groupcollapsed()' in that specification. living standard initial definition ...
Console.time() - Web APIs
ong an operation takes. you give each timer a unique name, and may have up to 10,000 timers running on a given page. when you call console.timeend() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started. see timers in the console documentation for details and examples. note: this feature is available in web workers. syntax console.time(
label); parameters
label the name to give the new timer. this will identify the timer; use the same name when calling console.timeend() to stop the timer and get the time output to the console. specifications specification status comment console apithe definition of 'console.time()' in that specification. living standard initial definition ...
Console.timeLog() - Web APIs
logs the current value of a timer that was previously started by calling console.time() to the console. see timers in the documentation for details and examples. note: this feature is available in web workers. syntax console.timelog(
label); parameters
label the name of the timer to log to the console. return if no
label parameter included: default: 1042ms if an existing
label is included: timer name: 1242ms exceptions if there is no running timer, timelog() returns the warning: timer “default” doesn’t exist. if a
label parameter is included, but there is no corresponding timer: timer “timer name” doesn’t exist. examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.tim...
Console.timeStamp() - Web APIs
adds a single marker to the browser's performance or waterfall tool. this lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. you can optionally supply an argument to
label the timestamp, and this
label will then be shown alongside the marker. note: this feature is available in web workers. syntax console.timestamp(
label); parameters
label label for the timestamp. optional. ...
console - Web APIs
usage examples. note: this feature is available in web workers. note: the actual console interface is defined as all lower case (i.e. not console), for historical reasons. methods console.assert() log a message and stack trace to console if the first argument is false. console.clear() clear the console. console.count() log the number of times this line has been called with the given
label. console.countreset() resets the value of the counter with the given
label. console.debug() outputs a message to the console with the log level debug. console.dir() displays an interactive listing of the properties of a specified javascript object. this listing lets you use disclosure triangles to examine the contents of child objects. console.dirxml() displays an xml/html element represe...
Constraint validation API - Web APIs
ring to be shown to the user upon submitting the form, explaining why the value is not valid — when a message is set, the validity state is set to invalid. to clear this state, invoke the function with an empty string passed as its argument. in this case the custom error message is cleared, the element is considered valid, and no message is shown. examples take the following form: <form> <
label for="name">enter username (upper and lowercase letters): </
label> <input type="text" name="name" id="name" required pattern="[a-za-z]+"> <button>submit</button> </form> the basic html form validation features will cause this to produce a default error message if you try to submit the form with either no valid filled in, or a value that does not match the pattern. if you wanted to instead di...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
e phrase "hello world!" nicely written at the top of the page, rather than a weirdly indented "hello" followed but an even more weirdly indented "world!" on the line below that. note: firefox devtools have supported highlighting text nodes since version 52, making it easier to see exactly what nodes whitespace characters are contained within. pure whitespace nodes are marked with a "whitespace"
label. whitespace in block formatting contexts above we just looked at elements that contain inline elements, and inline formatting contexts. if an element contains at least one block element, then it instead establishes what is called a block formatting context. within this context, whitespace is treated very differently. let’s take a look at an example to explain how. we've marked the whitespac...
Element: click event - Web APIs
up to but not including <body>. use a typically interactive element (e.g., <a>) instead of one that isn't typically interactive (e.g., <div>). stop using click event delegation. safari mobile considers the following elements to be typically interactive (and thus they aren't affected by this bug): <a> (but it must have an href) <area> (but it must have an href) <button> <img> <input> <
label> (but it must be associated with a form control) <textarea> this list is incomplete; you can help mdn by doing further testing/research and expanding it. examples this example displays the number of consecutive clicks on a <button>. html <button>click</button> javascript const button = document.queryselector('button'); button.addeventlistener('click', event => { button.innerhtml = `cl...
Element.clientTop - Web APIs
will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). gecko-based applications support clienttop starting with gecko 1.9 (firefox 3, implemented in bug 111207). this property is not supported in firefox 2 and earlier. syntax var top = element.clienttop; example in the following illustration, the client area is show in white. (the segments
labeled "top", "right", etc. have no significance regarding the client area.) the clienttop value is the distance from where the margin (yellow) area ends and the padding and content areas (white) begin. padding-top lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco l...
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 - Web APIs
height of the element. element.clientleft read only returns a number representing the width of the left border of the element. element.clienttop read only returns a number representing the width of the top border of the element. element.clientwidth read only returns a number representing the inner width of the element. element.computedname read only returns a domstring containing the
label exposed to accessibility. element.computedrole read only returns a domstring containing the aria role that has been applied to a particular element. element.id is a domstring representing the id of the element. element.innerhtml is a domstring representing the markup of the element's content. element.localname read only a domstring representing the local part of the qualified name of th...
Event.explicitOriginalTarget - Web APIs
m 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 ...
Event.preventDefault() - Web APIs
box. this example demonstrates how to prevent that from happening: javascript document.queryselector("#id-checkbox").addeventlistener("click", function(event) { document.getelementbyid("output-box").innerhtml += "sorry! <code>preventdefault()</code> won't let you check this!<br>"; event.preventdefault(); }, false); html <p>please click on the checkbox control.</p> <form> <
label for="id-checkbox">checkbox:</
label> <input type="checkbox" id="id-checkbox"/> </form> <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault(). nowadays, you should usually use native html form validation instead. html here's the form: <...
FormData() - Web APIs
example the following line creates an empty formdata object: var formdata = new formdata(); // currently empty you could add a key/value pair to this using formdata.append: formdata.append('username', 'chris'); or you can specify the optional form argument when creating the formdata object, to prepopulate it with values from the specified form: <form id="myform" name="myform"> <div> <
label for="username">enter name:</
label> <input type="text" id="username" name="username"> </div> <div> <
label for="useracc">enter account number:</
label> <input type="text" id="useracc" name="useracc"> </div> <div> <
label for="userfile">upload file:</
label> <input type="file" id="userfile" name="userfile"> </div> <input type="submit" value="submit!"> </form> note: on...
GlobalEventHandlers.oninvalid - Web APIs
or its owner form is called. syntax target.oninvalid = functionref; var functionref = target.oninvalid; value functionref is a function name or a function expression. the function receives a event object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a form. html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <
label for="city">city</
label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = i...
GlobalEventHandlers.onsubmit - Web APIs
events. the submit event fires when the user submits a form. syntax target.onsubmit = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a form. html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <
label for="city">city</
label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = i...
HTMLAnchorElement.download - Web APIs
if the name is not a valid file name in the underlying os, the browser will adjust it. note: this value might not be used for download. this value cannot be used to determine whether the download will occur. ...
HTMLAnchorElement - Web APIs
presenting a comma-separated list of coordinates. htmlanchorelement.name is a domstring representing the anchor name. htmlanchorelement.rev is a domstring representing that the rev html attribute, specifying the relationship of the link object to the target object. note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it
labeled obsolete. until this discrepancy is resolved, you should still assume it is obsolete. htmlanchorelement.shape is a domstring representing the shape of the active area. methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. htmlelement.blur() removes the keyboard focus from the current element. htmlelement.focus() gives the keyb...
HTMLElement.contextMenu - Web APIs
the htmlelement.contextmenu property refers to the context menu assigned to an element using the contextmenu attribute. the menu itself is created using the <menu> element. syntax var elementcontextmenu = element.contextmenu; example var contextmenu = document.getelementbyid("element").contextmenu; // change the
label of the first menu entry contextmenu.firstelementchild.
label = "new
label"; ...
HTMLImageElement.alt - Web APIs
images used as buttons when using an image as a button (by using it as the only visible child of an <a> element representing a hyperlink), the alt attribute must be used to convey the purpose of the button. in other words, it should be the same text you would use in a textual button to serve the same purpose. for example, in the snippet of html below, a toolbar which uses icon images as link
labels provides alt attributes for each giving a textual
label to use instead of the icon when the icons cannot be or are intentionally not used. <li class="toolbar" aria-role="toolbar"> <a href="songs.html" aria-role="button"><img src="songicon.svg" alt="songs"</a> <a href="albums.html" aria-role="button"><img src="albumicon.svg" alt="albums"</a> <a href="artists.html" aria-role="button"><img s...
HTMLKeygenElement - Web APIs
us when the page loads. challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key. form read only is a htmlformelement that indicates the control's form owner, reflecting the form html attribute if it is defined. keytype is a domstring that reflects the keytype html attribute, containing the type of key used.
labels read only unimplemented (see bug 556743) is a nodelist that represents a list of
label elements associated with this keygen element. name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data. type read only is a domstring that must be the value keygen. validationmessage read only is a domstring representing a localiz...
HTMLLinkElement - Web APIs
resource. obsolete properties htmllinkelement.charset is a domstring representing the character encoding for the target resource. htmllinkelement.rev is a domstring representing the reverse relationship of the linked resource from the resource to the document. note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it
labeled obsolete. until this discrepancy is resolved, you should still assume it is obsolete. htmllinkelement.target is a domstring representing the name of the target frame to which the resource applies. methods no specific method; inherits methods from its parent, htmlelement, and linkstyle. specifications specification status comment preload candidate recommenda...
HTMLMeterElement - Web APIs
htmlmeterelement.max a double representing the maximum value, reflecting the max attribute. htmlmeterelement.min a double representing the minimum value, reflecting the min attribute. htmlmeterelement.optimum a double representing the optimum, reflecting the optimum attribute. htmlmeterelement.value a double representing the currrent value, reflecting the value attribute. htmlmeterelement.
labelsread only a nodelist of <
label> elements that are associated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlmeterelement' in that specification. living standard html 5.1the defini...
HTMLOptGroupElement - Web APIs
e" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloptgroupelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmloptgroupelement.disabled is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false). htmloptgroupelement.
label is a domstring representing the
label for the group. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmloptgroupelement' in that specification. living standard html5the definition of 'htmloptgroupelement' in that specification. recommenda...
HTMLOptionElement - Web APIs
orm of the corresponding <select> element, if the option is a descendant of a <select> element, or null if none is found. htmloptionelement.index read only is a long representing the position of the option within the list of options it belongs to, in tree-order. if the option is not part of a list of options, like when it is part of the <datalist> element, the value is 0. htmloptionelement.
label read only is a domstring that reflects the value of the
label html attribute, which provides a
label for the option. if this attribute isn't specifically set, reading it returns the element's text content. htmloptionelement.selected is a boolean that indicates whether the option is currently selected. htmloptionelement.text is a domstring that contains the text content of the element. htm...
HTMLOutputElement - Web APIs
y string. htmloutputelement.formread only an htmlformelement indicating the form associated with the control, reflecting the form html attribute if it is defined. htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value. htmloutputelement.
labelsread only a nodelist of <
label> elements associated with the element. htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data. htmloutputelement.typeread only the domstring "output". htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation co...
HTMLProgressElement - Web APIs
lue is 1.0. htmlprogresselement.positionread only returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it returns -1. htmlprogresselement.value is a double value that reflects the current value; if the progress bar is an indeterminate progress bar, it returns 0. htmlprogresselement.
labelsread only returns nodelist containing the list of <
label> elements that are
labels for this element. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlprogresselement' in that specification. living standard html 5.1the definition of 'ht...
HTMLSelectElement.form - Web APIs
the htmlselectelement.form read-only property returns a htmlformelement representing the form that this element is associated with. if the element is not associated with of a <form> element, then it returns null. syntax edit aform = aselectelement.form.selectname; example html <form action="http://www.google.com/search" method="get"> <
label>google: <input type="search" name="q"></
label> <input type="submit" value="search..."> </form> javascript a property available on all form elements, "type" returns the type of the calling form element. for select, the two possible values are "select-one" or "select-multiple", depending on the type of selection list. the below code gives all select elements in a particular form a css class of "selectclass": <script type="text/javascript"> var form...
HTMLTableCellElement - Web APIs
nt-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablecellelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative
label for the header cell.. this alternate
label can be used in other contexts, such as when describing the headers that apply to a data cell. this is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibility tool. usually the value of abbr is an abbreviation or acronym, but can be any text that's appropriate contextually. htmltablecellelement.cellindex read...
HTMLTableRowElement.rowIndex - Web APIs
n to the whole <table>. even when the <thead>, <tbody>, and <tfoot> elements 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. html <table> <thead> <tr><th>item</th> <th>price</th></tr> </thead> <tbody> <tr><td>bananas</td> <td>$2</td></tr> <tr><td>oranges</td> <td>$8</td></tr> <tr><td>top sirloin</td> <td>$20</td></tr> </tbody> <tfoot> <tr><td>total</td> <td>$30</td></tr> </tfoot> </table> javascript let rows = document.queryselecto...
HTMLTrackElement - Web APIs
icating how the text track is meant to be used. possible values are: subtitles, captions, descriptions, chapters, or metadata. htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data. htmltrackelement.srclang is a domstring that reflects the srclang html attribute, indicating the language of the text track data. htmltrackelement.
label is a domstring that reflects the
label html attribute, indicating a user-readable title for the track. htmltrackelement.default a boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate. htmltrackelement.readystate read only returns an unsigned short that show the readiness ...
install - Web APIs
eliable as a determinant of the success of the operation. to surface detail about the status of the installation, use the optional callback function and its status parameter, as in the example below. description in the example below, a special javascript object constructor is used to create an object that can be passed to the install() method. the { } constructor takes a comma-delimited set of
label/value pairs. for installations, these pairs are the xpinstall confirm dialog display name and the path of the xpi, respectively. in the example below, a single installation object is created, but you can use this approach to create multiple installations to pass to a single install. as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js fil...
Keyboard API - Web APIs
des the keyboard.getlayoutmap method, which returns a promise that resolves with a keyboardlayoutmap object that contains members for converting codes to keys. a list of valid code values is found in the writing system keys section of the ui events keyboardevent code values spec. the following example demonstrates how to get the location-specific or layout-specific string associated with the key
labeled w on an english qwerty keyboard. if (navigator.keyboard) { var keyboard = navigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey = keyboardlayoutmap.get('keyw'); window.alert('press ' + upkey + ' to move up.'); }); } else { // do something else. } keyboard locking richly interactive web pages, games, and remote-streaming experiences often requir...
MediaDevices - Web APIs
= document.queryselector('video'); var constraints = window.constraints = { audio: false, video: true }; var errorelement = document.queryselector('#errormsg'); navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var videotracks = stream.getvideotracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[0].
label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by yo...
MediaRecorder - Web APIs
nsole.log(mediarecorder.state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var clipcontainer = document.createelement('article'); var clip
label = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; clip
label.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(clip
label); cl...
MediaStream.onremovetrack - Web APIs
trackevent object representing the removetrack event which has occurred. the mediastreamtrack representing the track which was removed is specified in the event's track property. example this example adds a listener which, when a track is removed from the stream, logs the track that was removed. stream.onremovetrack = function(event) { let tracklist = document.getelementbyid("tracks"); let
label = document.createelement("li");
label.innerhtml = "removed: " + event.track.kind + ": " + event.track.
label; tracklist.appendchild(
label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onremovetrack' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack - Web APIs
e track cannot be accessed by the document that owns the mediastreamtrack. this happens when the peeridentity property is set, or if the track comes from a cross-origin source. mediastreamtrack.kind read only returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track. it doesn't change if the track is deassociated from its source. mediastreamtrack.
label read only returns a domstring containing a user agent-assigned
label that identifies the track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. when the track is deassociated from its source, the
label is not changed. mediastreamtrack.muted read only returns a boolean value indicating whether the track is unable to provid...
MediaStream Recording API - Web APIs
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 api to record audio clips. a second article, recording a media element, ...
Media Source API - Web APIs
into an htmlmediaelement via a mediasource object. sourcebufferlist a simple container list for multiple sourcebuffer objects. videoplaybackquality contains information about the quality of video being played by a <video> element, such as number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method. trackdefault provides a sourcebuffer with kind,
label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. trackdefaultlist a simple container list for multiple trackdefault objects. extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be specified as the src value of an html media element to play a media...
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 in...
PaymentRequest.canMakePayment() - Web APIs
domexception. parameters none examples in the following example, is excerpted from a demo that asynchronously builds a paymentrequest object for both apple pay and credit cards. it wraps the call to canmakepayment() in feature detection, and calls an appropriate callback depending on the resolution of the promise. async function initpaymentrquest() { const details = { total: {
label: "total", amount: { currency: "usd", value: "0.00", }, }, }; const supportsapplepay = new paymentrequest( [{ supportedmethods: "https://apple.com/apple-pay" }], details ).canmakepayment(); // supports apple pay? if (await supportsapplepay) { // show apple pay logo, for instance return; } // otherwise... let's see if we can use basic...
PaymentRequest.prototype.id - Web APIs
articular paymentrequest instance. when constructing an instance of the paymentrequest, you are able to supply an custom id via paymentdetailsinit dictionary's id member. if none is provided, the browser automatically sets the id value to a uuid. example this example shows how to give a paymentrequest instance a custom id. const details = { id: "super-store-order-123-12312", total: {
label: "total due", amount: { currency: "usd", value: "65.00" }, }, }; const request = new paymentrequest(methoddata, details); console.log(request.id); // super-store-order-123-12312 the id is then also available in the paymentresponse returned from the show() method, but under the requestid attribute. const response = await request.show(); console.log(response.requestid === request.id); // ...
RTCDTMFSender.toneBuffer - Web APIs
s 0-9 these characters represent the digit keys on a telephone keypad. the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones. these are not interpreted as digits. lower-case "a"-"d" automatically gets converted to upper-case. the pound/hash sign ("#") and the asterisk ("*") these correspond to the similarly-
labeled keys which are typically on the bottom row of the telephone keypad. the comma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. using tone buffer strings for example, if you're writing code to control a ...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
s 0-9 these characters represent the digit keys on a telephone keypad. the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones. these are not interpreted as digits. lower-case "a"-"d" automatically gets converted to upper-case. the pound/hash sign ("#") and the asterisk ("*") these correspond to the similarly-
labeled keys which are typically on the bottom row of the telephone keypad. the comma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. specifications specification status comment webrtc ...
RTCDataChannel.id - Web APIs
maximum of 65,534 data channels on it, although the actual maximum may vary from browser to browser. in early versions of the webrtc specification, this property's name was stream. code that uses that property needs to be updated. syntax var id = adatachannel.id; value an unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. while the
label property doesn't have to be unique, this id number is guaranteed to be unique among all data channels. additionally, known implementations of webrtc use the same id on both peers. a unique id makes it easier for your code to do its own out-of-band data channel-related signaling. this can be also useful for logging and debugging purposes. example var pc = new rtcpeerconnection(); var dc = pc.cr...
RTCDataChannel - Web APIs
of data currently queued to be sent over the data channel.bufferedamountlowthreshold the rtcdatachannel property bufferedamountlowthreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." the default value is 0.id read only the read-only rtcdatachannel property id returns an id number (between 0 and 65,534) which uniquely identifies the rtcdatachannel.
label read only the read-only rtcdatachannel property
label returns a domstring containing a name describing the data channel. these
labels are not required to be unique.maxpacketlifetime read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was crea...
RTCIceCandidate.relatedPort - Web APIs
ty reasons, but if present can be a useful tool during debugging. see the example, which shows a bit of this. here's an sdp attribute line (a-line) describing an ice candidate discovered by the stun server: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 6502 typ srflx raddr 192.168.2.77 rport 32768 generation 0 the remote port, relatedport, is the number immediately following the "rport"
label on the a-line, or 32768. example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's type, address (ip and port), and related address (relatedaddress and relatedport). var ip = candidate.ip; var port = candidate.port; var relip = candidate.relatedaddress; var relport = candidate.relatedport; if (relip...
RsaOaepParams - Web APIs
the rsaoaepparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the rsa_oaep algorithm. properties name a domstring. this should be set to rsa-oaep.
label optional a buffersource — an array of bytes that does not itself need to be encrypted but which should be bound to the ciphertext. a digest of the
label is part of the input to the encryption operation. unless your application calls for a
label, you can just omit this argument and it will not affect the security of the encryption operation. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specif...
Using the Screen Capture API - Web APIs
graph, then gets into the meat of things. <p>this example shows you the contents of the selected part of your display. click the start capture button to begin.</p> <p><button id="start">start capture</button> <button id="stop">stop capture</button></p> <video id="video" autoplay></video> <br> <strong>log:</strong> <br> <pre id="log"></pre> the key parts of the html are: a <button>
labeled "start capture" which, when clicked, calls the startcapture() function to request access to, and begin capturing, screen contents. a second button, "stop capture", which upon being clicked calls stopcapture() to terminate capture of screen contents. a <video> into which the captured screen contents are streamed. a <pre> block into which logged text is placed by the intercepted consolemethod.
SourceBuffer.trackDefaults - Web APIs
syntax var mytrackdefaults = sourcebuffer.trackdefaults; sourcebuffer.trackdefaults = mytrackdefaultlist; value a trackdefaultlist object. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. ...
SourceBuffer - Web APIs
e appended in any order, or they have to be kept in a strict sequence. sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default values to use if kind,
label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.videotracks r...
TextEncoder() - Web APIs
the textencoder() constructor returns a newly created utf-8 textencoder object. syntax encoder = new textencoder(); parameters textencoder() takes no parameters since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53, an encoding type
label was accepted as a paramer to the textencoder object, since then both browers have removed support for any encoder type other than utf-8, to match the spec. any type
label passed into the textencoder constructor will now be ignored and a utf-8 textencoder will be created. exceptions textencoder() throws no exceptions since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53 an exception would be thrown for an unknown encoding type. specifications specification status comment encodin...
TextTrack - Web APIs
th a <track> element, then the track's id matches the element's id. texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type. needs details texttrack.kind read only returns a domstring indicating what kind of text track the texttrack describes. the value must be one of those in the texttrackkind enum. texttrack.
label read only a human-readable domstring which contains the text track's
label, if one is present; otherwise, this is an empty string (""), in which case a custom
label may need to be generated by your code using other attributes of the track, if the track's
label needs to be exposed to the user. texttrack.language read only a domstring which specifies the text language in which the text track's...
TextTrackList: addtrack event - Web APIs
event is fired when a track is added to a texttracklist. bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.addeventlistener('addtrack', (event) => { console.log(`text track: ${event.track.
label} added`); }); using the onaddtrack event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onaddtrack = (event) => { console.log(`text track: ${event.track.
label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification. living standard ...
TextTrackList: removeTrack event - Web APIs
fired when a track is removed from a texttracklist. bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.addeventlistener('removetrack', (event) => { console.log(`text track: ${event.track.
label} removed`); }); using the onremovetrack event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onremovetrack = (event) => { console.log(`text track: ${event.track.
label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specification. living standard ...
TrackDefault.TrackDefault() - Web APIs
the trackdefault() constructor of the trackdefault interface constructs and returns a new trackdefault object. syntax var trackdefault = new trackdefault(type, language,
label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track.
label a domstring specifying a default
label for the sourcebuffer to use when an initialization segment does not contain
label information for a new track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment doe...
VideoTrack - Web APIs
can be used to locate a specific track within a video track list by calling videotracklist.gettrackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main video track would have a kind of "main".
label read only a domstring providing a human-readable
label for the track. for example, a track whose kind is "sign" might have a
label of "a sign-language interpretation". this string is empty if no
label is provided. language read only a domstring specifying the video track's primary language, or an empty string if unknown. the language is specified as a bcp 47 (rfc 5646) language code, such as...
VideoTrackList: addtrack event - Web APIs
rack event is fired when a track is added to a videotracklist. bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('addtrack', (event) => { console.log(`video track: ${event.track.
label} added`); }); using the onaddtrack event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onaddtrack = (event) => { console.log(`video track: ${event.track.
label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification. living standard ...
VideoTrackList: removetrack event - Web APIs
is fired when a track is removed from a videotracklist. bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('removetrack', (event) => { console.log(`video track: ${event.track.
label} removed`); }); using the onremovetrack event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onremovetrack = (event) => { console.log(`video track: ${event.track.
label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specification. living standard ...
Lifetime of a WebRTC session - Web APIs
-to-peer networking, this introduces a conundrum: without a unique identifier for every user device, it’s not possible to instantly and automatically know how to connect to a specific device on the internet. even though you know who you want to talk to, you don’t necessarily know how to reach them or even what their address is. this is like trying to mail a package to your friend michelle by
labeling it “michelle” and dropping it in a mailbox when you don't know her address. you need to look up her address and include it on the package, or she'll wind up wondering why you forgot her birthday again. this is where signaling comes in. signaling signaling is the process of sending control information between two devices to determine the communication protocols, channels, media codecs an...
A simple RTCDataChannel sample - Web APIs
n" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text input box into which the user can type a message to transmit, with a button to send the entered text. this <div> will be the first peer in the channel. <div class="messagebox"> <
label for="message">enter a message: <input type="text" name="message" id="message" placeholder="message text" inputmode="latin" size=60 maxlength=120 disabled> </
label> <button id="sendbutton" name="sendbutton" class="buttonright" disabled> send </button> </div> finally, there's the little box into which we'll insert the messages. this <div> block will be the s...
Web Video Text Tracks Format (WebVTT) - Web APIs
vertical:rl vertical:lr align:start left top top align:middle centred horizontally centred vertically centred vertically align:end right bottom bottom example 13 - cue setting examples the first line demonstrates no settings. the second line might be used to overlay text on a sign or
label. the third line might be used for a title. the last line might be used for an asian language. 00:00:05.000 --> 00:00:10.000 00:00:05.000 --> 00:00:10.000 line:63% position:72% align:start 00:00:05.000 --> 00:00:10.000 line:0 position:20% size:60% align:start 00:00:05.000 --> 00:00:10.000 vertical:rt line:-1 align:end cue payload the payload is where the main information or content is located.
Inputs and input sources - Web APIs
"select" input on their controller. this input may be a button, trigger, trackpad tap or click, a voice command, or special hand gesture, or possibly some other form of input. for example, on a hand controller with a trackpad that can be clicked on, a trigger control, as well as back and "menu" buttons, clicking the trackpad is likely to be the primary action. some controllers might have a button
labeled "select." on a gamepad-style controller, the "a" button is likely to be the primary action. the primary squeeze action is the action which is engaged when the user squeezes the controller. this "squeezing" may be detected by literally using a pressure sensor in the controller, or may be simulated using a trigger, hand gesture, or other mechanism. for example, if the input controller is a hapti...
Window: load event - Web APIs
ples log a message when the page is fully loaded: window.addeventlistener('load', (event) => { console.log('page is fully loaded'); }); the same, but using the onload event handler property: window.onload = (event) => { console.log('page 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; } #relo...
XRInputSourceArray.length - Web APIs
es 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. let sources = xrsession.inputsources; if (sources.length === 0) { showalertdialog("you need to have at least one controller to play super duper shark jump fest 9000.", [ {
label: "shop now", url: "https://www.amazon.com/s?k=vr+controllers" }, {
label: "quit" handler: quitgame } ]); } here, if length is 0, a hypothetical showalertdialog() function is called with a prompt string explaining the need for a controller, and an array of objects, each describing a button and what should happen when it's clicked. the first takes the user to ...
msCapsLockWarningOff - Web APIs
{ if (document.mscapslockwarningoff == false) { document.mscapslockwarningoff = true; document.getelementbyid("caps").innerhtml = "warning off"; } else { document.mscapslockwarningoff = false; document.getelementbyid("caps").innerhtml = "warning on"; } } </script> </head> <body> <
label>type a password: <input type="password" /></
label><br /> <button id="caps" onclick="capsoff();">warning off</button> </body> </html> ...
Web APIs
tmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement html
labelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogr...
ARIA guides - Accessibility
accessible rich internet applications (aria) defines ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. error handling in forms
labeling widgets
labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs roving tabindex) using landmark roles handling dynamic updates & live regions virtual vs. non virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile devices ...
ARIA Screen Reader Implementors Guide - Accessibility
ue") 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. it is probably desirable to have at least a tiny timeout before presenting atomic region changes, in order to avoid presenting the region twice for two changes that occur quickly one after the other. include
labels when presenting changes: if the change occurs in something with a semantic
label of some kind, speak the
label. this is particularly important for changes in data cells, where the column and row headers provide important contextual information. ideas for settings and heuristics allow for a different voice (in text-to-speech) or other varying presentational characteristics to set live changes ...
Using the link role - Accessibility
comes visible, the user agent should do the following: expose the element as having a link role in the operating system's accessibility api. fire an accessible link event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the text of the link or its
label when it is focused, along with the fact that it is a link. aria links should be included in the screen reader's “list links” function just like ordinary links, and actions in this dialogue list, such as “activate link” or “move to link”, should perform the same as they do with ordinary links. screen magnifiers may enlarge links. note: opinons may differ on how assistive technolog...
Using the progressbar role - Accessibility
ia-valuetext is specified. it is best to set the values for aria-valuemin, aria-valuemax, and aria-valuenow in a manner that is appropriate for this calculation. note: elements with the role progressbar have an implicit aria-readonly value of true. possible effects on user agents and assistive technology screen readers should announce the progress updates as they occur. if the progress bar is
labeled, the
label text should be mentioned as well. note: opinions may differ on how assistive technology should handle this. the information provided above is one of those opinions and therefore not normative. examples example 1: basic progressbar with percentage values <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20 %</div> example 2: using aria-valuetext ...
ARIA: tabpanel role - Accessibility
purposing an element and adding an aria role, state or property to make it accessible, then do so. then post full details in best practices section below. examples fill in a simple example that nicely shows a typical usage of the property, then perhaps some more complex examples. <div role="tablist"> <div role="tab" aria-selected="true" aria-controls="tabpanel-id" id="tab-id" tabindex="0">tab
label</div> accessibility concerns optionally, warn of any potential accessibility concerns that exist with using this property, and how to work around them. remove this section if there are none to list. best practices optionally, here list any best practices that exist for this role. remove the section if none exist. added benefits any additional benefits this feature has for non-typical scree...
ARIA: timer role - Accessibility
rt of the web content is a live region containing a timer listing the time remaining or elapsed time. a timer's inner text should be an updating current time measurement. while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. associated wai-aria roles, states, and properties aria-
label used to provide the name of the timer. aria-live elements with the role timer have an implicit aria-live value of off. aria-describedby used to indicate the idref of an element that contains additional instructions for navigating or operating this element. aria-roledescription used to give the timer a more descriptive role text for screen readers to speak. this should be localized. keybo...
ARIA: application role - Accessibility
widgets that are not part of the standard set to be accessible for direct interaction in ats that use both browse and focus modes for interacting with web content. associated wai-aria roles, states, and properties document, article used to indicate parts of the application that should be treated as normal web content aria-activedescendant used to manage focus inside the application. aria-
label used to provide the name of the application or purpose of the widget that is being exposed. aria-describedby used to indicate the idref of an element that contains additional instructions for navigating or operating this element. aria-roledescription used to give the application a more descriptive role text for screen readers to speak. this should be localized. keyboard interactions keybo...
ARIA: banner role - Accessibility
ithin an article, aside, main, nav or section subsection. each page may have a banner landmark, but each page should be limited to only one header with the role of banner. in the case of a page containing nested document and/or application roles, each nested document or application role may also have one banner landmark. if a page includes more than one banner landmark, each should have a unique
label. associated aria roles, states, and properties none keyboard interactions none required javascript features none examples here's a fake simple banner with a skip to navigation link, a logo, a title and a subtitle. as this is the main header for the site, we've added the banner landmark role to the container element. <div role="banner"> <a href="#nav" id="skiptomenu" class="skiptoconten...
ARIA: Main role - Accessibility
e main section of a document that discusses avocados. subsections of this document could discuss their history, the different types, regions where they grow, etc. description the main role is a navigational landmark role identifying the main content of a document. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. by classifying and
labeling sections of a page, structural information conveyed visually through layout can be represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. for those navigating via landmark roles, the main role is an alternative for "skip to main content" links.there should only be one main landmark role per document. the <main> element h...
Mobile accessibility checklist - Accessibility
ed in a logical order and consistent manner. text equivalents text equivalent must be provided for every non-strictly presentational non-text element within the app. use alt and title where appropriate (see steve faulkner's post about using the html title attribute for a good guide.) if the above attributes are not applicable, use appropriate aria states and properties such as aria-
label, aria-
labelledby, or aria-describedby. images of text must be avoided. all user interface components with visible text (or image of text) as
labels must have the same text available in the programmatic name of the component. wcag 2.1:
label in name. all form controls must have
labels (<
label> elements) for the benefit of screen reader users. handling state standard controls such as r...
-webkit-text-security - CSS: Cascading Style Sheets
type=password. syntax -webkit-text-security: circle; -webkit-text-security: disc; -webkit-text-security: square; -webkit-text-security: none; formal definition value not found in db! formal syntax syntax not found in db! examples obscuring a text input try typing in the field below. if your browser supports this property, the characters should be visually replaced with squares. html <
label for="name">name:</
label> <input type="text" name="name" id="name" /> css input { -webkit-text-security: square; } result specifications not part of any standard. ...
::-webkit-file-upload-button - CSS: Cascading Style Sheets
the ::-webkit-file-upload-button css pseudo-element represents the button of an <input> of type="file". this pseudo-element is non-standard and only supported in webkit/blink compatible browsers like chrome, opera and safari (indicated by the -webkit prefix). syntax selector::-webkit-file-upload-button examples html <form> <
label for="fileupload">upload file</
label><br> <input type="file" id="fileupload"> </form> css input,
label { display: block; } input[type=file]::-webkit-file-upload-button { border: 1px solid grey; background: #fffaaa; } below is the example for you to try. the screenshot to the left shows what the button will look like if you are without access to chrome, opera or safari. screenshotlive sample specifications not part of any standard. ...
:indeterminate - CSS: Cascading Style Sheets
lime; } elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by javascript <input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate state syntax :indeterminate examples checkbox & radio button this example applies special styles to the
labels associated with indeterminate form fields. html <div> <input type="checkbox" id="checkbox"> <
label for="checkbox">this
label starts out lime.</
label> </div> <div> <input type="radio" id="radio"> <
label for="radio">this
label starts out lime.</
label> </div> css input:indeterminate +
label { background: lime; } javascript var inputs = document.getelementsbytagname("input"); for (...
aspect-ratio - CSS: Cascading Style Sheets
in-aspect-ratio: 8/5) { div { background: #9af; /* blue */ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { background: #9ff; /* cyan */ } } /* exact aspect ratio, put it at the bottom to avoid override*/ @media (aspect-ratio: 1/1) { div { background: #f9a; /* red */ } } _example used iframe and dataurl to enable this iframe could resize html <
label id="wf" for="w">width:165</
label> <input id="w" name="w" type="range" min="100" max="250" step="5" value="165"> <
label id="hf" for="w">height:165</
label> <input id="h" name="h" type="range" min="100" max="250" step="5" value="165"> <iframe id="outer" src="data:text/html,<style> @media (min-aspect-ratio: 8/5) { div { background: %239af; } } @media (max-aspect-ratio: 3/2) { div { background: %239f...
Color picker tool - CSS: Cascading Style Sheets
ack); }; var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic,
label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (
label !== undefined) slider.setattribute('data-info',
label); new inputslider(slider); return slider; }; var init = function init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; ...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
ess. flexbox makes this type of layout easy to achieve. i have contained my <button> and <input> field in a wrapper which i have given a border and set to display: flex. i then use the flex properties to allow the <input> field to grow, while the button does not grow. this means we have a pair of fields, with the text field growing and shrinking as the available space changes. you could add a
label or icon to the left as easily as we popped the button onto the right. i have added a
label, and other than some styling for background colour i didn’t need to change the layout. the stretchy input field now has a little less space to play with but it uses the space left after the two items are accounted for. patterns like this can make it much easier to create a library of form elements for ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
ffa94d; } .wrapper div:nth-child(2) { grid-column: 3; grid-row: 2 / 4; } .wrapper div:nth-child(5) { grid-column: 1 / 3; grid-row: 1 / 3; } filling in the gaps so far, other than items we have specifically placed, grid is always progressing forward and keeping items in dom order. this is generally what you want, if you are laying out a form for example you wouldn’t want the
labels and fields to become jumbled up in order to fill in some gap. however sometimes, we are laying things out that don’t have a logical order and we would like to create a layout that doesn’t have gaps in it. to do this, add the property grid-auto-flow with a value of dense to the container. this is the same property you use to change the flow order to column, so if you were working in columns ...
Breadcrumb Navigation - CSS: Cascading Style Sheets
is solution uses a more complex selector, but requires less rules. feel free to choose the solution that you prefer. choices made this pattern is laid out using a simple flex layout demonstrating how a line of css can give us our navigation. the separators are added using css generated content. you could change these to any separator that you like. accessibility concerns i have used the aria-
label and aria-current attributes to help users understand what this navigation is and where the current page is in the structure. see the related links for more information. ...
Pagination - CSS: Cascading Style Sheets
operty 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 screenreader understands what this navigation does, and where they will go when clicking a link. to help with this we have added aria-
label="pagination" on the <nav> element. we have also added some additional content that would be read by a screenreader but is hidden visually, and set the aria-hidden attribute on the paging arrows. the "see also" section at the end of this document has links to related accessibility topics. ...
align-content - CSS: Cascading Style Sheets
#ff8cff; min-height: 70px; } #item6 { background-color: #8cffff; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <
label for="display">display: </
label> <select id="display"> <option value="flex">flex</option> <option value="grid">grid</option> </select> </div> <div class="row"> <
label for="values">align-content: </
label> <select id="values"> <option value="normal">normal</option> <option value="stretch">stretch</option> <option value="flex-start">flex-start</option> <option value="...
align-items - CSS: Cascading Style Sheets
: #ff8cff; min-height: 70px; } #item6 { background-color: #8cffff; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <
label for="display">display: </
label> <select id="display"> <option value="flex">flex</option> <option value="grid">grid</option> </select> </div> <div class="row"> <
label for="values">align-items: </
label> <select id="values"> <option value="normal">normal</option> <option value="flex-start">flex-start</option> <option value="flex-end">flex-end</option> <option value="...
calc() - CSS: Cascading Style Sheets
} #formbox { width: calc(100% / 6); border: 1px solid black; padding: 4px; } here, the form itself is established to use 1/6 of the available window width. then, to ensure that input fields retain an appropriate size, we use calc() again to establish that they should be the width of their container minus 1em. then, the following html makes use of this css: <form> <div id="formbox"> <
label>type something:</
label> <input type="text"> </div> </form> nested calc() with css variables you can also use calc() with css variables. consider the following code: .foo { --widtha: 100px; --widthb: calc(var(--widtha) / 2); --widthc: calc(var(--widthb) / 2); width: var(--widthc); } after all variables are expanded, widthc's value will be calc( calc( 100px / 2) / 2), then when i...
float - CSS: Cascading Style Sheets
modern browsers support float, but in older browsers you have to spell it as cssfloat, with internet explorer versions 8 and older using stylefloat. this was an exception to the rule, that the name of the dom member is the camel-case name of the dash-separated css name (due to the fact that "float" is a reserved word in javascript, as seen in the need to escape "class" as "classname" and escape <
label>'s "for" as "htmlfor"). syntax /* keyword values */ float: left; float: right; float: none; float: inline-start; float: inline-end; /* global values */ float: inherit; float: initial; float: unset; the float property is specified as a single keyword, chosen from the list of values below. values left the element must float on the left side of its containing block. right the element mus...
grid-auto-flow - CSS: Cascading Style Sheets
mples setting grid auto-placement html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> <div id="item4"></div> <div id="item5"></div> </div> <select id="direction" onchange="changegridautoflow()"> <option value="column">column</option> <option value="row">row</option> </select> <input id="dense" type="checkbox" onchange="changegridautoflow()"> <
label for="dense">dense</
label> css #grid { height: 200px; width: 200px; display: grid; grid-gap: 10px; grid-template: repeat(4, 1fr) / repeat(2, 1fr); grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */ } #item1 { background-color: lime; grid-row-start: 3; } #item2 { background-color: yellow; } #item3 { background-color: blue; } #item4 { grid-column-start:...
linear-gradient() - CSS: Cascading Style Sheets
ent(red, orange, yellow, green, blue); linear-gradient(red 0%, orange 25%, yellow 50%, green 75%, blue 100%); by default, colors transition smoothly from the color at one color stop to the color at the subsequent color stop, with the midpoint between the colors being the half way point between the color transition. you can move this midpoint to any position between two color stops by adding an un
labelled % color hint between the two colors to indicate where the middle of the color transition should be. the following example is solid red from the start to the 10% mark and solid blue from 90% to the end. between 10% and 90% the color transitions from red to blue, however the midpoint of the transition is at the 30% mark rather than 50% as would have happened without the 30% color hint. linear-g...
place-items - CSS: Cascading Style Sheets
: #ff8cff; min-height: 70px; } #item6 { background-color: #8cffff; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <
label for="display">display: </
label> <select id="display"> <option value="flex">flex</option> <option value="grid">grid</option> </select> </div> <div class="row"> <
label for="values">place-items: </
label> <select id="values"> <option value="start">start</option> <option value="center">center</option> <option value="end">end</option> <option value="left">left</option> ...
Localizations and character encodings - Developer guides
te that firefox no longer sends the accept-charset http header, so there is no need to consider what gets advertised in accept-charset when setting the fallback encoding. for locales where the fallback encoding is currently iso-8859-1, it should be changed to windows-1252. iso-8859-1 is decoded in the exact same way as windows-1252, but firefox is moving to treating windows-1252 as the preferred
label for this encoding in accordance with the encoding standard. for locales where internet explorer has more market share than firefox, the fallback encoding should typically be set to the same value as in internet explorer. you can see the fallback encoding a particular browser has by loading a test page. (be sure to use a browser installation that has its settings left to the defaults when investi...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
the user can choose a color. as the user adjusts the color, the border around the example changes to reflect the new color. after finishing up and picking the final color, the color picker's value is displayed. on macos, you indicate that you've finalized selection of the color by closing the color picker window. html the html here creates a box that contains a color picker control (with a
label created using the <
label> element) and an empty paragraph element (<p>) into which we'll output some text from our javascript code. <div id="box"> <
label for="colorpicker">border color:</
label> <input type="color" value="#8888ff" id="colorpicker"> <p id="output"></p> </div> css the css simply establishes a size for the box and some basic styling for appearances. the border is also establ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
dynamic disabled state and (if applicable) dynamic checkedness of an <input> element, <textarea> element, or entire <form> across page loads. the persistence feature is enabled by default. setting the value of the autocomplete attribute to off disables this feature. this works even when the autocomplete attribute would normally not apply by virtue of its type. see bug 654072. examples <div> <
label for="cc-number">enter your credit card number</
label> <input name="cc-number" id="cc-number" autocomplete="off"> </div> administrative levels in addresses the four administrative level fields (address-level1 through address-level4) describe the address in terms of increasing levels of precision within the country in which the address is located. each country has its own system of administrati...
HTML attribute: minlength - HTML: Hypertext Markup Language
han minlength utf-16 code units long, with validitystate.tooshort returning true. constraint validation is only applied when the value is changed by the user. once submission fails, some browsers will display an error message indicating the minimum length required and the current length. examples by adding minlength="5", the value must either be empty or five characters or longer to be valid. <
label for="fruit">enter a fruit name that is at least 5 letters long</
label> <input type="text" minlength="5" id="fruit"> we can use pseudoclasses to style the element based on whether the value is valid. the value will be valid as long as it is either null (empty) or five or more characters long. lime is invalid, lemon is valid. input { border: 2px solid currentcolor; } input:invalid { border: 2...
HTML attribute: step - HTML: Hypertext Markup Language
ibute' in that specification. recommendation accessibility concerns provide instructions to help users understand how to complete the form and use individual form controls. indicate any required and optional input, data formats, and other relevant information. when using the min attribute, ensure this minimum requirement is understood by the user. providing instructions within the <
label> may be sufficient. if providing instructions outside of
labels, which allows more flexible positioning and design, consider using aria-
labelledby or aria-describedby. ...
Block-level elements - HTML: Hypertext Markup Language
s not technically defined for elements that are new in html5). <address> contact information. <article> article content. <aside> aside content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a description list. <div> document division. <dl> description list. <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 doc...
<button>: The Button element - HTML: Hypertext Markup Language
orm the user agent runs on, but you can change buttons’ appearance with css. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, interactive content, listed,
labelable, 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...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
you can use the object-position property to adjust the positioning of the embedded object within the element's frame, and the object-fit property to control how the object's size is adjusted to fit within the frame. examples <embed type="video/quicktime" src="movie.mov" width="640" height="480" title="title of my video"> accessibility concerns use the title attribute on an embed element to
label its content so that people navigating with assistive technology such as a screen reader can understand what it contains. the title's value should concisely describe the embedded content. without a title, they may not be able to determine what its embedded content is. this context shift can be confusing and time-consuming, especially if the embed element contains interactive content like video or ...
<frame> - HTML: Hypertext Markup Language
s not encouraged because of certain disadvantages such as performance problems and lack of accessibility for users with screen readers. instead of the <frame> element, <iframe> may be preferred. attributes like all other html elements, this element supports the global attributes. src this attribute specifies the document that will be displayed by the frame. name this attribute is used for
labeling frames. without
labeling, every link will open in the frame that it’s in – the closest parent frame. see the target attribute for more information. noresize this attribute prevents resizing of frames by users. scrolling this attribute defines the existence of a scrollbar. if this attribute is not used, the browser adds a scrollbar when necessary. there are two choices: "yes" for forcin...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
ng the frame, when the user clicks a button, its title is displayed in an alert. html <iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" title="iframe example 1" width="400" height="300"> </iframe> result accessibility concerns people navigating with assistive technology such as a screen reader can use the title attribute on an <iframe> to
label its content. the title's value should concisely describe the embedded content: <iframe title="wikipedia page for avocados" src="https://en.wikipedia.org/wiki/avocado"></iframe> without this title, they have to navigate into the <iframe> to determine what its embedded content is. this context shift can be confusing and time-consuming, especially for pages with multiple <iframe>s and/or if embe...
<input type="color"> - HTML: Hypertext Markup Language
and input events to take the new color and apply it to every <p> element in the document. html the html is fairly straightforward — a couple of paragraphs of descriptive material with an <input> of type color with the id colorwell, which we'll use to change the color of the paragraphs' text. <p>an example demonstrating the use of the <code><input type="color"></code> control.</p> <
label for="colorwell">color:</
label> <input type="color" value="#ff0000" id="colorwell"> <p>watch the paragraph colors change when you adjust the color picker. as you make changes in the color picker, the first paragraph's color changes, as a preview (this uses the <code>input</code> event). when you close the color picker, the <code>change</code> event fires, and we detect that to change ...
<isindex> - HTML: Hypertext Markup Language
accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <
label> search document... <input name="isindex"> </
label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex. on november 1992, indexes as links rather than documents started by dan connolly who is pushing the idea that indexes are more links than documents. in this thread, different type of solutions are proposed. the question of for...
<keygen> - HTML: Hypertext Markup Language
of an html form. this mechanism is designed for use with web-based certificate management systems. it is expected that the <keygen> element will be used in an html form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate. content categories flow content, phrasing content, interactive content, listed,
labelable, submittable, resettable form-associated element, palpable content. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents any element that accepts phrasing content. permitted aria roles none dom interface htmlkeygenelement attributes this element inc...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
the html <meter> element represents either a scalar value within a known range or a fractional value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content,
labelable content, palpable content. permitted content phrasing content, but there must be no <meter> element among its descendants. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted ...
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
y includes the global attributes. usage notes it's not necessary for all links to be contained in a <nav> element. <nav> is intended only for major block of navigation links; typically the <footer> element often has a list of links that don't need to be in a <nav> element. a document may have several <nav> elements, for example, one for site navigation and one for intra-page navigation. aria-
labelledby can be used in such case to promote accessibility, see example. user agents, such as screen readers targeting disabled users, can use this element to determine whether to omit the initial rendering of navigation-only content. examples in this example, a <nav> block is used to contain an unordered list (<ul>) of links. with appropriate css, this can be presented as a sidebar, navigation b...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
it was generated by that web editing tool automatically and was not to be adjusted or entered by hand. this element has the distinction of being the first element to become one of the "lost tags" by being eliminated from the official public dtd's of the html versions. it is also probably one of the least understood of all of the early html elements. html "0.a" - from the beginning through january 10, 1991 this tag had not been invented as yet, so no examples are found from this period. ...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
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> element, the order is meaningful. for example: steps in a recipe turn-by-turn directions the list of ingredients in decreasing proportion on nutrition information
labels to determine which list to use, try changing the order of the list items; if the meaning changes, use the <ol> element — otherwise you can use <ul>. examples simple example <ol> <li>fee</li> <li>fi</li> <li>fo</li> <li>fum</li> </ol> the above html will output: using roman numeral type <ol type="i"> <li>introduction</li> <li>list of greivances</li> <li>conclusion</li> ...
<option>: The HTML Option element - HTML: Hypertext Markup Language
tmloptionelement attributes this element includes the global attributes. disabled if this boolean attribute is set, this option is not checkable. often browsers grey out such control and it won't receive any browsing event, like mouse clicks or focus-related ones. if this attribute is not set, the element can still be disabled if one of its ancestors is a disabled <optgroup> element.
label this attribute is text for the
label indicating the meaning of the option. if the
label attribute isn't defined, its value is that of the element text content. selected if present, this boolean attribute indicates that the option is initially selected. if the <option> element is the descendant of a <select> element whose multiple attribute is not set, only one single <option> of this <select> ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
ncisely describe the image or diagram's content. people experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence. a combination of the <figure> and <figcaption> elements, supplemented by a combination of an id and the aria role and aria-
labelledby attributes allow the preformatted text to be announced as an image, with the figcaption serving as the image's alternate description. example <figure role="img" aria-
labelledby="cow-caption"> <pre> ___________________________ < i'm an expert in my field. > --------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | ...
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
ent displays an indicator showing the completion progress of a task, typically displayed as a progress bar. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content,
labelable content, palpable content. permitted content phrasing content, but there must be no <progress> element among its descendants. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role progressbar permitted aria roles no role permitted do...
contenteditable - HTML: Hypertext Markup Language
repository. if 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 attribute must take one of the following values: true or an empty string, which indicates that the element is editable. false, which indicates that the element is not editable. if the attribute is given without a value, like <
label contenteditable>example
label</
label>, its value is treated as an empty string. if this attribute is missing or its value is invalid, its value is inherited from its parent element: so the element is editable if its parent is editable. note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one. you can set the color used to draw the ...
inputmode - HTML: Hypertext Markup Language
. numeric numeric input keyboard, but only requires the digits 0–9. devices may or may not show a minus key. tel a telephone keypad input, including the digits 0–9, the asterisk (*), and the pound (#) key. inputs that require a telephone number should typically use <input type="tel">instead. search a virtual keyboard optimized for search input. for instance, the return/submit key may be
labeled "search", along with possible other optimizations. inputs that require a search query should typically use <input type="search"> instead. email a virtual keyboard optimized for entering email addresses. typically includes the @ character as well as other optimizations. inputs that require email addresses should typically use <input type="email"> instead. url a keypad optimized for entering ...
title - HTML: Hypertext Markup Language
the title global attribute contains text representing advisory information related to the element it belongs to. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, 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 c...
Global attributes - HTML: Hypertext Markup Language
>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. tabindex is only supported on <a>, <area>, <button>, <object>, <select>, and <textarea>. accesskey is only supported on <a>, <area>, <button>, <input>, <
label>, <legend> and <textarea>. title is supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
Inline elements - HTML: Hypertext Markup Language
t of "inline" elements the following elements are inline by default (although block and inline elements are no longer defined in html 5, use content categories instead): <a> <abbr> <acronym> <audio> (if it has visible controls) <b> <bdi> <bdo> <big> <br> <button> <canvas> <cite> <code> <data> <datalist> <del> <dfn> <em> <embed> <i> <iframe> <img> <input> <ins> <kbd> <
label> <map> <mark> <meter> <noscript> <object> <output> <picture> <progress> <q> <ruby> <s> <samp> <script> <select> <slot> <small> <span> <strong> <sub> <sup> <svg> <template> <textarea> <time> <u> <tt> <var> <video> <wbr> see also block-level elements html element reference display content categories block and inline layout in normal flow ...
MIME types (IANA media types) - HTTP
ed with the multipart document as a whole) --aboundarystring content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundarystring content-disposition: form-data; name="myfield" (data) --aboundarystring (more subparts) --aboundarystring-- the following <form>: <form action="http://localhost:8000/" method="post" enctype="multipart/form-data"> <
label>name: <input name="mytextfield" value="test"></
label> <
label><input type="checkbox" name="mycheckbox"> check</
label> <
label>upload file: <input type="file" name="myfile" value="test.txt"></
label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 a...
Content-Location - HTTP
ccess message confirming the post was published. the server specifies where the new post is with content-location: http/1.1 201 created content-type: text/plain; charset=utf-8 content-location: /my-first-blog-post ✅ success! indicating the url of a transaction's result say you have a <form> for sending money to another user of a site. <form action="/send-payment" method="post"> <p> <
label>who do you want to send the money to? <input type="text" name="recipient"> </
label> </p> <p> <
label>how much? <input type="number" name="amount"> </
label> </p> <button type="submit">send money</button> </form> when the form is submitted, the site generates a receipt for the transaction. the server could use content-location to indicate that receipt's url for fu...
A re-introduction to JavaScript (JS tutorial) - JavaScript
= (age > 18) ? 'yes' : 'no'; the switch statement can be used for multiple branches based on a number or string: switch (action) { case 'draw': drawit(); break; case 'eat': eatit(); break; default: donothing(); } if you don't add a break statement, execution will "fall through" to the next level. this is very rarely what you want — in fact it's worth specifically
labeling deliberate fallthrough with a comment if you really meant it to aid debugging: switch (a) { case 1: // fallthrough case 2: eatit(); break; default: donothing(); } the default clause is optional. you can have expressions in both the switch part and the cases if you like; comparisons take place between the two using the === operator: switch (1 + 3) { case 2 + 2: yay()...
SyntaxError: function statement requires a name - JavaScript
n 'hello world'; } // syntaxerror: function statement requires a name you can use a function expression (assignment) instead: var greet = function() { return 'hello world'; }; or, you function is maybe intended to be an iife (immediately invoked function expression), which is a function that runs as soon as it is defined. you will need a few more braces in this case: (function () { })();
labeled functions if you are using function
labels, you will still need to provide a function name after the function keyword. this doesn't work: function greeter() { german: function () { return "moin"; } } // syntaxerror: function statement requires a name this would work, for example: function greeter() { german: function g() { return "moin"; } } object methods if you intended...
Arrow function expressions - JavaScript
keep in mind that returning object literals using the concise body syntax params => {object:literal} will not work as expected. var func = () => { foo: 1 }; // calling func() returns undefined! var func = () => { foo: function() {} }; // syntaxerror: function statement requires a name this is because the code inside braces ({}) is parsed as a sequence of statements (i.e. foo is treated like a
label, not a key in an object literal). you must wrap the object literal in parentheses: var func = () => ({ foo: 1 }); line breaks an arrow function cannot contain a line break between its parameters and its arrow. var func = (a, b, c) => 1; // syntaxerror: expected expression, got '=>' however, this can be amended by putting the line break after the arrow or using parentheses/braces as seen b...
block - JavaScript
a block statement (or compound statement in other languages) is used to group zero or more statements. the block is delimited by a pair of braces ("curly brackets") and may optionally be
labelled: the source for this interactive example is stored in a github repository. if 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 block statement { statementlist }
labelled block statement
labelidentifier: { statementlist } statementlist statements grouped within the block statement.
labelidentifier an optional
label for visual identification or as a target for break. description the block statement is often called compound statement in other languages. it allows you to use mult...
switch - JavaScript
use is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements. if no default clause is found, the program continues execution at the statement following the end of switch. by convention, the default clause is the last clause, but it does not need to be so. the optional break statement associated with each case
label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. if break is omitted, the program continues execution at the next statement in the switch statement. examples using switch in the following example, if expr evaluates to bananas, the program matches the value with case case 'bananas' and executes the as...
JavaScript reference - JavaScript
primary expressionsthis function class function* yield yield* async function await [] {} /ab+c/i ( ) null left-hand-side expressions property accessors new new.target super ...obj increment & decrement a++ a-- ++a --a unary operators delete void typeof ...
name - Web app manifests
name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the values of the dir and lang manifest members. ...
short_name - Web app manifests
short_name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the value of the dir and lang manifest members. ...
<mstyle> - MathML
ault value is 8pt. scriptsizemultiplier specifies the multiplier to be used to adjust font size due to changes in scriptlevel. the default value is 0.71. the <mstyle> element accepts all attributes of all presentation elements with the following exceptions: height, depth or width do not apply to <mglyph>, <mpadded> or <mtable>. rowalign, columnalign, or groupalign do not apply to <mtr>, <m
labeledtr>, <mtd> or <maligngroup>. lspace or voffset do not apply to <mpadded>. fontfamily does not apply to <mglyph>. align does not apply to <mtable> or <mstack>. index cannot be set on <mstyle>. src and alt on <mglyph> cannot be set on <mstyle>. actiontype on <maction> cannot be set on <mstyle>. examples using displaystyle and mathcolor to effect style changes in the layout of the whole su...
Web video codec guide - Web media technologies
ose is to be used to stream mpeg-4 audio and video over an rtp session. however, mp4v-es is also used to transmit mpeg-4 audio and video over a mobile connection using 3gp. you almost certainly don't want to use this format, since it isn't supported in a meaningful way by any major browsers, and is quite obsolete. files of this type should have the extension .mp4v, but sometimes are inaccurately
labeled .mp4. supported bit rates 5 kbps to 1 gbps and more supported frame rates no specific limit; restricted only by the data rate compression lossy dct-based algorithm supported frame sizes up to 4,096 x 4,096 pixels supported color modes ycrcb with chroma subsampling (4:2:0, 4:2:2, and 4:4:4) supported; up to 12 bits per component ...
Animation performance and frame rate - Web Performance
process a browser uses to paint changes to a page when an element is animating css properties can be described as a waterfall consisting of the following steps: recalculate style: when a property for an element changes, the browser must recalculate computed styles. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is
labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". the process a browser uses to paint updated changes to a canvas element is different. in the <canvas> scenar...
<a> - SVG: Scalable Vector Graphics
attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<circle> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<ellipse> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<foreignObject> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<g> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<line> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<marker> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<path> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<polygon> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<polyline> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<rect> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<svg> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<symbol> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<text> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<textPath> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attribut...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
the <title> element provides an accessible, short-text description of any svg container element or graphics element. text in a <title> element is not rendered as part of the graphic, but browsers usually display it as a tooltip. if an element can be described by visible text, it is recommended to reference that text with an aria-
labelledby attribute rather than using the <title> element. note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent. html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <circle cx="5" cy="5" r="4"> <title>i'm a circle</title> </circle> <rect x="11" y="1" width="8" height="8"> <title>i'm a square</title> </rect> </svg> attributes this element onl...
<tspan> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes ...
<use> - SVG: Scalable Vector Graphics
transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-
label, aria-
labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attribut...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><
label>enter something:</
label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin"...
Certificate Transparency - Web security
. potentially malicious certificates, such as those that violate the ca/b forum baseline requirements, can be detected and revoked much more quickly. browser vendors and root store maintainers are also empowered to make more informed decisions regarding problematic cas that they may decide to distrust. background ct logs are built upon the foundation of the merkle tree data structure. nodes are
labelled with the cryptographic hashes of their child nodes. leaf nodes contain hashes of actual pieces of data. the
label of the root node therefore depends on all other nodes in the tree. in the context of certificate transparency, the data hashed by the leaf nodes are the certificates that have been issued by the various different cas operating today. certificate inclusion can be verified via an au...
How to turn off form autocompletion - Web security
tocompletion for the form itself has been turned off. disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <
label for="cc">credit card:</
label> <input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autocomplete="off" on fields has two effects: it tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heuristics for complying vary by browser. it stops the browser from caching form data in the session history. when form dat...
Introduction to using XPath in JavaScript - XPath
match default elements in a non-null namespace (and one which works well for dynamic xpath expressions where the namespaces might not be known), involves referring to a particular element using a form such as [namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid']. this circumvents the problem of an xpath query not being able to detect the default namespace on a regularly
labeled element. getting specifically namespaced elements and attributes regardless of prefix if one wishes to provide flexibility in namespaces (as they are intended) by not necessarily requiring a particular prefix to be used when finding a namespaced element or attribute, one must use special techniques. while one can adapt the approach in the above section to test for namespaced elements regardl...
Understanding WebAssembly text format - WebAssembly
ing trees, and thus we can think of a module as a tree of nodes that describe the module’s structure and its code. unlike the abstract syntax tree of a programming language, though, webassembly’s tree is pretty flat, mostly consisting of lists of instructions. first, let’s see what an s-expression looks like. each node in the tree goes inside a pair of parentheses — ( ... ). the first
label inside the parenthesis tells you what type of node it is, and after that there is a space-separated list of either attributes or child nodes. so that means the webassembly s-expression: (module (memory 1) (func)) represents a tree with the root node “module” and two child nodes, a "memory" node with the attribute "1" and a "func" node. we’ll see shortly what these nodes actually mean. ...