Search completed in 1.25 seconds.
3098 results for "elements":
Your results are loading. Please wait...
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
this page lists all the html elements, which are created using tags.
...an alphabetical list of all elements is provided in the sidebar on every element's page as well as this one.
... for more information about the basics of html elements and attributes, see the section on elements in the introduction to html article.
...And 32 more matches
Pseudo-classes and pseudo-elements - Learn web development
previous overview: building blocks next the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements.
... a pseudo-class is a selector that selects elements that are in a specific state, e.g.
...take a look at some other examples on mdn: :last-child :only-child :invalid note: it is valid to write pseudo-classes and elements without any element selector preceding them.
...And 29 more matches
Images, media, and form elements - Learn web development
previous overview: building blocks next in this lesson we will take a look at how certain special elements are treated in css.
... images, other media, and form elements behave a little differently in terms of your ability to style them with css than regular boxes.
... prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the way that some elements behave unusually when styled with css.
...And 20 more matches
Using custom elements - Web Components
one of the key features of the web components standard is the ability to create custom elements that encapsulate your functionality on an html page, rather than having to make do with a long, nested batch of elements that together provide a custom page feature.
... this article introduces the use of the custom elements api.
... note: custom elements are supported by default in firefox, chrome, and edge (76).
...And 15 more matches
Document.getElementsByTagName() - Web APIs
the getelementsbytagname method of document interface returns an htmlcollection of elements with the given tag name.
...the returned htmlcollection is live, meaning that it updates itself automatically to stay in sync with the dom tree without having to call document.getelementsbytagname() again.
... syntax var elements = document.getelementsbytagname(name); elements is a live htmlcollection (but see the note below) of found elements in the order they appear in the tree.
...And 12 more matches
Custom XUL Elements with XBL - Archive of obsolete content
« previousnext » xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents.
... this somewhat cryptic explanation describes a very simple concept: with xbl you can create your own custom elements.
... with xbl you can define new elements and define their properties, attributes, methods and event handlers.
...And 10 more matches
Adding HTML Elements - Archive of obsolete content
« previousnext » now that we've added some buttons, let's add some other elements.
... adding html elements to a window in addition to all of the xul elements that are available, you can also add html elements directly within a xul file.
...you should avoid using html elements in xul files if you can.
...And 10 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom methods to xbl-defined elements.
...you can define custom methods for your elements using the method element.
...the method element contains two type of child elements, parameter elements which describe the parameters to the method and body which contains the script for the method.
...And 10 more matches
Element.getElementsByTagName() - Web APIs
the element.getelementsbytagname() method returns a live htmlcollection of elements with the given tag name.
...therefore, there is no need to call element.getelementsbytagname() with the same element and arguments repeatedly if the dom changes in between calls.
... when called on an html element in an html document, getelementsbytagname lower-cases the argument before searching for it.
...And 10 more matches
Document.getElementsByTagNameNS() - Web APIs
returns a list of elements with the given tag name belonging to the given namespace.
... syntax elements = document.getelementsbytagnamens(namespace, name) elements is a live nodelist (but see the note below) of found elements in the order they appear in the tree.
... namespace is the namespace uri of elements to look for (see element.namespaceuri).
...And 9 more matches
Elements - Archive of obsolete content
bindings contains zero or more binding elements as children.
... each binding child element defines a unique binding that can be attached to elements in other documents.
...firefox 2) it is impossible to attach bindings to table sub-elements (rows, cells etc.) you can attach binding only to the table element itself.
...And 8 more matches
Document.getElementsByClassName() - Web APIs
the getelementsbyclassname method of document interface returns an array-like object of all child elements which have all of the given class name(s).
...you may also call getelementsbyclassname() on any element; it will return only elements which are descendants of the specified root element with the given class name(s).
... syntax var elements = document.getelementsbyclassname(names); // or: var elements = rootelement.getelementsbyclassname(names); elements is a live htmlcollection of found elements.
...And 7 more matches
Document.getElementsByName() - Web APIs
the getelementsbyname() method of the document object returns a nodelist collection of elements with a given name in the document.
... syntax var elements = document.getelementsbyname(name); elements is a live nodelist collection, meaning it automatically updates as new elements with the same name are added to/removed from the document.
... example <!doctype html> <html lang="en"> <title>example: using document.getelementsbyname</title> <input type="hidden" name="up"> <input type="hidden" name="down"> <script> var up_names = document.getelementsbyname("up"); console.log(up_names[0].tagname); // displays "input" </script> </html> notes the name attribute can only be applied in (x)html documents.
...And 7 more matches
Element.getElementsByClassName() - Web APIs
the element method getelementsbyclassname() returns a live htmlcollection which contains every descendant element which has the specified class name or names.
... the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root.
... syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace.
...And 6 more matches
Element.getElementsByTagNameNS() - Web APIs
the element.getelementsbytagnamens() method returns a live htmlcollection of elements with the given tag name belonging to the given namespace.
... it is similar to document.getelementsbytagnamens, except that its search is restricted to descendants of the specified element.
... syntax elements = element.getelementsbytagnamens(namespaceuri, localname) elements is a live htmlcollection of found elements in the order they appear in the tree.
...And 6 more matches
Block-level elements - HTML: Hypertext Markup Language
html (hypertext markup language) elements historically were categorized as either "block-level" elements or "inline-level" elements.
... the following example demonstrates the block-level element's influence: block-level elements html <p>this paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p> css p { background-color: #8abb55; } usage block-level elements may appear only within a <body> element.
...inline there are a couple of key differences between block-level elements and inline elements: content model generally, block-level elements may contain inline elements and (sometimes) other block-level elements.
...And 6 more matches
Inline elements - HTML: Hypertext Markup Language
html (hypertext markup language) elements historically were categorized as either "block-level" elements or "inline-level" elements.
... inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content.
... in this article, we'll examine html inline-level elements and how they differ from block-level elements.
...And 6 more matches
Window.customElements - Web APIs
the customelements read-only property of the window interface returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
... examples the most common example you'll see of this property being used is to get access to the customelementregistry.define() method to define and register a new custom element, e.g.: let customelementregistry = window.customelements; customelementregistry.define('my-custom-element', mycustomelement); however, it is usually shortened to something like the following: customelements.define('element-details', class extends htmlelement { constructor() { super(); const template = document .getelementbyid('element-details-template') .content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(template.clonenode(true)); } } ); see our web-components-examples repo for more usage examples.
... specification specification status comment html living standardthe definition of 'window.customelements' in that specification.
...And 5 more matches
Replaced elements - CSS: Cascading Style Sheets
put in simpler terms, they're elements whose contents are not affected by the current document's styles.
...some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document.
... replaced elements typical replaced elements are: <iframe> <video> <embed> <img> some elements are treated as replaced elements only in specific cases: <option> <audio> <canvas> <object> <applet> html spec also says that an <input> element can be replaced, because <input> elements of the "image" type are replaced elements similar to <img>.
...And 5 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
with css, there are lots of ways to add color to your html elements to create just the look you want.
...instead, let's look at things in terms of the kinds of things that are drawn in the elements, such as text and borders and so forth.
...this is only useful in elements that are editable, such as <input> and <textarea> or elements whose html contenteditable attribute is set.
...And 5 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom properties to xbl-defined elements.
... the xbl interface javascript and the dom provide access to get and set the properties of elements.
... with xbl, you can define your own properties for the elements you create.
...And 4 more matches
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
the angle_instanced_arrays.drawelementsinstancedangle() method of the webgl api renders primitives from array data like the gl.drawelements() method.
... in addition, it can execute multiple instances of a set of elements.
... note: when using webgl2, this method is available as gl.drawelementsinstanced() by default.
...And 4 more matches
HTMLSlotElement.assignedElements() - Web APIs
the assignedelements() property of the htmlslotelement interface returns a sequence of the elements assigned to this slot (and no other nodes).
... if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
... syntax var assignedelements = htmlslotelement.assignedelements(options) parameters options optional an object that sets options for the nodes to be returned.
...And 4 more matches
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
the webgl2renderingcontext.drawelementsinstanced() method of the webgl 2 api renders primitives from array data like the gl.drawelements() method.
... in addition, it can execute multiple instances of a set of elements.
... syntax void gl.drawelementsinstanced(mode, count, type, offset, instancecount); parameters mode a glenum specifying the type primitive to render.
...And 4 more matches
AudioContext.createMediaElementSource() - Web APIs
the createmediaelementsource() method of the audiocontext interface is used to create a new mediaelementaudiosourcenode object, given an existing html <audio> or <video> element, the audio from which can then be played and manipulated.
... syntax var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); parameters mymediaelement an htmlmediaelement object that you want to feed into an audio processing graph to manipulate.
... example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback.
...And 3 more matches
HTMLFormElement.elements - Web APIs
the htmlformelement property elements returns an htmlformcontrolscollection listing all the form controls contained in the <form> element.
... syntax nodelist = htmlformelement.elements value an htmlformcontrolscollection containing all non-image controls in the form.
... the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
...And 3 more matches
NonDocumentTypeChildNode.nextElementSibling - Web APIs
the nondocumenttypechildnode.nextelementsibling read-only property returns the element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list.
... syntax var nextnode = elementnodereference.nextelementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("nextelementsibling" in document.documentelement)){ object.defineproperty(element.pro...
...totype, "nextelementsibling", { get: function(){ var e = this.nextsibling; while(e && 1 !== e.nodetype) e = e.nextsibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/nextelementsibling/nextelementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('nextelementsibling')) { return; } object.defineproperty(item, 'nextelementsibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.nodetype === 1) { return el; } } return null; ...
...And 3 more matches
Adding more elements - Archive of obsolete content
adding elements to our find files example we will add some more elements to the find files dialog now.
...if you resize the window vertically, the elements do not change size.
...the first spacer adds extra spacing in between the title label and the search criteria elements.
...And 2 more matches
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
the mselementsfromrect method returns the node list of elements that are under a rectangle defined by left, top, width, and height.
... syntax object.mselementsfromrect(left, top, width, height, retval) parameters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y).
... to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height).
...And 2 more matches
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list.
... syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when it loads: siblings of div-03 1.
...div polyfills polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("previouselementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "previouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.nodetype) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/previouselementsibling/previouselementsibling.md (function (arr) { arr.foreach(function (item) { if (item.
...And 2 more matches
WebGL2RenderingContext.drawRangeElements() - Web APIs
the webgl2renderingcontext.drawrangeelements() method of the webgl api renders primitives from array data in a given range.
... syntax void gl.drawrangeelements(mode, start, end, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... count a glsizei specifying the number of elements to be rendered.
...And 2 more matches
WebGLRenderingContext.drawElements() - Web APIs
the webglrenderingcontext.drawelements() method of the webgl api renders primitives from array data.
... syntax void gl.drawelements(mode, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... count a glsizei specifying the number of elements to be rendered.
...And 2 more matches
Pseudo-elements - CSS: Cascading Style Sheets
*/ p::first-line { color: blue; text-transform: uppercase; } note: in contrast to pseudo-elements, pseudo-classes can be used to style an element based on its state.
...this distinguishes pseudo-classes from pseudo-elements.
... however, since this distinction was not present in older versions of the w3c spec, most browsers support both syntaxes for the original pseudo-elements.
...And 2 more matches
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
jank problems when loading images in the olden days of web development, it was always seen as a good practice to add width and height attributes to your html <img> elements, so that when browsers first loaded the page, they could put a correctly-sized placeholder box in the layout for each image to appear in when it finally loads.
...firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements, and other related elements that accept width and height attributes.
... note: currently this effect is being limited to actual <img> elements, as applying to other such elements may have undesirable results.
...And 2 more matches
getElementsByAttributeNS - Archive of obsolete content
« xul reference home getelementsbyattributens(ns, attrib, value ) return type: dom nodelist returns an array of all the child elements of the element that have the attribute namespace given by the first argument, the attribute name given by the second argument, and the value given by the third argument.
... if the namespace (first argument) is set to '*', elements with any attribute namespace will be retrieved.
... if the third argument is '*', the elements retrieved may have the attribute (second argument) set to any value.
... note that this method is only available on xul elements and is not part of the dom.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add event handlers to xbl-defined elements.
... event handlers as you might expect, mouse clicks, key presses and other events are passed to each of the elements inside the content.
...you can add event handlers to the elements inside the content if needed.
...handler element however, you may want to add an event handler to the entire contents, that is, all the elements defined in the content tag.
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
the elementsfrompoint() method of the documentorshadowroot interface returns an array of all elements at the specified coordinates (relative to the viewport).
... syntax const elements = document.elementsfrompoint(x, y); parameters x the horizontal coordinate of a point.
... example html <div> <p>some text</p> </div> <p>elements at point 30, 20:</p> <div id="output"></div> javascript let output = document.getelementbyid("output"); if (document.elementsfrompoint) { let elements = document.elementsfrompoint(30, 20); for (var i = 0; i < elements.length; i++) { output.textcontent += elements[i].localname; if (i < elements.length - 1) { output.textcontent += " < "; } } } else { output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.elementsfrompoint()</code>" + "</span>"; } specifications specification status shadow domthe definition of 'elementsfrompoint()' in that specification...
... obsolete css object model (cssom) view modulethe definition of 'elementsfrompoint()' in that specification.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
the html <h1>–<h6> elements represent six levels of section headings.
... implicit aria role heading permitted aria roles tab, presentation or none dom interface htmlheadingelement attributes these elements only include the global attributes.
... <h1>heading elements</h1> <h2>summary</h2> <p>some text here...</p> <h2>examples</h2> <h3>example 1</h3> <p>some text here...</p> <h3>example 2</h3> <p>some text here...</p> <h2>see also</h2> <p>some text here...</p> here is the result of this code: accessibility concerns navigation a common navigation technique for users of screen reading software is jumping from heading to heading to quickly determine the...
getElementsByAttribute - Archive of obsolete content
« xul reference home getelementsbyattribute( attrib, value ) return type: dom nodelist returns a nodelist of all the child elements of the element that have the attribute given by the first argument set to the value given by the second argument.
... note that this method is only available on xul elements; it is not part of the w3c dom.
Reposition elements in the page - Firefox Developer Tools
new in firefox 48 starting in firefox 48 you can move absolutely positioned elements by dragging them around the page.
...for relatively positioned elements the dashed lines indicate the original position of the node.
Locating DOM elements using selectors - Web APIs
selectors the selector methods accept one or more comma-separated selectors to determine what element or elements should be returned.
... for example, to select all paragraph (p) elements in a document whose css class is either warning or note, you can do the following: var special = document.queryselectorall( "p.warning, p.note" ); you can also query by id.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are two types of elements discussed here: top-level elements and instructions.
... on a related note, any attribute in an lre and some attributes of a limited number of xslt elements can also include what is known as an attribute value template.
preferenceElements - Archive of obsolete content
« xul reference preferenceelements type: dom nodelist holds a list of the ui elements in the pane that are attached to preferences.
Test your skills: Images and Form elements - Learn web development
the aim of this task is to help you check your understanding of some of the values and units that we looked at in the lesson on images, media and form elements.
hasMoreElements
documentation is now located at nsisimpleenumerator.hasmoreelements().
Select and highlight elements - Firefox Developer Tools
the highlighted element is the element that's overlaid in the page with a graphic showing the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
Determining the dimensions of elements - Web APIs
there are several properties you can look at in order to determine the width and height of elements, and it can be tricky to determine which is the right one for your needs.
Index - Archive of obsolete content
41 addon-page add-on sdk, add-ons, extensions, obsolete, reference create a page that does not contain navigational elements.
...xul <iframe> elements) that are not displayed to the user.
... 279 custom xul elements with xbl no summary!
...And 226 more matches
Index - Web APIs
WebAPIIndex
in addition, it can execute multiple instances of the range of elements.
... 4 angle_instanced_arrays.drawelementsinstancedangle() angle_instanced_arrays, api, method, reference, webgl, webgl extension the angle_instanced_arrays.drawelementsinstancedangle() method of the webgl api renders primitives from array data like the gl.drawelements() method.
... in addition, it can execute multiple instances of a set of elements.
...And 205 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
2 &lt;statusbarpanel&gt; deprecated, xul, xul elements, xul reference an individual element of a statusbar.
... 6 flexgroup "flexgroup" is used to group flexible elements together and should be set to an integer.
... elements with a lower flexgroup are flexed first.
...And 193 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
3 applying color to html elements using css beginner, css, css colors, guide, html, html colors, html styles, styling html, color with css, there are lots of ways to add color to your html elements to create just the look you want.
... 4 block-level elements beginner, development, guide, html, html5, web html (hypertext markup language) elements historically were categorized as either "block-level" elements or "inline-level" elements.
... 6 date and time formats used in html date, element, format, html, iso 8601, input, reference, string, time, week, datetime, datetime-local, del, ins, month, month-year, week-year certain html elements use date and/or time values.
...And 61 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
because a xul document is also an xml document, it can contain xhtml, svg, mathml, and other elements; if you use external entity references, the xml document's contents are modularized; combined with other xml-related technologies, such as dom, xlink, or xslt, you can use it for a number of different applications.
... reading in style sheets xul uses css to specify the appearance of its elements.
...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.
...And 45 more matches
XUL element attributes - Archive of obsolete content
« xul reference home the following attributes are common to all xul elements: align type: one of the values below the align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
... start child elements are aligned starting from the left or top edge of the box.
... center extra space is split equally along each side of the child elements, resulting in the children being placed in the center of the box.
...And 34 more matches
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
... there are a number of different types of positioning that you can put into effect on html elements.
...this is very similar to static positioning, except that once the positioned element has taken its place in the normal layout flow, you can then modify its final position, including making it overlap other elements on the page.
...And 28 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types.
... 13 svg attribute reference drawing, landing, needshelp, overview, responsive design, svg, svg attribute, svg reference, vector graphics svg elements can be modified using attributes that specify details about exactly how the element should be handled or rendered.
... 14 svg conditional processing attributes intermediate, needsexample, property, reference, svg the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered.
...And 27 more matches
Content categories - Developer guides
every html element is a member of one or more content categories — these categories group elements that share common characteristics.
... this is a loose grouping (it doesn't actually create a relationship among elements of these categories), but they help define and describe the categories' shared behavior and their associated rules, especially when you come upon their intricate details.
... it's also possible for elements to not be a member of any of these categories.
...And 26 more matches
Element Positioning - Archive of obsolete content
box element positioning so far, we know how to position elements either horizontally or vertically inside a box.
... we will often need more control over the position and size of elements within the box.
...some elements, such as textboxes have a default size, which will be used.
...And 25 more matches
Templates - Archive of obsolete content
« previousnext » in this section, we'll find out how to populate elements with data.
... populating elements xul provides a method in which we create elements from data supplied by rdf, either from an rdf file or from an internal datasource.
... usually, elements such as treeitems and menuitems will be populated with data.
...And 25 more matches
Text labels and names - Accessibility
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.
... examples the following example show a simple image map (taken from h24: providing text alternatives for the area elements of image maps): <img src="welcome.gif" usemap="#map1" alt="areas in the library.
... 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.
...And 23 more matches
Index - Learn web development
css is what you use to selectively style html elements.
...html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way.
... 107 css selectors attribute, beginner, css, class, learn, pseudo, selectors, id in css, selectors are used to target the html elements on our web pages that we want to style.
...And 22 more matches
Indexed collections - JavaScript
creating an array the following statements create equivalent arrays: let arr = new array(element0, element1, ..., elementn) let arr = array(element0, element1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements.
... when these values are specified, the array is initialized with them as the array's elements.
...calling arr.length will return arraylength, but the array doesn't contain any elements.
...And 22 more matches
Getting started with HTML - Learn web development
to get you started, this article defines elements, attributes, and all the other important terms you may have heard.
...you will learn how html elements are structured, how a typical html page is structured, and other important basic language features.
... objective: to gain basic familiarity with html, and practice writing a few html elements.
...And 21 more matches
XUL accessibility guidelines - Archive of obsolete content
by default, the tab order is determined by the order of the elements in the underlying code.
... ensure that tab order is logical and all interactive elements can be accessed simply without the use of a mouse.
...consider using context menu items or other xul elements along with keyboard shortcuts.
...And 20 more matches
WAI-ARIA basics - Learn web development
for example, html5 introduced a number of semantic elements to define common page features (<nav>, <footer>, etc.) before these were available, developers would simply use <div>s with ids or classes, e.g.
...as a result, developers quite often rely on javascript libraries that generate such controls as a series of nested <div>s or table elements with classnames, which are then styled using css and controlled using javascript.
... the problem here is that visually they work, but screenreaders can't make any sense of what they are at all, and their users just get told that they can see a jumble of elements with no semantics to describe what they mean.
...And 20 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
for example, you should not delete elements of an array during the enumeration as this will often confuse the loop which is enumerating the array.
...enumerators are used to access the elements in an ordered way, without relying on the underlying array type.
...this basic interface only allows querying of existing elements in the array.
...And 20 more matches
Using HTML sections and outlines - Developer guides
the html5 specification introduced several semantic sectioning elements to help organize the structure of documents.
... semantic sectioning elements are specifically designed to communicate structural meaning to browsers and other technologies interpreting the document on behalf of users, such as screen readers and voice assistants.
... semantic sectioning elements clarify the larger-scale structures within a document.
...And 20 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
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.
... 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.
... htmlformelement.elements when an input element is given a name, that name becomes a property of the owning form element's htmlformelement.elements property.
...And 20 more matches
Anonymous Content - Archive of obsolete content
xbl content xbl can be used to automatically add a set of elements inside another element.
... the xul file only needs to specify the outer element while the inner elements are described in the xbl.
...mechanisms are provided for adding attributes to the inner elements that were specified on the outer element.
...And 19 more matches
The HTML DOM API - Web APIs
the html dom api is made up of the interfaces that define the functionality of each of the elements in html, as well as any supporting types and interfaces they rely upon.
... the functional areas included in the html dom api include: access to and control of html elements via the dom.
... management of media connected to the html media elements (<audio> and <video>).
...And 19 more matches
display - CSS: Cascading Style Sheets
WebCSSdisplay
run-in elements act like inlines or blocks, depending on the surrounding elements.
... table these elements behave like html <table> elements.
...it behaves like the corresponding html <ruby> elements.
...And 19 more matches
position - CSS: Cascading Style Sheets
WebCSSposition
the top, right, bottom, and left properties determine the final location of positioned elements.
...the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
...its effect on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined.
...And 19 more matches
Layout System Overview - Archive of obsolete content
this paged presentation presents several challenges not present in the galley presentation, namely how to break up elements that are larger than a single page, and how to handle changes to page dimensions.
...generally frames correspond to the content elements, though there is often a one-to-many correspondence between content elements and frames.
...in the case of the html-specific elements, the frame types that correspond to the element are hard-coded, but in the more general case where the display type is needed, the layout system must determine that display type by using the style system.
...And 18 more matches
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
« previousnext » xul has a set of elements for creating tabular grids.
... xul tabular layout xul has a set of elements for doing layout of elements in a grid-like manner using the grid element.
...the grid does not display anything itself; it is used only to position elements in a tabular form with rows and columns.
...And 18 more matches
Introduction to CSS layout - Learn web development
css page layout techniques allow us to take elements contained in a web page and control where they are positioned relative to their default position in normal layout flow, the other elements around them, their parent container, or the main viewport/window.
...let's look at a quick html example: <p>i love my cat.</p> <ul> <li>buy cat food</li> <li>exercise</li> <li>cheer up friend</li> </ul> <p>the end!</p> by default, the browser will display this code as follows: note here how the html is displayed in the exact order in which it appears in the source code, with elements stacked up on top of one another — the first paragraph, followed by the unordered list, followed by the second paragraph.
... the elements that appear one below the other are described as block elements, in contrast to inline elements, which appear one beside the other, like the individual words in a paragraph.
...And 18 more matches
StringView - Archive of obsolete content
(nfrstchr - 0xd800 /* 55296 */ << 10) + achars[nidx + 1] + 0x2400 /* 9216 */ : nfrstchr; }; stringview.pututf16charcode = function (atarget, nchar, nputat) { var nidx = nputat; if (nchar < 0x10000 /* 65536 */) { /* one element */ atarget[nidx++] = nchar; } else { /* two elements */ atarget[nidx++] = 0xd7c0 /* 55232 */ + (nchar >>> 10); atarget[nidx++] = 0xdc00 /* 56320 */ + (nchar & 0x3ff /* 1023 */); } return nidx; }; stringview.getutf16charlength = function (nchar) { return nchar < 0x10000 ?
... startoffset optional a number expressing: the start offset of the new stringview in bytes if the input argument is an arraybuffer the start offset of the new stringview in raw elements if the input argument is a typed array or other ordered object the start offset of the new stringview in codepoints if the input argument is a stringview or a string if not specified (or specified as null) it will default to 0.
... length optional a number expressing in codepoints the length of the new stringview if the input argument is a string or a stringview, or in raw elements if the input is a typed array, an arraybuffer or any other kind of ordered object (like array, collections, etc.).
...And 17 more matches
The Box Model - Archive of obsolete content
this is the system that determines how all elements are laid out visually in a xul document.
... any xul interface can be broken down into the following basic components: boxes text images alignment and flexibility widths and heights margins and paddings menus, toolbar buttons, and even the most complex elements in xul are composed of these simple ingredients.
... complex elements are created from simpler ones through xbl, which will be covered later on.
...And 17 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
you will learn how to create, access and control, and remove html elements dynamically.
... example: creating an html table dynamically (sample1.html) html <input type="button" value="generate a table." onclick="generate_table()"> javascript function generate_table() { // get the reference for the body var body = document.getelementsbytagname("body")[0]; // creates a <table> element and a <tbody> element var tbl = document.createelement("table"); var tblbody = document.createelement("tbody"); // creating all cells for (var i = 0; i < 2; i++) { // creates a table row var row = document.createelement("tr"); for (var j = 0; j < 2; j++) { // create a <td> element and a text node, make the text ...
...; cell.appendchild(celltext); row.appendchild(cell); } // add the row to the end of the table body tblbody.appendchild(row); } // put the <tbody> in the <table> tbl.appendchild(tblbody); // appends <table> into <body> body.appendchild(tbl); // sets the border attribute of tbl to 2; tbl.setattribute("border", "2"); } note the order in which we created the elements and the text node: first we created the <table> element.
...And 17 more matches
Array - JavaScript
neither the length of a javascript array nor the types of its elements are fixed.
...the array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties.
... console.log(vegetables) // ["cabbage", "carrot"] (the original array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fruits.slice() // this is how to make a copy // ["strawberry", "mango"] accessing array elements javascript arrays are zero-indexed.
...And 17 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
in this guide, we will explore the basics of how block and inline elements behave when they are part of the normal flow.
... the behaviour of elements which have a block or inline formatting context is also defined in this specification.
... for elements with a block formatting context, the spec says: “in a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block.
...And 16 more matches
Adding Style Sheets - Archive of obsolete content
« previousnext » we have hardly modified the look of the elements we have created so far.
... xul uses css (cascading style sheets) to customize elements.
... style sheets a style sheet is a file which contains style information for elements.
...And 15 more matches
Box Objects - Archive of obsolete content
various pieces of information are used such as the tag name, the attributes on an element, various css properties, the elements and layout objects around the element, and the xbl associated with an element (xbl is described in a later section).
... unless you change the style for an element, most xul elements will usually use the box layout object or one of its subtypes.
... recall that all xul elements are types of boxes, that is the box is the base of all displayed xul elements.
...And 15 more matches
The box model - Learn web development
padding, margin and border will cause other elements to be pushed away from the box unless we decide to change the display type to inline, elements such as headings (e.g.
... the <a> element, used for links, <span>, <em> and <strong> are all examples of elements that will display inline by default.
... boxes also have an inner display type, however, which dictates how elements inside that box are laid out.
...And 15 more matches
Introduction to the DOM - Web APIs
for example, the standard dom specifies that the getelementsbytagname method in the code below must return a list of all the <p> elements in the document: const paragraphs = document.getelementsbytagname("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc.
...that is to say, it's written in javascript, but it uses the dom to access the document and its elements.
...elements).
...And 15 more matches
Accessibility documentation index - Accessibility
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.
...its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name.
...here's where to file bugs: 13 using aria: roles, states, and properties aria, accessibility, overview, reference aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role.
...And 15 more matches
CSS selectors - CSS: Cascading Style Sheets
css selectors define the elements to which a set of css rules apply.
... basic selectors universal selector selects all elements.
... syntax: * ns|* *|* example: * will match all the elements of the document.
...And 15 more matches
Global attributes - HTML: Hypertext Markup Language
global attributes are attributes common to all html elements; they can be used on all elements, though they may have no effect on some elements.
... global attributes may be specified on all html elements, even those not specified in the standard.
... that means that any non-standard elements must still permit these attributes, even though using those elements means that the document is no longer html5-compliant.
...And 15 more matches
Mozilla XForms User Interface - Archive of obsolete content
introduction this article is a quick reference of the xforms user interface elements.
... mainly this is aimed to document how xforms elements will be presented in mozilla since the xforms specifications give only a hint of how controls might be rendered.
...the xforms specs define two kinds of xforms ui elements, called 'form controls' and 'xforms user interface'.
...And 14 more matches
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next a great deal of web content can be made accessible just by making sure the correct hypertext markup language elements are used for the correct purpose at all times.
...this means using the correct html elements for their intended purpose as much as possible.
... there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors.
...And 14 more matches
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next a great deal of web content can be made accessible just by making sure the correct hypertext markup language elements are used for the correct purpose at all times.
...this means using the correct html elements for their intended purpose as much as possible.
... there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors.
...And 14 more matches
Normal Flow - Learn web development
previous overview: css layout next this article explains normal flow, or the way that webpage elements lay themselves out if you have not changed their layout.
... as detailed in the last lesson introducing layout, elements on a webpage lay out in the normal flow, if you have not applied any css to change the way they behave.
... and, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or removing them from it altogether.
...And 14 more matches
Starting WebLock
this interface allows you to pass a list of elements between interfaces.
... it has two methods: hasmoreelements() and getnext().
... [scriptable, uuid(d1899240-f9d2-11d2-bdd6-000064657374)] interface nsisimpleenumerator : nsisupports { /** * called to determine whether or not the enumerator has * any elements that can be returned via getnext().
...And 14 more matches
MathML documentation index - MathML
WebMathMLIndex
7 values guide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for size or spacing.
... 8 mathml documentation index index, mathml found 40 pages: 9 mathml element reference mathml, mathml reference this is an alphabetical list of mathml presentation elements.
...in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
...And 14 more matches
Anonymous Content - Archive of obsolete content
an element declared in a bound document using a single tag can then be constructed out of multiple child elements, and this implementation is hidden from the bound document.
...elements and attributes in the xbl namespace are never cloned.
...when anonymous content elements are built above the bound element, the topmost elements' parentnode pointers are set to the bound element's parentnode.
...And 13 more matches
Building accessible custom components in XUL - Archive of obsolete content
assistive technologies could only see the generic html markup used to build the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a treeview).
... by implementing dhtml accessibility techniques, web developers can declare that generic html elements are really acting as specific gui controls (such as a treeitem within a treeview).
...firefox ships with a tabbox element and a tree element, and these elements are fully accessible out-of-the-box.
...And 13 more matches
Box Model Details - Archive of obsolete content
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.
...because all three elements are flexible, but they don't need any more room, the flexibility adds no extra space.
...you can also prevent this stretching by placing a maximum height on the elements or, better, on the box itself.
...And 13 more matches
Broadcasters and Observers - Archive of obsolete content
« previousnext » there may be times when you want several elements to respond to events or changes of state easily.
... command 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.
...And 13 more matches
Skinning XUL Files by Hand - Archive of obsolete content
following the instructions here, you are going to create a skin for a xul file and apply it by specifying classes for all of the interested elements.
...as you will see, css provides a lot of flexibility for defining styles to individual elements, to classes of elements, to pseudo-classes, and to anonymous classes.
... 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.
...And 12 more matches
The Box Model - Archive of obsolete content
elements inside of a box will orient themselves horizontally or vertically.
... by combining a series of boxes, spacers and elements with flex and pack attributes, you can control the layout of a window.
...a horizontal box lines up its elements horizontally and a vertical box orients its elements vertically.
...And 12 more matches
XUL controls - Archive of obsolete content
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.
... 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.
... groupbox reference related elements: caption <filefield> allows the user to select a file.
...And 12 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
12 accessibility tree (aom) aom, accessibility, dom, glossary, reference the accessibility tree, or accessibility object model (aom), contains accessibility-related information for most html elements.
... 128 empty element codingscripting, glossary, intermediate an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes).
... 135 event codingscripting, glossary events are assets generated by dom elements, which can be manipulated by a javascript code.
...And 12 more matches
Styling web forms - Learn web development
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.
... 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.
...And 12 more matches
HTML basics - Learn web development
html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way.
... elements can also have attributes that look like the following: attributes contain extra information about the element that you don't want to appear in the actual content.
...the class attribute allows you to give the element a non-unique identifier that can be used to target it (and any other elements with the same class value) with style information and other things.
...And 12 more matches
Accessibility API cross-reference
the roles it specifies have already informed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5.
... aria can be used to 'fill out' the missing semantics of html, but may also be used in other markup languages (such as svg) and expresses semantics using attributes, compared with html, which tends to have distinct named elements for its roles.
...in tagged pdf n/a n/a expressed with aria-labelledby if visible on screen or aria-label otherwise <caption> (for tables), <figcaption> (for figures), and <label> with a for attribute (for input elements) a <toc> or <l> may contain a <caption> as its first item <caption> or <lbl> a cell in a table cell n/a table_cell cell <td> td not what you think - this is for the damn paperclip character n/a n/a n/a for graphics representing data chart n/a figure ?
...And 12 more matches
Plug-in Basics - Plugins
the way the content provider uses html elements to invoke the plug-in determines its display mode: whether it is embedded in a page, is part of a section, appears on its own separate page, or is hidden.
... this section discusses using html elements and display modes.
...for details about the html elements and their attributes, go on to: using the object element for plug-in display using the embed element for plug-in display plug-in display modes whether you are writing an html page to display a plug-in or developing a plug-in for an html author to include in a page, you need to understand how the display mode affects the way plug-ins appear.
...And 12 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
in the case of html, whitespace is largely ignored — whitespace in between words is treated as a single character, and whitespace at the start and end of elements and outside elements is ignored.
...creating space around and inside elements is the job of css.
... any whitespace characters that are outside of html elements in the original document are represented in the dom.
...And 12 more matches
Web Components
web components is a suite of different technologies allowing you to create reusable custom elements — with their functionality encapsulated away from the rest of your code — and utilize them in your web apps.
... web components aims to solve such problems — it consists of three main technologies, which can be used together to create versatile custom elements with encapsulated functionality that can be reused wherever you like without fear of code collisions.
... custom elements: a set of javascript apis that allow you to define custom elements and their behaviour, which can then be used as desired in your user interface.
...And 12 more matches
jspage - Archive of obsolete content
;}return b;}var browser=$merge({engine:{name:"unknown",version:0},platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.queryselectorall)?6:5):4);},webkit:function(){return(navigator.taintenabled)?false:((browser.features.xpath)?((browser.features.query)?525:420):419); },gecko:function(){return(!document.getboxobjectfor&&window.mozinnerscreenx==null)?false:((document.getelementsbyclassname)?19:18);}}...
...ent.prototype=(browser.engine.webkit)?window["[[domelement.prototype]]"]:{}; }a.document.window=a;return $extend(a,window.prototype);},afterimplement:function(b,a){window[b]=window.prototype[b]=a;}});window.prototype={$family:{name:"window"}}; new window(window);var document=new native({name:"document",legacy:(browser.engine.trident)?null:window.document,initialize:function(a){$uid(a);a.head=a.getelementsbytagname("head")[0]; a.html=a.getelementsbytagname("html")[0];if(browser.engine.trident&&browser.engine.version<=4){$try(function(){a.execcommand("backgroundimagecache",false,true); });}if(browser.engine.trident){a.window.attachevent("onunload",function(){a.window.detachevent("onunload",arguments.callee);a.head=a.html=a.window=null; });}return $extend(a,document.prototype);},afterimplement:functi...
...-z]/).test(a)){continue;}this.addevent(a,this.options[a]); delete this.options[a];}return this;}});var element=new native({name:"element",legacy:window.element,initialize:function(a,b){var c=element.constructors.get(a); if(c){return c(b);}if(typeof a=="string"){return document.newelement(a,b);}return document.id(a).set(b);},afterimplement:function(a,b){element.prototype[a]=b; if(array[a]){return;}elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); if(g){g=($type(f)=="element");}}return(g)?new elements(c):c;});}});element.prototype={$family:{name:"element"}};element.constructors=new hash;var iframe=new native({name:"iframe",generics:false,initialize:function(){var f=array.link(arguments,{properties:object.type,ifram...
...And 11 more matches
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
the tree one of the more complex elements in xul is the tree.
... the set of columns is defined by a number of treecol elements, one for each column.
...this is because there are no elements that display the individual cells, like there is with the listbox.
...And 11 more matches
How to build custom form controls - Learn web development
when it comes to standardized elements, of which the <select> is one, the specification authors spent an inordinate amount of time specifying all interactions for every use case for every input device.
...layed, we'll see later how to handle the real value that will be sent with the form data --> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> note the use of class names; these identify each relevant part regardless of the actual underlying html elements used.
... .widget select, .no-widget .select { /* this css selector basically says: - either we have set the body class to "widget" and thus we hide the actual <select> element - or we have not changed the body class, therefore the body class is still "no-widget", so the elements whose class is "select" must be hidden */ position : absolute; left : -5000em; height : 0; overflow : hidden; } this css visually hides one of the elements, but it is still available to screen readers.
...And 11 more matches
Handling common accessibility problems - Learn web development
html semantic html (where the elements are used for their correct purpose) is accessible right out of the box — such content is readable by sighted viewers (provided you don't do anything silly like make the text way too small or hide it using css), but will also be usable by assistive technologies like screen readers (apps that literally read out a web page to their user), and confer other advantages too.
...the elements that have this capability are the common ones that allow user to interact with web pages, namely links, <button>s, and form elements like <input>.
... you can try this out using our native-keyboard-accessibility.html example (see the source code) — open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements; the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused.
...And 11 more matches
XForms Accessibility
implementation of accessible objects for xforms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module.
... xforms elements behavior is implemented in accordance with accessible toolkit checklist.
... in general, when elements are similar to html elements, they are exposed to msaa/atk in a similar way.
...And 11 more matches
Document - Web APIs
WebAPIDocument
the dom tree includes elements such as <body> and <table>, among many others.
... it provides functionality globally to the document, like how to obtain the page's url and create new elements in the document.
... document.embedsread only returns a list of the embedded <embed> elements within the current document.
...And 11 more matches
:nth-child() - CSS: Cascading Style Sheets
the :nth-child() css pseudo-class matches elements based on their position in a group of siblings.
... keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc.
... even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc.
...And 11 more matches
Microsummary XML grammar reference - Archive of obsolete content
hod="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> namespace the namespace uri for microsummary generator xml documents is: http://www.mozilla.org/microsummaries/0.1 all elements in a microsummary generator document should be in this namespace except the descendants of the <template> element, which should be in the xslt namespace: http://www.w3.org/1999/xsl/transform the <generator> element the <generator> element is the root tag for all microsummary generators, and should contain the remainder of the xml code describing the generator.
... child elements: <template> (required) defines how to transform pages into their microsummaries.
...child elements: <stylesheet> or <transform> (required) the xslt stylesheet which performs the transformation.
...And 10 more matches
Introduction to XUL - Archive of obsolete content
the task of writing a xul window description is basically the same as the task of writing an html content description, with these exceptions: the syntax is xml (not that different from html 4), and there are some elements unique to xul.
... these elements are widgets and certain infrastructure associated with the behaviour of the window, explained below.
... a xul file can contain xml elements and html elements, as well as special elements unique to xul: xul elements.
...And 10 more matches
Document and website structure - Learn web development
previous overview: introduction to html next in addition to defining individual parts of your page (such as "a paragraph" or "an image"), html also boasts a number of block level elements used to define areas of your website (such as "the header", "the navigation menu", "the main content column").
...usually, this is contextual to what is contained in the main content (for example on a news article page, the sidebar might contain the author's bio, or links to related articles) but there are also cases where you'll find some recurring elements like a secondary navigation system.
...with the right css, you could use pretty much any elements to wrap around the different sections and get it looking how you wanted, but as discussed before, we need to respect semantics and use the right element for the right job.
...And 10 more matches
HTML text fundamentals - Learn web development
in html, each paragraph has to be wrapped in a <p> element, like so: <p>i am a paragraph, oh yes i am.</p> each heading has to be wrapped in a heading element: <h1>i am the title of the story.</h1> there are six heading elements: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.
... implementing structural hierarchy for example, in this story, the <h1> element represents the title of the story, the <h2> elements represent the title of each chapter, and the <h3> elements represent sub-sections of each chapter: <h1>the crushing bore</h1> <p>by chris mills</p> <h2>chapter 1: the dark night</h2> <p>it was a dark night.
...the rain lashed down on the ...</p> <h2>chapter 2: the eternal silence</h2> <p>our protagonist could not so much as a whisper out of the shadowy figure ...</p> <h3>the specter speaks</h3> <p>several more hours had passed, when all of a sudden the specter sat bolt upright and exclaimed, "please have mercy on my soul!"</p> it's really up to you what the elements involved represent, as long as the hierarchy makes sense.
...And 10 more matches
Index
MozillaTechXPCOMIndex
336 nsiarray interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference an indexed collection of elements.
... provides basic functionality for retrieving elements at a specific position, searching for elements.
...xul elements can also have controllers, although they do not have any default controllers.
...And 10 more matches
HTMLFormElement - Web APIs
it allows access to—and, in some cases, modification of—aspects of the form, as well as access to its component elements.
... htmlformelement.elements read only a htmlformcontrolscollection holding all form controls belonging to this form element.
... accessing the form's elements you can access the list of the form's data-containing elements by examining the form's elements property.
...And 10 more matches
Microdata DOM API - Web APIs
these elements have their element.itemscope idl attribute set to true.
...getitems( [ types ] ) returns a nodelist of the elements in the document that create items, that are not part of other items, and that are of the types given in the argument, if any are listed.
...when called, the method must return a live nodelist object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types specified in the method's argument, having obtained the types by splitting the string on spaces.
...And 10 more matches
WebGL constants - Web APIs
rendering primitives constants passed to webglrenderingcontext.drawelements() or webglrenderingcontext.drawarrays() to specify what kind of primitive to render.
... constant name value description points 0x0000 passed to drawelements or drawarrays to draw single points.
... lines 0x0001 passed to drawelements or drawarrays to draw lines.
...And 10 more matches
Keyboard-navigable JavaScript widgets - Accessibility
these widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do.
... using tabindex by default, when people use the tab key to browse a webpage, only interactive elements (like links, form controls) get focused.
... with the tabindex global attribute, authors can make other elements focusable, too.
...And 10 more matches
HTML attribute reference - HTML: Hypertext Markup Language
elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want.
... attribute list attribute name elements description accept <form>, <input> list of types the server accepts, typically a file type.
... class global attribute often used with css to style elements with common properties.
...And 10 more matches
HTML: Hypertext Markup Language
WebHTML
html markup includes special "elements" such as <head>, <title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>, <span>, <img>, <aside>, <audio>, <canvas>, <datalist>, <details>, <embed>, <nav>, <output>, <progress>, <video>, <ul>, <ol>, <li> and many others.
... cors settings attributes some html elements that provide support for cors, such as <img> or <video>, have a crossorigin attribute (crossorigin property), which lets you configure the cors requests for the element's fetched data.
... references html reference html consists of elements, each of which may be modified by some number of attributes.
...And 10 more matches
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
... if negative, it will begin that many elements from the end of the array.
... deletecount optional an integer indicating the number of elements in the array to remove from start.
...And 10 more matches
Introduction to using XPath in JavaScript - XPath
note: xpath defines qnames without a prefix to match only elements in the null namespace.
...to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as ['namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'] (this approach works well for dynamic xpath's where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
... numbervalue stringvalue booleanvalue example the following uses the xpath expression count(//p) to obtain the number of <p> elements in an html document: var paragraphcount = document.evaluate( 'count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.numbervalue + ' paragraph elements' ); although javascript allows us to convert the number to a string for display, the xpath interface will not automatically convert the numerical result if the stringvalue property is reque...
...And 10 more matches
Stack Positioning - Archive of obsolete content
placement of stack children normally, the child elements of a stack stretch to fit the size of the stack.
... 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.
...And 9 more matches
Stacks and Decks - Archive of obsolete content
« previousnext » there may be need to display elements as a set of overlapping cards.
... the stack and deck elements can be used for this purpose.
...there are a number of elements that are specialized types of boxes, such as toolbars and tabbed panels.
...And 9 more matches
Trees and Templates - Archive of obsolete content
using a template with a tree uses very much the same syntax as with other elements.
...this means that elements will not be created for every row in the tree, making it more efficient.
...we need to put this attribute on only those elements that we want repeated for each resource.
...And 9 more matches
listitem - Archive of obsolete content
the text of the listitem is specified either using listcell elements, or by placing a label attribute directly on the listitem element.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...And 9 more matches
menulist - Archive of obsolete content
the user may select one of the elements displayed in the menulist.
...to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...And 9 more matches
nsIContentPolicy - Archive of obsolete content
type_image 3 indicates an image (for example, <img> elements).
... type_stylesheet 4 indicates a stylesheet (for example, <style> elements).
... type_subdocument 7 indicates a document contained within another document (for example, <iframe> and <frame> elements).
...And 9 more matches
Legacy layout methods - Learn web development
this leaves us with 960 pixels for our total column/gutter widths — in this case, the padding is subtracted from the total content width because we have set box-sizing to border-box on all elements on the site (see changing the box model completely for more explanation).
...add the following rule below your previous one: .row { clear: both; } applying this clearing means that we don’t need to completely fill each row with elements making the full twelve columns.
... try modifying the classes on your elements or even adding and removing some containers, to see how you can vary the layout.
...And 9 more matches
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
html elements can have an id and/or class attribute.
...the class attribute assigns a class name to the element, and that name can be used on many elements within the page.
... use a class-specific style when you want to apply the styling rules to many blocks and elements within the page, or when you currently only have element to style with that style, but you might want to add more later.
...And 9 more matches
How to structure a web form - Learn web development
previous overview: forms next with the basics out of the way, we'll now look in more detail at the elements used to provide structure and meaning to the different parts of a form.
... the flexibility of forms makes them one of the most complex structures in html; you can build any kind of basic form using dedicated form elements and attributes.
...many assistive technologies and browser plugins can discover <form> elements and implement special hooks to make them easier to use.
...And 9 more matches
Manipulating documents - Learn web development
you can use this object to return and manipulate information on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new styles to it, create new elements and add them to the current element as children, or even delete it altogether.
...this is a "tree structure" representation created by the browser that enables the html structure to be easily accessed by programming languages — for example the browser itself uses it to apply styling and other information to the correct elements as it renders a page, and developers like you can manipulate the dom with javascript after the page has been rendered.
... root node: the top node in the tree, which in the case of html is always the html node (other markup vocabularies like svg and custom xml will have different root elements).
...And 9 more matches
Handling common HTML and CSS problems - Learn web development
in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less performant (generating dom elements is expensive).
...if you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely.
...in general, most core html and css functionality (such as basic html elements, css basic colors and text styling) works across most browsers you'll want to support; more problems are uncovered when you start wanting to use newer features such as flexbox, or html5 video/audio, or even more nascent, css grids or -webkit-background-clip: text.
...And 9 more matches
Element - Web APIs
WebAPIElement
objects that represent elements) in a document inherit.
... it only has methods and properties common to all kinds of elements.
...for example, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements.
...And 9 more matches
ARIA: tab role - Accessibility
elements with the role tab must either be a child of an element with the tablist role, or have their id part of the aria-owns property of a tablist.
... this combination identifies to assistive technology that the element is part of a group of related elements.
... some assistive technology will provide a count of the number of tab role elements inside a tablist, and inform users of which tab they currently have targeted.
...And 9 more matches
<display-internal> - CSS: Cascading Style Sheets
syntax valid <display-internal> values: table-row-group these elements behave like <tbody> html elements.
... table-header-group these elements behave like <thead> html elements.
... table-footer-group these elements behave like <tfoot> html elements.
...And 9 more matches
Block formatting context - Developer guides
it's the region in which the layout of block boxes occurs and in which floats interact with other elements.
... floats (elements where float isn't none).
... absolutely positioned elements (elements where position is absolute or fixed).
...And 9 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
<input> elements of type image are used to create graphical submit buttons, i.e.
... value <input type="image"> elements do not accept value attributes.
... additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height, in...
...And 9 more matches
HTTP Index - HTTP
WebHTTPIndex
19 cross-origin resource policy (corp) http, reference, security cross-origin resource policy is an opt-in mechanism that allows web applications to protect against certain cross-origin requests, such as those issued by the browser when resources are embedded using elements such as <script> and <img>.
... 79 csp: child-src csp, child, content-security-policy, directive, http, reference, security, child-src, source the http content-security-policy (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>.
... 85 csp: frame-src csp, content-security-policy, directive, frame, http, reference, security, frame-src, source the http content-security-policy (csp) frame-src directive specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
...And 9 more matches
TypedArray - JavaScript
on the following pages you will find common properties and methods that can be used with any typed array containing elements of any type.
... typedarray.prototype.length returns the number of elements held in the typed array.
... instance methods typedarray.prototype.copywithin() copies a sequence of array elements within the array.
...And 9 more matches
Adding Events and Commands - Archive of obsolete content
« previousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements.
...elements only implement the events that are relevant to them, but there are several events that are implemented for most elements.
...you can combine these with -moz-user-focus to add custom focus behavior to elements that normally wouldn't have it.
...And 8 more matches
The Essentials of an Extension - Archive of obsolete content
the chrome.manifest file chrome is the set of user interface elements of the application window that are outside of a window's content area.
... toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome.
... xul files are xml files that define the user interface elements in firefox and firefox extensions.
...And 8 more matches
button - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed.
... normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...And 8 more matches
menuitem - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 8 more matches
menuseparator - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 8 more matches
radio - Archive of obsolete content
ArchiveMozillaXULradio
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 8 more matches
richlistitem - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...elements with a higher tabindex are later in the tab sequence.
...And 8 more matches
scale - Archive of obsolete content
ArchiveMozillaXULscale
min, movetoclick, pageincrement, tabindex, value properties disabled, max, min, increment, pageincrement, tabindex, value, methods decrease, decreasepage, increase, increasepage, examples horizontal scale: <scale min="1" max="10"/> vertical scale: <scale min="1" max="10" orient="vertical"/> attributes dir type: one of the values below the direction in which the child elements of the element are placed.
... normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
...And 8 more matches
toolbarbutton - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed.
... normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...And 8 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
« xul reference home [ examples | attributes | properties | methods | related ] a container which can be used to hold a tabular or hierarchical set of rows of elements.
...unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object.
... description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element.
...And 8 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
additional param elements (which are "children" of the above object element) specify configuration parameters for the flash plugin.
...the data attribute points to the swf file to play, and the configuration parameters (the param elements) are used in a consistent manner both for ie and for mozilla-based browsers such as netscape 7.
... ie doesn't display nested object elements correctly according to the html 4.01 specification.
...And 8 more matches
CSS basics - Learn web development
css is what you use to selectively style html elements.
...it defines the element(s) to be styled (in this example, <p> elements).
...(in this example, color is a property of the <p> elements.) in css, you choose which properties you want to affect in the rule.
...And 8 more matches
nsIAccessibleProvider
outerdoc 0x00000001 for elements that spawn a new document.
... xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 xforms elements constants constant value description xformscontainer 0x00002000 used for xforms elements that provide accessible object for itself as well for anonymous content.
... xformstrigger 0x00002003 used for trigger and submit elements.
...And 8 more matches
Timing element visibility with the Intersection Observer API - Web APIs
the intersection observer api makes it easy to be asynchronously notified when elements of interest become more or less obscured by a shared ancestor node or element, including the document itself.
... the basics we provide styles for the <body> and <main> elements to define the site's background as well as the grid the various parts of the site will be placed in.
...the rows are sized the same way as the columns: the first one is automatically sized and the one uses the remaining space, but at least enough space to provide room for all elements within it.
...And 8 more matches
:nth-last-child() - CSS: Cascading Style Sheets
the :nth-last-child() css pseudo-class matches elements based on their position among a group of siblings, counting from the end.
... syntax the nth-last-child pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end.
... keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end.
...And 8 more matches
HTML5 - Developer guides
WebGuideHTMLHTML5
it is a new version of the language html, with new elements, attributes, and behaviors, and a larger set of technologies that allows the building of more diverse and powerful web sites and applications.
... semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <aside>.
... using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content.
...And 8 more matches
BigInt64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... bigint64array.prototype.length returns the number of elements hold in the bigint64array.
... instance methods bigint64array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
BigUint64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... biguint64array.prototype.length returns the number of elements hold in the biguint64array.
... instance methods biguint64array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Float32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... float32array.prototype.length returns the number of elements hold in the float32array.
... instance methods float32array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Float64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... float64array.prototype.length returns the number of elements hold in the float64array.
... instance methods float64array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Int16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int16array.prototype.length returns the number of elements hold in the int16array.
... instance methods int16array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Int32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int32array.prototype.length returns the number of elements hold in the int32array.
... instance methods int32array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Int8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int8array.prototype.length returns the number of elements hold in the int8array.
... instance methods int8array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Uint16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint16array.prototype.length returns the number of elements hold in the uint16array.
... instance methods uint16array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Uint32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint32array.prototype.length returns the number of elements hold in the uint32array.
... instance methods uint32array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Uint8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint8array.prototype.length returns the number of elements held in the uint8array.
... instance methods uint8array.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Uint8ClampedArray - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint8clampedarray.prototype.length returns the number of elements hold in the uintclamped8array.
... instance methods uint8clampedarray.prototype.copywithin() copies a sequence of array elements within the array.
...And 8 more matches
Using templates and slots - Web Components
this article explains how you can use the <template> and <slot> elements to create a flexible template that can then be used to populate the shadow dom of a web component.
...we'll call it <my-paragraph>: customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template conte...
...as before, this can be anything you like, for example: <my-paragraph> <span slot="my-text">let's have some different text!</span> </my-paragraph> or <my-paragraph> <ul slot="my-text"> <li>let's have some different text!</li> <li>in a list!</li> </ul> </my-paragraph> note: elements that can be inserted into slots are known as slotable; when an element has been inserted in a slot, it is said to be slotted.
...And 8 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
“chrome”is the word used to describe all the gui structural elements that go into an xul application.
... the skin package this is used to include source files used as visual elements in the gui, including style sheets and images.
... expand spot 3; this will disclose the area numbered 4, with several menuitem elements.
...And 7 more matches
align - Archive of obsolete content
« xul reference home align type: one of the values below the align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
... start child elements are aligned starting from the left or top edge of the box.
... center extra space is split equally along each side of the child elements, resulting in the children being placed in the center of the box.
...And 7 more matches
attribute.align - Archive of obsolete content
summary the align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.
... parameters start child elements are aligned starting from the left or top edge of the box.
... center extra space is split equally along each side of the child elements, resulting the children being placed in the center of the box.
...And 7 more matches
listbox - Archive of obsolete content
a listbox is expected to contain listitem elements.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 7 more matches
menu - Archive of obsolete content
ArchiveMozillaXULmenu
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 7 more matches
Attribute selectors - Learn web development
previous overview: building blocks next as you know from your study of html, elements can have attributes that give further detail about the element being marked up.
... in css you can use attribute selectors to target elements with certain attributes.
... selector example description [attr] a[title] matches elements with an attr attribute (whose name is the value in square brackets).
...And 7 more matches
CSS selectors - Learn web development
previous overview: building blocks next in css, selectors are used to target the html elements on our web pages that we want to style.
... there are a wide variety of css selectors available, allowing for fine-grained precision when selecting elements to style.
...it is a pattern of elements and other terms that tell the browser which html elements should be selected to have the css property values inside the rule applied to them.
...And 7 more matches
Styling tables - Learn web development
by default, when you set borders on table elements, they will all have spacing between them, as the below image illustrates: this doesn't look very nice (although it might be the look you want, who knows?) with border-collapse: collapse; set, the borders collapse down into one, which looks much better: we've put a border around the whole table, which is needed because we'll be putting some borders round the table header and footer later on —...
... we've set some padding on the <th> and <td> elements — this gives the data items some space to breathe, making the table look a lot more legible.
...we've also set our custom font on the headings inside the <thead> and <tfoot> elements, for a nice grungy, punky look.
...And 7 more matches
Practical positioning examples - Learn web development
the div contains three <article> elements, which will make up the content panels that correspond to each tab.
...the <a> elements are set to display inline-block so they will sit in a line but still be stylable, and they are styled appropriately for tab buttons, using a variety of other properties.
...here we simply set a fixed height to make sure the panels fit snugly inside the info-box, position relative to set the <div> as the positioning context, so you can then place positioned child elements relative to it and not the <html> element, and finally we clear the float set in the css above so that it doesn't interfere with the remainder of the layout.
...And 7 more matches
Fundamental text and font styling - Learn web development
text content effectively behaves like a series of inline elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line break manually using the <br> element.
...but it was a rare occasion such as this that he did.</p> you can find the finished example on github (see also the source code.) color the color property sets the color of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property).
...but it was a rare occasion such as this that he did.</p> font families to set a different font on your text, you use the font-family property — this allows you to specify a font (or list of fonts) for the browser to apply to the selected elements.
...And 7 more matches
Basic native form controls - Learn web development
previous overview: forms next in the previous article, we marked up a functional web form example, introducing some form controls and common structural elements, and focusing on accessibility best practices.
... you've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>.
... note: the <input> element is unique amongst html elements because it can take many different forms depending on its type attribute value.
...And 7 more matches
CSS property compatibility table for form controls - Learn web development
border and background background no no border-radius no no box-shadow no no select boxes (single line) see the <select>, <optgroup> and <option> elements.
... property n t note css box model width partial[1] partial[1] this property is okay on the <select> element, but it cannot be the case on the <option> or <optgroup> elements.
... the property is well applied on the <select> element, but is inconsistently handled on <option> and <optgroup> elements.
...And 7 more matches
UI pseudo-classes - Learn web development
prerequisites: basic computer literacy, and a basic understanding of html and css, including general knowledge of pseudo-classes and pseudo-elements.
... <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.
... the idea is that we can use the ::before and ::after pseudo-elements along with the content property to make a chunk of content appear before or after the affected element.
...And 7 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
we will also see how to declare and clean-up event listeners on dom elements.
...we will also learn about the action directive, which will allow us to extend the functionality of html elements in a reusable and declarative way.
... if you press the tab key repeatedly, you'll see the dashed focus indicator cycling between all the focusable elements on the page.
...And 7 more matches
nsIDOMXULElement
66 introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute.
...gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script.
...focus() attempts to set focus to the element; will not work for example for disabled elements.
...And 7 more matches
XUL Overlays
MozillaTechXULOverlays
though overlays often define ui elements that have been added as a result of an update or enhancement of some kind, they can be used in many different ways.
...when plug-ins, browser extensions, or other applications provide new ui elements to the browser, these elements should be defined in overlay files.
... the installation of a media plug-in, for example, may add new icons and menu items to the interface: in the navigatoroverlay.xul file or in a separate navigatorsspoverlay.xul file (where navigator.xul defines the basic ui for the navigator package), these new plug-in elements would be defined as a collection of elements or subtrees: <menuitem name="super stream player"/> <menupopup name="ss favorites"> <menuitem name="wave" src="mavericks.ssp"/> <menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute.
...And 7 more matches
Examine and edit HTML - Firefox Developer Tools
css selector search you can search elements by entering a css selector.
...this allows you to search for specific elements without the conflict of matching words within the text.
... for example, //a matches all <a> elements but not the letter "a" within the text content.
...And 7 more matches
Keyboard - Accessibility
focusable elements should have interactive semantics if an element can be focused using the keyboard, then it should be interactive; that is, the user should be able to do something to it and produce a change of some kind (for example, activating a link or changing an option).
... most interactive elements are focusable by default; you can make an element focusable by adding a tabindex=0 attribute value to it.
...a value of zero indicates that the element is part of the default focus order, which is based on the ordering of elements in the html document.
...And 7 more matches
The stacking context - CSS: Cascading Style Sheets
the stacking context is a three-dimensional conceptualization of html elements along an imaginary z-axis relative to the user, who is assumed to be facing the viewport or the webpage.
... html elements occupy this space in priority order based on element attributes.
... the stacking context in the previous part of this article, using z-index, the rendering order of certain elements is influenced by their z-index value.
...And 7 more matches
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
use this css reference to browse an alphabetical index of all of the standard css properties, pseudo-classes, pseudo-elements, data types, and at-rules.
...where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list] properties-list ::= [property : value] [; properties-list] see the index of selectors, pseudo-classes, and pseudo-elements below.
...nicode-range (@font-face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvwwwhite-spacewidowswidthwidth (@viewport)will-changeword-breakword-spacingword-wrapwriting-modexxzz-indexzoom (@viewport)others--* selectors the following are the various selectors, which allow styles to be conditional based on various features of elements within the dom.
...And 7 more matches
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
the default value is single, which means that all elements will be placed in a single row or column, and any elements that don't fit will simply be considered overflow.
...the box must attempt to fit its children on as few lines as possible by shrinking all elements down to their minimum widths or heights if necessary.
... if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths, then children are moved one by one onto a new line, until the elements remaining on the previous line fit.
...And 7 more matches
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
it is possible to use the :valid and :invalid css pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid.
... content categories flow content, palpable content permitted content flow content, but not containing <form> elements tag omission none, both the starting and ending tag are mandatory.
...instead, use the accept attribute on <input type=file> elements.
...And 7 more matches
Keyed collections - JavaScript
« previousnext » this chapter introduces collections of data which are indexed by a key; map and set objects contain elements which are iterable in the order of insertion.
...a map object is a simple key/value map and can iterate its elements in insertion order.
... the iteration of maps is in insertion order of the elements.
...And 7 more matches
Array.prototype.sort() - JavaScript
the sort() method sorts the elements of an array in place and returns the sorted array.
... the default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of utf-16 code units values.
...if omitted, the array elements are converted to strings, then sorted according to each character's unicode code point value.
...And 7 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
the markup is very simple: <x-deck selected-index="0"> <x-card> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps.
... border-box sizing the padding does not affect the overall width and height of the containers because we have set the box-sizing of all elements to border-box: *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } this basically means that width and height will now set the dimensions of an element all the way up to and including the border, not just the content.
... flexible replaced elements things are working fairly well now, but there are still some issues just waiting to present themselves.
...And 7 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
the problem with mixing content from different xml dialects in a single xml document is that the elements defined by one dialect may have the same name as elements defined by another.
...this parameter says that the <svg> element and its child elements belong to whichever xml dialect has the namespace name 'http://www.w3.org/2000/svg' which is, of course, svg.
...as a result, it and all its child elements are interpreted by the user agent as belonging to xhtml, except for the <svg> element.
...And 7 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
dom differences the document object model (dom) is the tree structure that contains the document elements.
... accessing elements to retrieve an element reference using the cross-browser approach, you use document.getelementbyid(aid), which works in internet explorer 5.0+, mozilla-based browsers, other w3c-compliant browsers and is part of the dom level 1 specification.
...while document.getelementbyid lets you retrieve one element, you can also use document.layers and document.all to obtain a list of all document elements with a certain tag name, such as all <div> elements.
...And 6 more matches
Binding Attachment and Detachment - Archive of obsolete content
attachment using css bindings can be attached to elements through css using the -moz-binding property.
... -moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of urls that identify specific bindings.
... in the following example, a binding is referenced that will be attached to all html checkbox elements.
...And 6 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
...And 6 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
...And 6 more matches
Document Object Model - Archive of obsolete content
« previousnext » the document object model (dom) can be used with xul elements to get information about them or modify them.
...specific xul elements also provide additional functions which may be used.
... retrieving elements the most common method to retrieve an element in a document is to give the element an id attribute and the use the document's getelementbyid() method.
...And 6 more matches
Using Remote XUL - Archive of obsolete content
it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers).
...the window element is the root (outermost) element in a xul document and encompasses all other elements.
... these two elements give us a valid xul document we can load and display in our web browser, even though there's nothing to see yet.
...And 6 more matches
description - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 6 more matches
richlistbox - Archive of obsolete content
tion, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which can contain any content.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 6 more matches
Processing XML with E4X - Archive of obsolete content
operator accesses all children no matter how deeply nested: alert(person..*.length()); // 11 the length() method here returns 11 because both elements and text nodes are included in the resulting xmllist.
... objects representing xml elements provide a number of useful methods, some of which are illustrated below: todo: add all of the methods to the javascript reference, link from here alert(person.name.text()) // bob smith var xml = person.name.toxmlstring(); // a string containing xml var personcopy = person.copy(); // a deep copy of the xml object var child = person.child(1); // the second child node; in this case the <likes> element working with xmllists in addition to the xml object, e4x introduces an xmllist object.
... xmllist is used to represent an ordered collection of xml objects; for example, a list of elements.
...And 6 more matches
CSS and JavaScript accessibility best practices - Learn web development
using correct semantics has a lot to do with user expectations — elements look and behave in certain ways, according to their functionality, and these common conventions are expected by users.
... as an example, a screen reader user can't navigate a page via heading elements if the developer hasn't appropriately used heading elements to markup the content.
... emphasised text inline markup that confers specific emphasis to the text that it wraps: <p>the water is <em>very hot</em>.</p> <p>water droplets collecting on surfaces is called <strong>condensation</strong>.</p> you might want to add some simple coloring to your emphasised text: strong, em { color: #a60000; } you will however rarely need to style emphasis elements in any significant way.
...And 6 more matches
Combinators - Learn web development
descendant combinator the descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector.
...it matches only those elements matched by the second selector that are the direct children of elements matched by the first.
... descendent elements further down the hierarchy don't match.
...And 6 more matches
Getting started with CSS - Learn web development
styling html elements by making our heading red we have already demonstrated that we can target and style an html element.
... changing the default behavior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html readable by adding some default styling.
... adding a class so far we have styled elements based on their html element names.
...And 6 more matches
Your first form - Learn web development
overview: forms next the first article in our series provides you with your very first experience of creating a web form, including designing a simple form, implementing it using the right html form controls and other html elements, adding some very simple styling via css, and describing how data is sent to a server.
... objective: to gain familiarity with what web forms are, what they are used for, how to think about designing them, and the basic html elements you'll need for simple cases.
... a web form's html is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as html forms.
...And 6 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article.
... the elements described in this article are less known, but still useful to know about (and this is still not a complete list by any means).
... objective: to learn how to use lesser-known html elements to mark up advanced semantic features.
...And 6 more matches
Video and audio content - Learn web development
in this article we'll look at doing just that with the <video> and <audio> elements; we'll then finish off by looking at how to add captions/subtitles to your videos.
...fortunately, a few years later the html5 specification had such features added, with the <video> and <audio> elements, and some shiny new javascript apis for controlling them.
...this is especially interesting since while most browsers don't support using mpeg media in the <video> and <audio> elements, they may still support mp3 due to its popularity.
...And 6 more matches
nsISimpleEnumerator
xpcom/ds/nsisimpleenumerator.idlscriptable this interface represents an enumeration of xpcom objects and provides methods to access elements sequentially.
... inherits from: nsisupports last changed in gecko 0.9.6 method overview nsisupports getnext(); boolean hasmoreelements(); methods getnext() called to retrieve the next element in the enumerator.
...must be preceded by a call to hasmoreelements() which returns pr_true.
...And 6 more matches
Introduction to DOM Inspector - Firefox Developer Tools
(note that there are bugs which prevent the flasher from dom inspector apis from working correctly on certain platforms.) if you inspect the main browser window, for example, and select nodes in the dom nodes viewer (other than the elements which have no visible ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with a blinking red border.
... the box model viewer gives various metrics about xul and html elements, including placement and size.
... the xbl bindings viewer lists the xbl bindings attached to elements.
...And 6 more matches
Fullscreen API - Web APIs
this makes it possible to present desired content—such as an online game—using the user's entire screen, removing all browser user interface elements and other applications from the screen until full-screen mode is shut off.
... methods on the element interface element.requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's ui elements as well as all other applications from the screen.
... event handlers on elements element.onfullscreenchange an event handler which is called when the fullscreenchange event is sent to the element, indicating that the element has been placed into, or removed from, full-screen mode.
...And 6 more matches
Intersection Observer API - Web APIs
historically, detecting visibility of an element, or the relative visibility of two elements in relation to each other, has been a difficult task for which solutions have been unreliable and prone to causing the browser and the sites the user is accessing to become sluggish.
... how intersection is calculated all areas considered by the intersection observer api are rectangles; elements which are irregularly shaped are considered as occupying the smallest rectangle which encloses all of the element's parts.
...this lets you determine whether the entry represents a transition from the elements intersecting to no longer intersecting or a transition from not intersecting to intersecting.
...And 6 more matches
ARIA: listbox role - Accessibility
the listbox role is used for lists from which a user may select one or more items which are static and, unlike html <select> elements, may contain images.
... it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free.
... elements with the role listbox have an implicit aria-orientation value of vertical.
...And 6 more matches
Specificity - CSS: Cascading Style Sheets
as per css rules, directly targeted elements will always take precedence over rules which an element inherits from its ancestor.
... note: proximity of elements in the document tree has no effect on the specificity.
... selector types the following list of selector types increases by specificity: type selectors (e.g., h1) and pseudo-elements (e.g., ::before).
...And 6 more matches
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
<input> elements of type submit are rendered as buttons.
...this label is likely to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form.
... this attribute is also available on <input type="image"> and <button> elements.
...And 6 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
the row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements.
...we have some examples below, but for more examples and an in-depth tutorial, see the html tables series in our learn web development area, where you'll learn how to use the table elements and their attributes to get just the right layout and formatting for your tabular data.
...not even the table section elements are used; instead, the browser is allowed to determine this automatically.
...And 6 more matches
Array.prototype.filter() - JavaScript
the filter() method creates a new array with all elements that pass the test implemented by the provided function.
... return value a new array with the elements that pass the test.
... if no elements pass the test, an empty array will be returned.
...And 6 more matches
requiredFeatures - SVG: Scalable Vector Graphics
twentynine elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <circle>, <clippath>, <cursor>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <use> html, body, svg { height: 100%; } text { fill: white; } <svg viewb...
...in some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser.
... http://www.w3.org/tr/svg11/feature#coreattribute the browser supports the id, xml:base, xml:lang and xml:space attributes http://www.w3.org/tr/svg11/feature#structure the browser supports <svg>, <g>, <defs>, <desc>, <title>, <metadata>, <symbol> and <use> elements.
...And 6 more matches
Menus - Archive of obsolete content
there are four elements that a menupopup can be attached to.
...the following is a brief summary of these elements, examples of each will be provided later.
...it should contain menu elements.
...And 5 more matches
Groupboxes - Archive of obsolete content
« previousnext » this section 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.
...groupboxes are box elements, so you can use the box attributes, such as orient and flex.
...And 5 more matches
Styling a Tree - Archive of obsolete content
styling the tree you can style the tree border and the column headers in the same way as other elements.
... the body of the tree must be styled in a somewhat different way than other elements.
... this is because the tree body is stored in a different way to other elements.
...And 5 more matches
Tabboxes - Archive of obsolete content
it involves five new elements, which are described briefly here and in more detail below.
...it consists of two children, a tabs element which contains the row of tabs and a tabpanels elements which contains the tabbed pages.
... shown below is the general syntax of a tabbox: <tabbox id="tablist"> <tabs> <!-- tab elements go here --> </tabs> <tabpanels> <!-- tabpanel elements go here --> </tabpanels> </tabbox> the tab elements are placed inside a tabs element, which is much like a regular box.
...And 5 more matches
Using Spacers - Archive of obsolete content
« previousnext » in this section, we will find out how to add some spacing in between the elements we have created.
...(java uses layout managers for example.) xul provides the capability for elements to position and resize automatically.
... as we've seen, the find files window has appeared in a size that will fit the elements inside it.
...And 5 more matches
XML - Archive of obsolete content
html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a closing element.
... in xul, elements must either be of the form <tag></tag> or <tag/> to be valid.
...an actual memo using the memoml to represent itself might look like this: <memo> <from>ian oeschger</from> <to>steve rudman</to> <body>i think the first draft of the guide is done!</body> </memo> note how the memo element -- the root element in our brief definition, ordeclaration, above -- surrounds the other three elements.
...And 5 more matches
prefpane - Archive of obsolete content
the former is specified using a preferences element while the latter may be specified using other xul elements.
... 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 ui elements ...
...And 5 more matches
radiogroup - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...elements with a higher tabindex are later in the tab sequence.
...And 5 more matches
tab - Archive of obsolete content
ArchiveMozillaXULtab
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 5 more matches
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
a tabs element should be placed inside a tabbox and should contain tab elements.
... nb: you can add some other elements to tabs such as button, but they will receive an index.
...disabled elements are usually drawn with grayed-out text.
...And 5 more matches
Using the W3C DOM - Archive of obsolete content
« previousnext » the document object has properties for accessing collections of elements, such as document.images and document.forms.
... the w3c document object model provides interfaces dom elements to scriptable objects.
... accessing elements with the w3c dom the basic method for referencing elements in an html page is document.getelementbyid().
...And 5 more matches
XForms Switch Module - Archive of obsolete content
the module defines for this switch, case and toggle elements.
... switch element the element (see the spec) is used in conjunction with case and toggle elements.
... the switch element contains case elements which in turn contain markup.
...And 5 more matches
Type, class, and ID selectors - Learn web development
all instances of <span>, <em> and <strong> elements are therefore styled accordingly.
...in the following example we have used the universal selector to remove the margins on all elements.
...for example, if i wanted to select the first child of any descendant element of <article> , no matter what element it was, and make it bold, i could use the :first-child selector, which we will learn more about in the lesson on pseudo-classes and pseudo-elements, as a descendant selector along with the <article> element selector: article :first-child { } this could be confused however with article:first-child, which will select any <article> element that is the first child of another element.
...And 5 more matches
Client-side form validation - Learn web development
this is done by using validation attributes on form elements.
... when an element is valid, the following things are true: the element matches the :valid css pseudo-class, which lets you apply a specific style to valid elements.
... when an element is invalid, the following things are true: the element matches the :invalid css pseudo-class, and sometimes other ui pseudo-classes (e.g., :out-of-range) depending on the error, which lets you apply a specific style to invalid elements.
...And 5 more matches
HTML Cheatsheet - Learn web development
inline elements an "element" is a single part of a webpage.
... some elements are large and hold smaller elements like containers.
... some elements are small and are "nested" inside larger ones.
...And 5 more matches
JNI.jsm
working with arrays creating/preallocating a typed array methods cdata .get(number aindex); cdata .getelements(number astart, number alength); void .set(number aindex, cdata avalue); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given aindex.
... .getelements() returns a new cdata object of the section of the array specified by astart and ending at position astart + alength.
... void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in.
...And 5 more matches
Mozilla Quirks Mode Behavior
collapse the bottom or top margins of empty elements (bug 97361).
... indent nested dl elements (bug 8749).
... (this also applies to getelementsbyclassname.) stylesheets linked in the document with an advisory mime type of text/css will still be treated as css even if the server gives a content-type header other than text/css.
...And 5 more matches
Attribute selectors - CSS: Cascading Style Sheets
the css attribute selector matches elements based on the presence or value of a given attribute.
... /* <a> elements with a title attribute */ a[title] { color: purple; } /* <a> elements with an href matching "https://example.org" */ a[href="https://example.org"] { color: green; } /* <a> elements with an href containing "example" */ a[href*="example"] { font-size: 2em; } /* <a> elements with an href ending ".org" */ a[href$=".org"] { font-style: italic; } /* <a> elements whose class attribute contains the word "logo" */ a[class~="logo"] { padding: 2px; } syntax [attr] represents elements with an attribute name of attr.
... [attr=value] represents elements with an attribute name of attr whose value is exactly value.
...And 5 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
a block formatting context (bfc) will lay child elements out according to block layout rules, a flex formatting context will lay its children out as flex items, etc.
...elements participating in a bfc use the rules outlined by the css box model, which defines how an element's margins, borders, and padding interact with other blocks in the same context.
... a new bfc is created in the following situations: elements made to float using float absolutely positioned elements (including position: fixed or position: sticky) elements with display: inline-block table cells or elements with display: table-cell, including anonymous table cells created when using the display: table-* properties table captions or elements with display: table-caption block elements where overflow has a value other than visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict ...
...And 5 more matches
Visual formatting model - CSS: Cascading Style Sheets
relationships between elements in the document tree.
... box generation box generation is the part of the css visual formatting model that creates boxes from the document's elements.
... some elements may generate additional boxes in addition to the principal box, for example display: list-item generates more than one box (e.g.
...And 5 more matches
clear - CSS: Cascading Style Sheets
WebCSSclear
the clear css property sets whether an element must be moved below (cleared) floating elements that precede it.
... the clear property applies to floating and non-floating elements.
... vertical margins between two floated elements on the other hand will not collapse.
...And 5 more matches
<color> - CSS: Cascading Style Sheets
to learn more about using color in html, see applying color to html elements using css.
... buttonhighlight the color of the border facing the light source for 3-d elements that appear 3-d due to that layer of surrounding border.
... buttonshadow the color of the border away from the light source for 3-d elements that appear 3-d due to that layer of surrounding border.
...And 5 more matches
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
lack of reparsing prior to html5, parsers reparsed the document if they hit the end of the file within certain elements or within comments.
... foreignobject and annotation-xml (and various less important elements) establish a nested html scope, so you can nest svg, mathml and html as you’d expect to be able to nest them.
... attributes starting with xmlns have absolutely no effect on what namespace elements or attributes end up in, so you don’t need to use attributes starting with xmlns.
...And 5 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
however, this can be useful when creating media elements whose source will be set at a later time, under user control.
...without sending the origin: http header), preventing its non-tainted used in <canvas> elements.
... waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same file types and audio codecs; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands: <audio controls> <source src="myaudio.mp3" type="audio/mpeg"> <source src="myaudio.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio.
...And 5 more matches
Content-Security-Policy - HTTP
child-src defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>.
... frame-src specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
... media-src specifies valid sources for loading media using the <audio> , <video> and <track> elements.
...And 5 more matches
Grammar and types - JavaScript
the source text of javascript script gets scanned from left to right, and is converted into a sequence of input elements which are tokens, control characters, line terminators, comments, or whitespace.
...objects and functions are the other fundamental elements in the language.
...when you create an array using an array literal, it is initialized with the specified values as its elements, and its length is set to the number of arguments specified.
...And 5 more matches
Array.prototype.every() - JavaScript
the every() method tests whether all elements in the array pass the test implemented by the provided function.
...otherwise, if callback returns a truthy value for all elements, every returns true.
... the range of elements processed by every is set before the first invocation of callback.
...And 5 more matches
Array.prototype.forEach() - JavaScript
the range of elements processed by foreach() is set before the first invocation of callback.
... elements which are appended to the array after the call to foreach() begins will not be visited by callback.
... if existing elements of the array are changed or deleted, their value as passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited.
...And 5 more matches
TypedArray.prototype.filter() - JavaScript
the filter() method creates a new typed array with all elements that pass the test implemented by the provided function.
... return value a new typed array with the elements that pass the test.
...typed array elements which do not pass the callback test are simply skipped, and are not included in the new typed array.
...And 5 more matches
Performance fundamentals - Web Performance
text and images reflow automatically, ui elements automatically receive the system theme, and the system provides "built-in" support for some use cases developers may not think of initially, like different-resolution displays or right-to-left languages.
...you can easily trigger these animations with the :hover, :focus, or :target, or by dynamically adding and removing classes on parent elements.
...not only can you translate elements in 2d space, but you can transform in three dimensions, skew and rotate, and so forth.
...And 5 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
general change notes length attribute and indexed property for list interfaces implementation status unknown <script> element in content model of all elements implementation status unknown initialize(), appenditem(), replaceitem(), and insertitembefore() on list objects making a copy of any list item being inserted that is already in another list implementation status unknown crossorigin attribute for <image> and <script> elements not implemented yet (at least for <image>; bug 1240357) rendering model change ...
... notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementation status unknown allow overflow: scroll; to show scroll bars on <svg> elements implementation status unknown basic data types and interfaces change notes dommatrix or dommatrixreadonly instead of svgmatrix implementation status unknown domrect or domrectreadonly instead of svgrect implementation status unknown dompoint or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in svgelement implementation status unknown svggraphicselement instead of sv...
... svgsvgelement.currentview was never implemented, svgsvgelement.usecurrentview not removed yet (bug 1174097) svgunknownelement not implemented (bug 1239218) lang attribute without namespace implemented (bug 721920) svgsvgelement.viewport removed never implemented xml:base attribute removed implementation status unknown reorder descendent elements of <switch> having systemlanguage attribute according to allowreorder smil attribute implementation status unknown made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown ...
...And 5 more matches
Specification Deviations - SVG: Scalable Vector Graphics
the 'class' and 'style' attributes unlike html and mathml, the svg specification does not specify the 'style' and 'class' attributes on all svg elements.
... nevertheless, to allow mozilla to more cleanly share internal 'class' and 'style' related code, we will implement these attributes on all svg elements as of firefox 3.
... in general this change will not be visible to svg authors (the elements for which the svg specification does not define the 'class' and 'style' attribute are elements that are not displayed directly).
...And 5 more matches
SVG and CSS - SVG: Scalable Vector Graphics
note: elements referenced by <use> elements inherit the styles from that element.
...er petals */ #outer-petals { opacity: .75; --segment-fill-fill: azure; --segment-fill-stroke: lightsteelblue; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: deepskyblue; --segment-edge-stroke-width: 3; --segment-fill-fill-hover: plum; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: slateblue; } /* non-standard way of styling elements referenced via <use> elements, supported by some older browsers */ #outer-petals .segment-fill { fill: azure; stroke: lightsteelblue; stroke-width: 1; } #outer-petals .segment-edge { fill: none; stroke: deepskyblue; stroke-width: 3; } #outer-petals .segment:hover > .segment-fill { fill: plum; stroke: none; } #outer-petals .segment:hover > .segment-edge { stroke: slateblue; }...
... /* inner petals */ #inner-petals { --segment-fill-fill: yellow; --segment-fill-stroke: yellow; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: yellowgreen; --segment-edge-stroke-width: 9; --segment-fill-fill-hover: darkseagreen; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: green; } /* non-standard way of styling elements referenced via <use> elements, supported by some older browsers */ #inner-petals .segment-fill { fill: yellow; stroke: yellow; stroke-width: 1; } #inner-petals .segment-edge { fill: none; stroke: yellowgreen; stroke-width: 9; } #inner-petals .segment:hover > .segment-fill { fill: darkseagreen; stroke: none; } #inner-petals .segment:hover > .segment-edge { stroke: green; } open the do...
...And 5 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in listing 1, xml uses elements, which consist of an opening tag, a closing tag, and content.
... note: elements that take no content can be expressed in compact form as <elementname/>.
... an element can include other elements as well as text in its content, and all information is structured as a tree.
...And 4 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
of course, specific implementations may have different requirements, like the use of multiple iframe elements to make multiple requests retrieving different contents at the same time.
...the code locates element with id mydata then copies the content of mydata (mydata.innerhtml) into the tickerdiv element (div element that is the container of elements into the ticker).
...the following code snippet shows a simplified version of the logic that happens in the actual sample: // doc is the dom to the document returned articles=doc.getelementsbytagname("article"); for(i=0;i<articles.length;i++) { // acquiring the data from the dom...
...And 4 more matches
JXON - Archive of obsolete content
in addition, all properties of the tree with a true value will be converted into empty elements with no text nodes (see the code considerations).
...and decimals): <root><age>12</age><height>1.73</height></root> becomes { "age": 12, "height": 1.73 } booleans are recognized case insensitive: <root><checked>true</checked><answer>false</answer></root> becomes { "checked": true, "answer": false } strings are escaped: <root>quote: &quot; new-line: </root> becomes "quote: \" new-line:\n" empty elements will become null: <root><nil/><empty></empty></root> becomes { "nil": null, "empty": null } if all sibling elements have the same name, they become an array <root><item>1</item><item>2</item><item>three</item></root> becomes [1, 2, "three"] mixed mode text-nodes, comments and attributes get absorbed: <root version="1.0">testing<!--comment--><element test="t...
... extra javascript translations this is the same as the json translation, but with these extras: property names are only escaped when necessary <root><while>true</while><wend>false</wend><only-if/></root> becomes { "while": true, wend: false, "only-if": null } within a string, closing elements "</" are escaped as "<\/" <root><![cdata[<script>alert("yes");</script>]]></root> becomes { script: "<script>alert(\"yes\")<\/script>" } dates are created as new date objects <root>2006-12-25</root> becomes new date(2006, 12 - 1, 25) attributes and comments are shown as comments (for testing purposes): <!--testing--><root><test version="1.0">123</test></root> ...
...And 4 more matches
Style System Overview - Archive of obsolete content
selector matches elements in the document.
... rule applies to matched elements.
... has a separate rulesmatching method for pseudo-elements.
...And 4 more matches
Creating a Window - Archive of obsolete content
the simplest xul file has the following structure: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- other elements go here --> </window> this window will not do anything since it doesn't contain any ui elements.
...this file contains all the default declarations for all of the xul elements.
... because xml does not have any knowledge of how elements should be displayed, the file indicates how.
...And 4 more matches
Focus and Selection - Archive of obsolete content
« previousnext » the section will describe how to handle the focus and selection of elements.
... focused elements the focused element refers to the element which currently receives input events.
...rearranging the tab order you can change the order in which elements are focused when the user presses the tab key by adding a tabindex attribute to an element.
...And 4 more matches
Introduction to RDF - Archive of obsolete content
resource description framework we can use the tree elements to display a set of data, such as bookmarks or mail messages.
...rdf can also populate other xul elements as well such as listboxes and menus.
...it contains a fairly simple set of elements.
...And 4 more matches
Introduction to XBL - Archive of obsolete content
you can customize the look of elements by applying styles to them.
...the basic appearance of all elements, such as scroll bars and check boxes may be modified by adjusting the style or by setting attributes on the element.
...the behavior describes the properties and methods of the scroll bar in addition to describing the xul elements that make up a scroll bar.
...And 4 more matches
List Controls - Archive of obsolete content
« previousnext » xul has a number of types of elements for creating list boxes.
...xul provides two types of elements to create lists, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes.
... they work similar to the html select element, which performs both functions, but the xul elements have additional features.
...And 4 more matches
XUL Template Primer - Bindings - Archive of obsolete content
dr" predicate="http://home.netscape.com/nc-rdf#street" object="?street"/> </bindings> <action> <hbox uri="?friend"> <label value="?name"/> <label value="?street"/> </hbox> </action> </rule> </template> </vbox> </window> the xul template primer covers the <conditions> and <action> elements, so we won't discuss those here.
... the <bindings> element the <bindings> element is optional in a xul template, but if present, must appear as a sibling of the <conditions> and <action> elements in a rule.
... the <binding> element the <bindings> element (plural) may contain any number of <binding> (singular) elements.
...And 4 more matches
XUL Event Propagation - Archive of obsolete content
and sometimes elements raise different events for the pressing down of the click and the release.
...the availability of event listeners is also somewhat pre-determined, though xul provide generalized event listeners (i.e., oncommand event listeners) for most of the elements in the widget hierarchy.
...where event bubbling propagates an event from its target up higher into the node hiearchy, event capturing intercepts an event before it is received by other elements, even by the event target itself.
...And 4 more matches
Gecko Compatibility Handbook - Archive of obsolete content
instead, each browser supports its own proprietary api for manipulating the content, style and position of html elements in a web page.
... internet explorer incorrectly specifies height and width of inline elements such as span.
...do not specify heights or widths on inline elements such as spans.
...And 4 more matches
Browser Feature Detection - Archive of obsolete content
ocument.createcomment() true true true document.createcdatasection() true false true document.createprocessinginstruction() true false true document.createattribute() true true true document.createentityreference()obsolete since gecko 7 (method present but only returns null: bug 9850) false false document.getelementsbytagname() true true true dom core level 2 support for properties/methods in document name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 document.doctype true true true document.implementation true true true document.documentelement true true true document.createelement() true true true d...
...extnode() true true true document.createcomment() true true true document.createcdatasection() true false true document.createprocessinginstruction() true false true document.createattribute() true true true document.createentityreference()obsolete since gecko 7 true false false document.getelementsbytagname() true true true document.importnode() true false true document.createelementns() true false true document.createattributens() true false true document.getelementsbytagnamens() true false true document.getelementbyid() true true true dom level 1 html support for properties/methods...
... opera 8.54 - 9.01 document.documentelement true true true document.createelement() true true true document.createdocumentfragment() true true true document.createtextnode() true true true document.createcomment() true true true document.createattribute() true true true document.getelementsbytagname() true true true document.title true true true document.referrer true true true document.domain true true true document.url true true true document.body true true true document.images true true true document.applets true true true document.links ...
...And 4 more matches
XUL Parser in Python - Archive of obsolete content
v.00001 to celebrate activestate's recent announcement about support for perl and python in mozilla, i have put together this little python script that parses your local xul and builds a list of all the xul elements and their attributes in an html page.
... with new widgets and attributes landing all the time, i wanted to get some quicker way of looking at the xul--at particular builds, at particular widgets, at which elements had which attributes, etc.
... the script writes out all the attributes and none of the values, but the parser itself is seeing the elements, their attributes, and the values of those attributes, and you just have to ask for them if you want them.
...And 4 more matches
Cascade and inheritance - Learn web development
it is basically a measure of how specific a selector's selection will be: an element selector is less specific — it will select all elements of that type that appear on a page — so will get a lower score.
... a class selector is more specific — it will select only the elements on a page that have a specific class attribute value — so will get a higher score.
... inheritance inheritance also needs to be understood in this context — some css property values set on parent elements are inherited by their child elements, and some aren't.
...And 4 more matches
Styling links - Learn web development
the text "http" should therefore only appear in external links (like the second and third ones), and we can select this with an attribute selector: a[href*="http"] selects <a> elements, but only if they have an href attribute with a value that contains "http" somewhere inside it.
...for example, states like hover can be used to style many different elements, not just links — you might want to style the hover state of paragraphs, list items, or other things.
... <li> elements are normally block by default (see types of css boxes for a refresher), meaning that they will sit on their own lines.
...And 4 more matches
Advanced form styling - Learn web development
to recap what we said in the previous article, we have: 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"> the ugly: some elements can't be styled thoroughly using css.
... these include: elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <datalist>.
... what can be done about the "ugly" elements?
...And 4 more matches
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars.
... note that even though you can put anything inside a <textarea> element (including other html elements, css, and javascript), because of its nature, it is all rendered as if it was plain text content.
... the following screenshots show default, focused, and disabled <textarea> elements in firefox 71 and safari 13 on macos, and edge 18, yandex 14, firefox 71 and chrome 79 on windows 10.
...And 4 more matches
What’s in the head? Metadata in HTML - Learn web development
our aim here is not to show you how to use everything that can possibly be put in the head, but rather to teach you how to use the major elements that you'll want to include in the head, and give you some familiarity.
... you should also try opening the code up in your code editor, editing the contents of these elements, then refreshing the page in your browser.
...there are a lot of different types of <meta> elements that can be included in your page's <head>, but we won't try to explain them all at this stage, as it would just get too confusing.
...And 4 more matches
From object to iframe — other embedding technologies - Learn web development
at this point we'd like to take somewhat of a sideways step, looking at some elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements.
...embedding these technologies was achieved through elements like <object>, and the lesser-used <embed>, and they were very useful at the time.
...<iframe> elements are designed to allow you to embed other web documents into the current document.
...And 4 more matches
Introduction to events - Learn web development
in the case of the web, events are fired inside the browser window, and tend to be attached to a specific item that resides in it — this might be a single element, set of elements, the html document loaded in the current tab, or the entire browser window.
...it makes sense to use onplay only on specific elements, such as <video>).
... the main advantages of the third mechanism are that you can remove event handler code if needed, using removeeventlistener(), and you can add multiple listeners of the same type to elements if required.
...And 4 more matches
Video and Audio APIs - Learn web development
previous overview: client-side web apis next html5 comes with elements for embedding rich media in documents — <video> and <audio> — which in turn come with their own apis for controlling playback, seeking, etc.
... html5 video and audio the <video> and <audio> elements allow us to embed video and audio into web pages.
...this interface is available to both <audio> and <video> elements, as the features you'll want to implement are nearly identical.
...And 4 more matches
Accessibility in React - Learn web development
when we switch between templates in our <todo /> component, we completely remove the elements that were there before to replace them with something else.
... targeting our elements in order to focus on an element in our dom, we need to tell react which element we want to focus on and how to find it.
...it’s particularly useful for referring to dom elements.
...And 4 more matches
Mozilla Web Developer FAQ
these aspects of the layout can be changed by explicitly setting the display css property of the images (and possible surrounding <a> elements) to block.
... the <link> and <style> elements should be inside the <head> element.
... width and height do not apply to non-replaced inline elements such as (by default) <span>.
...And 4 more matches
Bytecode Descriptions
array literals newarray operands: (uint32_t length) stack: ⇒ array create and push a new array object with the given length, preallocating enough memory to hold that many elements.
...val may be magicvalue(js_elements_hole).
...val may be magicvalue(js_elements_hole).
...And 4 more matches
Building the WebLock UI
elements in the xul markup map to widgets in the interface that gecko renders in a fairly straightforward way - so, for instance, the root element of an application window is the element <window/>, the root element of the dialog we'll be creating here is <dialog/>, and so forth.
... within a xul application file, elements like <button/>, <menu/>, and <checkbox/> can be hooked up to an event model, to scripts, and to the xpcom interfaces that carry out a lot of the browser functionality in mozilla.
... in xul individual <radio/> elements are contained within a parent element called <radiogroup/>.
...And 4 more matches
nsIMutableArray
as above, it is legal to add null elements to the array.
... note also that null elements can be created as a side effect of insertelementat().
... conversely, if insertelementat() is never used, and null elements are never explicitly added to the array, then it is guaranteed that nsiarray.queryelementat() will never return a null value.
...And 4 more matches
DOMMatrixReadOnly - Web APIs
dommatrixreadonly.tofloat32array() returns a new float32array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix.
... the elements are stored into the array as single-precision floating-point numbers in column-major (colexographical access, or "colex") order.
... (in other words, down the first column from top to bottom, then the second column, and so forth.) dommatrixreadonly.tofloat64array() returns a new float64array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix.
...And 4 more matches
EventTarget.addEventListener() - Web APIs
event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event.
... the event propagation mode determines the order in which elements receive the event.
... it works on any dom element, not just html elements.
...And 4 more matches
HTMLInputElement - Web APIs
the htmlinputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements.
... properties that apply only to elements of type checkbox or radio checked boolean: returns / sets the current state of the element when type is checkbox or radio.
... properties that apply only to elements of type image alt string: returns / sets the element's alt attribute, containing alternative text to use when type is image.
...And 4 more matches
ARIA: List role - Accessibility
<section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively.
... there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g.
... warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a list and its listitems — <ul>/<ol> and <li>.
...And 4 more matches
WAI-ARIA Roles - Accessibility
this usually includes a logo, company name, search icon, photo related to the page, or slogan.aria: button rolethe button role should be used for clickable elements that trigger a response when activated by the user.
...elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, ye...
...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.aria: form rolethe form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells.
...And 4 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
in this next live example the child elements have been floated, and then their container has had display: flex added.
...if a flex item becomes a grid item, then the flex properties that may have been assigned to the child elements will be ignored.
... flexbox and display: contents the contents value of the display property is a new value that is described in the spec as follows: “the element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal.
...And 4 more matches
box-flex-group - CSS: Cascading Style Sheets
the box-flex-group css property assigns the flexbox's child elements to a flex group.
... /* <integer> values */ box-flex-group: 1; box-flex-group: 5; /* global values */ box-flex-group: inherit; box-flex-group: initial; box-flex-group: unset; for flexible elements assigned to flex groups, the first flex group is 1 and higher values specify subsequent flex groups.
...when dividing up the box's extra space, the browser first considers all elements within the first flex group.
...And 4 more matches
Audio and Video Delivery - Developer guides
the audio and video elements whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same.
... seeking through media media elements provide support for moving the current playback position to specific points in the media's content.
...at this time, this is the only part of the media fragments uri specification implemented by gecko, and it can only be used when specifying the source for media elements, and not in the address bar.
...And 4 more matches
Constraint validation - Developer guides
er a valid number the value must be less than or equal to the value rangeoverflow constraint violation date, month, week a valid date datetime, datetime-local, time a valid date and time required text, search, url, tel, email, password, date, datetime, datetime-local, month, week, time, number, checkbox, radio, file; also on the <select> and <textarea> elements none as it is a boolean attribute: its presence means true, its absence means false there must be a value (if set).
... controlling the look of elements the look of elements can be controlled via css pseudo-classes.
... :required and :optional css pseudo-classes the :required and :optional pseudo-classes allow writing selectors that match form elements that have the required attribute, or that don't have it.
...And 4 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
values for the rel attribute, and the elements for which each is relevant rel value description <link> <a> and <area> <form> alternate alternate representations of the current document.
... not allowed link not allowed the rel attribute is relevant to the <link>, <a>, <area>, and <form> elements, but some values only relevant to a subset of those elements.
...relevant for <link>, <a>, and <area> elements, the author keyword creates a hyperlink.
...And 4 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
<input> elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes.
... additional attributes in addition to the attributes common to all <input> elements, datetime-local inputs offer the following attributes: attribute description max the latest date and time to accept min the earliest date and time to accept step the stepping interval to use for this input, such as when clicking arrows on spinner controls or performing validation max the latest date and time to accept.
...you'll have to resort to css for customizing the sizes of these elements.
...And 4 more matches
HTML reference - HTML: Hypertext Markup Language
this html reference describes all elements and attributes of html, including global attributes that apply to all elements.
... html element reference this page lists all the html elements, which are created using tags.
... html attribute reference elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want.
...And 4 more matches
Array.prototype.join() - JavaScript
the join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string.
... syntax arr.join([separator]) parameters separator optional specifies a string to separate each pair of adjacent elements of the array.
...if omitted, the array elements are separated with a comma (",").
...And 4 more matches
SVG element reference - SVG: Scalable Vector Graphics
WebSVGElement
« svg / svg attribute reference » svg drawings and images are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams.
... here you'll find reference documentation for each of the svg elements.
... svg elements a to z a <a> <animate> <animatemotion> <animatetransform> c <circle> <clippath> <color-profile> d <defs> <desc> <discard> e <ellipse> f <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <fedistantlight> <fedropshadow> <feflood> <fefunca> <fefuncb> <fefuncg> <fefuncr> <fegaussianblur> <feimage> <femerge> <femergenode> <femorphology> <feoffset> <fepointlight> <fespecularlighting> <fespotlight> <fetile> <feturbulence> <filter> <foreignobject> g <g> h <hatch> <hatchpath> i <image> l <line> <lineargradient> m <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <mpath> p <path> <pattern> <polygon> <pol...
...And 4 more matches
page-mod - Archive of obsolete content
the main add-on code sends the desired tag to the content script, and the content script replies by sending the html content of all the elements with that tag.
... /lib/main.js: var tag = "p"; var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: data.url("element-getter.js"), onattach: function(worker) { worker.port.emit("getelements", tag); worker.port.on("gotelement", function(elementcontent) { console.log(elementcontent); }); } }); /data/element-getter.js: self.port.on("getelements", function(tag) { var elements = document.getelementsbytagname(tag); for (var i = 0; i < elements.length; i++) { self.port.emit("gotelement", elements[i].innerhtml); } }); when the user loads a document hosted at "mozilla.org": the content script "element-getter.js" is attached to the document and runs.
... it adds a listener to the getelements message.
...And 3 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
figure out what xul elements you need to create for your add-on to add your interface, where it needs to go into a xul window, and how to do it.
... docs: document.getelementbyid(), document.createelement(), element reference, node reference (dom elements are also nodes).
...one to take a xul window object and then create and add your elements, and then another to find your elements and remove them from the window object.
...And 3 more matches
Adding windows and dialogs - Archive of obsolete content
let's look into the most commonly used form elements and how to use them in your xul windows.
...it is frequently used with the caption element to associate the grouped elements with a title.
...the groupbox element should be used when enclosed elements share some function which is separate from other elements or groups in the same window.
...And 3 more matches
CSS3 - Archive of obsolete content
pseudo-elements are now characterized by two colons rather than one: :after becomes ::after, :before becomes ::before, :first-letter becomes ::first-letter, and :first-line becomes ::first-line.
... media queries are not only used in css document but also in some attributes of html elements, like the media attribute of the <link> element.
... allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-index pseudo-elements.
...And 3 more matches
Simple Query Syntax - Archive of obsolete content
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.
...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.
...And 3 more matches
Template Builder Interface - Archive of obsolete content
templates can only be used in xul documents, however, there is no requirement that the templates generate xul elements.
... they could also be used, for example, to generate html elements.
... this isn't a very common technique, however, here is an example of how this can be used: <html:div id="photoslist" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:html="http://www.w3.org/1999/xhtml"> <html:h1>my photos</html:h1> <template> <html:p uri="rdf:*"><textnode value="rdf:http://purl.org/dc/elements/1.1/title"/></html:p> </template> </html:div> this example generates three paragraphs.
...And 3 more matches
Introduction - Archive of obsolete content
xul provides the ability to create most elements found in modern graphical interfaces.
... some elements that can be created are: input controls such as textboxes and checkboxes toolbars with buttons or other content menus on a menu bar or pop up menus tabbed dialogs trees for hierarchical or tabular information keyboard shortcuts the displayed content can be created from the contents of a xul file or with data from a datasource.
...the contents of menus, trees and other elements can be populated with this data, or with your own data supplied in an rdf file.
...And 3 more matches
Modifying the Default Skin - Archive of obsolete content
support for the userchrome.css file and any of its elements described below are not guaranteed in future versions of firefox.
... a skin is described using css, allowing you to define the colors, borders and images used to draw elements.
...the global directory within this archive contains the main style definitions for how to display the various xul elements.
...And 3 more matches
Splitters - Archive of obsolete content
you can place a splitter anywhere you want and it will allow resizing of the elements that come before it and the elements that come after it in the same box.
... resizebefore when the splitter is dragged, the elements to the left (or above) resize.
... resizeafter when the splitter is dragged, the elements to the right (or below) resize.
...And 3 more matches
box - Archive of obsolete content
ArchiveMozillaXULbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
... if 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.
...And 3 more matches
grid - Archive of obsolete content
ArchiveMozillaXULgrid
« xul reference home [ examples | attributes | properties | methods | related ] a grid is a layout type that arranges elements in rows and columns.
...the size and attributes defined on columns and rows will affect the size and placement of elements in each cell.
... elements placed within both the columns and rows will be displayed, although usually only elements will be placed inside one of these.
...And 3 more matches
key - Archive of obsolete content
ArchiveMozillaXULkey
in order to use (non-default) key commands within specific elements, you will need to listen for key events.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 3 more matches
label - Archive of obsolete content
ArchiveMozillaXULlabel
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 3 more matches
notification - Archive of obsolete content
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 "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean...
...for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax.
... for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user.
...And 3 more matches
preference - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
...And 3 more matches
treecell - Archive of obsolete content
ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins.
...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 "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean...
...for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax.
...And 3 more matches
treeitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a treeitem should be placed inside a treechildren element and should contain treerow elements.
... 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.
... elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource.
...And 3 more matches
Archived Mozilla and build documentation - Archive of obsolete content
web pages can reference generators via <link rel="microsummary"> elements in their <head> elements.
... introducing the audio api extension the audio data api extension extends the html5 specification of the <audio> and <video> media elements by exposing audio metadata and raw audio data.
... space manager high level design the space manager and associated classes and structures are used by block and line layout to manage rectangular regions that are occupied and available, for correct handling of floated elements and the elements that flow around them.
...And 3 more matches
CSS values and units - Learn web development
you might get confused between css data types and html elements too, as they both use angle brackets, but this is unlikely — they are used in very different contexts.
...the benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scale relative to everything else on the page.
...change this value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size.
...And 3 more matches
Flexbox - Learn web development
specifying what elements to lay out as flexible boxes to start with, we need to select which elements are to be laid out as flexible boxes.
... to do this, we set a special value of display on the parent element of the elements you want to affect.
... in this case we want to lay out the <article> elements, so we set this on the <section>: section { display: flex; } this causes the <section> element to become a flex container, and its children to become flex items.
...And 3 more matches
HTML table advanced features and accessibility - Learn web development
these elements don't make the table any more accessible to screenreader users, and don't result in any visual enhancement on their own.
... active learning: adding table structure let's put these new elements into action.
... let's add some simple extra styling to the table, to give you an idea of how useful these elements are for applying css.
...And 3 more matches
Focus management with Vue refs - Learn web development
virtual dom and refs vue, like some other frameworks, uses a virtual dom (vdom) to manage elements.
...however, it also means you often should not edit your html elements directly through native browser apis (like document.getelementbyid) when using frameworks, because it results in the vdom and real dom going out of sync.
...no two elements rendered at the same time should have the same ref.
...And 3 more matches
JavaScript Tips
for instance, windowmanager.getenumerator(atype).hasmoreelements() may be replaced with windowmanager.getmostrecentwindow(atype) != null for a single window.
... dom elements dom elements are just xpcom objects with some of the interfaces precached.
...similarly prefer document.getelementsbytagname(atag).item(0) != null to document.getelementsbytagname(atag).length > 0.
...And 3 more matches
JS::HandleValueArray
syntax js::handlevaluearray(const js::rootedvalue& value); js::handlevaluearray(const js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::frommarkedlocation(size_t len, const js::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t startindex, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue &amp; an element of newly created 1-length array.
... values js::autovaluevector &amp; elements of newly created array.
... values js::autovaluearray &amp; elements of newly created array.
...And 3 more matches
JS_SetArrayLength
length uint32_t number of array elements to set.
...length indicates the number of elements.
...you can call js_setarraylength either to set the number of elements for an array object you created without specifying an initial number of elements, or to change the number of elements allocated for an array.
...And 3 more matches
nsIParserUtils
sanitizerallowstyle (1 << 1) flag for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding).
... sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute.
... by default, non-dangerous non-css presentational html elements and attributes or forms are not removed.
...And 3 more matches
WebIDL bindings
any dictionary members and sequence elements become js::value.
... the dictionary members and sequence elements are guaranteed to be marked by whomever puts the sequence or dictionary on the stack, using sequencerooter and dictionaryrooter.
... object dictionary members and sequence elements become jsobject*.
...And 3 more matches
Working with windows in chrome code
the elements above the chrome document opened in the tab are separate from your chrome document.
...accessing elements which are ancestors of your chrome document, or accessing elements which are descendants of your chrome document (but nevertheless in a different context).
...to access the elements and variables inside the sidebar, you need to use document.getelementbyid("sidebar").contentdocument or .contentwindow, like when accessing content documents.
...And 3 more matches
Accessibility Inspector - Firefox Developer Tools
here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose information on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links, form elements, etc.?).
... semantic dom elements have roles assigned to them by default that hint at what their purpose is.
...this is a bit like the dom tree, except that it contains a more limited set of elements and slightly different information about them.
...And 3 more matches
CustomElementRegistry.define() - Web APIs
there are two types of custom elements you can create: autonomous custom element: standalone elements; they don't inherit from built-in html elements.
... customized built-in element: these elements inherit from — and extend — built-in html elements.
... syntax customelements.define(name, constructor, options); parameters name name for the new custom element.
...And 3 more matches
Document.execCommand() - Web APIs
when an html document has been switched to designmode, its document object exposes an execcommand method to run commands that manipulate the current editable region, such as form inputs or contenteditable elements.
... most commands affect the document's selection (bold, italics, etc.), while others insert new elements (adding a link), or affect an entire line (indenting).
... enableabsolutepositioneditor enables or disables the grabber that allows absolutely-positioned elements to be moved around.
...And 3 more matches
Element: click event - Web APIs
bubbles yes cancelable yes interface mouseevent event handler property onclick if the button is pressed on one element and the pointer is moved outside the element before the button is released, the event is fired on the most specific ancestor element that contained both elements.
... internet explorer internet explorer 8 & 9 suffer from a bug where elements with a computed background-color of transparent that are overlaid on top of other element(s) won't receive click events.
... known workarounds for this bug: for ie9 only: set background-color: rgba(0,0,0,0) set opacity: 0 and an explicit background-color other than transparent for ie8 and ie9: set filter: alpha(opacity=0); and an explicit background-color other than transparent safari mobile safari mobile 7.0+ (and likely earlier versions too) suffers from a bug where click events aren't fired on elements that aren't typically interactive (e.g.
...And 3 more matches
Element.getClientRects() - Web APIs
when called on svg elements other than an outer-<svg>, the "viewport" that the resulting rectangles are relative to is the viewport that the element's outer-<svg> establishes (and to be clear, the rectangles are also transformed by the outer-<svg>'s viewbox transform, if any).
... the returned rectangles do not include the bounds of any child elements that might happen to overflow.
... for html <area> elements, svg elements that do not render anything themselves, display:none elements, and generally any elements that are not directly rendered, an empty list is returned.
...And 3 more matches
HTMLSelectElement - Web APIs
these elements also share all of the properties and methods of other html elements via the htmlelement interface.
... 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.
...And 3 more matches
WebGLRenderingContext.getParameter() - Web APIs
constant returned type description gl.active_texture glenum gl.aliased_line_width_range float32array (with 2 elements) gl.aliased_point_size_range float32array (with 2 elements) gl.alpha_bits glint gl.array_buffer_binding webglbuffer gl.blend glboolean gl.blend_color float32array (with 4 values) gl.blend_dst_alpha glenum gl.blend_dst_rgb glenum gl.blend_equation glenum gl.b...
... gl.depth_bits glint gl.depth_clear_value glfloat gl.depth_func glenum gl.depth_range float32array (with 2 elements) gl.depth_test glboolean gl.depth_writemask glboolean gl.dither glboolean gl.element_array_buffer_binding webglbuffer gl.framebuffer_binding webglframebuffer or null null corresponds to a binding to the default framebuffer.
... glint gl.max_renderbuffer_size glint gl.max_texture_image_units glint gl.max_texture_size glint gl.max_varying_vectors glint gl.max_vertex_attribs glint gl.max_vertex_texture_image_units glint gl.max_vertex_uniform_vectors glint gl.max_viewport_dims int32array (with 2 elements) gl.pack_alignment glint gl.polygon_offset_factor glfloat gl.polygon_offset_fill glboolean gl.polygon_offset_units glfloat gl.red_bits glint gl.renderbuffer_binding webglrenderbuffer or null see bindrenderbuffer.
...And 3 more matches
Signaling and video calling - Web APIs
this requires video elements, and a button to hang up the call: <div class="flexchild" id="camera-container"> <div class="camera-box"> <video id="received_video" autoplay></video> <video id="local_video" autoplay muted></video> <button id="hangup-button" onclick="hangupcall();" disabled> hang up </button> </div> </div> the page structure defined here is using <div> elements, giving us full control...
...take note of the two <video> elements, one for your self-view, one for the connection, and the <button> element.
...hild); } msg.users.foreach(function(username) { var item = document.createelement("li"); item.appendchild(document.createtextnode(username)); item.addeventlistener("click", invite, false); listelem.appendchild(item); }); } after getting a reference to the <ul> which contains the list of user names into the variable listelem, we empty the list by removing each of its child elements.
...And 3 more matches
Generating HTML - Web APIs
the <body> element of the article now contains html elements (a <b> and <u> tag, see figure 2).
... the xml document contains both html elements and xml elements, but only one namespace is needed, namely for the xml elements.
...for the xml elements, our own namespace is needed, http://devedge.netscape.com/2002/de, and it is given the prefix myns (xmlns:myns="http://devedge.netscape.com/2002/de").
...And 3 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.
... 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.
... this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
...And 3 more matches
ARIA: rowgroup role - Accessibility
"none">population</span> </div> </div> <div role="rowgroup"> <div role="row"> <span role="cell">finland</span> <span role="cell">5.5 million</span> </div> <div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> </div> </div> description rowgroup establishes a relationship between owned row elements and is a structural equivalent to the thead, tfoot and tbody elements in html.
...their elements must be contained in, or owned by, elements with either the table or grid role.
... using the native <thead>, <tfoot> , and <tbody> html elements, whenever possible, is strongly encouraged.
...And 3 more matches
::after (:after) - CSS: Cascading Style Sheets
WebCSS::after
/* add an arrow after links */ a::after { content: "→"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements.
... syntax /* css3 syntax */ ::after /* css2 syntax */ :after note: css3 introduced the ::after notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
...we can use these classes to add pseudo-elements to the end of paragraphs.
...And 3 more matches
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
/* add a heart before links */ a::before { content: "♥"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements.
... syntax /* css3 syntax */ ::before /* css2 syntax */ :before note: css3 introduced the ::before notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
... examples adding quotation marks one simple example of using ::before pseudo-elements is to provide quotation marks.
...And 3 more matches
In Flow and Out of Flow - CSS: Cascading Style Sheets
all elements that are in flow, will be laid out using this method.
... all of the elements can be said to be in flow.
... taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page.
...And 3 more matches
bottom - CSS: Cascading Style Sheets
WebCSSbottom
it has no effect on non-positioned elements.
... syntax /* <length> values */ bottom: 3px; bottom: 2.4em; /* <percentage>s of the height of the containing block */ bottom: 10%; /* keyword value */ bottom: auto; /* global values */ bottom: inherit; bottom: initial; bottom: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the bottom edge of the containing block.
... for relatively positioned elements, the distance that the element is moved above its normal position.
...And 3 more matches
box-flex - CSS: Cascading Style Sheets
WebCSSbox-flex
notes the containing box allocates the available extra space in proportion to the flex value of each of the content elements.
... content elements that have zero flex do not grow.
... content elements that have the same flex grow by the same absolute amounts.
...And 3 more matches
direction - CSS: Cascading Style Sheets
WebCSSdirection
the property sets the base text direction of block-level elements and the direction of embeddings created by the unicode-bidi property.
... it also sets the default alignment of text, block-level elements, and the direction that cells flow within a table row.
... syntax /* keyword values */ direction: ltr; direction: rtl; /* global values */ direction: inherit; direction: initial; direction: unset; values ltr text and other elements go from left to right.
...And 3 more matches
left - CSS: Cascading Style Sheets
WebCSSleft
it has no effect on non-positioned elements.
... syntax /* <length> values */ left: 3px; left: 2.4em; /* <percentage>s of the width of the containing block */ left: 10%; /* keyword value */ left: auto; /* global values */ left: inherit; left: initial; left: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block.
... for relatively positioned elements, the distance that the element is moved to the right of its normal position.
...And 3 more matches
right - CSS: Cascading Style Sheets
WebCSSright
it has no effect on non-positioned elements.
... syntax /* <length> values */ right: 3px; right: 2.4em; /* <percentage>s of the width of the containing block */ right: 10%; /* keyword value */ right: auto; /* global values */ right: inherit; right: initial; right: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block.
... for relatively positioned elements, the distance that the element is moved to the left of its normal position.
...And 3 more matches
top - CSS: Cascading Style Sheets
WebCSStop
it has no effect on non-positioned elements.
... syntax /* <length> values */ top: 3px; top: 2.4em; /* <percentage>s of the height of the containing block */ top: 10%; /* keyword value */ top: auto; /* global values */ top: inherit; top: initial; top: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the top edge of the containing block.
... for relatively positioned elements, the distance that the element is moved below its normal position.
...And 3 more matches
vertical-align - CSS: Cascading Style Sheets
ething even more bizarre and inexplicable.</p> <p>there is another theory which states that this has already happened.</p> </td> </tr> </table> table { margin-left: auto; margin-right: auto; width: 80%; } table, th, td { border: 1px solid black; } td { padding: 0.5em; font-family: monospace; } note that vertical-align only applies to inline, inline-block and table-cell elements: you can't use it to vertically align block-level elements.
... values for inline elements parent-relative values these values vertically align the element relative to its parent element: baseline aligns the baseline of the element with the baseline of its parent.
... the baseline of some replaced elements, like <textarea>, is not specified by the html specification, meaning that their behavior with this keyword may vary between browsers.
...And 3 more matches
will-change - CSS: Cascading Style Sheets
l-change: contents; will-change: transform; /* example of <custom-ident> */ will-change: opacity; /* example of <custom-ident> */ will-change: left, top; /* example of two <animateable-feature> */ /* global values */ will-change: inherit; will-change: initial; will-change: unset; proper usage of this property can be a bit tricky: don't apply will-change to too many elements.
...but adding will-change directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise.
... don't apply will-change to elements to perform premature optimization.
...And 3 more matches
Video player styling basics - Developer guides
the custom video controls and <progress> element are now contained within <div> elements, rather than residing inside unordered list items.
... as mentioned earlier, a data-state attribute is now used to indicate whether the video controls are visible or not and these also need to be styled: .controls[data-state=hidden] { display:none; } .controls[data-state=visible] { display:block; } there are a number of properties that also need to be set for all elements within the video controls: .controls > * { float:left; width:3.90625%; height:100%; margin-left:0.1953125%; display:block; } .controls > *:first-child { margin-left:0; } all elements are floated left, as they are to be aligned next to one another, and each element is set to have a width of nearly 4% (again the actual value was calculated based on the required dimensions of th...
... the <div> container for the <progress> element also requires some specific settings; it is set to be much wider than the other child elements and its cursor value is set to be pointer: .controls .progress { cursor:pointer; width:75.390625%; } buttons the first major styling task to tackle is to make the video control's buttons actually look like and act like real buttons.
...And 3 more matches
Making content editable - Developer guides
these are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or remove rows and columns; and the grabber that allows moving of absolutely-positioned elements.
...most commands affect the document's selection by, for example, applying a style to the text (bold, italics, etc), while others insert new elements (like adding a link) or affect an entire line (indenting).
...for example, even something as simple as what happens when you press enter/return to create a new line of text inside an editable element was handled differently across the major browsers (firefox inserted <br> elements, ie/opera used <p>, chrome/safari used <div>).
...And 3 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
firefox 79+) setting target="_blank" on <a> elements implicitly provides the same rel behavior as setting rel="noopener".
... permitted parents any element that accepts phrasing content, or any element that accepts flow content, but not other <a> elements.
...*2); c.closepath(); c.fill(); } } canvas.addeventlistener('mousemove', event => draw(event.offsetx, event.offsety) ); canvas.addeventlistener('mousedown', () => isdrawing = true); canvas.addeventlistener('mouseup', () => isdrawing = false); document.queryselector('a').addeventlistener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy.
...And 3 more matches
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
(if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.) this attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>.
... multipart/form-data: use to submit <input> elements with their type attributes set to file.
... this attribute is also available on <input type="image"> and <input type="submit"> elements.
...And 3 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
<input> elements of type="date" create input fields that let the user enter a date, either with a textbox that validates the input or a special date picker interface.
... additional attributes along with the attributes common to all <input> elements, date inputs have the following attributes: attribute description max the latest acceptable date min the earliest acceptable date step the stepping interval, when clicking up and down spinner buttons and validating the date max the latest date to accept.
...we make use of the :valid and :invalid pseudo-elements to add an icon next to the input, based on whether or not the current value is valid.
...And 3 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
<input> elements of type month create input fields that let the user enter a month and year allowing a month and year to be easily entered.
... set the date value in javascript using the htmlinputelement.value property, for example: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> var monthcontrol = document.queryselector('input[type="month"]'); monthcontrol.value = '1978-06'; additional attributes in addition to the attributes common to <input> elements, month inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that...
...: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the best way to deal with dates in forms in a cross-browser way (until all of the major browsers have supported them for a while) is to get the user to enter the month and year in separate controls (<select> elements being popular; see below for an implementation), or use javascript libraries such as the jquery date picker plugin.
...And 3 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
<input> elements of type text create basic single-line text fields.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, text inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considere...
...it can be used on any editable content, but here we consider specifics related to the use of spellcheck on <input> elements.
...And 3 more matches
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
if there are other elements which also match the id value, later in the document, they are not considered.
... styling with css there are no special styling considerations for <label> elements — structurally they are simple inline elements, and so can be styled in much the same way as a <span> or <a> element.
... examples simple label example <label>click me <input type="text"></label> using the "for" attribute <label for="username">click me</label> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label.
...And 3 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
however, this isn't a good practice to follow; it makes more sense to separate your <link> elements from your body content, putting them in the <head>.
... under xhtml 1.0, empty elements such as <link> require a trailing slash: <link />.
...the table below lists the valid values for this attribute and the elements or resources they apply to.
...And 3 more matches
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
the html table body element (<tbody>) encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of the table (<table>).
... permitted content zero or more <tr> elements.
... if you use <tbody>, you can't also have table rows (<tr> elements) which are direct children of the <table> but not included inside the <tbody>.
...And 3 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
attributes like all other html elements, this element supports the global attributes.
...however, this can be useful when creating media elements whose source will be set at a later time, under user control.
...without sending the origin: http header), preventing its non-tainted used in <canvas> elements.
...And 3 more matches
hidden - HTML: Hypertext Markup Language
for example, it can be used to hide elements of the page that can't be used until the login process has been completed.
... browsers won't render elements with the hidden attribute set.
... hidden elements shouldn't be linked from non-hidden elements, and elements that are descendants of a hidden element are still active, which means that script elements can still execute and form elements can still submit.
...And 3 more matches
tabindex - HTML: Hypertext Markup Language
if multiple elements share the same positive tabindex value, their order relative to each other follows their position in the document source.
...instead, write the document with the elements in a logical sequence.
... interactive components authored using non-interactive elements are not be listed in the accessibility tree.
...And 3 more matches
CSP: object-src - HTTP
the http content-security-policy object-src directive specifies valid sources for the <object>, <embed>, and <applet> elements.
... to set allowed types for <object>, <embed>, and <applet> elements, use the plugin-types directive.
... elements controlled by object-src are perhaps coincidentally considered legacy html elements and aren't receiving new standardized features (such as the security attributes sandbox or allow for <iframe>).
...And 3 more matches
Index - HTTP
WebHTTPHeadersIndex
31 csp: child-src csp, directive, http, reference, security the deprecated http content-security-policy (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>.
... 37 csp: frame-src csp, directive, http, reference, security the http content-security-policy (csp) frame-src directive specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
... 40 csp: media-src csp, directive, http, reference, security the http content-security-policy (csp) media-src directive specifies valid sources for loading media using the <audio> and <video> elements.
...And 3 more matches
JavaScript technologies overview - JavaScript
however, the umbrella term "javascript" as understood in a web browser context contains several very different elements.
...layered above the abstract concepts defined in dom core, html also defines the meaning of elements.
... the html dom includes such things as the classname property on html elements, or apis such as document.body.
...And 3 more matches
WebAssembly.Table() constructor - JavaScript
initial the initial number of elements of the webassembly table.
... maximum optional the maximum number of elements the webassembly table is allowed to grow to.
... examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an initial size of 2 elements.
...And 3 more matches
WebAssembly.Table - JavaScript
the number of elements.
... table.prototype.grow() increases the size of the table instance by a specified number of elements.
... examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an initial size of 2 elements.
...And 3 more matches
MathML attribute reference - MathML
notes: the mathml <mstyle> and <math> elements accept all attributes of all mathml presentation elements.
... the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well.
... name elements accepting attribute description accent <mo>, <mover>, <munderover> a boolean value specifying whether the operator should be treated as an accent.
...And 3 more matches
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetransform>, <discard>, <feimage>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference.
...if the url points to multiple target elements, if the given target element is not capable of being a target of the given animation element, or if the given target element is not part of the current document, then the animation element will not affect any target element.
... refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
...And 3 more matches
Using shadow DOM - Web Components
high-level view this article assumes you are already familiar with the concept of the dom (document object model) — a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an html document in the case of web documents).
...aur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> this fragment produces the following dom structure: shadow dom allows hidden dom trees to be attached to elements in the regular dom tree — this shadow dom tree starts with a shadow root, underneath which can be attached to any elements you want, in the same way as the normal dom.
...the shadow dom spec has made it so that you are allowed to actually manipulate the shadow dom of your own custom elements.
...And 3 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes found 54 pages: # page tags and summary 1 xslt: extensible stylesheet language transformations landing, web, xslt extensible stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents.
... 19 xslt elements reference element, overview, reference, xslt there are two types of elements discussed here: top-level elements and instructions.
...but it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.).
...And 3 more matches
Adding menus and submenus - Archive of obsolete content
the separator is usually displayed as a horizontal line that creates a logical division between different types of menuitem elements, keeping everything more organized.
... a menubar can hold one or more menu elements.
... menus require a menupopup element as a container for its children, which are usually menuitem elements, but can also be menuseparator, or menu in order to have multiple nesting levels: <toolbox> <menubar id="xulschoolhello-menubar"> <menu id="xulschoolhello-greeting-menu" label="&xulschoolhello.greeting.label;"> <menupopup> <menu id="xulschoolhello-greeting-sizes-menu" label="&xulschoolhello.greetingsizes.label;"> <menupopup> <menuitem label="&xulschoolhello.greet.short.label;" oncommand="xulschoolchrome.greetingdialog.greetingshort(event);" /> <menuitem label="&xulschoolhello.greet.medium.label;" oncommand="xulschoolchrome.greetingdialog.greetingmedium(event);" /> <menuitem label="&xulschoolhello.greet.
...And 2 more matches
Adding sidebars - Archive of obsolete content
for this purpose we'll also look at some handy xul elements in this section.
... the tabbox element the « xul reference « element creates a tabbed view of one or more tabpanel elements.
...using custom-made elements are likely to cause accessibility and functional problems.
...And 2 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
in particular, the ::before and ::after pseudo-elements, and pseudo-classes like :hover and :active can be used to achieve extremely complex dynamic behavior.
... late binding and event delegation often times, it suffices to bind event listeners to top-level elements and check for matching elements when the event fires.
... for instance, rather than watching for the creation of <a> elements and adding event listeners to them as they are created, an event listener can be added to the root <html> element, and when the event fires, the event.target and its parents can be searched for a matching element.
...And 2 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
you should define this function for elements that allow dragged data to be dropped on them.
...for elements that can have objects dropped on them, you should define ondragover, ondrop and getsupportedflavours (and, if desired, ondragexit).
...you can reuse the same observer for multiple elements.
...And 2 more matches
Space Manager High Level Design - Archive of obsolete content
overview the space manager and associated classes and structures are used by block and line layout to manage rectangular regions that are occupied and available, for correct handling of floated elements and the elements that flow around them.
... when elements are floated to the left or right in a layout, they take up space and influence where other elements can be placed.
...this information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits.
...And 2 more matches
Dynamically modifying XUL-based user interface - Archive of obsolete content
there are also dom methods that create, move, or delete elements from a document.
...a logical structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc.
...it uses document.createelementns() method to create the items, and insertbefore() with appendchild() to insert the created xml elements within the document.
...And 2 more matches
Tooltips - Archive of obsolete content
for this, the tooltiptext attribute may be used, which is valid for all xul elements.
...elements that use the tooltiptext attribute display the tooltip in a default tooltip element, which typically looks like a small yellow box large enough to fit the text inside it.
... however, it is possible to use another tooltip element that looks differently, or which supports other elements besides a single text label.
...And 2 more matches
Additional Navigation - Archive of obsolete content
here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> this new triple has a static value for the object attribute instead of a variable reference.
...for the first result, the value of the ?photo variable 'http://www.xulplanet.com/ndeakin/images/t/palace.jpg' will be used as the subject, the predicate will be 'http://purl.org/dc/elements/1.1/title', and the object will be 'canal'.
...another thing that you cannot have is a triple where both variables would be unknown as in the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?category" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template builder gets to the triple, neither the ?category nor the ?title variables can be filled in so the builder doesn't know what to generate.
...And 2 more matches
Building Menus With Templates - Archive of obsolete content
« previousnext » menus may be generated using a template in the same manner as other elements.
... however, unlike with other elements, the content of a menu is only generated once the menu has been opened.
...the menuitem elements however will be repeated for each result from the query.
...And 2 more matches
Building Trees - Archive of obsolete content
<tree id="photoslist" flex="1" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" flags="dont-build-content"> <treecols> <treecol id="name" label="name" flex="1"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://purl.org/dc/elements/1.1/title"/> <treecell label="rdf:http://purl.org/dc/elements/1.1/date"/> </treerow> </treeitem> </treechildren> </template> </tree> note: the tree columns (treecols) are declared outside the template as static content, since they only need to be declared once.
...when the view requests a label for the first cell, the builder looks up the ‘http://purl.org/dc/elements/1.1/title’ predicate for the row in question and returns it.
...since no elements are generated, you won’t be able to retrieve the values for them either.
...And 2 more matches
RDF Modifications - Archive of obsolete content
for instance, an assert call looks like the following: var source = rdf.getresource("http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"); var predicate = rdf.getresource("http://purl.org/dc/elements/1.1/description"); var target = rdf.getliteral("one of the thirty or so egyptian obelisks"); datasource.assert(source, predicate, target, true); the assert call adds a new triple to the rdf datasource.
... subject: http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg predicate: http://purl.org/dc/elements/1.1/description object: one of the thirty or so egyptian obelisks the template builder will be notified through the rdf observer mechanism of the change.
...let's assume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> these query statements will cause any photos with both a title and a description to be displayed.
...And 2 more matches
Adding Event Handlers - Archive of obsolete content
add the line below just after the opening window tag and before any elements.
...some events are triggered only by certain elements.
...naturally, an event attached to an element higher up will receive notification of all elements inside it, whereas an event attached to a button will only receive events pertaining to that button.
...And 2 more matches
Adding Labels and Images - Archive of obsolete content
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.
...And 2 more matches
Commands - Archive of obsolete content
command elements the command element is used to create commands which can be used to carry out operations.
... the other advantage is that several buttons or other ui elements can be hooked up to the same command.
...normally, you would only hook up elements that would send a command event.
...And 2 more matches
Input Controls - Archive of obsolete content
« previousnext » xul has elements that are similar to the html form controls.
... 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.
...in xul, you can use the textbox element for this purpose as well -- two separate elements are not necessary.
...And 2 more matches
Modifying a XUL Interface - Archive of obsolete content
creating new elements you can create new elements using the createelement() function of the document.
...the createelementns() function may be used to create elements in a different namespace.
... note that some elements, such as listbox and menulist provide some additional specialized modification functions which you should use instead when you can.
...And 2 more matches
XUL Questions and Answers - Archive of obsolete content
overlaying elements without ids the original developers only tend to put ids where they need them.
... as an extension author, you have at least two options: use dom methods to dynamically create or rearrange elements file an enhancement request in bugzilla to have extra ids added.
...*/ how do i create xul elements dynamically in javascript?
...And 2 more matches
caption - Archive of obsolete content
it may contain either a text label, using the label attribute, or child elements for a more complex caption.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...elements with a higher tabindex are later in the tab sequence.
...And 2 more matches
checkbox - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 2 more matches
colorpicker - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
...And 2 more matches
listcell - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 2 more matches
listhead - Archive of obsolete content
it is usual to place listheader elements inside the listhead, one for each column.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...And 2 more matches
prefwindow - Archive of obsolete content
this element should be used in place of the window tag and should contain one or more prefpane elements.
... preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild()...
...And 2 more matches
rows - Archive of obsolete content
ArchiveMozillaXULrows
child row elements define the individual rows to appear in the grid.
...however, nesting rows elements allows groups of rows to have a separate appearance such as a different border, or separate scrolling may be defined for these rows.
... non-row related elements placed inside a rows element occupy the full width of the grid and are placed in their corresponding positions between the rows.
...And 2 more matches
separator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a small separating gap between elements.
... horizontal the separator separates vertically placed elements.
... vertical the separator separates horizontally placed elements.
...And 2 more matches
tabbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display a set of tabbed pages of elements.
...down, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selectedindex, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard navigation events are listened to.
... selectedtab type: tab element a reference to the currently selected tab, which will always be one of the tab elements in the tabs element.
...And 2 more matches
textbox - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...--> <input type="text" spellcheck="false" /><br /> <textarea spellcheck="false"></textarea> <div contenteditable="true" spellcheck="false">i am some content</div> you can use spellcheck on input, textarea, and contenteditable elements.
...And 2 more matches
treecol - Archive of obsolete content
you can also place splitter elements between the columns to allow column resizing.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...individual treecell elements in the column may be marked editable="false" in order to disable editing.
...And 2 more matches
CSS - Archive of obsolete content
ArchiveWebCSS
normally, a <xul:stack> will change its size so that all of its child elements are completely visible.
...om behavior that occurs when a user hits the zoom limit during page manipulation.-ms-content-zoom-limitthe -ms-content-zoom-limit css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-limit-min and -ms-content-zoom-limit-max properties.-ms-content-zoom-limit-maxthe -ms-content-zoom-limit-max css property is a microsoft extension that specifies the selected elements' maximum zoom factor.-ms-content-zoom-limit-minthe -ms-content-zoom-limit-min css property is a microsoft extension that specifies the minimum zoom factor.-ms-content-zoom-snapthe -ms-content-zoom-snap css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-snap-type and -ms-content-zoom-snap-points properties.-ms-content-zoom-snap-pointsthe -ms-content-zoom...
...l-to-horizontal scroll wheel translation occurs on the specified element.-ms-scrollbar-3dlight-colorthe -ms-scrollbar-3dlight-color css property is a microsoft extension specifying the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.-ms-scrollbar-arrow-colorthe -ms-scrollbar-arrow-color css property is a microsoft extension that specifies the color of the arrow elements of a scroll arrow.-ms-scrollbar-base-colorthe -ms-scrollbar-base-color css property is a microsoft extension that specifies the base color of the main elements of a scroll bar.-ms-scrollbar-darkshadow-colorthe -ms-scrollbar-darkshadow-color css property is a microsoft extension that specifies the color of a scroll bar's gutter.-ms-scrollbar-face-colorthe -ms-scrollbar-face-color css property is a...
...And 2 more matches
Introduction - Archive of obsolete content
« previousnext » basic syntax with e4x enabled, basic xml elements are valid syntax for variables.
... var element2 = <foo> <bar/> </foo>; additionally, you can specify all of the normal attributes on elements that you would normally include in an xml document.
... var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to provide an easier way for javascript programmers to manipulate an xml document, without going through the dom interfaces.
...And 2 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
at the end of it, there were a series of div elements that contained a picture of the fish, the name of the fish, and one or more paragraphs of text about the fish.
...this was most easily accomplished by floating the div elements themselves.
...these are enclosed in h3 elements, so the field was pretty wide open in terms of what we could do.
...And 2 more matches
Styling Abbreviations and Acronyms - Archive of obsolete content
summary: the html elements abbr and acronym are useful accessibility aids, but their styling can come as a surprise to authors.
... see how you can take control of their presentation without sacrificing the benefits these elements provide.
... many authors are beginning to use the html elements abbr (abbreviation) and acronym in their web pages.
...And 2 more matches
Sizing items in CSS - Learn web development
understanding how big the different features in your design will be is important, and in this lesson we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future.
... the natural or intrinsic size of things html elements have a natural size, set before they are affected by any css.
... setting a specific size we can of course give elements in our design a specific size.
...And 2 more matches
CSS building blocks - Learn web development
css selectors there are a wide variety of css selectors available, allowing for fine-grained precision when selecting elements to style.
...the sub-articles are as follows: type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to align items with other items.
...understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future.
...And 2 more matches
How CSS is structured - Learn web development
each css rule starts with a selector—or a list of selectors—in order to tell the browser which element or elements the rules should apply to.
...however, there is also a class that sets the text of selected elements to red.
...write css rules that apply styling to different html elements: font-size width background-color color border important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid.
...And 2 more matches
create fancy boxes - Learn web development
pseudo-elements when styling a single box, you could find yourself limited and could wish to have more boxes to create even more amazing styles.
...one solution to avoid such pitfalls is to use css pseudo-elements.
... feel free to tweak this example to make a cloud that isn't flat at the bottom ;) */ border-radius: 100% 100% 0 0; } /* those are common style that apply to both our ::before and ::after pseudo elements.
...And 2 more matches
Styling lists - Learn web development
ther ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>halloumi</dt> <dd>a semi-hard, unripened, brined cheese with a higher-than-usual melting point, usually made from goat/sheep milk.</dd> <dt>green salad</dt> <dd>that green healthy stuff that many of us just use to garnish kebabs.</dd> </dl> if you go to the live example now and investigate the list elements using browser developer tools, you'll notice a couple of styling defaults: the <ul> and <ol> elements have a top and bottom margin of 16px (1em) and a padding-left of 40px (2.5em.) the list items (<li> elements) have no set defaults for spacing.
... the <dd> elements have margin-left of 40px (2.5em.) the <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types.
... handling list spacing when styling lists, you need to adjust their styles so they keep the same vertical spacing as their surrounding elements (such as paragraphs and images; sometimes called vertical rhythm), and the same horizontal spacing as each other (you can see the finished styled example on github, and find the source code too.) the css used for the text styling and spacing is as follows: /* general styles */ html { font-family: helvetica, arial, sans-serif; font-size: 10px; } h2 { font-size: 2rem; } ul,ol,dl,p { font-size: 1.5rem; } li, p { line-height: 1.5; } /* description list styles */ dd, dt { line-height: 1.5; } dt { font-weight: bold; } the first rule sets a sitewide font and a baseline font size of 10px.
...And 2 more matches
Web forms — Working with user data - Learn web development
the above text is a good indicator as to why we've put web forms into its own standalone module, rather than trying to mix bits of it into the html, css, and javascript topic areas — form elements are more complex than most other html elements, and they also require a close marriage of related css and javascript techniques to get the most out of them.
... introductory guides your first form the first article in our series provides your very first experience of creating a web form, including designing a simple form, implementing it using the right html elements, adding some very simple styling via css, and how data is sent to a server.
... how to structure a web form with the basics out of the way, we now look in more detail at the elements used to provide structure and meaning to the different parts of a form.
...And 2 more matches
Debugging HTML - Learn web development
<ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>badly nested elements: nesting elements properly is also very important for code behaving correctly.
...let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and list item elements have no closing tags.
... "end tag li implied, but there were open elements" (2 instances): these messages indicate that an element is open that should be closed.
...And 2 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
adding headers with <th> elements now let's turn our attention to table headers — special cells that go at the start of a row or column and define the type of data that row or column contains (as an example, see the "person" and "age" cells in the first example shown in this article).
...go into your html, and change all the <td> elements surrounding the table headers into <th> elements.
...html has a method of defining styling information for an entire column of data all in one place — the <col> and <colgroup> elements.
...And 2 more matches
Drawing graphics - Learn web development
previous overview: client-side web apis next the browser contains some very powerful graphics programming tools, from the scalable vector graphics (svg) language, to apis for drawing on html <canvas> elements, (see the canvas api and webgl).
... prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn the basics of drawing on <canvas> elements using javascript.
...once you've drawn a graphic to a canvas, there's no way to manipulate that graphic individually like you can with dom elements.
...And 2 more matches
What is JavaScript? - Learn web development
whereas css uses <link> elements to apply external stylesheets and <style> elements to apply internal stylesheets to html, javascript only needs one friend in the world of html — the <script> element.
...if you are using javascript to manipulate elements on the page (or more accurately, the document object model), your code won't work if the javascript is loaded and parsed before the html you are trying to do something to.
... for example, if you have the following script elements: <script async src="js/vendor/jquery.js"></script> <script async src="js/script2.js"></script> <script async src="js/script3.js"></script> you can't rely on the order the scripts will load in.
...And 2 more matches
Solve common problems in your JavaScript code - Learn web development
some common built-in browser functions that cause problems are: correct wrong getelementsbytagname() getelementbytagname() getelementsbyname() getelementbyname() getelementsbyclassname() getelementbyclassname() getelementbyid() getelementsbyid() semi-colon position you need to make sure you don't place any semi-colons incorrectly.
... how do you iterate over the elements in an array?
... how do you iterate over the elements in a multidimensional array?
...And 2 more matches
TypeScript support in Svelte - Learn web development
we also had a look at using the transition directive to implement animations on dom elements in svelte.
... let's see a quick example, a simple stack class that let's us push and pop elements, like this: export class stack { private elements = [] push = (element) => this.elements.push(element) pop() { if (this.elements.length === 0) throw new error('the stack is empty!') return this.elements.pop() } } in this case elements is an array of type any, and accordingly the push() and pop() methods both receive and return a variable of type any.
...we could do the following: export class stringstack { private elements: string[] = [] push = (element: string) => this.elements.push(element) pop(): string { if (this.elements.length === 0) throw new error('the stack is empty!') return this.elements.pop() } } that would work.
...And 2 more matches
Getting started with Svelte - Learn web development
highly interactive pages or complex visualizations: if you are building data-visualizations that need to display a large number of dom elements, the performance gains that come from a framework with no runtime overhead will ensure that user interactions are snappy and responsive.
... <script> // logic goes here </script> <style> /* styles go here */ </style> <!-- markup (zero or more html elements) goes here --> note: for more information on the component format, have a look at the svelte documentation.
... <main> <h1>hello {name}!</h1> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> svelte also supports tags like {#if...}, {#each...}, and {#await...} — these examples allow you to conditionally render a portion of the markup, iterate through a list of elements, and work with async values, respectively.
...And 2 more matches
Mozilla’s UAAG evaluation report
(p2) p dom inspector provides some capability, but not really intended for end users (tasks, tools, dom inspector) 9.10 configure important elements.
... (p3) ni the navigational elements aren't user configurable guideline 10.
... 10.4 highlight special elements.
...And 2 more matches
Displaying Places information using views
places provides the following built-in views: tree menu toolbar instantiating the three built-in views are simply standard xul elements with a special type attribute whose value is "places".
... every xul document containing a built-in view must import the stylesheet browser/components/places/content/places.css and overlay the file browser/components/places/content/placesoverlay.xul: <?xml-stylesheet href="chrome://browser/content/places/places.css" ?> <?xul-overlay href="chrome://browser/content/places/placesoverlay.xul" ?> it's this stylesheet that binds elements with the special type attribute to one of the views.
...it does so by recognizing certain magic values of the id attribute on your treecol elements.
...And 2 more matches
Performance best practices for Firefox front-end engineers
always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.
... javascript code might, for example, change dom node attributes (either directly or by adding or removing classes from elements), and can also add, remove, or delete dom nodes.
...however, as of firefox 49, the nsidomwindowutils.elementsrestyled attribute records a count of how many style calculations have occurred for a particular dom window.
...And 2 more matches
Mozilla Style System Documentation
the css specification describes formatting objects that correspond to elements in the content model and formatting objects that correspond to pseudo-elements.
... (mozilla has a bunch of its pseudo-elements that are not in the css specification.) we also create style contexts for some things that are not css formatting objects: text nodes and placeholder frames.
...this is useful for the pseudo-elements defined in the css specification (:before, :after, :first-line, :first-letter), but few of mozilla's custom pseudo-elements, many of which are hacks for further formatting objects that we create.
...And 2 more matches
L20n HTML Bindings
<link rel="localization" href="../locales/manifest.json"> an example of the manifest file (all keys are required): { "locales": [ "en-us", "pl"], "default_locale": "en-us", "resources": [ "../locales/{{locale}}/strings.l20n", "/shared/{{locale}}/date.l20n"¨ ] } make html elements localizable use the data-l10n-id attribute on an html element to mark it as localizable.
... a safe subset of html elements (e.g.
...the value attribute is allowed on input elements, but type is not.
...And 2 more matches
Python binding for NSS
python also provides an abstraction of common operating system services but because nss and nspr are tightly bound python-nss exposes elements of nspr.
... nss/nspr objects whose collection elements can be referenced by name support associative indexing.
... deprecated elements of the python-nss api are marked with python deprecation warnings as well as being documented in the nss module documentation.
...And 2 more matches
JS_NewArrayObject
contents js::handlevaluearray&amp; reference to the initial values for the array's elements.
... vector jsval * pointer to the initial values for the array's elements, or null.
... obsolete since jsapi 30 description js_newarrayobject with contents parameter creates a new array object with the specified contents elements.
...And 2 more matches
XUL Accessibility
introduction this article shows how xul control elements are mapped to accessibility api.
... searching specific element in neighbour of the element search inside the element subtree go up through parents (max level is 5) and search inside theirs subtrees if the element is anonymous then search in whole anonymous subtree, here the attribute anonid is used instead of id attribute accessible properties this section describes common rules how accessibility properties are formed for xul elements.
... name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulselectcontrolitemelement interface then it is used label property if the element doesn't implement nsidomxulselectcontrolelement then label attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content.
...And 2 more matches
nsIArray
inherits from: nsisupports last changed in gecko 1.7 an indexed collection of elements.
... provides basic functionality for retrieving elements at a specific position, searching for elements.
...neither interface makes any attempt to protect the individual elements from modification.
...And 2 more matches
nsIDOMElement
inherits from: nsidomnode last changed in gecko 1.7 method overview domstring getattribute(in domstring name); nsidomattr getattributenode(in domstring name); nsidomattr getattributenodens(in domstring namespaceuri, in domstring localname); domstring getattributens(in domstring namespaceuri, in domstring localname); nsidomnodelist getelementsbytagname(in domstring name); nsidomnodelist getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void removeattribute(in domstring name) nsidomattr removeattributenode(in nsidomattr oldattr) void removeattributens(in domstring namespaceuri, in domst...
...getelementsbytagname() get all descendants of a tag name.
... nsidomnodelist getelementsbytagname( in domstring name ); parameters name tag name return value a nsidomnodelist containg all the descendants of this tag name.
...And 2 more matches
nsISupportsArray
inherits from: nsicollection last changed in gecko 1.7 method overview boolean appendelements(in nsisupportsarray aelements); violates the xpcom interface guidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long aindex); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long aindex); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates th...
...n nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex); violates the xpcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the xpcom interface guidelines long lastindexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines boolean moveelement(in long afrom, in long ato); violates the xpcom interface guidelines boolean removeelementat(in unsigned long aindex); violates the xpcom interface guidelines boolean removeele...
...nt); violates the xpcom interface guidelines boolean removelastelement([const] in nsisupports aelement); violates the xpcom interface guidelines boolean replaceelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean sizeto(in long asize); violates the xpcom interface guidelines methods violates the xpcom interface guidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone(); parameters none.
...And 2 more matches
nsIVariant
violates the xpcom interface guidelines getasarray() nsresult getasarray( out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr ); parameters type the type of the array elements.
... iid the iid of the array elements, if they are interface pointers.
... count the number of elements in the array.
...And 2 more matches
3D view - Firefox Developer Tools
off-screen elements become visible, so that you can see where your elements are located in relation to the visible content.
... you can click on elements to see their html in the html panel or the style panel.
... conversely, you can click on elements in the breadcrumb bar to change which element is selected in the 3d view.
...And 2 more matches
Waterfall - Firefox Developer Tools
recalculate style calculating the computed styles that apply to page elements.
...the hint may be any of: self subtree latersiblings csstransitions cssanimations svgattranimations styleattribute styleattribute_animations force forcedescendants layout calculating the position and size of page elements.
... recalculate style: if the browser thinks the computed styles for page elements have changed, it must then recalculate them.
...And 2 more matches
Using images - Web APIs
you can even use the image produced by other canvas elements on the same page as the source!
... using images from the same page we can obtain a reference to images on the same page as the canvas by using one of: the document.images collection the document.getelementsbytagname() method if you know the id of the specific image you wish to use, you can use document.getelementbyid() to retrieve that specific image using images from other domains using the crossorigin attribute of an <img> element (reflected by the htmlimageelement.crossorigin property), you can request permission to load an image from another domain for use in your call to drawimage().
... using other canvas elements just as with normal images, we access other canvas elements using either the document.getelementsbytagname() or document.getelementbyid() method.
...And 2 more matches
CustomElementRegistry.upgrade() - Web APIs
the upgrade() method of the customelementregistry interface upgrades all shadow-containing custom elements in a node subtree, even before they are connected to the main document.
... syntax customelements.upgrade(root); parameters root a node instance with shadow-containing descendant elements that are to be upgraded.
... if there are no descendant elements that can be upgraded, no error is thrown.
...And 2 more matches
Document.createElementNS() - Web APIs
optionsoptional an optional elementcreationoptions object containing a single property named is, whose value is the tag name for a custom element previously defined using customelements.define().
... for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
... see extending native html elements for more information on how to use this parameter.
...And 2 more matches
Element.name - Web APIs
WebAPIElementname
it only applies to the following elements: <a>, <applet>, <button>, <form>, <frame>, <iframe>, <img>, <input>, <map>, <meta>, <object>, <param>, <select>, and <textarea>.
... note: the name property doesn't exist for other elements; unlike tagname and nodename, it is not a property of the node, element or htmlelement interfaces.
... name can be used in the document.getelementsbyname() method, a form and with the form elements collection.
...And 2 more matches
HTMLButtonElement - Web APIs
the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements.
... htmlbuttonelement.labels read only is a nodelist that represents a list of <label> elements that are labels for this button.
... methods inherits methods from its parent, htmlelement name return type description checkvalidity() boolean not supported for reset or button elements.
...And 2 more matches
Drag Operations - Web APIs
for other elements, they must be part of a selection for a default drag to occur.
... in html, apart from the default behavior for images, links, and selections, no other elements are draggable by default.
... to make other html elements draggable, three things must be done: set the draggable="true" on the element that you wish to make draggable.
...And 2 more matches
HTML Drag and Drop API - Web APIs
the user may select draggable elements with a mouse, drag those elements to a droppable element, and drop them by releasing the mouse button.
... a translucent representation of the draggable elements follows the pointer during the drag operation.
... for web sites, extensions, and xul applications, you can customize which elements can become draggable, the type of feedback the draggable elements produce, and the droppable elements.
...And 2 more matches
MediaElementAudioSourceNode - Web APIs
a mediaelementsourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediaelementsource() method.
... number of inputs 0 number of outputs 1 channel count defined by the media in the htmlmediaelement passed to the audiocontext.createmediaelementsource method that created it.
... example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback.
...And 2 more matches
WebGL2RenderingContext - Web APIs
drawing buffers webgl2renderingcontext.vertexattribdivisor() modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced().
...in addition, it can execute multiple instances of the range of elements.
... webgl2renderingcontext.drawelementsinstanced() renders primitives from array data.
...And 2 more matches
ARIA annotations - Accessibility
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.
... role="mark" — semantically denotes html elements containing text that is marked/highlighted for reference purposes.
...And 2 more matches
ARIA: grid role - Accessibility
while it does not imply a specific visual presentation, it implies a relationship among elements.
...see aria authoring practices for more details cell elements have the role gridcell, unless they are a row or column header.
... then the elements are rowheader and columnheader, respectively.
...And 2 more matches
ARIA: Listitem role - Accessibility
<section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively.
... there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g.
... warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a list and its listitems — <ul>/<ol> and <li>.
...And 2 more matches
ARIA: button role - Accessibility
the button role should be used for clickable elements that trigger a response when activated by the user.
... <div id="savechanges" tabindex="0" role="button" aria-pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's input.
... aria-expanded if the button controls a grouping of other elements, the aria-expanded state indicates whether the controlled grouping is currently expanded or collapsed.
...And 2 more matches
ARIA - Accessibility
for instance, native elements have built-in keyboard accessibility, roles and states.
...the new landmark elements (<main>, <header>, <nav> etc) have built-in aria roles, so there is no need to duplicate them.
...because of this, it is important to use semantic html elements whenever possible, as semantic html has far better support for assistive technology.
...And 2 more matches
:checked - CSS: Cascading Style Sheets
WebCSS:checked
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.
...e="opt2">grapes</option> <option value="opt3">pears</option> </select> css div, select { margin: 8px; } /* labels for checked inputs */ input:checked + label { color: red; } /* radio element, when checked */ input[type="radio"]:checked { box-shadow: 0 0 0 3px orange; } /* checkbox element, when checked */ input[type="checkbox"]:checked { box-shadow: 0 0 0 3px hotpink; } /* option elements, when selected */ option:checked { box-shadow: 0 0 0 3px lime; color: red; } result toggling elements with a hidden checkbox this example utilizes the :checked pseudo-class to let the user toggle content based on the state of a checkbox, all without using javascript.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:checkedchrome full support 1notes full support 1notes notes on macos, styling <option&rt; elements has no effect.edge full support 12notes full support 12notes notes on macos, styling <option&rt; elements has no effect.firefox full support 1notes full support 1notes notes from firefox 56, <option&rt; elements canno...
...And 2 more matches
@namespace - CSS: Cascading Style Sheets
syntax /* default namespace */ @namespace url(xml-namespace-url); @namespace "xml-namespace-url"; /* prefixed namespace */ @namespace prefix url(xml-namespace-url); @namespace prefix "xml-namespace-url"; description the defined namespaces can be used to restrict the universal, type, and attribute selectors to only select elements within that namespace.
...when a default namespace is defined, all universal and type selectors (but not attribute selectors, see note below) apply only to elements in that namespace.
... in html5, known foreign elements will automatically be assigned namespaces.
...And 2 more matches
CSS Flow Layout - CSS: Cascading Style Sheets
normal flow, or flow layout, is the way that block and inline elements are displayed on a page before any changes are made to their layout.
... in normal flow, inline elements display in the inline direction, that is in the direction words are displayed in a sentence according to the writing mode of the document.
... block elements display one after the other, as paragraphs do in the writing mode of that document.
...And 2 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
grid can be really very useful here, elements deprioritized in the mobile source order can be moved into a sidebar in a desktop layout, for example.
...therefore, where you have a <ul> element inside a grid container, that ul becomes a grid item – the child <li> elements do not.
... given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite temptation when developing a site using css grid layout to flatten out the markup, to remove semantic elements in order to make it simpler to create a layout.
...And 2 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
my mark-up is a container with elements inside for a header, footer, main content, navigation, sidebar, and a block into which i am intending to place advertising.
...i find this named areas method very helpful at a prototyping stage, it is easy to play around with the location of elements.
... .wrapper { max-width: 1024px; margin: 0 auto; font: 1.2em helvetica, arial, sans-serif; } .wrapper > * { border: 2px solid #f08c00; background-color: #ffec99; border-radius: 5px; padding: 10px; } .wrapper { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); grid-gap: 20px; } to demonstrate how this grid system works i have four child elements inside my wrapper.
...And 2 more matches
box-ordinal-group - CSS: Cascading Style Sheets
the box-ordinal-group css property assigns the flexbox's child elements to an ordinal group.
...when the computed box-direction is normal, a box will display its elements starting from the lowest numbered ordinal group and ensure that those elements appear to the left (for horizontal boxes) or at the top (for vertical boxes) of the container.
... elements with the same ordinal group are flowed in the order they appear in the source document tree.
...And 2 more matches
<display-box> - CSS: Cascading Style Sheets
syntax valid <display-box> values: contents these elements don't produce a specific box by themselves.
...please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements.
... see appendix b: effects of display: contents on unusual elements for more details.
...And 2 more matches
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max width in pixels in this example, the "child" will be either 150 pixels wide or the width of the "parent," whichever is smaller.
...firefox supports applying max-width to table elements.ie full support 7opera full support 4notes full support 4notes notes css 2.1 leaves the behavior of max-width with table undefined.
...And 2 more matches
pointer-events - CSS: Cascading Style Sheets
none the element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value.
... elements with pointer-events: none will still receive focus through sequential keyboard navigation using the tab key.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | inherit examples disabling pointer events on all images this example disables pointer events (clicking, dragging, hovering, etc.) on all images.
...And 2 more matches
unicode-bidi - CSS: Cascading Style Sheets
for inline elements, implicit reordering works across element boundaries.
... bidi-override for inline elements this creates an override.
... for block container elements this creates an override for inline-level descendants not within another block container element.
...And 2 more matches
user-select - CSS: Cascading Style Sheets
syntax none the text of the element and its sub-elements is not selectable.
... note that the selection object can contain these elements.
... auto the used value of auto is determined as follows: on the ::before and ::after pseudo elements, the used value is none if the element is an editable element, the used value is contain otherwise, if the used value of user-select on the parent of this element is all, the used value is all otherwise, if the used value of user-select on the parent of this element is none, the used value is none otherwise, the used value is text text the text can be selected by the user.
...And 2 more matches
visibility - CSS: Cascading Style Sheets
for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect.
... for other elements, collapse is treated the same as hidden.
...this will cause the element and all its descendant elements to no longer be announced by screen reading technology.
...And 2 more matches
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes like all other html elements, this element supports the global attributes, except that the dir attribute behaves differently than normal: it defaults to auto, meaning its value is never inherited from the parent element.
... examples no <bdi> with only ltr this example lists the winners of a competition using <span> elements only.
...ine: <ul> <li><span class="name">henrietta boffin</span> - 1st place</li> <li><span class="name">jerry cruncher</span> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-width: 1px 1px 1px 5px; } no <bdi> with rtl text this example lists the winners of a competition using <span> elements only, and one of the winners has a name consisting of rtl text.
...And 2 more matches
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
the element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements).
... permitted content either: zero or more groups each consisting of one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements.
... or: one or more <div> elements, optionally intermixed with <script> and <template> elements.
...And 2 more matches
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
<input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event).
... note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons.
... 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.
...And 2 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
<input> elements of type number are used to let the user enter a number.
... using number inputs <input type="number"> elements can help simplify your work when building the user interface and logic for entering numbers into a form.
... controlling input size <input> elements of type number don't support form sizing attributes such as size.
...And 2 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
<input> elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options.
... additional attributes in addition to the common attributes shared by all <input> elements, radio inputs support the following attributes: attribute description checked a boolean indicating whether or not this radio button is the currently-selected item in the group value the string to use as the value of the radio when submitting the form, if the radio is currently toggled on checked a boolean attribute which, if present, indicates that...
... beyond accessibility, this is another good reason to properly set up <label> elements on your forms.
...And 2 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
<input> elements of type search are text fields designed for the user to enter search queries into.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, search field inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be c...
... using search inputs <input> elements of type search are very similar to those of type text, except that they are specifically intended for handling search terms.
...And 2 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
<input> elements of type time create input fields designed to let the user easily enter a time (hours and minutes, and optionally seconds).
... additional attributes in addition to the attributes common to all <input> elements, time inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest time to accept, in the syntax described under time value format min the earliest time to accept as a valid input readonly a boolean attribute which, if pr...
... padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the best way to deal with times in forms in a cross-browser way, for the time being, is to get the user to enter the hours and minutes (and seconds if required) in separate controls (<select> elements are popular; see below for an example), or use javascript libraries such as the jquery timepicker plugin.
...And 2 more matches
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
this might be in the form of an unordered list of <li> elements, or, if the element has no <li> element children, flow content describing available commands.
... usage notes the <menu> and <ul> elements both represent an unordered list of items.
... context menus consist of a <menu> element which contains <menuitem> elements for each selectable option in the menu, <menu> elements for submenus within the menu, and <hr> elements for separator lines to break up the menu's content into sections.
...And 2 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown.
...(if this attribute is not set, the <select> is associated with its ancestor <form> element, if any.) this attribute lets you associate <select> elements to <form>s anywhere in the document, not just inside a <form>.
...if you want to get full control, you should consider using a library with good facilities for styling form widgets, or try rolling your own dropdown menu using non-semantic elements, javascript, and wai-aria to provide semantics.
...And 2 more matches
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
in general, it is better to put your styles in external stylesheets and apply them using <link> elements.
... if you include multiple <style> and <link> elements in your document, they will be applied to the dom in the order they are included in the document — make sure you include them in the correct order, to avoid unexpected cascade issues.
... in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as viewport width.
...And 2 more matches
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
content categories flow content permitted content in this order: an optional <caption> element, zero or more <colgroup> elements, an optional <thead> element, either one of the following: zero or more <tbody> elements one or more <tr> elements an optional <tfoot> element tag omission none, both the starting and ending tag are mandatory.
... to achieve a similar effect, apply the border-collapse property to the <table> element, with its value set to collapse, and the padding property to the <td> elements.
...it can have the following values: none, which indicates that no rules will be displayed; it is the default value; groups, which will cause the rules to be displayed between row groups (defined by the <thead>, <tbody> and <tfoot> elements) and between column groups (defined by the <col> and <colgroup> elements) only; rows, which will cause the rules to be displayed between rows; columns, which will cause the rules to be displayed between columns; all, which will cause the rules to be displayed between rows and columns.
...And 2 more matches
TypeError: can't delete non-configurable array element - JavaScript
the javascript exception "can't delete non-configurable array element" occurs when it was attempted to shorten the length of an array, but one of the array's elements is non-configurable.
... it was attempted to shorten the length of an array, but one of the array's elements is non-configurable.
... when shortening an array, the elements beyond the new array length will be deleted, which failed in this situation.
...And 2 more matches
TypeError: Reduce of empty array with no initial value - JavaScript
examples invalid cases this problem appears frequently when combined with a filter (array.prototype.filter(), typedarray.prototype.filter()) which will remove all elements of the list.
... var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value.
... similarly, the same issue can happen if there is a typo in a selector, or an unexpected number of elements in a list: var names = document.getelementsbyclassname("names"); var name_list = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); valid cases these problems can be solved in two different ways.
...And 2 more matches
Array.prototype.concat() - JavaScript
description the concat method creates a new array consisting of the elements in the object on which it is called, followed in order by, for each argument, the elements of that argument (if the argument is an array) or the argument itself (if the argument is not an array).
... the concat method does not alter this or any of the arrays provided as arguments but instead returns a shallow copy that contains copies of the same elements combined from the original arrays.
... elements of the original arrays are copied into the new array as follows: object references (and not the actual object): concat copies object references into the new array.
...And 2 more matches
Array.prototype.map() - JavaScript
it is not called for missing elements of the array; that is: indexes that have never been set; which have been deleted; or which have never been assigned a value.
... the range of elements processed by map is set before the first invocation of callback.
... elements which are appended to the array after the call to map begins will not be visited by callback.
...And 2 more matches
Array.prototype.slice() - JavaScript
slice(-2) extracts the last two elements in the sequence.
...for example, slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3).
... return value a new array containing the extracted elements.
...And 2 more matches
Array.prototype.some() - JavaScript
the range of elements processed by some() is set before the first invocation of callback.
... elements appended to the array after the call to some() begins will not be visited by callback.
...elements that are deleted are not visited.
...And 2 more matches
TypedArray.prototype.forEach() - JavaScript
however, it is executed for elements that are present and have the value undefined.
... the range of elements processed by foreach() is set before the first invocation of callback.
... elements that are appended to the typed array after the call to foreach() begins will not be visited by callback.
...And 2 more matches
MathML element reference - MathML
this is an alphabetical list of mathml presentation elements.
... mathml elements implement the mathmlelement class.
... mathml presentation 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 <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (stri...
...And 2 more matches
Populating the page: how browsers work - Web Performance
waiting to obtain css doesn't block html parsing or downloading, but it does block javascript, because javascript is often used to query css properties’ impact on elements.
...taking the size of the viewport as its base, layout generally starts with the body, laying out the dimensions of all the body’s descendants, with each element's box model properties, providing placeholder space for replaced elements it doesn’t know the dimensions of, such as our image.
...painting involves drawing every visual part of an element to the screen, including text, colors, borders, shadows, and replaced elements like buttons and images.
...And 2 more matches
lang - SVG: Scalable Vector Graphics
WebSVGAttributelang
the lang attribute specifies the primary language used in contents and attributes containing text content of particular elements.
... in svg 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements.
... all elements are using this attribute.
...And 2 more matches
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
--> </svg> the effect is the same as if the nodes were deeply cloned into a non-exposed dom, then pasted where the use element is, much like cloned template elements in html5.
... for security reasons, browsers may apply the same-origin policy on use elements and may refuse to load a cross-origin url in the href attribute.
... there is currently no defined way to set a cross-origin policy for use elements.
...And 2 more matches
addon-page - Archive of obsolete content
create a page that does not contain navigational elements.
... for pages like this, navigational elements such as the awesome bar, search bar, or bookmarks toolbar are not usually relevant and distract from the content you are presenting.
... the addon-page module provides a simple way to have a page which excludes these elements.
...after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally.
util/array - Archive of obsolete content
hasany(array, elements) returns true if the given array contains any of the elements in the elements array, or false otherwise.
... let { hasany } = require('sdk/util/array'); let a = ['rock', 'roll', 100]; hasany(a, ['rock', 'bright', 'light']); // true hasany(a, ['rush', 'coil', 'jet']); // false parameters array : array the array to search for elements.
... elements : array an array of elements to search for in array.
... returns boolean : a boolean indicating whether or not any of the elements were found in the array.
util/list - Archive of obsolete content
globals constructors list(element1, element2, ...) constructor can takes any number of elements and creates an instance of list populated with the specified elements.
... removelistitem(list, item) function removes an item from a list list an ordered collection (also known as a sequence) disallowing duplicate elements.
... list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list).
... array.slice(arguments).foreach(this._remove.bind(this)); } }); mylist('foo', 'bar', 'baz').length == 3; // true new mylist('new', 'keyword').length == 2; // true mylist.apply(null, [1, 2, 3]).length == 3; // true let list = mylist(); list.length == 0; // true list.add(1, 2, 3) == 3; // true properties length number of elements in this list.
Creating annotations - Archive of obsolete content
we'll use two objects to create annotations: a page-mod to find page elements that the user can annotate, and a panel for the user to enter the annotation text itself.
...the idea here is to make it more likely that the annotator will be able to identify annotated elements correctly later on.
...you should see the highlight appearing when you move the mouse over certain elements: click on the highlight and you should see something like this in the console output: info: show info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review.
... annotation editor panel so far we have a page-mod that can highlight elements and send information about them to the main add-on code.
Extension Etiquette - Archive of obsolete content
other ui elements in general, toolbar items are very useful to end users because they can be removed or added to various toolbars as necessary.
...likewise, use context menu items sparingly — only for tasks that are done frequently or on specific elements of a web page.
... ids and class names in html and xul documents, when extensions add elements to web pages or browser windows.
...class names for html elements created by the cool beans extension, for instance, might all be prefixed with cool-beans-.
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
toolbar buttons there are several types of buttons and elements you can add to a toolbar depending on your needs.
...if you shrink the firefox window, you'll notice that the content resizes until it reaches its minimum size and begin to be cropped (cut), making ui elements disappear.
...adding elements to your toolbar that are not toolbarbutton or toolbaritem will cause it to fail.
...all of this is very important to test because, when the dialog is opened, firefox changes the dom of the toolbar, adding wrapper elements that allow the customization.
Handling Preferences - Archive of obsolete content
the prefwindow allows you to use the preferences and preference elements, which facilitate preference handling.
... <preferences> <preference id="xulschoolhello-message-count-pref" name="extensions.xulschoolhello.message.count" type="int" /> <!-- more preference elements.
... --> </preferences> after you define the preferences you need, you associate them with the form elements in your window or pane using the preference attribute: <textbox preference="xulschoolhello-message-count-pref" type="number" min="0" max="100" /> in this case we use a numeric field to set the message count preference.
...you should also look at the class values set to elements in the xul file, so that your preferences window is just like the one in firefox and your extension is better integrated into the application and the native os look and feel.
Drag and Drop Example - Archive of obsolete content
dragging elements around here, we'll create a simple board where items from a palette can be dragged onto the board.
... the user can click on one of several xul elements on the palette and drag it onto a stack element to create an element of a particular type.
...a maximum size is also specified so that it doesn't resize when new elements are dragged onto it.
...the position of elements in a stack is determined by the left and top attributes.
Creating a Help Content Pack - Archive of obsolete content
if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - elements, attributes, and element contents.
...this attribute marks the start point in the rdf graph described by the file, and the help viewer searches for this element in order to query for further information (stored in child elements) about the content pack being parsed.
...search automatically goes through all of the elements in the table of contents, index, and glossary, but you might wish to have search go through more sources of data.
...it's exactly the same as any javascript command, you you can insert it in command elements, oncommand attributes, and other such places.
Mozilla Application Framework in Detail - Archive of obsolete content
themes are simply collections of images and css which can augment or replace your current ui elements.
...xbl (extensible binding language) allows you to expand your library of interface elements, and even construct your own xml language for defining your ui.
...you could easily create xml elements such as <chessboard> or <chesspiece> and via xbl map these to images and application logic.
...rdf, a core element to the framework, allows you to define dynamic elements in your ui (elements that may change after you have completed the application, such as a "history" menu item).
XBL - Archive of obsolete content
xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents.
...for example, names of the elements are different.
... also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements.
... custom xul elements with xbl from the xul school tutorial for add-on developers xbl chapter of "rapid application development with mozilla" xbl 2.0 primer (draft) xbl 2.0 cross-browser implementation in javascript more xbl resources...
A XUL Bestiary - Archive of obsolete content
when you create styles in <style> tags, as style attributes for individual elements, or in custom css files, you break the ability of gecko to skin the application to which your xul belongs.
...these widgets can be created and placed within a xul file as simple elements: <menu>, <toolbar>, and so on.
... the syntax for these elements is based for the most part on xml.
... the differences here are significant: xul is the universe of elements, attributes, syntax, rules, and relationships, while xptoolkit is really the finite set of interface-specific elements created in xul.
Flexgroup - Archive of obsolete content
"flexgroup" is used to group flexible elements together and should be set to an integer.
... elements with a lower flexgroup are flexed first.
... when those elements have reached their maximum sizes, the elements with the next higher flexgroup are flexed.
... this process continues until there are no more elements remaining.
allowevents - Archive of obsolete content
on listitem and titlebar elements, mouse events normally do not get sent to their children; instead they are retargeted to the listitem and titlebar element itself.
... this means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list.
... by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements.
... for menu, menuseparator, menuitem and treecol elements, as well as menu buttons, and the popup datepicker, mouse events are also retargeted to the element itself.
flex - Archive of obsolete content
ArchiveMozillaXULAttributeflex
flexible elements grow and shrink to fit their given space.
... elements with larger flex values will be made larger than elements with lower flex values, at the ratio determined by the two elements.
... the actual value is not relevant unless there are other flexible elements within the same container.
... once the default sizes of elements in a box are calculated, the remaining space in the box is divided among the flexible elements, according to their flex ratios.
pack - Archive of obsolete content
ArchiveMozillaXULAttributepack
« xul reference home pack type: one of the values below the pack attribute specifies where child elements of the box are placed when the box is larger that the size of the children.
... start child elements are placed starting from the left or top edge of the box.
... center extra space is split equally along each 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.
XUL Events - Archive of obsolete content
« xul reference home the following tables and sections describe the event handler that are valid for most xul elements.
...this event will only be sent to elements connected to a preference and in a prefwindow.
...this event will only be sent to elements connected to a preference and in a prefwindow.
...this applies to boxes and other layout elements with a css overflow property other than 'visible'.
Namespaces - Archive of obsolete content
duplicates element and attribute names can occur when an xml document contains elements and attributes from two or more different xml schemas (or dtds).
...even if they did accidentally choose it, they may not define the same elements as xul anyway (e.g., <textbox/>) in their schema/dtd.
...every xml element has a "default namespace", and this is used with xul elements all the time.
...this signifies to the xml parser that http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul is the default namespace for the element and its descendant elements (unless further overridden by a default namespace on a descendant element), and that any element without a namespace (i.e., no prefix and colon) belongs to the default namespace.
Popup Guide - Archive of obsolete content
popup types xul provides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened.
...a menu should only contain menu related elements.
... how popups are placed to read about how the position of a popup on screen is determined, and how to align popups to other elements, see positioning popups.
... features of items on a menu to learn about the various features of items on a menu, see features of the menuitem element modifying the items on a menu to append, insert and remove elements from a menu, see modifying a menu.
Filtering - Archive of obsolete content
this example only adds one triple, but you could add others, or add <member> elements.
...the resulting rdf triples for the first country will be: http://www.daml.org/2001/09/countries/iso#it -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.daml.org/2001/09/countries/country-ont#country http://www.daml.org/2001/09/countries/iso#it -> http://purl.org/dc/elements/1.1/title -> italy the type is just like any other triple in the datasource, so we don't need any special syntax to navigate over it.
... <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> the action body will need to generate a <menuitem> for each result.
...the elements above are not.
Multiple Rules - Archive of obsolete content
this involves using additional rule elements after the first.
...a multiple rule template looks like the following: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> <rule> <where subject="?title" rel="equals" value="canal"/> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </rule> <rule> <action> <image uri="?photo" src="?photo"/> </action> </rule> </template> </hbox> this template contains a query w...
... where elements we saw in the example above how to compare a value exactly to a specific value.
...we can add multiple where elements if we want to check additional conditions.
Accesskey display rules - Archive of obsolete content
xul elements display their accesskeys in their label automatically if it's necessary.
...xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac.
... if a label doesn't have the character, xul elements append the accesskey character with parentheses.
...xul elements check "intl.menuitems.alwaysappendaccesskeys" pref value whether they should append accesskey text always.
Adding Buttons - Archive of obsolete content
like html, xul has a number of tags that can be used to create user interface elements.
...you'll see this attribute on all elements.
...however, you should add this attribute to almost all elements.
... it isn't always placed on elements in this tutorial for simplicity.
Content Panels - Archive of obsolete content
second, the elements such the back and next buttons are the same throughout the interface.
...a box has been created containing two elements: a toolbox and an iframe.
...the tabbrowser element is actually implemened as a tabbox containing a set of browser elements.
...the third type is used when your window contains multiple browser elements, for example if you have a sidebar displaying some extra content.
Features of a Window - Archive of obsolete content
for example: var mywin = window.open("chrome://findfile/content/findfile.xul", "findfile", "chrome"); specifying the width and height you should have noticed that whenever elements were added to a window, the window's width expanded to fit the new elements.
...if you leave it out, the size is determined by the elements that are in it.
...even if there aren't enough elements to fit this size, the window will still open at this size and there will be blank space in the remaining area.
... if there are too many elements, the window will not be large enough to fit the elements.
More Button Features - Archive of obsolete content
in general, it can be used on all xul elements.
...you probably wouldn't use this very often, but you might use it when creating custom elements.
...html elements will be ignored, so you need to wrap them inside a description element.
...next, we will learn more details about how xul elements are positioned in a window.
Numeric Controls - Archive of obsolete content
« previousnext » xul has two elements used for the entry of numeric values or ranges, and well as two elements for entering dates and times.
... these elements are only available in firefox 3 and later.
...date and time entry fields the datepicker and timepicker elements may be used to allow the user to enter dates and times.
...these two elements ensure that the user enters a value date or time.
Popup Menus - Archive of obsolete content
the menupopup element surrounds the three menuitem elements.
...this way, you can have a number of popups and associate them with different elements.
...you could also associate the same popup with multiple elements, which is one advantage of using this popup syntax.
... popups can only be associated with xul elements; they cannot be associated with html elements.
Simple Menu Bars - Archive of obsolete content
the menu features of xul consist of a number of different elements which allow you to create menu bars or popup menus.
...xul does have some special elements which provide special functionality typical of menus.
... there are five elements associated with creating a menu bar and its menus, which are explained briefly here and in detail afterwards: menubar the container for the row of menus.
...although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied.
Toolbars - Archive of obsolete content
adding a toolbar like a number of elements, xul toolbars are a type of box.
...inside it are placed the individual toolbar items, usually buttons, but they can be other elements.
...multiple toolbars can be created just as easily by adding more toolbar elements after the first one.
...you do not have to put toolbar elements inside a toolbox.
XUL Changes for Firefox 1.5 - Archive of obsolete content
<richlistbox> and <richlistitem> the <richlistbox> and <richlistitem> elements are used for creating lists containing arbitrary content.
... preferences system several elements have been added which may be used for creating preference windows.
...along with the new preference elements and some additional attributes for existing elements, they make it easy to set preferences without having to use code.
... tabindex the tabindex property is now applied to most elements.
XUL Reference - Archive of obsolete content
« xul reference « 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 ...
...tbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups --- 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 menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton 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) time...
...rollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where script commandset command broadcaster broadcasterset observes key keyset stringbundle stringbundleset arrowscrollbox dropmarker grippy scrollbar scrollcorner spinbuttons all attributes all properties all methods attributes defined for all xul elements style classes event handlers deprecated/defunct markup ...
arrowscrollbox - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...elements with a higher tabindex are later in the tab sequence.
... inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
column - Archive of obsolete content
the column with the most child elements determines the number of rows in each column.
... it is common to use columns only to define width and flexibility for the grid column and not place elements directly inside the column.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, rows, row ...
columns - Archive of obsolete content
child column elements define the individual columns to appear in the grid.
...other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, column, rows, row.
command - Archive of obsolete content
like a broadcaster, commands forward attributes to other elements.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements.
...if this attribute is not specified, or you set it to the value '*', all elements are valid.
... the command update will only occur when the event occurs to one of the specified elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
content - Archive of obsolete content
for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag.
... thus, nested elements will not match because they are directly inside a treeitem.
... this attribute is useful to provide different rules for outer and inner elements.
... métodos inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
datepicker - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...elements with a higher tabindex are later in the tab sequence.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
keyset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for key elements.
...disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
listheader - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listhead, listitem ...
menubar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container that usually contains menu elements.
... on the macintosh, the menubar is displayed along the top of the screen, and all non-menu related elements inside the menubar will be ignored.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider ...
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.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements popup, menupopup ...
rule - Archive of obsolete content
ArchiveMozillaXULrule
a rule may contain where, binding and/or action elements.
... true: the rule will only match nodes that contain no child elements.
... false: the rule will only match nodes that contain one or more child elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
splitter - Archive of obsolete content
when the splitter is dragged, the sibling elements of the splitter are resized.
... grow the elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
... tree-splitter this splitter is intended to be used in tree columns (in-between treecol elements).
timepicker - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
...elements with a higher tabindex are later in the tab sequence.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
toolbox - Archive of obsolete content
the external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externaltoolbars property.
... externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
... related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring interfaces nsiaccessibleprovider ...
-ms-content-zoom-limit-max - Archive of obsolete content
the -ms-content-zoom-limit-max css property is a microsoft extension that specifies the selected elements' maximum zoom factor.
... initial value400%applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednopercentagesthe largest allowed zoom factor.
...this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
Writing JavaScript for XHTML - Archive of obsolete content
problem: names in xhtml and html are represented in different cases scripts that used getelementsbytagname() with an upper case html name no longer work, and attributes like nodename or tagname return upper case in html and lower case in xhtml.
... solution: use or convert to lower case for methods like getelementsbytagname(), passing the name in lower case will work in both html and xhtml.
...use dom methods to create all of your elements, attributes and other nodes.
...s here is the accept field, that firefox 2.0.0.9 sends with its requests: accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 further reading you will find several useful articles in the developer wiki: xml in mozilla dom xml introduction xml extras dom 2 methods you will need are: dom:document.createelementns dom:document.getelementsbytagnamens see also properly using css and javascript in xhtml documents ...
Implementation Status - Archive of obsolete content
4.6.7 sequence: value change with focus change supported 4.6.8 sequence: activating a trigger supported 4.6.9 sequence: submission supported 4.7 resolving id references in xforms unsupported 4.7.1 references to elements within a repeat element unsupported 4.7.2 references to elements within a bind element unsupported 4.8 dom interface for access to instance data supported 4.8.1 getinstancedocument() supported 4.8.2 rebuild() supporte...
... 9.3.3 repeat processing partial we currently obey the 1.0 rules for repeat 9.3.4 user interface interaction partial we currently obey the 1.0 rules for repeat, no support for @number 302026; 9.3.5 creating repeating structures via attributes partial does not work for html:tr, html:td, or xf:group elements 340515; 350617; 9.3.6 itemset supported performance problem with large itemsets 372197; 9.3.7 copy supported 10.
...xforms submission model section title status notes bugs 11.1 submission partial from 1.1 we do not yet support @mode, @indent, @replace='text', @separator, @serialize, @target, header or method child elements 11.2 xforms-submit partial we currently limit (for security reasons) submission only back to the server that served the document.
...xforms and styling section title status notes bugs g.1 pseudo-classes partial :read-only and :read-write are suported using :-moz-read-only and :-moz-read-write 313111; g.2 pseudo-elements unsupported we support ::value, ::repeat-index, and ::repeat-item through the attributes xf-value, xf-repeat-index, and xf-repeat-item.
XForms Repeat Element - Archive of obsolete content
actions you can use xforms action module elements to modify the nodeset that the repeat element is bound to.
... the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and setindex (see the spec) elements.
...since html:table doesn't (and probably never will) allow xforms:repeat elements as children, another syntax is needed.
...here comes the output: <br/> <xf:output ref="@id"><xf:label>output: </xf:label></xf:output> <div xf:repeat-nodeset="nest"><xf:output ref="."><xf:label>nested output: </xf:label></xf:output></div> </div> repeat in anonymous content (usage in xbl) you can use repeat elements inside anonymous content to create powerful new widgets.
Script-supporting element - MDN Web Docs Glossary: Definitions of Web-related terms
in an html document, script-supporting elements are those elements that don't directly contribute to the appearance or layout of the page; instead, they're either scripts or contain information that's only used by scripts.
... these elements may be important, but do not affect the displayed page unless the page's scripts explicitly cause them to do so.
... there are only two script-supporting elements: <script> and <template>.
... technical reference to learn more, see script-supporting elements in kinds of html content.
Accessible multimedia - Learn web development
multimedia and accessibility so far in this module we have looked at a variety of content and what needs to be done to ensure its accessibility, ranging from simple text content to data tables, images, native controls such as form elements and buttons, and even more complex markup structures (with wai-aria attributes).
...images, videos, <canvas> elements, flash movies, etc., aren't as easily understood by screenreaders or navigated by the keyboard, and we need to give them a helping hand.
...on() { if(player.paused) { player.play(); playpausebtn.textcontent = 'pause'; } else { player.pause(); playpausebtn.textcontent = 'play'; } }; next, add this code to the bottom, which controls the stop button: stopbtn.onclick = function() { player.pause(); player.currenttime = 0; playpausebtn.textcontent = 'play'; }; there is no stop() function available on htmlmediaelements, so instead we pause() it, and at the same time set the currenttime to 0.
...<track> should be placed within <audio> or <video>, but after all <source> elements.
Advanced styling effects - Learn web development
blend modes css blend modes allow us to add blend modes to elements that specify a blending effect when two elements overlap — the final color shown for each pixel will be the result of a combination of the original pixel color, and that of the pixel in the layer underneath it.
... mix-blend-mode, which blends together the element it is set on with elements it is overlapping — both background and content.
...here we'll present the same two <div>s, but each one is now sat on top of a simple <div> with a purple background, to show how the elements will blend together: <article> no mix blend mode <div> </div> <div> </div> </article> <article> multiply mix <div class="multiply-mix"> </div> <div> </div> </article> here's the css we'll style this with: article { width: 280px; height: 180px; margin: 10px; position: relative; display: inline-block; } div { width: 250px; height: 130px; padding: 10px; m...
...the actual file is rectangular, but by floating the image (shapes only apply to floated elements) and using the shape-outside property with a value of circle(50%), we can give the effect of the text following the line of the balloon.
Debugging CSS - Learn web development
for inspecting the properties and values applied to elements on your page, and making changes to them from the editor.
... understanding the box model in previous lessons we have discussed the box model, and the fact that we have an alternate box model that changes how the size of elements are calculated based on the size you give them, plus the padding and borders.
...remove components or even main elements of the layout.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Grids - Learn web development
a grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements.
... they help us to create designs where elements don’t jump around or change width as we move from page to page, providing greater consistency on our websites.
... we will instead place all of the elements for our site on the grid, using the grid lines.
... positioning with grid-template-areas an alternative way to place items on your grid is to use the grid-template-areas property and giving the various elements of your design a name.
HTML forms in legacy browsers - Learn web development
just check the support of the elements (or dom interface) you want to use.
... mdn has compatibility tables available for most elements, properties and apis that can be used in a web page.
...while resolved in all modern browsers, it is still recommended to always set the type attribute on <button> elements.
...even if it's still possible to do a few adjustments on text elements (such as sizing or font color), there are always side effects.
Add a hitmap on top of an image - Learn web development
if the image is only present as a navigation device, you may write alt="", provided you furnish appropriate alt text in the <area> elements later on.
...<map> only needs one attribute, the same map name as you used in your usemap attribute above: <map name="example-map-1"> </map> inside the <map> element, we need <area> elements.
...to keep keyboard navigation intuitive, make sure the source order of <area> elements corresponds to the visual order of hotspots.
... <area> elements are empty elements, but do require four attributes: shape coords shape takes one of four values: circle, rect, poly, and default.
Marking up a letter - Learn web development
block/structural semantics use appropriate document structure including doctype, and <html>, <head> and <body> elements.
... put the two addresses inside <address> elements.
... the four dates in the document should be have appropriate elements containing machine-readable dates.
... mark up the university motto quote and citation with appropriate elements.
Introduction to HTML - Learn web development
at its heart, html is a fairly simple language made up of elements, which can be applied to pieces of text to give them different meaning in a document (is it a paragraph?
... getting started with html covers the absolute basics of html, to get you started — we define elements, attributes, and other important terms, and show where they fit in the language.
... advanced text formatting there are many other elements in html for formatting text that we didn't get to in the html text fundamentals article.
... the elements here are less well-known, but still useful to know about.
A first splash into JavaScript - Learn web development
in this case, we are using constants to store references to parts of our user interface; the text inside some of them might change, but the html elements referenced stay the same.
... enables the form elements, and empties and focuses the text field, ready for a new guess to be entered.
...one method available to input elements is focus(), so we can now use this line to focus the text input: guessfield.focus(); variables that don't contain references to form elements won't have focus() available to them.
...this allows us to dynamically set new css styles on elements using javascript.
Introduction to client-side frameworks - Learn web development
the verbosity of dom changes building html elements and rendering them in the browser at the appropriate time takes a surprising amount of code.
... working directly with the dom, as in this example, requires understanding many things about how the dom works: how to make elements; how to change their properties; how to put elements inside of each other; how to get them on the page.
... the vanilla javascript approach to building out new dom elements in repetition was difficult to understand at a glance.
...that might be a useful idea for something as simple as our to-do list application, but it's not maintainable for large applications that manage thousands of records of data, and could render just as many unique elements in a user interface.
Getting started with React - Learn web development
the jsx approach allows us to nest our elements within each other, just like we do with html: const header = ( <header> <h1>mozilla developer network</h1> </header> ); note: the parentheses in the previous snippet aren't unique to jsx, and don’t have any effect on your application.
... it's possible to add react to a website without create-react-app by copying some <script> elements into an html file, but the create-react-app cli is a common starting point for react applications.
... some elements in the expression have attributes, which are written just like in html, following a pattern of attribute="value".
... note: in jsx, react components and html elements must have closing slashes.
Setting up your own test automation environment - Learn web development
you can select ui elements in many ways in webdriver, including by id, class, element name, etc.
...ement = driver.findelement(by.id('myelementid')); one of the most useful ways to find an element by css — the by.css method allows you to select an element using a css selector enter the following at the bottom of your quick_test.js code now: const button = driver.findelement(by.css('button:nth-of-type(1)')); testing your element there are many ways to interact with your web documents and elements on them.
...add the following to the bottom of the code, and try testing it again: let alert = driver.switchto().alert(); alert.gettext().then(function(text) { console.log('alert text is \'' + text + '\''); }); alert.accept(); next, let's try entering some text into one of the form elements.
...for example if you load a new page, you'll want to wait for the page's dom to finish loading before you try to interact with any of its elements, otherwise the test will likely fail.
Mozilla's Section 508 Compliance
(c) a well-defined on-screen indication of the current focus shall be provided that moves among interactive interface elements as the input focus changes.
... (e) when bitmap images are used to identify controls, status indicators, or other programmatic elements, the meaning assigned to those images shall be consistent throughout an application's performance.
... (k) software shall not use flashing or blinking text, objects, or other elements having a flash or blink frequency greater than 2 hz and lower than 55 hz.
... (l) when electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
Chrome registration
chrome is the set of user interface elements of the application window that are outside the window's content area.
... toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome.
... contentaccessible chrome resources can no longer be referenced from within <img>, <script>, or other elements contained in, or added to, content that was loaded from an untrusted source.
... this restriction applies to both elements defined by the untrusted source and to elements added by trusted extensions.
The Firefox codebase: CSS Guidelines
some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; .
... threedshadow: used as border on elements.
... threedlightshadow: used as light border on elements.
... the text color of elements often contains valuable information from the theme colors, so currentcolor/inheritance is again a good idea for theme support.
MathML Torture Test
i> <mtext>&nbsp;</mtext> <mi>b</mi> <mtext>'s</mtext> </mrow> </mover> </mover> </mrow> <munder> <mo>&underbrace;</mo> <mrow> <mi>k</mi> <mo>+</mo> <mi>&ell;</mi> <mtext>&nbsp;elements</mtext> </mrow> </munder> </munder> <mo stretchy="false">}</mo> </mrow> </math> </td> </tr> <tr> <td>23</td> <td><img src="https://udn.realityripple.com/samples/45/c73ac26e1d.png" width="213" height="108" alt="texbook, 18.42" /></td> <td> <math display="block"> <mrow> <mo>(</mo> <mtab...
... <mtext>&nbsp;</mtext> <mi>&#x1ee1c;</mi> <mtext>'s</mtext> </mrow> </mover> </mover> </mrow> <munder> <mo>&underbrace;</mo> <mrow> <mi>&#x1ee1f;</mi> <mo>+</mo> <mi>&ell;</mi> <mtext>&nbsp;elements</mtext> </mrow> </munder> </munder> <mo stretchy="false">}</mo> </mrow> </math> </td> <td> <math dir="rtl" display="block"> <mrow> <mo stretchy="false">{</mo> <munder> <mrow> <mover> <mrow> <mpadded width="0em"><mphantom><mo>(</mo></mpha...
... <mtext>&nbsp;</mtext> <mi>&#x1ee1c;</mi> <mtext>'s</mtext> </mrow> </mover> </mover> </mrow> <munder> <mo>&underbrace;</mo> <mrow> <mi>&#x1ee1f;</mi> <mo>+</mo> <mi>&ell;</mi> <mtext>&nbsp;elements</mtext> </mrow> </munder> </munder> <mo stretchy="false">}</mo> </mrow> </math> </td> <td> <math display="block"> <mrow> <mo stretchy="false">{</mo> <munder> <mrow> <mover> <mrow> <mpadded width="0em"><mphantom><mo>(</mo></mphantom></mpa...
...i> <mtext>&nbsp;</mtext> <mi>b</mi> <mtext>'s</mtext> </mrow> </mover> </mover> </mrow> <munder> <mo>&underbrace;</mo> <mrow> <mi>k</mi> <mo>+</mo> <mi>&ell;</mi> <mtext>&nbsp;elements</mtext> </mrow> </munder> </munder> <mo stretchy="false">}</mo> </mrow> </math> </td></tr> <tr> <td>23</td> <td> <math dir="rtl" display="block"> <mrow> <mo>(</mo> <mtable> <mtr> <mtd columnalign="center"> <mrow> <mo>(</mo> ...
Mozilla MathML Status
an overview of the mathml 3 elements/attributes - excluding deprecated ones - and the current status of the native support.
... attributes shared by all mathml elements see § 2.1.6 and § 3.1.10.
... token elements element [- attribute] notes mi implemented.
... other elements element [- attribute] notes mglyph not implemented.
Mozilla Web Services Security Model
all of these children elements must be in the same namespace as the parent, and must be empty.
... the allow element if no delegate elements are present or if the web service is in the same directory as the web-script-access.xml file, then the allow elements will be processed.
... if the file exists but contains no allow elements, then all access will be allowed.
... if allow elements exist, then the access will be allowed if one of them allows it.
Profiling with the Firefox Profiler
elements in the timeline are spaced at the sampling frequency with an attempt to align them with time.
...also note that you can click on timeline elements (the selected element gets darker when selected) and the tree view (see below) reflects the selected element.
...there are lighter grey names to the right of tree elements that indicate where the code comes from.
... be aware that elements can be from javascript, gecko, or system libraries.
JS::CompileOptions
(note that one may assign both strings and functions to dom elements' event handler idl attributes.
... "eventhandler" - code assigned to dom elements' event handler idl attributes as a string.
... "scriptelement" - code belonging to <script> elements.
...an instance of this type makes a copy of / holds / roots all dynamically allocated resources (principals; elements; strings) that it refers to.
nsIComponentRegistrar
elements of the enumeration can be queryinterfaced for the nsisupportsid interface.
...elements of the enumerator implement nsisupportsid.
...elements of the enumeration can be queryinterfaced for the nsisupportscstring interface.
...elements of the enumerator implement nsisupportscstring.
nsILoginManager
void findlogins( out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array.
... void getalldisabledhosts( [optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames ); parameters count the number of elements in the returned array.
... void getalllogins( [optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array.
... void searchlogins( out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array.
nsIXULTemplateBuilder
the nsitemplatebuilder interface controls the display of elements using a xul template element and is automatically attached to an element containing a datasources attribute.
...the <queryset> element contains a single query and one or more <rule> elements.
...the template builder then generates output for each result based on the <rule> elements.
...each query may be accompanied by one or more <rule> elements.
Mozilla
chrome registration chrome is the set of user interface elements of the application window that are outside the window's content area.
... toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome.
... gecko's "almost standards" mode "almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "quirks" mode: the height calculations for line boxes and some of the inline elements in them.
...changes to a document originate in the content tree (from dom modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/realityripple/uxp/blob/master/layout/base/nscssframeconstructor.cpp getting started with chat note that on 2nd march 2020, mozilla moved away from irc to matrix for its public channels, the irc server...
Debugger.Source - Firefox Developer Tools
for example, an html document can contain javascript in multiple <script> elements and event handler content attributes.
...(note that one may assign both strings and functions to dom elements’ event handler idl attributes.
... "eventhandler", for code assigned to dom elements’ event handler idl attributes as a string.
... "scriptelement", for code belonging to <script> elements.
Animating CSS properties - Firefox Developer Tools
compared with animating elements using javascript, css animations can be easier to create.
... layout: next, the browser uses the computed styles to figure out the position and geometry for the elements.
... paint: finally, the browser needs to repaint the elements to the screen.
... there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint.
AnalyserNode.getByteFrequencyData() - Web APIs
if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
... if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
AnalyserNode.getByteTimeDomainData() - Web APIs
if the array has fewer elements than the analysernode.fftsize, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
... if the array has fewer elements than the analysernode.fftsize, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
AnalyserNode.getFloatTimeDomainData() - Web APIs
if the array has fewer elements than the analysernode.fftsize, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
... if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
Background Tasks API - Web APIs
this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run, accepts events from input devices, and dispatches those events to the elements that should receive them.
... let totaltaskcountelem = document.getelementbyid("totaltaskcount"); let currenttasknumberelem = document.getelementbyid("currenttasknumber"); let progressbarelem = document.getelementbyid("progress"); let startbuttonelem = document.getelementbyid("startbutton"); let logelem = document.getelementbyid("log"); next we have variables which reference the dom elements we need to interact with.
... these elements are: totaltaskcountelem is the <span> we use to insert the total number of tasks created into the status display in the progress box.
...this element is a pseudo-dom into which we can insert elements without immediately changing the main dom itself.
CustomElementRegistry.whenDefined() - Web APIs
syntax promise<> customelements.whendefined(name); parameters name custom element name.
... examples this example uses whendefined() to detect when the custom elements that make up a menu are defined.
...const undefinedelements = container.queryselectorall(':not(:defined)'); const promises = [...undefinedelements].map( button => customelements.whendefined(button.localname) ); // wait for all the children to be upgraded, // then remove the placeholder.
... await promise.all(promises); container.removechild(placeholder); specifications specification status comment html living standardthe definition of 'customelements.whendefined()' in that specification.
Document.createElement() - Web APIs
options optional an optional elementcreationoptions object, containing a single property named is, whose value is the tag name of a custom element previously defined via customelements.define().
... html <!doctype html> <html> <head> <title>||working with elements||</title> </head> <body> <div id="div1">the text above has been created dynamically.</div> </body> </html> javascript document.body.onload = addelement; function addelement () { // create a new div element const newdiv = document.createelement("div"); // and give it some content const newcontent = document.createtextnode("hi there and greetings!"); // add the text node to the newly created div newdiv.appendchild(newcontent); // add the newly created element and its content into the dom const currentdiv = document.getelementb...
... } } // define the new element customelements.define('expanding-list', expandinglist, { extends: "ul" }); if we wanted to create an instance of this element programmatically, we'd use a call along the following lines: let expandinglist = document.createelement('ul', { is : 'expanding-list' }) the new element will be given an is attribute whose value is the custom element's tag name.
... note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document.forms - Web APIs
WebAPIDocumentforms
the forms read-only property of the document interface returns an htmlcollection listing all the <form> elements contained in the document.
... note: similarly, you can access a list of a form's component user input elements using the htmlformelement.elements property.
..." value="robby's form" /> </form> <form id="dave"> <input type="button" onclick="alert(document.forms[1].id);" value="dave's form" /> </form> <form id="paul"> <input type="button" onclick="alert(document.forms[2].id);" value="paul's form" /> </form> </body> </html> getting an element from within a form var selectform = document.forms[index]; var selectformelement = document.forms[index].elements[index]; named form access <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form name="login"> <input name="email" type="email"> <input name="password" type="password"> <button type="submit">log in</button> </form> <script> var loginform = document.forms.login; // or document.forms['login'] loginform.elements.email.placeholder = 'test@...
...example.com'; loginform.elements.password.placeholder = 'password'; </script> </body> </html> specifications specification status comment html living standardthe definition of 'document.forms' in that specification.
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a static (not live) nodelist representing a list of the document's elements that match the specified group of selectors.
...see locating dom elements using selectors for more information about using selectors to identify elements.
... examples obtaining a list of matches to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is a <div> with the class highlighted and which are located inside a container whose id is t...
... var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array.
Element.attachShadow() - Web APIs
elements you can attach a shadow to note that you can't attach a shadow root to every type of element.
...the following is a list of elements you can attach a shadow root to: any autonomous custom element with a valid name <article> <aside> <blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowrootinit); parameters shadowrootinit a shadowrootinit dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree.
... this can be one of: open: elements of the shadow root are accessible from javascript outside the root, for example using element.shadowroot: element.shadowroot; // returns a shadowroot obj closed: denies access to the node(s) of a closed shadow root from javascript outside it: element.shadowroot; // returns null delegatesfocus a boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability.
...create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); specifications specification status comment domthe definition of 'attachshadow()' in that specification.
Element.classList - Web APIs
WebAPIElementclassList
lyfillclasslist(this); return this.classlist; }, configurable: 0, set: function(val){this.classname = val} }); } catch(e) { // less performant fallback for older browsers (ie 6-8): window[" ucl"] = polyfillclasslist; // the below code ensures polyfillclasslist is applied to all current and future elements in the doc.
...it's currently unable to polyfill out-of-document-elements (e.g.
... elements created by document.createelement before they are appended to a parent node) in ie6-7.
... a minor note is that in ie6-7, this polyfill uses the window[" ucl"] property on the window object for communicating with the css expressions, the x-uclp css property on all elements, and the element[" ucl"] property on all elements to allow garbage collection and boost performance.
Element.querySelector() - Web APIs
syntax element = baseelement.queryselector(selectors); parameters selectors a group of selectors to match the descendant elements of the element baseelement against; this must be valid css syntax, or a syntaxerror exception will occur.
...the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an initial list of potential elements.
... the resulting elements are then examined to see if they are descendants of baseelement.
... the first match of those remaining elements is returned by the queryselector() method.
Element.querySelectorAll() - Web APIs
the element method queryselectorall() returns a static (not live) nodelist representing a list of elements matching the specified group of selectors which are descendants of the element on which the method was called.
...see locating dom elements using selectors for more information about using selectors to identify elements.
... const refs = [...document.queryselectorall(`[class*="funnel-chart-percent"]`)]; // const refs = [...document.queryselectorall(`[class^="funnel-chart-percent"]`)]; // const refs = [...document.queryselectorall(`[class$="funnel-chart-percent"]`)]; // const refs = [...document.queryselectorall(`[class~="funnel-chart-percent"]`)]; obtaining a list of matches to obtain a nodelist of all of the <p> elements contained within the element "mybox": var matches = mybox.queryselectorall("p"); this example returns a list of all <div> elements within "mybox" with a class of either "note" or "alert": var matches = mybox.queryselectorall("div.note, div.alert"); here, we get a list of the document's <p> elements whose immediate parent element is a div with the class "highlighted" and which are located ins...
... var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the iframe elements in the document that contain an attribute named "data-src": var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is "userlist" which have a "data-active" attribute whose value is "1": var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array.
Event - Web APIs
WebAPIEvent
many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them.
... event-handlers are usually connected (or "attached") to various html elements (such as <button>, <div>, <span>, etc.) using eventtarget.addeventlistener(), and this generally replaces using the old html event handler attributes.
...(for example, a webpage with an advertising-module and statistics-module both monitoring video-watching.) when there are many nested elements, each with its own handler(s), event processing can become very complicated—especially where a parent element receives the very same event as its child elements because "spatially" they overlap so the event technically occurs in both, and the processing order of such events depends on the event bubbling and capture settings of each handler triggered.
...this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance).
Using files from web applications - Web APIs
+) { soutput = napprox.tofixed(3) + " " + amultiples[nmultiple] + " (" + nbytes + " bytes)"; } // end of optional code document.getelementbyid("filenum").innerhtml = nfiles; document.getelementbyid("filesize").innerhtml = soutput; } document.getelementbyid("uploadinput").addeventlistener("change", updatesize, false); </script> </body> </html> using hidden file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected.
...(as of time of writing, firefox doesn’t show this visual cue for <input type="file"> elements.) selecting files using drag and drop you can also let the user drag and drop files into your web application.
...this is explained in the section using hidden file input elements using the click() method, as is the method that invokes the file picker.
...this allows us to select all of the images the user has chosen for uploading using document.queryselectorall(), like this: function sendfiles() { const imgs = document.queryselectorall(".obj"); for (let i = 0; i < imgs.length; i++) { new fileupload(imgs[i], imgs[i].file); } } line 2 fetches a nodelist, called imgs, of all the elements in the document with the css class obj.
HTMLElement: input event - Web APIs
bubbles yes cancelable no interface inputevent event handler property globaleventhandlers.oninput the event also applies to elements with contenteditable enabled, and to any element when designmode is turned on.
...if these properties apply to multiple elements, the editing host is the nearest ancestor element whose parent isn't editable.
... for <input> elements with type=checkbox or type=radio, the input event should fire whenever a user toggles the control, per the html5 specification.
...check compatibility, or use the change event instead for elements of these types.
HTMLElement.offsetHeight - Web APIs
it does not include the height of pseudo-elements such as ::before or ::after.
...floated elements extending below other linear content are ignored.
...however, non-scrollable elements may have large offsetheight values, much larger than the visible content.
... these elements are typically contained within scrollable elements; consequently, these non-scrollable elements may be completely or partly invisible, depending on the scrolltop setting of the scrollable container.
HTMLFormElement.length - Web APIs
you can access the list of the form's controls using the elements property.
... this includes both elements that are descendents of the <form> element as well as elements that are made members of the form using their form property.
... the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
...this is the same as the number of the elements in the htmlformcontrolscollection returned by the elements property.
HTMLMediaElement - Web APIs
the htmlvideoelement and htmlaudioelement elements both inherit this interface.
... htmlmediaelement.mediagroup a domstring that reflects the mediagroup html attribute, which indicates the name of the group of elements it belongs to.
... a group of media elements shares a common mediacontroller.
...this is optimized so this element gets access to all of the other element's cached and buffered data; in fact, the two elements share downloaded data, so data downloaded by either element is available to both.
HTMLOrForeignElement.tabIndex - Web APIs
tab order is as follows: elements with a positive tabindex.
... elements that have identical tabindex values should be navigated in the order they appear.
... elements that do not support the tabindex attribute or support it and assign tabindex to 0, in the order they appear.
... elements that are disabled do not participate in the tabbing order.
HTMLOutputElement - Web APIs
the htmloutputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements.
... 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.value a domstring representing the value of the contents of the elements.
Capabilities, constraints, and settings - Web APIs
let videoconstraints = null; let audioconstraints = null; let audiotrack = null; let videotrack = null; and we get references to all of the elements we'll need to access.
...mentbyid("log"); let supportedconstraintlist = document.getelementbyid("supportedconstraints"); let videoconstrainteditor = document.getelementbyid("videoconstrainteditor"); let audioconstrainteditor = document.getelementbyid("audioconstrainteditor"); let videosettingstext = document.getelementbyid("videosettingstext"); let audiosettingstext = document.getelementbyid("audiosettingstext"); these elements are: videoelement the <video> element that will show the stream.
... finally, we set the current contents of the two constraint set editor elements to the defaults.
... simple tab support in the editor this code adds simple support for tabs to the <textarea> elements by making the tab key insert two space characters when either constraint edit box is focused.
ParentNode.querySelectorAll() - Web APIs
the parentnode mixin defines the queryselectorall() method as returning a nodelist representing a list of elements matching the specified group of selectors which are descendants of the object on which the method was called.
...see locating dom elements using selectors for more information about using selectors to identify elements.
... examples to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is a <div> with the class highlighted and which are located inside a container whose id is t...
... var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active=1]"); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
Using Pointer Events - Web APIs
function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointercancel", handlecancel, false); el.addeventlistener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
... function handlestart(evt) { log("pointerdown."); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); log("pointerdown: id = " + evt.pointerid); ongoingtouches.push(copytouch(evt)); var color = colorfortouch(evt); ctx.beginpath(); ctx.arc(touches[i].pagex, touches[i].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.arc(evt.clientx, evt.clienty, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); } after storing some of the event's processing in the ongoing...
... function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); log("ctx.
... function handleend(evt) { log("pointerup"); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.beginpath(); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); ctx.lineto(evt.clientx, evt.clienty); ctx.fillrect(evt.clientx - 4, evt.clienty - 4, 8, 8);...
Pointer events - Web APIs
typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media.
...this property may be applied to all elements except: non-replaced inline elements, table rows, row groups, table columns, and column groups.
...</div> </body> </html> in the following example, default touch behavior is disabled for some button elements.
...if the target area is too small, touching it could result in firing other events for adjacent elements.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
the pubkeycredparams property of the publickeycredentialcreationoptions dictionary is an array whose elements are objects describing the desired features of the credential to be created.
... if this array contains multiple elements, they are sorted by descending order of preference.
... syntax pubkeycredparams = publickeycredentialcreationoptions.pubkeycredparams value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... though those elements are sorted by preference (the first element being the most prefered), it is up to the client to choose among those elements for building the credential.
SVGSVGElement - Web APIs
the svgsvgelement interface provides access to the properties of <svg> elements, as well as methods to manipulate them.
...the behavior is undefined for <svg> elements that are not at the outermost level.
... svgsvgelement.getintersectionlist() returns a nodelist of graphics elements whose rendered content intersects the supplied rectangle.
... svgsvgelement.getenclosurelist() returns a nodelist of graphics elements whose rendered content is entirely contained within the supplied rectangle.
Multi-touch interaction - Web APIs
define touch targets the application uses <div> elements to represent four touch areas.
... function end_handler(ev) { ev.preventdefault(); if (logevents) log(ev.type, ev, false); if (ev.targettouches.length == 0) { // restore background and border to original values ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; } } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
...false : true; } function log(name, ev, printtargetids) { var o = document.getelementsbytagname('output')[0]; var s = name + ": touches = " + ev.touches.length + " ; targettouches = " + ev.targettouches.length + " ; changedtouches = " + ev.changedtouches.length; o.innerhtml += s + " "; if (printtargetids) { s = ""; for (var i=0; i < ev.targettouches.length; i++) { s += "...
... id = " + ev.targettouches[i].identifier + " "; } o.innerhtml += s; } } function clearlog(event) { var o = document.getelementsbytagname('output')[0]; o.innerhtml = ""; } related topics and resources pointer events ...
Example and tutorial: Simple synth keyboard - Web APIs
we draw this in a pair of nested <div> elements so that we can make the keyboard horizontally scrollable if all the keys don't fit on the screen, without having them wrap around.
... let keyboard = document.queryselector(".keyboard"); let wavepicker = document.queryselector("select[name='waveform']"); let volumecontrol = document.queryselector("input[name='volume']"); references to elements we'll need access to are obtained: keyboard is the container element into which the keys will be placed.
...it creates the elements that comprise the key and its label, adds some data attributes to the element for later use, and assigns event handlers for the events we care about.
...lelement.innerhtml = note + "<sub>" + octave + "</sub>"; keyelement.appendchild(labelelement); keyelement.addeventlistener("mousedown", notepressed, false); keyelement.addeventlistener("mouseup", notereleased, false); keyelement.addeventlistener("mouseover", notepressed, false); keyelement.addeventlistener("mouseleave", notereleased, false); return keyelement; } after creating the elements that will represent the key and its label, we configure the key's element by setting its class to "key" (which establishes its appearance).
Using the aria-describedby attribute - Accessibility
description the aria-describedby attribute is used to indicate the ids of the elements that describe the object.
... 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.
... this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
... 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: application role - Accessibility
description the application role indicates to assistive technologies that this part of the web content contains elements that do not conform to any other known html element or wai-aria widget.
...such elements usually include headings, form fields, lists, tables, links, graphics, or landmark regions.
...in a slides application, for example, a widget could be created that uses the arrow keys to position elements on the slide, and uses audio feedback via an aria live region to communicate the position and overlap status with other objects.
... recommendation precedence order applying the application role will cause this and all of the descendant elements of this element to be treated like application content, not web content.
ARIA: cell role - Accessibility
using native html <td> elements, whenever possible, is strongly encouraged.
...it is a structural equivalent to the thead, tfoot, and tbody elements in an html table element.
... examples <div role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none" aria-rowindex="1">aria role</span> <span role="columnheader" aria-sort="none" aria-rowindex="1">semantic element</span> </div>...
... <table role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <caption id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</caption> <thead role="rowgroup"> <tr role="row"> <th role="columnheader" aria-sort="none" aria-rowindex="1">aria role</th> <th role="columnheader" aria-sort="none" aria-rowindex="1">semantic element...
ARIA: gridcell role - Accessibility
<div role="gridcell">potato</div> <div role="gridcell">cabbage</div> <div role="gridcell">onion</div> elements that have role="gridcell" applied to them must be the child of an element with a role of row.
...the ids provided for aria-describedby should correspond to parent elements intended to be the rows and columns.
... by referencing the parent elements with roles of rowheader or columnheader applied to them via aria-describedby, it allows assistive technology to understand the position and relationship of the gridcell element to the rest of the table-style grouping of content.
... interactive grids and treegrids editable cells both td elements and elements with a role of gridcell applied to them can be made editable, mimicking functionality similar to editing a spreadsheet.
ARIA: row role - Accessibility
using native html <tr> elements, whenever possible, is strongly encouraged.
...it is a structural equivalent to the thead, tfoot, and tbody elements in an html table element.
... examples <div role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> ...
... <table role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <caption id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</caption> <thead role="rowgroup"> <tr role="row"> <th role="columnheader" aria-sort="none">aria role</th> <th role="columnheader" aria-sort="none">semantic element</th> </tr> </thead> ...
ARIA: switch role - Accessibility
all elements that are descendants of an element with the switch role applied to it are automatically assigned role presentation.
... this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies.
... text in these elements remains visible to the user agent and may be read or otherwise delivered to the user, unless it's expressly hidden using display: none or aria-hidden="true".
...the switch has two child elements containing the "off" and "on" labels and is followed by a <label> identifying the switch.
ARIA: table role - Accessibility
<div role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-rowindex="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" ar...
... 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.
...realize, it is much simpler to simply use the <table> element, along with all the related semantic elements and attributes that are all supported by all assistive technologies.
... examples <div role="table" aria-label="semantic elements" aria-describedby="semantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> ...
An overview of accessible web applications and widgets - Accessibility
since the html4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>.
... aria-checked: indicates the state of a checkbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise operable aria-grabbed: indicates the 'grabbed' state of an object in a drag-and-drop operation (for a full list of aria states, consult the aria list of states and properties.) developers should use aria states to indicate the state of ui widget elements and use css attribute selectors to alter the visual appearance based on the state changes (rather than using script to change a class name on the element).
...a developer might be tempted to implement the "view" mode using a read-only text <input> element and setting its aria role to button, then switching to "edit" mode by making the element writable and removing the role attribute in "edit" mode (since <input> elements have their own role semantics).
...once keyboard focus is inside the container, the arrow keys should allow the user to navigate between each tab (the <li> elements).
Cognitive accessibility - Accessibility
cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; providing easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery.
... focus order makes sense the order of focus for interactive elements should make sense.
... focused elements should be visibly focused when a user navigates using a keyboard, the ui should make it obvious which element currently has focus.
...include labels or instructions when users need to input information, using the <label>, <fieldset>, and <legend> elements to do so.
-moz-image-region - CSS: Cascading Style Sheets
for certain xul elements and pseudo-elements that use an image from the list-style-image property, this property specifies a region of the image that is used in place of the whole image.
... this allows elements to use different pieces of the same image to improve performance.
... formal definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements.
... note: -moz-image-region only works with <image> elements where the icon is specified using list-style-image.
::backdrop - CSS: Cascading Style Sheets
this includes both elements which have been placed in full-screen mode using the fullscreen api and <dialog> elements.
... when multiple elements have been placed into full-screen mode, the backdrop is drawn immediately beneath the frontmost such element, and on top of the older full-screen elements.
... /* backdrop is only displayed when dialog is opened with dialog.showmodal() */ dialog::backdrop { background: rgba(255,0,0,.25); } all full-screen elements are placed in a last-in/first out (lifo) stack in the top layer, which is a special layer in the viewport which is always rendered last (and therefore on top) before drawing the viewport's contents to the screen.
... ::backdrop neither inherits from nor is inherited by any other elements.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
note also that this selector won't select a text node placed into a slot; it only targets actual elements.
...'='<attr-modifier> = i | s examples highlighting slotted elements the following snippets are taken from our slotted-pseudo-element demo (see it live also).
...use a simple template with three slots: <template id="person-template"> <div> <h2>personal id card</h2> <slot name="person-name">name missing</slot> <ul> <li><slot name="person-age">age missing</slot></li> <li><slot name="person-occupation">occupation missing</slot></li> </ul> </div> </template> a custom element — <person-details> — is defined like so: customelements.define('person-details', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('person-template'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}); let style = document.createelement('style'); style.textcontent = 'div { padding: 10px; border: 1px solid gray; width: 200px;...
...gin: 0 0 10px; }' + 'ul { margin: 0; }' + 'p { margin: 10px 0; }' + '::slotted(*) { color: gray; font-family: sans-serif; } '; shadowroot.appendchild(style); shadowroot.appendchild(templatecontent.clonenode(true)); } }) you'll see that when filling the style element with content, we select all slotted elements (::slotted(*)) and give them a different font and color.
:defined - CSS: Cascading Style Sheets
WebCSS:defined
this includes any standard element built in to the browser, and custom elements that have been successfully defined (i.e.
... /* selects any defined element */ :defined { font-style: italic; } /* selects any instance of a specific custom element */ simple-custom:defined { display: block; } syntax :defined examples hiding elements until they are defined the following snippets are taken from our defined-pseudo-class demo (see it live also).
... in this demo we define a very simple trivial custom element: customelements.define('simple-custom', class extends htmlelement { constructor() { super(); let divelem = document.createelement('div'); divelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(divelem); } }) then insert a copy of this element into the document, along with a standard <p>: <simple-custom text="custom element example text"></simple-custom> <p>standard paragraph example text</p> in the css we first include the following rules: // give the two elements distinctive backgrounds p { background: yellow; } simple-custom { background: cyan; } // both the custom and the built-in element are given italic text :defined { ...
...font-style: italic; } then provide the following two rules to hide any instances of our custom element that are not defined, and display instances that are defined as block level elements: simple-custom:not(:defined) { display: none; } simple-custom:defined { display: block; } this is useful if you have a complex custom element that takes a while to load into the page — you might want to hide instances of the element until definition is complete, so that you don't end up with flashes of ugly unstyled elements on the page specifications specification status comment html living standardthe definition of ':defined' in that specification.
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
the :dir() css pseudo-class matches elements based on the directionality of the text contained in them.
...the latter match the html dir attribute, and ignore elements that lack it — even if they inherit a direction from their parent.
... parameters ltr target left-to-right elements.
... rtl target right-to-left elements.
Box-shadow generator - CSS: Cascading Style Sheets
: init, addshadow : addshadow, swapshadow : swapshadow, addcssclass : addcssclass, disableclass : disableclass, deleteshadow : deleteshadow, setactiveclass : setactiveclass, setactiveshadow : setactiveshadow } })(); /** * layer manager */ var layermanager = (function layermanager() { var stacks = []; var active = { node : null, stack : null } var elements = {}; var mouseevents = function mouseevents(e) { var node = e.target; var type = node.getattribute('data-type'); if (type === 'subject') setactivestack(stacks[node.id]); if (type === 'disable') { tool.disableclass(node.parentnode.id); setactivestack(stacks['element']); } if (type === 'add') active.stack.addlayer(); if (type === 'layer') active.stac...
... return; if (index == this.layerid) { if (this.count >= 1) { this.layerid = 0; this.setactivelayer(this.stack.children[0], true); } else { this.layer = null; this.show(); } } if (index < this.layerid) { this.layerid--; tool.setactiveshadow(this.layerid, true); } } stack.prototype.setactivelayer = function setactivelayer(node) { elements.shadow_properties.style.display = 'block'; elements.element_properties.style.display = 'none'; if (this.layer) this.layer.removeattribute('data-active'); this.layer = node; this.layer.setattribute('data-active', 'layer'); var shadowid = node.getattribute('data-shid') | 0; this.layerid = this.order.indexof(shadowid); tool.setactiveshadow(this.layerid, true); } sta...
... function unsetactivelayer() { if (this.layer) this.layer.removeattribute('data-active'); this.layer = null; this.layerid = 0; } stack.prototype.hide = function hide() { this.unsetactivelayer(); this.subject.removeattribute('data-active'); var style = this.container.style; style.left = '100%'; style.zindex = '0'; } stack.prototype.show = function show() { elements.shadow_properties.style.display = 'none'; elements.element_properties.style.display = 'block'; if (this.id === 'element') { elements.zindex.style.display = 'none'; elements.transform_rotate.style.display = 'none'; } else { elements.zindex.style.display = 'block'; elements.transform_rotate.style.display = 'block'; } this.subject.setattribute('data-active', 'subj...
...ect'); var style = this.container.style; style.left = '0'; style.zindex = '10'; tool.setactiveclass(this.id); } function init() { var elem, size; var layermanager = getelembyid("layer_manager"); var layermenu = getelembyid("layer_menu"); var container = getelembyid("stack_container"); elements.shadow_properties = getelembyid('shadow_properties'); elements.element_properties = getelembyid('element_properties'); elements.transform_rotate = getelembyid('transform_rotate'); elements.zindex = getelembyid('z-index'); elem = document.queryselectorall('#layer_menu [data-type="subject"]'); size = elem.length; for (var i = 0; i < size; i++) { var s = new stack(elem[i]); stacks[elem[i].id] = s; container.appendchild(s.container); tool.addc...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
in this page we explore how box alignment works in the context of block layout, including floated, positioned, and table elements.
... this property does not apply to floated elements or table cells.
... absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right.
... absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right.
Understanding CSS z-index - CSS: Cascading Style Sheets
in the most basic cases, html pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping.
... in this case, there is a single rendering flow, and all elements are aware of the space taken by others.
...however, when z-index is applied to complex hierarchies of html elements, its behaviour can be hard to understand or predict.
... stacking with floated blocks: how floating elements are handled with stacking.
Using CSS transforms - CSS: Cascading Style Sheets
css transforms are implemented using a set of css properties that let you apply affine linear transformations to html elements.
... only elements positioned by the box model can be transformed.
...you have to start by configuring the 3d space by giving it a perspective, then you have to configure how your 2d elements will behave in that space.
...the farther from the viewer the elements are, the smaller they are.
Using media queries - CSS: Cascading Style Sheets
to target specific media for the <style>, <link>, <source>, and other html elements with the media= attribute.
... name summary notes any-hover does any available input mechanism allow the user to hover over elements?
... height height of the viewport hover does the primary input mechanism allow the user to hover over elements?
...this example applies styles when the user's primary input mechanism (such as a mouse) can hover over elements: @media (hover: hover) { ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
mozilla applications such as firefox support a number of special mozilla extensions to css, including properties, values, pseudo-elements and pseudo-classes, at-rules, and media queries.
...some of them apply only to xul elements.
...r-textfield spinner-upbutton statusbar statusbarpanel tab tabpanels tab-scroll-arrow-back tab-scroll-arrow-forward textfield textfield-multiline toolbar toolbarbutton-dropdown toolbox tooltip treeheadercell treeheadersortarrow treeitem treetwisty treetwistyopen treeview window background-image gradients -moz-linear-gradient -moz-radial-gradient elements -moz-element sub-images -moz-image-rect() border-color -moz-use-text-colorobsolete since gecko 52 (removed in bug 1306214); use currentcolor instead.
... -moz-urdu overflow -moz-scrollbars-none -moz-scrollbars-horizontal -moz-scrollbars-vertical -moz-hidden-unscrollable text-align -moz-center -moz-left -moz-right text-decoration -moz-anchor-decoration -moz-user-select -moz-all -moz-none width, min-width, and max-width -moz-min-content -moz-fit-content -moz-max-content -moz-available pseudo-elements and pseudo-classes a – d ::-moz-anonymous-block eg@:- bug 331432 ::-moz-anonymous-positioned-block :-moz-any :-moz-any-link [matches :link and :visited] :-moz-broken ::-moz-canvas ::-moz-color-swatch ::-moz-cell-content :-moz-drag-over f – i :-moz-first-node ::-moz-focus-inner ::-moz-focus-outer :-moz-focusring :-moz-full-screen :-moz-full-screen-ancestor :-moz-...
box-sizing - CSS: Cascading Style Sheets
this typically makes it much easier to size elements.
... note: it is often useful to set box-sizing to border-box to layout elements.
... this makes dealing with the sizes of elements much easier, and generally eliminates a number of pitfalls you can stumble on while laying out your content.
... formal definition initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements.
line-height - CSS: Cascading Style Sheets
on block-level elements, it specifies the minimum height of line boxes within the element.
... on non-replaced inline elements, it specifies the height that is used to calculate line box height.
... w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements.
...we will use two <div> elements.
margin - CSS: Cascading Style Sheets
WebCSSmargin
the top and bottom margins have no effect on non-replaced inline elements, such as <span> or <code>.
... margin collapsing elements' top and bottom margins are sometimes collapsed into a single margin that is equal to the larger of the two margins.
... recommendation removes the effect of top and bottom margins on inline elements.
... initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
max-height - CSS: Cascading Style Sheets
accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block.
...firefox supports applying max-height to table elements.ie full support 7opera full support 7notes full support 7notes notes css 2.1 leaves the behavior of max-height with table undefined.
... opera supports applying max-height to table elements.safari full support 1.3webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0fit-content experimentalchrome full support 46 full support 46 full support 25prefixed prefi...
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
formal definition initial valueautoapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> exa...
...firefox supports applying min-width to table elements.ie full support 7opera full support 4notes full support 4notes notes css 2.1 leaves the behavior of min-width with table undefined.
... opera supports applying min-width to table elements.safari full support 1webview android full support 4.4chrome android full support 18firefox android full support 4notes full support 4notes notes css 2.1 leaves the behavior of min-width with table undefined.
... firefox supports applying min-width to table elements.opera android full support 14safari ios full support 1samsung internet android full support 1.0autochrome full support 21notes full support 21notes notes chrome uses auto as the initial value for min-width.edge full support 12notes full support 12notes notes edge uses auto as the initial value for min-width.firefox full support 34 full support ...
ruby-align - CSS: Cascading Style Sheets
the ruby-align css property defines the distribution of the different ruby elements over the base.
... space-between is a keyword indicating that the extra space will be distributed between the elements of the ruby.
... space-around is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it.
... text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: start; } result ruby aligned at the center of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: center; } result extra space distributed between ruby elements html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: space-between; } result extra space distributed between and around ruby elements html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: space-around; } result specifications ...
transform - CSS: Cascading Style Sheets
WebCSStransform
in that case, the element will act as a containing block for any position: fixed; or position: absolute; elements that it contains.
... only transformable elements can be transformed.
... that is, all elements whose layout is governed by the css box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes.
... find out more: mdn understanding wcag, guideline 2.3 explanations understanding success criterion 2.3.3 | w3c understanding wcag 2.1 formal definition initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <transform-list>where <transform-list> = <transform-function>+where <transform-function> = <matrix()> | <translate()> | <translatex()> | <translatey()> | <scale()> | <scalex()> | <scal...
Adding captions and subtitles to HTML5 video - Developer guides
we actually have our subtitles in three different languages — english, german, and spanish — 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 l...
... in addition to adding the <track> elements, we have also added a new button to control the subtitles menu that we will build.
...this menu is built dynamically, so that languages can be added or removed later by simply editing the <track> elements within the video's markup.
...eo.texttracks[i].language == lang) { video.texttracks[i].mode = 'showing'; this.setattribute('data-state', 'active'); } else { video.texttracks[i].mode = 'hidden'; } } subtitlesmenu.style.display = 'none'; }); subtitlemenubuttons.push(button); return listitem; } this function builds the required <li> and <button> elements, and returns them so they can be added to the subtitles menu list.
DOM onevent handlers - Developer guides
registering onevent handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events.
... elements can be interactive (links, buttons, images, forms, and so forth) or non-interactive (such as the base <body> element).
...for example, for the progress event on instances of xmlhttprequest: const xhr = new xmlhttprequest(); xhr.onprogress = function() { … }; html onevent attributes html elements have attributes named onevent which can be used to register a handler for an event directly within the html code.
...'<hr/><br> changing onclick handler using <strong> setattribute method </strong> '); el.setattribute("onclick", 'anchoronclick(event)'); log(`changed the property to: <code> ${el.onclick.tostring()} </code>`); log(`now even the html attribute has changed: <code> ${el.getattribute("onclick")} </code><br>`); result for historical reasons, some attributes/properties on the <body> and <frameset> elements instead set event handlers on their parent window object.
Rich-Text Editing in Mozilla - Developer guides
starting in firefox 3, mozilla also supports internet explorer's contenteditable attribute which allows any element to become editable or non-editable (the latter for when preventing change to fixed elements in an editable environment).
... similarly, setting contenteditable to "true" allows you to make individual elements of a document editable.
...most commands affect the document's selection (bold, italics, etc), while others insert new elements (adding a link) or affect an entire line (indenting).
...the example page consists of an iframe, which will be the rich editing area, as well as elements for basic editing commands such as bold/italics/text color.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
WebHTMLElementbase
if the document has no <base> elements, then baseuri defaults to location.href.
... if either of the following attributes are specified, this element must come before other elements with attribute values of urls, such as <link>’s href attribute.
... target a keyword or author-defined name of the default browsing context to show the results of navigation from <a>, <area>, or <form> elements without explicit target attributes.
... usage notes multiple <base> elements if multiple <base> elements are used, only the first href and first target are obeyed — all others are ignored.
<br>: The Line Break element - HTML: Hypertext Markup Language
WebHTMLElementbr
note: do not use <br> to create margins between paragraphs; wrap them in <p> elements and use the css margin property to control their size.
... you can set a margin on <br> elements themselves to increase the spacing between the lines of text in the block, but this is a bad practice — you should use the line-height property that was designed for that purpose.
... examples simple br in the following example we use <br> elements to create line breaks between the different lines of a postal address: mozilla<br> 331 e.
... use <p> elements, and use css properties like margin to control their spacing.
<colgroup> - HTML: Hypertext Markup Language
WebHTMLElementcolgroup
the span attribute is not permitted if there are one or more <col> elements within the <colgroup>.
...the descendant <col> elements may override this value using their own align attribute.
...because <td> elements are not descendant of the <colgroup> element, they won't inherit it.
...because <td> elements are not descendant of the <colgroup> element, they won't inherit it.
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementelement
the obsolete html <element> element was part of the web components specification; it was intended to be used to define new custom dom elements.
... it was removed in favor of a javascript-driven approach for creating new custom elements.
... permitted parent elements ???
... specifications the <element> element was formerly in a draft specification of custom elements but it has been removed.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
if the crossorigin attribute is not specified, then a non-cors request is sent (without the origin request header), and the browser marks the image as tainted and restricts access to its image data, preventing its usage in <canvas> elements.
...st header); but if the server does not opt into allowing cross-origin access to the image data by the origin site (by not sending any access-control-allow-origin response header, or by not including the site's origin in any access-control-allow-origin response header it does send), then the browser marks the image as tainted and restricts access to its image data, preventing its usage in <canvas> elements.
... security and privacy concerns although <img> elements have innocent uses, they can have undesirable consequences for user security and privacy.
...if an image needs a caption, use the figure and figcaption elements.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
<input> elements of type range let the user specify a numeric value which must be no less than a given value, and no more than another given value.
... additional attributes in addition to the attributes shared by all <input> elements, range inputs offer the following attributes: attribute description list the id of the <datalist> element that contains optional pre-defined options max the maximum permitted value min the minimum permitted value step the stepping interval, used both for user interface and validation purposes list the values of the list attr...
... orient similar to the -moz-orient non-standard css property impacting the <progress> and <meter> elements, the orient attribute defines the orientation of the range slider.
...</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.
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
<input> elements of type url are used to let the user enter and edit a url.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, url inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered...
...it can be used on any editable content, but here we consider specifics related to the use of spellcheck on <input> elements.
... using labels for suggested values you can opt to include the label attribute on one or all of your <option> elements to provide textual labels.
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
<input> elements of type week create input fields allowing easy entry of a year plus the iso 8601 week number during that year (i.e., week 1 to 52 or 53).
... you can also get and set the value in javascript using the input element's value property, for example: var weekcontrol = document.queryselector('input[type="week"]'); weekcontrol.value = '2017-w45'; additional attributes in addition to the attributes common to <input> elements, week inputs offer the following attributes: attribute description max the latest year and week to accept as valid input min the earliest year and week to accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed value...
... the best way to deal with week/years in forms in a cross-browser way at the moment is to get the user to enter the week number and year in separate controls (<select> elements being popular; see below for an example), or use javascript libraries such as jquery date picker.
... examples in this example we create two sets of ui elements for choosing weeks: a native picker created using <input type="week">, and a set of two <select> elements for choosing weeks/years in older browsers that don't support the week input type.
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnextid
it is also probably one of the least understood of all of the early html elements.
... html version 2 level 1 this is like the level 2 default but it excludes all the forms elements, i.
...<form>, <input>, <textarea>, <select>, and <option> html version 2 strict level 1 this is like regular level 1 but it also excludes these depreciated elements, along with such constructs as nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
... attributes like all other html elements, this element accepts the global attributes.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
permitted content zero or more <li>, <script> and <template> elements.
...for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4".
... 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.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
this attribute enables you to place <textarea> elements anywhere within a document, not just as descendants of form elements.
...compared to other form elements it is relatively easy to style, with its box model, fonts, color scheme, etc.
...other major browsers place the insertion point at the beginning of the text.notes a default background-image gradient is applied to all <textarea> elements, which can be disabled using background-image: none.ie full support yesopera full support yessafari full support yeswebview android full support yeschrome android full support ...
...other major browsers place the insertion point at the beginning of the text.notes a default background-image gradient is applied to all <textarea> elements, which can be disabled using background-image: none.opera android full support yessafari ios full support yesnotes full support yesnotes notes unlike other major browsers, a default style of opacity: 0.4 is applied to disabled <textarea> elements.samsung internet...
itemprop - HTML: Hypertext Markup Language
property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>.
... examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data.
...when a string value is a url, it is expressed using the <a> element and its href attribute, the <img> element and its src attribute, or other elements that link to or embed external resources.
...the url property elements are the a, area, audio, embed, iframe, img, link, object, source, track, and video elements.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
this example is trivial, as the browser probably discovers the <link rel="stylesheet"> and <script> elements in the same chunk of html as the preloads, but the benefits can be seen much more clearly the later resources are discovered and the larger they are.
... including a mime type <link> elements can accept a type attribute, which contains the mime type of the resource the element points to.
... including media one nice feature of <link> elements is their ability to accept media attributes.
...>my site</h1> </header> <script> var mediaquerylist = window.matchmedia("(max-width: 600px)"); var header = document.queryselector('header'); if (mediaquerylist.matches) { header.style.backgroundimage = 'url(bg-image-narrow.png)'; } else { header.style.backgroundimage = 'url(bg-image-wide.png)'; } </script> </body> we include media attributes on our <link> elements so that a narrow image is preloaded if the user has a narrow viewport, and a wider image is loaded if they have a wide viewport.
CSP: media-src - HTTP
the http content-security-policy (csp) media-src directive specifies valid sources for loading media using the <audio> and <video> elements.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
... examples violation cases given this csp header: content-security-policy: media-src https://example.com/ the following <audio>, <video> and <track> elements are blocked and won't load: <audio src="https://not-example.com/audio"></audio> <video src="https://not-example.com/video"> <track kind="subtitles" src="https://not-example.com/subtitles"> </video> specifications specification status comment content security policy level 3the definition of 'media-src' in that specification.
CSP: script-src - HTTP
this includes not only urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt stylesheets which can trigger script execution.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
... content-security-policy: script-src 'unsafe-inline'; the above content security policy will allow inline <script> elements <script> var inline = 1; </script> you can use a nonce-source to only allow specific inline script blocks: content-security-policy: script-src 'nonce-2726c7f26c' you will have to set the same nonce on the <script> element: <script nonce="2726c7f26c"> var inline = 1; </script> alternatively, you can create hashes from your inline scripts.
Expressions and operators - JavaScript
for example, if a is a 2-dimensional array with 10 elements on a side, the following code uses the comma operator to update two variables at once.
... the code prints the values of the diagonal elements in the array: var x = [0,1,2,3,4,5,6,7,8,9] var a = [x, x, x, x, x]; for (var i = 0, j = 9; i <= j; i++, j--) // ^ console.log('a[' + i + '][' + j + ']= ' + a[i][j]); unary operators a unary operation is an operation with only one operand.
...2; // implicitly creates window.x var y = 43; var myobj = {h: 4}; // create object with property h delete x; // returns true (can delete if created implicitly) delete y; // returns false (cannot delete if declared with var) delete math.pi; // returns false (cannot delete non-configurable properties) delete myobj.h; // returns true (can delete user-defined properties) deleting array elements since arrays are just objects, it's technically possible to delete elements from them.
...when you delete an array property, the array length is not affected and other elements are no re-indexed.
Array.prototype.find() - JavaScript
if so, the elements processed by find are set before the first invocation of callback.
... therefore: callback will not visit any elements added to the array after the call to find begins.
... elements that are deleted are still visited.
...undefined if there is no prime number): function isprime(element, index, array) { let start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } console.log([4, 6, 8, 12].find(isprime)); // undefined, not found console.log([4, 5, 8, 12].find(isprime)); // 5 the following examples show that nonexistent and deleted elements are visited, and that the value passed to the callback is their value when visited: // declare array with no elements at indexes 2, 3, and 4 const array = [0,1,,,,5,6]; // shows all indexes, not just those with assigned values array.find(function(value, index) { console.log('visited index ', index, ' with value ', value); }); // shows all indexes, including deleted array.find(function(value,...
Array.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the array.
... the elements are converted to strings using their tolocalestring methods and these strings are separated by a locale-specific string (such as a comma “,”).
... return value a string representing the elements of the array.
... examples using locales and options the elements of the array are converted to strings using their tolocalestring methods.
String.prototype.split() - JavaScript
after splitting the string, the function logs messages indicating the original string (before the split), the separator used, the number of elements in the array, and the individual array elements.
... function splitstring(stringtosplit, separator) { const arrayofstrings = stringtosplit.split(separator) console.log('the original string is: ', stringtosplit) console.log('the separator is: ', separator) console.log('the array has ', arrayofstrings.length, ' elements: ', arrayofstrings.join(' / ')) } const tempeststring = 'oh brave new world that has such people in it.' const monthstring = 'jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec' const space = ' ' const comma = ',' splitstring(tempeststring, space) splitstring(tempeststring) splitstring(monthstring, comma) this example produces the following output: the original string is: "oh brave new world that has such people in it." the separator is: " " the array has 10 elements: oh / brave / new / world / that / has / such / people ...
... the original string is: "oh brave new world that has such people in it." the separator is: "undefined" the array has 1 elements: oh brave new world that has such people in it.
... the original string is: "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec" the separator is: "," the array has 12 elements: jan / feb / mar / apr / may / jun / jul / aug / sep / oct / nov / dec removing spaces from a string in the following example, split() looks for zero or more spaces, followed by a semicolon, followed by zero or more spaces—and, when found, removes the spaces and the semicolon from the string.
TypedArray.prototype.copyWithin() - JavaScript
the copywithin() method copies the sequence of array elements within the array to the position starting at target.
... syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start index position where to copy the elements to.
... start source start index position where to start copying elements from.
...source end index position where to end copying elements from.
TypedArray.prototype.every() - JavaScript
the every() method tests whether all elements in the typed array pass the test implemented by the provided function.
...otherwise, if callback returned a true value for all elements, every will return true.
... examples testing size of all typed array elements the following example tests whether all elements in the typed array are bigger than 10.
... function isbigenough(element, index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.slice() - JavaScript
slice(-2) extracts the last two elements in the sequence.
... for example, slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3).
... return value a new typed array containing the extracted elements.
...it returns a shallow copy of elements from the original typed array.
TypedArray.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the typed array.
... the elements are converted to strings and are separated by a locale-specific string (such as a comma “,”).
... this method has the same algorithm as array.prototype.tolocalestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocalestring() applies for each element.
... return value a string representing the elements of the typed array.
Autoplay guide for media and Web Audio APIs - Web media technologies
autoplay blocking is not applied to <video> elements when the source media does not have an audio track, or if the audio track is muted.
... that means that both of the following are considered autoplay behavior, and are therefore subject to the browser's autoplay blocking policy: <audio src="/music.mp4" autoplay> and audioelement.play(); the following web features and apis may be affected by autoplay blocking: the html <audio> and <video> elements the web audio api from the user's perspective, a web page or app that spontaneously starts making noise without warning can be jarring, inconvenient, or off-putting.
... autoplay of media elements now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how your web site or app can automatically play media upon page load, how to detect when autoplay fails to occur, and tips for coping when autoplay is denied by the browser.
...if this is false, the allowedtoplay property is missing from the htmlmediaelement interface, and is thus not present on either <audio> or <video> elements.
Image file type and format guide - Web media technologies
as such, svg is popular for user interface elements in modern web design.
...for instance, this example defines an drawing area with initial size 100 by 100 units, containing a line drawn diagonally through the box: <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> </svg> svg can be used in web content in two ways: you can directly write the <svg> element within the html, containing svg elements to draw the image.
... you can display an svg image anywhere you can use any of the other image types, including with the <img> and <picture> elements, the background-image css property, and so forth.
...<picture> is used as a wrapper for a number of <source> elements, each specifying a version of the image in a different format or under different media conditions, as well as an <img> element which defines where to display the image and the fallback to the default or "most compatible" version.
Animation performance and frame rate - Web Performance
compared with animating elements using javascript, css animations can be easier to create.
... layout: next, the browser uses the computed styles to figure out the position and geometry for the elements.
... paint: finally, the browser needs to repaint the elements to the screen.
... there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
svg presentation attributes are css properties that can be used as attributes on svg elements.
... value: ltr|rtl|inherit; animatable: yes display it allows to control the rendering of graphical or container elements.
... value: normal|<length>|inherit; animatable: yes lighting-color it defines the color of the light source for filter primitives elements <fediffuselighting> and <fespecularlighting>.
... value: default|non-scaling-stroke|inherit|<uri>; animatable: yes visibility lets you control the visibility of graphical elements.
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
six elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, and <set> animate, animatecolor, animatemotion, animatetransform, set for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>, begin defines when the element should begin, i.e.
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
... seeking backwards in the timeline doesn't re-insert the discarded elements.
... value <begin-value-list> default value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
the display attribute lets you control the rendering of graphical or container elements.
... when applied to a container element, setting display to none causes the container and all of its children to be invisible; thus, it acts on groups of elements as a group.
...it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the purposes of text layout.
... the display attribute only affects the direct rendering of a given element, whereas it does not prevent elements from being referenced by other elements.
dur - SVG: Scalable Vector Graphics
WebSVGAttributedur
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value specifies ...
...this is only valid for elements that define media.
... (for animation elements the attribute will be ignored if media is specified.) indefinite this value specifies the simple duration as indefinite.
... note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements).
textLength - SVG: Scalable Vector Graphics
the textlength attribute, available on svg <text> and <tspan> elements, lets you specify the width of the space into which the text will draw.
... four elements are using this attribute: <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 60" xmlns="http://www.w3.org/2000/svg"> <text y="20" textlength="6em">small text length</text> <text y="40" textlength="120%">big text length</text> </svg> usage notes value <length-percentage> | <number> default value none anim...
... html the html is also simple, with only two displayed elements contained inside a grouping <div>: <div class="controls"> <input type="range" id="widthslider" min="80" max="978"> <span id="widthdisplay"></span> </div> the <input> element, of type "range", is used to create the slider control the user will manipulate to change the width of the text.
...it starts by stashing references to the elements it will need to access, using document.getelementbyid(): const widthslider = document.getelementbyid("widthslider"); const widthdisplay = document.getelementbyid("widthdisplay"); const textelement = document.getelementbyid("hello"); const baselength = math.floor(textelement.textlength.baseval.value); widthslider.value = baselength; widthslider.addeventlistener("input", function(event) { textelement.textlength.baseval.newvaluespecifiedunits( svglength.svg_lengthtype_px, widthslider.valueasnumber); widthdisplay.innertext = widthslider.value; }, false); widthslider.dispatchevent(new event("...
type - SVG: Scalable Vector Graphics
WebSVGAttributetype
for the <fefuncr>, <fefuncg>, <fefuncb>, and <fefunca> elements, it indicates the type of component transfer function.
... for the <style> and <script> elements, it defines the content type of the element.
... usage context for the <animatetransform> elements categories none value translate | scale | rotate | skewx | skewy animatable no normative document svg 1.1 (2nd edition) for the <fecolormatrix> element categories none value matrix | saturate | huerotate | luminancetoalpha animatable yes normative document svg 1.1 (2nd edition) for the <fefuncr>, <fefuncg>, <fefuncb>, and <fefunca> elements categories none value identity | table | discrete | linear | gamma animatable yes normative document svg 1.1 (2nd edition) for the <feturbulence> element categories none value fractalnoise | turbulence animata...
...ble yes normative document svg 1.1 (2nd edition) for the <style> and <script> elements categories none value <content-type> animatable no normative document svg 1.1 (2nd edition) : script svg 1.1 (2nd edition) : style example elements the following elements can use the values attribute <animatetransform> <fecolormatrix> <fefunca> <fefuncb> <fefuncg> <fefuncr> <feturbulence> <script> <style> ...
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
the <g> svg element is a container used to group other svg elements.
... transformations applied to the <g> element are performed on its child elements, and its attributes are inherited by its children.
... it can also group multiple elements to be referenced later with the <use> element.
...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 categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2th...
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
it is unnecessary for inner svg elements or inside html documents.
...no effect on outermost svg elements.
...no effect on outermost svg elements.
...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 categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2th...
Introduction - SVG: Scalable Vector Graphics
basic ingredients html provides elements for defining headers, paragraphs, tables, and so on.
... in much the same way svg provides elements for circles, rectangles, and simple and complex curves.
...but all these extra features of the language rely on this relatively small set of elements to define the graphics area.
...if you are not too familiar with xml, here are some guidelines to keep in mind: svg elements and attributes should all be entered in the case shown here since xml is case-sensitive (unlike html).
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:output> element controls the characteristics of the output document.
... syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none.
... cdata-section-elements lists elements whose text contents should be written as cdata sections.
... elements should be whitespace separated.
Overview - Archive of obsolete content
it identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element.
... the matcher is responsible for finding annotated elements: it is initialized with the list of annotations and searches web pages for the elements they are associated with.
... it highlights any annotated elements that are found.
Label and description - Archive of obsolete content
to cause the text to wrap: ensure the long-running text is a text node child of <description/> or <label/> (i.e., do not specify the long-running text in the value attribute of these elements).
... the default style for these xul elements includes white-space: wrap;.
... 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.
Toolbar - Archive of obsolete content
you must not insert your toolbar button between any of the following elements: the combined back/forward button, the location bar, the stop botton, or the reload button.
... these elements have special behaviors when placed next to eachother, and will break if separated by another element.
...tallbutton(toolbarid, id, afterid) { if (!document.getelementbyid(id)) { var toolbar = document.getelementbyid(toolbarid); // if no afterid is given, then append the item to the toolbar var before = null; if (afterid) { let elem = document.getelementbyid(afterid); if (elem && elem.parentnode == toolbar) before = elem.nextelementsibling; } toolbar.insertitem(id, before); toolbar.setattribute("currentset", toolbar.currentset); document.persist(toolbar.id, "currentset"); if (toolbarid == "addon-bar") toolbar.collapsed = false; } } if (firstrun) { installbutton("nav-bar", "my-extension-navbar-button"); // the "addon-bar" is available since firefox 4 instal...
Displaying web content in an extension without security issues - Archive of obsolete content
plate document might have this code: <style type="text/css"> #entrytemplate { display: none; } </style> <div id="entrytemplate"> <div class="title"></div> <div class="description"></div> </div> now to insert a new entry in the document you would do the following: var template = doc.getelementbyid("entrytemplate"); var entry = template.clonenode(true); entry.removeattribute("id"); entry.getelementsbyclassname("title")[0].textcontent = title; entry.getelementsbyclassname("description")[0].textcontent = description; template.parentnode.appendchild(entry); the important difference here is that the result will always have the same structure as the template tag.
...so there is no chance of accidentally adding new elements or attributes.
...instead, nsiscriptableunescapehtml.parsefragment() method should be used that is meant for just that scenario: var target = entry.getelementsbyclassname("description")[0]; var fragment = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(description, false, null, target); target.appendchild(fragment); this will add the html code to the specified node — minus all the potentially dangerous content.
Listening to events in Firefox extensions - Archive of obsolete content
types of events there are multiple types of events that application and extension authors can use to receive notifications from <xul:browser> and <xul:tabbrowser> elements to hear about changes relating to loads of the content contained within them.
...both browser and tabbrowser elements support the following: var progresslistener = { // add nsiwebprogressimplementation here } b.addprogresslistener(progresslistener); where b is the browser or tabbrowser you want to listen to events for.
... pageshoweventhandlers the pageshoweventhandlers() function is called by the pageshow event and is used to populate the character set menu and update the ui elements associated with any detected feeds or opensearch plugins for the website.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
listing 5: closing all browser windows var browsers = windowmediator.getenumerator('navigator:browser'); var browser; while (browsers.hasmoreelements()) { browser = browsers.getnext().queryinterface(components.interfaces.nsidomwindowinternal); browser.browsertrytoclosewindow(); } this method returns an overview of the specified window type in the form of an iterator pattern object called nsisimpleenumerator.
... listing 9: listing the contents of a specific directory file.initwithpath('c:\\'); var children = file.directoryentries; var child; var list = []; while (children.hasmoreelements()) { child = children.getnext().queryinterface(components.interfaces.nsilocalfile); list.push(child.leafname + (child.isdirectory() ?
...g setting var string = 'this is test.'; pref.setcharpref('extensions.myextension.testpref', unescape(encodeuricomponent(string))); data type get set boolean getboolpref(prefname) setboolpref(prefname) integer getintpref(prefname) setintpref(prefname) text string getcharpref(prefname) setcharpref(prefname) using methods from xul elements xpcom gives you access to sophisticated functions in xul elements.
Tabbed browser - Archive of obsolete content
the code given is for a menuitem, but will work equally well for other xul elements.
... function openandreuseonetabperurl(url) { var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var browserenumerator = wm.getenumerator("navigator:browser"); // check each browser instance for our url var found = false; while (!found && browserenumerator.hasmoreelements()) { var browserwin = browserenumerator.getnext(); var tabbrowser = browserwin.gbrowser; // check each tab of this browser instance var numtabs = tabbrowser.browsers.length; for (var index = 0; index < numtabs; index++) { var currentbrowser = tabbrowser.getbrowseratindex(index); if (url == currentbrowser.currenturi.spec) { // the url is already opened.
...for example: var num = gbrowser.browsers.length; for (var i = 0; i < num; i++) { var b = gbrowser.getbrowseratindex(i); try { dump(b.currenturi.spec); // dump urls of all open tabs to console } catch(e) { components.utils.reporterror(e); } } to learn what methods are available for <browser/> and <tabbrowser/> elements, use dom inspector or look in browser.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser.
Making it into a static overlay - Archive of obsolete content
a xul overlay is a xul file containing elements to be inserted into another xul file when the other xul file is rendered into an application interface.
...when navigator.xul is rendering into the browser's application interface, this causes any attributes or child elements of the statusbar element in the overlay file to be added to the interface's dom and thus show up in the interface as if they were defined on the same element in navigator.xul.
...thus it allows us to define the exact position of our element relative to the other statusbarpanel elements within statusbar.
Block and Line Layout Cheat Sheet - Archive of obsolete content
maxelementwidth the maximum width for elements within the frame that cannot be broken down further; e.g., the longest word in a paragraph.
... brs_computemaxelementsize this flag is set if reflow should recompute an element's maximum size.
... it is set in the nsblockreflowstate constructor if the "maxelementsize" member of the nshtmlreflowmetrics object has been provided by (the parent frame?).
Extensions - Archive of obsolete content
one of prism's features is an extreme lack of ui elements, which means that trying to use the same overlays in firefox and prism is really not possible.
...prism does have a few ui elements, such as a toolbox, toolbar, menubar, popup menus, statusbar and a container for the browser.
... you can use these ui elements to merge in your extension ui.
Proxy UI - Archive of obsolete content
camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel overview the ui is based on selecting a proxy mode, then filling out any additional needed information in "related" ui.
... "related" ui elements only two proxy modes have related ui.
... enabling and disabling related fields when a radio button is selected, the related ui elements are enabled (and editable).
Binding Implementations - Archive of obsolete content
a method with parameters specifies those parameters and their names with parameter elements declared underneath the method element.
... properties with getters and setters can define them using onget and onset attributes, or using the more verbose getter and setter elements.
... because bindings extend dom elements, they can override any built-in methods or properties on the dom element.
XBL 1.0 Reference - Archive of obsolete content
extensible binding language is a xml-based markup language to implement reusable components (bindings) that can be bound to elements in other documents.
...bindings can be bound to elements using cascading style sheets (css) or dom.
... xbl elements xbl 1.0 elements are in the http://www.mozilla.org/xbl namespace.
XML in Mozilla - Archive of obsolete content
you can use xhtml elements inside an arbitrary xml document by using the xhtml namespace.
...you can also use the linking elements from the xhtml namespace.
... see also e4x xquery code snippets for queryselector - useful techniques for navigating dom using css selectors on xml dom documents (firefox 3.5 only) identifying xml elements and documents parsing and serializing xml ...
dir - Archive of obsolete content
ArchiveMozillaXULAttributedir
« xul reference home dir type: one of the values below the direction in which the child elements of the element are placed.
... normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
disabled - Archive of obsolete content
disabled elements are usually drawn with grayed-out text.
...in the case of form elements, it will not be submitted.
... // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by removing the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this attribute was added in firefox 3.5.
value - Archive of obsolete content
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 "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax.
... for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user.
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct.
... the list below may include a few elements which are actually in use, but at a deeper level in the code.
... elements <actions> (listed here by mistake or was it a container tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated?
Working With Directories - Archive of obsolete content
function getlatestfile() { var lastmod = 0; var homedir = io.getfile("home", ""); var items = homedir.directoryentries; while (items.hasmoreelements()) { var item = items.getnext().queryinterface(components.interfaces.nsifile); if (item.isfile() && item.lastmodifiedtime > lastmod.lastmodifiedtime) lastmod = item; } return lastmod; } this example iterates through the files in the home directory and looks for the file with the latest modification time (the last file in that directory that was written to).
... as the directoryentries (nsifile.attributes) property is an enumeration, you can iterate over the items by using nsisimpleenumerator.hasmoreelements() and nsisimpleenumerator.getnext().
...the following example returns an array of all of a directory's subdirectories: function getsubdirs() { var arr = []; var items = io.getfile("home", "").directoryentries; while (items.hasmoreelements()) { var item = items.getnext(); if (item.isdirectory()) arr.push(item); } return arr; } ...
ContextMenus - Archive of obsolete content
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 elements you want the context menu to apply to.
...the result is that context clicking on images will show a menu with three items, but will only show one item for other types of elements.
MenuModification - Archive of obsolete content
to do this, we instead need to use the inherited node modification methods available for all elements.
... the appendchild method is available for all elements, and is used to add new nodes within another node.
... the appenditem method is specific to menus, as well as some other specific elements, and is simpler to use to append new menuitem elements to a menu.
Panels - Archive of obsolete content
the panel will display whatever elements are placed as children of the panel element.
...for other types of elements, you need to use a different technique as in the following example.
... focus in panels elements within panels may be focused with the mouse, and the currently focused element may be adjusted by pressing the tab key.
tag - Archive of obsolete content
ArchiveMozillaXULPropertytag
for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag.
... thus, nested elements will not match because they are directly inside a treeitem.
... this attribute is useful to provide different rules for outer and inner elements.
Actions - Archive of obsolete content
this action contains only one element, but you can put as many or as few elements as you need.
...you would only use the uri attribute on a single element since only one of the generated elements should be given a particular id.
...you can place other elements outside this to serve as containers for all the results.
Multiple Queries - Archive of obsolete content
here is an example using an rdf datasource: <hbox id="photoslist" datasources="template-guide-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...
...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.
... <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.
Rule Compilation - Archive of obsolete content
an attribute substitution syntax, explained later, is used to modify the attributes of elements generated from the template, to correspond with the data for each result.
...thus, changing the rule elements around dynamically doesn't affect anything.
...if the generated content itself contains hidden elements, those child elements will not be generated until necessary.
Simple Example - Archive of obsolete content
<?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:seq rdf:about="http://www.xulplanet.com/rdf/myphotos"> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/canal.jpg"/> <rdf:li rdf:resource="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"/> </rdf:seq> <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"/> <rd...
... <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> the seed is set in a similar manner as the previous examples, effectively creating a single result with the ?start variable set to the reference resource 'http://www.xulplanet.com/rdf/myphotos'.
...for the first result, the value of the ?photo variable is known, so the triple will be evaluated like so: <triple subject="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> the builder next calculates the value for ?title using the predicate 'http://purl.org/dc/elements/1.1/title'.
Sorting Results - Archive of obsolete content
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.
...for rdf datasources, you can also use an rdf predicate for sorting instead of a variable: <hbox datasources="template-guide-photos5.rdf" sort="http://purl.org/dc/elements/1.1/title" sortdirection="ascending" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </template> </hbox> in this example, the generated items will be sorted by title.
Special Condition Tests - Archive of obsolete content
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.
...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="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <groupbox uri="?item"> <caption label="?title"/> </groupbox> </action> </rule> <rule> <binding subject="?item" predicate="http://www.xulplanet.com/rdf/address" object="?address"/> <action> <label uri="?item" value="?address"/> </action> </rule> </template> </vbox> containment tests...
...<button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule iscontainer="true"> <menupopup> <menu uri="rdf:*" label="rdf:http://purl.org/dc/elements/1.1/title"/> </menupopup> </rule> <rule> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.xulplanet.com/rdf/address"/> </menupopup> </rule> </template> </button> the only difference in the code in this example is that the order of the rules has been switched around, the condition check for house has been removed and the iscontainer attribute has bee...
Template Logging - Archive of obsolete content
unexpected <queryset> element a <queryset> element was placed in an invalid location; they should be placed directly inside the <template> element with no other kinds of elements as siblings.
...expected <content> to be first for an rdf template, when using the full query syntax, the <content> element must always appear before any other elements.
...common errors are misspelled variable names or <member> and <triple> elements placed in the wrong order.
XML Templates - Archive of obsolete content
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.
...any elements between the action element and this element are only copied once.
...note the only change is that the addition of the xmlns attribute on the data; this is used to clear the namespace used for the elements in the data, otherwise they become xul elements.
Advanced Rules - Archive of obsolete content
content element the conditions element can contain three elements.
...inside it, you place one or more binding elements.
...next, we'll find out how to save the state of xul elements.
Creating a Skin - Archive of obsolete content
four elements, the menubar, the menupopup, the toolbar and the tabpanels appear in light blue.
... the border around these four elements has been changed to give a heavier 3d appearance.
...we could continue by changing the menus, the grippies on the toolbar and the input and checkbox elements.
Keyboard Shortcuts - Archive of obsolete content
this element is designed for holding a set of key elements, which serves to group all of the key definitions in one place in a file.
... any key elements outside of a keyset element will not work.
...it would be inconvenient to define separate key elements for each platform.
Manipulating Lists - Archive of obsolete content
these three methods are also available for several other xul elements and work in the same manner.
... in fact, these methods are part of the nsidomxulselectcontrolelement interface so any xul elements which implement this interface have these methods.
... this includes the menulist, radiogroup and tabs elements.
More Event Handlers - Archive of obsolete content
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.
...var element = event.target; var elementx = event.clientx - element.boxobject.x; var elementy = event.clienty - element.boxobject.y; xul elements have a box object that can be retrieved using the boxobject property.
...this is because the xul elements may not have loaded or fully initialized yet, so some things may not work as expected.
RDF Datasources - Archive of obsolete content
instead, only the files and directories that the tree element (or other elements) will need to display at a given time will be determined.
...you will notice that the value of the ref attribute in the example is http://www.some-fictitious-zoo.com/mammals which corresponds to one of the seq elements in the rdf file.
...you can see this attribute in the rdf file on each of the description elements.
Scrolling Menus - Archive of obsolete content
« previousnext » this section will describe scrolling menus and how to use the mechanism with other elements.
...it is always a vertical box and may contain any elements inside it.
...next, we'll see how to add some event handlers to xul elements.
XBL Attribute Inheritance - Archive of obsolete content
it would be useful to add attributes to the bound elements that modify the inner elements.
...you can add the inherits attribute to as many elements as you wish, to inherit any number of attributes.
...there may be times where two generated elements need to inherit from an attribute that has the same name.
Using Visual Studio as your XUL IDE - Archive of obsolete content
compared to a simple text-editor, visual studio gives you some special features when writing xul: intellisense / autocompletion for elements and attributes validation syntax coloring (okay, more sophisticated editors like notepad++ provide this as well) before you can use all of this, you have to adjust visual studio a little.
...xbl if you are writing your own elements in xbl, you can download a xbl schema from mozilla.doslash.org/xblschema.
...to combine both, you can also add your own xbl elements to the xul schema to get autocompletion-support and validation for those in your xul files.
XUL FAQ - Archive of obsolete content
are there any elements inside the <prefwindow>, before the <prefpane>s?
... (putting any elements there triggers bug 296418.) are prefpanes nested correctly?
...if you want to access elements inside <prefpane>, you should put script in the <prefpane> or write script into "onpaneload" of the <prefpane>.) note, that prefwindow only works in chrome xul.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
although tutorials claim label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas labels do.
...ogress advances, jaws indicates percentage to the user radio see radiogroup radiogroup <label value='<!--radio group-->' control='radioid' /> <radiogroup id='radioid'> <radio selected="true" label='<!--option1-->' /> <radio label='<!--option2-->' /> </radiogroup> row see grid rows see grid stack all elements can be focused, even if not visible due to being hidden under something else statusbar <statusbar> <statusbarpanel label="<!--status bar-->" flex="1"/> </statusbar> read using jaws with insert+page down statusbarpanel see statusbar tab see tabbox tabbox <tabbox> <tabs> <tab label="<!--tab text-->" /> </tabs> <t...
... treecell see tree treechildren see tree treecol see tree treecols see tree treeitem see tree treerow see tree elements that do not expose anything to screen readers/have no discovered accessibility issues yet: arrowscrollbox bbox box grippy hbox menuseparator overlay page script spacer splitter stringbundle stringbundleset vbox window elements not processed yet: action binding bindings broadcaster broadcasterset conditions content dialog dialogheader editor listcell member obs...
bindings - Archive of obsolete content
this element should be contained within a rule element and contain one or more binding elements.
... this element is optional in firefox 3/mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
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.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
dialogheader - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements dialog, window ...
hbox - Archive of obsolete content
ArchiveMozillaXULhbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, vbox ...
notificationbox - Archive of obsolete content
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
...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.
... related elements notification ...
preferences - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] overview <preferences> is a container for <preference> elements.
... <preferences> element should contain one or more <preference> elements.
... inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
query - Archive of obsolete content
ArchiveMozillaXULquery
for rdf datasources, the query should contain one content element as well as member and/or triple elements.
... for xml datasources, the query should have an expr attribute and may optionally contain assign elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
row - Archive of obsolete content
ArchiveMozillaXULrow
the row with the most child elements determines the number of columns in each row, which may be smaller or larger than the number of column elements defined in the grid.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, column, rows.
stack - Archive of obsolete content
ArchiveMozillaXULstack
all elements are displayed at once.
... child elements may also be placed at absolute positions within the stack.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
<statusbarpanel> - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
... related elements statusbar ...
tabbrowser - Archive of obsolete content
properties browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser.
... selectedtab type: tab element a reference to the currently selected tab, which will always be one of the tab elements in the tabs element.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
tabpanels - Archive of obsolete content
in most cases you would use a vbox, but they can be any element, although some people like to use tabpanel elements.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tabbox, tabs, tab, tabpanel.
template - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to declare a template for rule-based construction of elements.
... elements are constructed from a datasource.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
treecols - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a group of treecol elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecol, treechildren, treeitem, treerow, treecell and treeseparator.
treerow - Archive of obsolete content
children of the treerow should be treecell elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treecell and treeseparator.
vbox - Archive of obsolete content
ArchiveMozillaXULvbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, hbox ...
window - Archive of obsolete content
this is supported only from window elements, and is ignored on platforms that don't support drawing into the title bar.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
... related elements prefwindow, dialog, dialogheader related topics user notes to change the icon to a window's title bar check this page on window icons.
Windows and menus in XULRunner - Archive of obsolete content
the css is used to apply formatting to elements, just as it would in html.
...xul provides elements to support both menus and toolbars.
...you can add a <commandset> and <command> elements like this: <commandset> <command id="cmd_open" label="&file.open;" oncommand="dofileopen();"/> <command id="cmd_save" label="&file.save;" oncommand="dofilesave();"/> </commandset> ...
2006-09-29 - Archive of obsolete content
discussions discussion on how the firefox 1.5.0.7 dom generates xhtml inline elements using wordpress.
... it was determined that the generated elements from wordpress do not follow the wc3 guidelines in appendix c of xhtml 1.0.
... although the w3 validation accepted the generated xhtml as valid, a bug identified within the html working group ignored the invalid elements.
Building a Theme - Archive of obsolete content
these xul elements are styled using css.
... the browser ui has absolutely no styling on its own - if you try to start up with an empty theme, firefox will be unusable, as the button elements will be drawn as plain text.
... from here, you can play around with various different stylings for the toolbar and associated elements.
-ms-content-zoom-chaining - Archive of obsolete content
initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value.
... remarks this property has no effect on non-zoomable elements.
... for information on zoomable elements, see -ms-content-zooming.
-ms-content-zoom-limit-min - Archive of obsolete content
initial value100%applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednopercentagesthe smallest allowed zoom factor.
...this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
-ms-content-zoom-limit - Archive of obsolete content
initial valueas each of the properties of the shorthand:-ms-content-zoom-limit-max: 400%-ms-content-zoom-limit-min: 100%applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednopercentagesas each of the properties of the shorthand:-ms-content-zoom-limit-max: the largest allowed zoom factor.
... remarks this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
-ms-content-zoom-snap-points - Archive of obsolete content
initial valuesnapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values snapinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed.
... remarks this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
-ms-content-zoom-snap-type - Archive of obsolete content
initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none initial value.
... remarks this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
-ms-content-zoom-snap - Archive of obsolete content
initial valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: none-ms-content-zoom-snap-points: snapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: as specified-ms-content-zoom-snap-points: as specifiedanimation typediscrete syntax the -ms-content-zoom-snap shorthand property is specified as one or both of the following content zoom snap values, in order, separated by spaces.
... remarks this property has no effect on non-zoomable elements.
... see -ms-content-zooming for details on zoomable elements.
-ms-scroll-translation - Archive of obsolete content
initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values vertical-to-horizontal vertical to horizontal translation, as described in remarks, will take place when appropriate.
... this property has no effect on non-scrollable elements.
... this property's initial value is inherit on all elements, except the <html> element, where it defaults to none.
-ms-wrap-flow - Archive of obsolete content
the -ms-wrap-flow css property is a microsoft extension that specifies how exclusions impact inline content within block-level elements.
... initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto for floated elements, an exclusion is created; for all other elements, an exclusion is not created.
...this property specifies that the exclusion element (the exclusion) can be positioned in various ways, and that inline content will wrap around the exclusion in a way similar to how it wraps around floated elements.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
n the raw data var s = new java.io.inputstreamreader( c.getinputstream() ); var b = new java.io.bufferedreader( s ); var l, str = ""; while( ( l = b.readline() ) != null ) { // skip if( l != "" ) { str = str + l + "\n"; } } // define the namespaces, first the default, // then additional namespaces default xml namespace = "http://purl.org/rss/1.0/"; var dc = new namespace( "http://purl.org/dc/elements/1.1/" ); var rdf = new namespace( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ); // use e4x to process the feed var x = new xml( str ); for each( var i in x..item ) { print( "title: " + i.title + "\n" ); print( "about: " + i.@rdf::about + "\n" ); print( "link: " + i.link + "\n" ); print( "date: " + i.dc::date + "\n" ); } the first half of this script is standard j...
...defining these namespaces becomes important if we want to be able to access any data elements in the feed defined in these namespaces.
...dler }); // 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.
Mozilla XForms Specials - Archive of obsolete content
(limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ).
...} the pseudo elements are defined in the css3 basic user interface specification .
...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.
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
summary: when in quirks mode, gecko-based browsers will appear to ignore inheritance of font styles into tables from parent elements.
...if a css property can be inherited, then table elements and their components (tr, td, etc.) should inherit just as any other element would.
...in these browsers, a table's text would be the same size as the user's default settings, regardless of the css assigned to ancestor elements such as body.
Audio for Web games - Game development
let's add some javascript to make this work: var myaudio = document.getelementbyid('myaudio'); var buttons = document.getelementsbytagname('button'); var stoptime = 0; for (var i = 0; i < buttons.length; i++) { buttons[i].addeventlistener('click', function() { myaudio.currenttime = this.getattribute("data-start"); stoptime = this.getattribute("data-stop"); myaudio.play(); }, false); } myaudio.addeventlistener('timeupdate', function() { if (this.currenttime > stoptime) { this.pause(); } }, false); ...
... let's create our audio context: // for cross browser compatibility const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); now let's select all the <li> elements; later we can harness these elements to give us access to the track file path and each individual play button.
... let offset = 0; function playtrack(audiobuffer) { const tracksource = audioctx.createbuffersource(); tracksource.buffer = audiobuffer; tracksource.connect(audioctx.destination) if (offset == 0) { tracksource.start(); offset = audioctx.currenttime; } else { tracksource.start(0, audioctx.currenttime - offset); } return tracksource; } finally, let's loop over our <li> elements, grab the correct file for each one and then allow playback by hiding the "loading" text and displaying the play button: trackels.foreach((el, i) => { // get children const anchor = el.queryselector('a'); const loadtext = el.queryselector('p'); const playbutton = el.queryselector('button'); // load file loadfile(anchor.href).then((track) => { // set loading to false el.dat...
Gecko FAQ - Gecko Redirect 1
by the end of calendar year 2000, gecko is expected to support the following recommended 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 turn off author styles the names of certain mozilla extension pseudo-classes lack the moz- prefix css 2 - partial support is expected and has already been built into gecko, including support for css2 positioning, but no commitment has been made to achieve a specific level of support dom level 0 level 1 core: full support making entityreferences available through dom1; per a provision of the dom1 spec for xml implementations, entities will be automatically expanded inline and therefore not available through dom1; our impl...
... layout component tracks content layout bugs that may be related to a variety of specifications html 4.0 elements, form controls, frames, tables, and form submission bug reports marked with the html4 keyword "meta bug" for tracking outstanding issues with html 4.01 compliance css: style system component (see also bug reports marked with the css1, css2, and css3 keywords) dom: see dom0, dom1, dom2 and event handling components xml rdf core javascript language interpreter (javascript engine) h...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
code sample the following code aims to let <xi:include> and <xi:fallback> tags (the two elements in the language) with all of the attributes of <xi:include> be included in an xml document so as to be resolvable into a single xml document.
...should become: var href = getxmlbaselink (/* xlink sans xml:base */ xinclude.getattribute('href'), /* element to query from */ xinclude); function resolvexincludes(docu) { // http://www.w3.org/tr/xinclude/#xml-included-items var xincludes = docu.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'include'); if (xincludes) { for (i=0; i < xincludes.length; i++) { var xinclude = xincludes[i]; var href = xinclude.getattribute('href'); var parse = xinclude.getattribute('parse'); var xpointer = xinclude.getattribute('xpointer'); var encoding = xinclude.getattribute('encoding')...
...; // e.g., utf-8 // "text/xml or application/xml or matches text/*+xml or application/*+xml" before encoding (then utf-8) var accept = xinclude.getattribute('accept'); // header "accept: "+x var acceptlanguage = xinclude.getattribute('accept-language'); // "accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is equivalent to empty string) href = null; // set for uniformity in testing below if (parse === 'xml' && xpointer === null) { alert('there must be an xpointer attribute present if "href" is empty an parse is "xml"');...
Assessment: Accessibility troubleshooting - Learn web development
if the online editor you are using doesn't have a separate css/js panel, feel free to put them in appropriate <style> / <script> elements.
...once you add paragraph elements, you'll notice the styling looking better.
... 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?
Handling different text directions - Learn web development
so the writing-mode property is in reality setting the direction in which block-level elements are displayed on the page — either from top-to-bottom, right-to-left, or left-to-right.
... writing modes and block and inline layout we have already discussed block and inline layout, and the fact that some things display as block elements and others as inline elements.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Test your skills: Grid Layout - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered.
... grid layout one in this task you should create a grid into which the four child elements will auto-place.
...by editing the css rules for the two child elements, cause them to span over several grid tracks each; the second item should overlay the first as in the image below.
What is CSS? - Learn web development
using css you can control exactly how html elements look in the browser, presenting your markup using whatever design you like.
... css syntax css is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page.
...ebviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-familychrome full support 1edge full support 12firefox full support 1notes full support 1notes notes not supported on option elements.
Structuring a page of content - Learn web development
project brief for this project, your task is to take the content for the homepage of a bird watching website and add structural elements to it so it can have a page layout applied to it.
... the provided css is designed so that when the correct structural elements are added to the markup, they will appear green in the rendered page.
... if you are getting stuck and can't envisage what elements to put where, draw out a simple block diagram of the page layout, and write on the elements you think should wrap each block.
Adding vector graphics to the Web - Learn web development
it's basically markup, like html, except that you've got many different elements for defining the shapes you want to appear in your image, and the effects you want to apply to those shapes.
...at the simplest end of the spectrum, you've got elements for creating simple shapes, like <circle> and <rect>.
... you can assign classes and ids to svg elements and style them with css, either within the svg or wherever you put the css style rules for your html document.
Images in HTML - Learn web development
the src attribute contains a path pointing to the image you want to embed in the page, which can be a relative or absolute url, in the same way as href attribute values in <a> elements.
... our above code would give us the following result: note: elements like <img> and <video> are sometimes referred to as replaced elements.
... a better solution, is to use the html5 <figure> and <figcaption> elements.
Responsive images - Learn web development
vector images are great for simple graphics, patterns, interface elements, etc., but it starts to get very complex to create a vector-based image with the kind of detail that you'd find in say, a photo.
...like <video> and <audio>, the <picture> element is a wrapper containing several <source> elements that provide different sources for the browser to choose from, followed by the all-important <img> element.
... the code in responsive.html looks like so: <picture> <source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg"> <source media="(min-width: 800px)" srcset="elva-800w.jpg"> <img src="elva-800w.jpg" alt="chris standing up holding his daughter elva"> </picture> the <source> elements include a media attribute that contains a media condition — as with the first srcset example, these conditions are tests that decide which image is shown — the first one that returns true will be displayed.
Client-side storage - Learn web development
the javascript file contains five declared constants containing references to the <ul> element the notes will be displayed in, the title and body <input> elements, the <form> itself, and the <button>.
...when you first run the example, it downloads all the videos from the network, stores them in an indexeddb database, and then displays the videos in the ui inside <video> elements.
... }; last but not least, we have displayvideo(), which creates the dom elements needed to insert the video in the ui and then appends them to the page.
Multimedia: Images - Learn web development
and finally, should you want to include animated images into your page, then know that safari allows using video files within <img> and <picture> elements.
...that's where you would need to upgrade your <picture> and <source> elements with media and/or sizes attributes.
... the first thing to check is that your content images use <img> elements and your background images are defined in css with background-image — images referenced in <img> elements are assigned a higher loading priority than background images.
Perceived performance - Learn web development
if some assets are going to be slower to load than others, with elements loading after other content has already been painted to the screen, plan ahead and leave space in the layout for them so that content doesn't jump or resize, especially after the site has become interactive.
... interactive elements are interactive make sure visible interactive elements are always interactive and responsive.
... if input elements are visible, the user should be able to interact with them without a lag.
Rendering a list of Vue components - Learn web development
directives are applied to elements like other attributes.
...to help vue optimize rendering the elements in the list, it tries to patch list elements so it's not recreating them every time the list changes.
...to make sure it is re-using list elements appropriately, it needs a unique "key" on the same element that you attach v-for to.
Mozilla accessibility architecture
xul elements are checked for support of the nsiaccessibleprovider interface, which can return an accessible.
... html elements ask the node's primary frame for an accessible via nsiframe::getaccessible().
... nsouterdocaccessible: used for elements such as <iframe>, <browser> and <editor>, which spawn an entire new document, but don't actually have any child nodes in their own dom.
Accessibility information for UI designers and developers
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.
... see also: heading elements join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility.
Experimental features in Firefox
nightly 75 no developer edition 75 no beta 75 no release 75 no preference name layout.css.conic-gradient.enabled and gfx.webrender.all pseudo-class: :focus-visible allows focus styles to be applied to elements like buttons and form controls, only when they are focused using the keyboard (e.g.
... when tabbing between elements), and not when they are focused using a mouse or other pointing device.
... nightly 64 no developer edition 64 no beta 64 no release 64 no preference name media.setsinkid.enabled htmlmediaelement properties: audiotracks and videotracks enabling this feature adds the htmlmediaelement.audiotracks and htmlmediaelement.videotracks properties to all html media elements.
MathML Accessibility in Mozilla
, b ⏞ ℓ b 's ⏟ k + ℓ elements } __________ the set modified modified a comma ...
... comma b with modified over brace with script l b apostraphes above above with modified under brace with k plus script l elements below below end set __________ { a , ...
...underscript k plus l elements.
accessibility.tabfocus
the preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.
... type:integer default value: 7 (windows and linux); 2 (mac os x) exists by default: no application support:gecko 1.7 status: active introduction: bugs: bug 140612 values 1 give focus only to text fields (default on mac osx) 2 give focus to all form elements except text fields.
...the value 7 (give focus to all elements) is the default on windows and linux.
NSS API Guidelines
accessor functions, for these data elements, should be added to the api.
...some return allocated arrays of data, some return linked lists of data, others use callbacks to return data elements one at a time.
... layer_datatypeextractdatatype() -- get a pointer to the second data type which was derived for elements of the first data type.
JSAPI User Guide
the spidermonkey universe in order to run any javascript code in spidermonkey, an application must have three key elements: a jsruntime, a jscontext, and a global object.
... a minimal example each of the three key elements described in the previous section requires a few jsapi calls: the runtime: use js_newruntime to create it and js_destroyruntime to clean it up when you're done.
....; break; } } return true; } defining classes this pulls together the above api elements by defining a constructor function, a prototype object, and properties of the prototype and of the constructor, all with one api call.
Parser API
interface arrayexpression <: expression { type: "arrayexpression"; elements: [ expression | null ]; } an array expression.
... interface arraypattern <: pattern { type: "arraypattern"; elements: [ pattern | null ]; } an array-destructuring pattern.
... interface xmllist <: xml, expression { type: "xmllist"; contents: [ xml ]; } an e4x literal representing a list of xml elements.
nsICategoryManager
ractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catmgr)); if (ns_failed(rv)) return rv; nscomptr<nsisimpleenumerator> cats; rv = catmgr->enumeratecategories(getter_addrefs(cats)); if (ns_failed(rv)) return rv; prbool hasmore; while (ns_succeeded(cats->hasmoreelements(&hasmore) && hasmore) { nscomptr<nsisupports> elem; cats->getnext(getter_addrefs(elem)); nscomptr<nsisupportscstring> category = do_queryinterface(elem, &rv); if (ns_failed(rv)) break; nsembedcstring categoryname; rv = category->getdata(categoryname); if (ns_failed(rv)) break; printf("%s\n", categoryname.get()); } return ns_ok; } this snippe...
... var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); var enumerator = categorymanager.enumeratecategories(); var categories = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var category = item.queryinterface(components.interfaces.nsisupportscstring) categories.push(category.tostring()); } categories.sort(); var categoriesstring = categories.join("\n"); dump(categoriesstring + "\n"); print out a list of app-startup entries this example prints out a list of entries of "app-startup" category.
... var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); var enumerator = categorymanager.enumeratecategory("app-startup"); var entries = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var entry = item.queryinterface(components.interfaces.nsisupportscstring) entries.push(entry.tostring()); } entries.sort(); var entriesstring = entries.join("\n"); dump(entriesstring + "\n"); disable currently loaded plugins by type this snippet here shows how to disable plugins that are currently loaded for the file type of pdf.
nsIDOMWindowUtils
elementsrestyled read only unsigned long long the number of elements which have been restyled for the current document.
...this number also counts restyling of pseudo-elements and anonymous boxes.
... audiomuted boolean with this it's possible to mute all the mediaelements in this window.
nsIHTMLEditor
used primarily to supply new element for various insert element dialogs (image, link, table, and horizontalrule are the only returned elements as of 9/12/18); namedanchor was removed in firefox 63.
... void indent( in astring aindent ); parameters aindent insertelementatselection() insert an element, which may have child nodes, at the selection used primarily to insert a new element for various insert element dialogs, but it enforces the html 4.0 dtd "cancontain" rules, so it should be useful for other elements.
... the selection is set to parent-of-aelement with an offset 1 greater than aelement's offset but it enforces the html 4.0 dtd "cancontain" rules, so it should be useful for other elements.
nsIIOService
but if the load is coming from a js api (such as xmlhttprequest) or if the load might be coalesced across multiple elements (such as for ) then pass in the document node instead.
...but if the load is coming from a js api (such as xmlhttprequest) or if the load might be coalesced across multiple elements (such as for <img>) then pass in the document node instead.
...but if the load is coming from a js api (such as xmlhttprequest) or if the load might be coalesced across multiple elements (such as for ) then pass in the document node instead.
XPCOM Interface Reference by grouping
(i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the view pane or the content of the "browser window" proper.
... security this section contains apis for secure channel communications system this section contains application level interfaces including calls to external support elements (such as device calls).
... user this section contains elements specific to a given user's data storage.
Building a Thunderbird extension 5: XUL
we add widgets by inserting new xul dom elements into the application window and modify them using scripts and attaching event handlers.
... while xul provides the elements of the user interface, actions are written in javascript.
...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.
ArrayType
ctype arraytype() type[ length] ); parameters type: it represents the type of the elements or variable which is going to be present in an array length optional it denotes the number of entries present in an array or the number of elements that an array should contain.
... properties property type description elementtype ctype the data type of the elements in an array type.
... length number the number of elements in the array, or undefined if the array type doesn't have a specified length.
DOM Inspector FAQ - Firefox Developer Tools
those text nodes are actually the newlines and spacing between the elements.
... how do i inspect pseudo-classes and pseudo-elements in the css rules viewer?
... there is currently no way to inspect dynamically-applied rules for other pseudo-classes or any pseudo-elements from the dom inspector ui.
DOM Inspector internals - Firefox Developer Tools
shared structure overlays taking a look at the contents of inspector.xul, dom inspector's primary ui, will reveal that it contains almost no visible elements.
...even most of the elements that aren't visible, such as key- and commandsets, are not defined in inspector.xul.
... commandoverlay.xul the popupoverlay.xul-provided menuitems that delegate to external command elements have their commands defined here.
Debugger.Script - Firefox Developer Tools
the elements of the array are objects, each of which describes a single entry point, and contains the following properties: linenumber: the line number for which offset is an entry point columnnumber: the column number for which offset is an entry point offset: the bytecode instruction offset of the entry point for example, suppose we have a script for the following source co...
...the elements of the array are objects, each of which describes a single opcode, and contains the following properties: linenumber: the line number of the current opcode.
... getchildscripts() if the instance refers to a jsscript, return a new array whose elements are debugger.script objects for each function in this script.
Index - Firefox Developer Tools
61 examine event listeners guide, inspector, tools the inspector shows the word "event" next to elements in the html pane, that have event listeners bound to them: 62 examine and edit css guide, inspector, tools you can examine and edit css in the inspector's css pane.
...the page, the box model for the element is shown overlaid on the page: 65 inspect and select colors guide, inspector, tools in the css pane's rules view, if a rule contains a color value, you'll see a sample of the color next to the value: 66 open the inspector guide, inspector, tools there are two main ways to open the inspector: 67 reposition elements in the page starting in firefox 48 you can move absolutely positioned elements by dragging them around the page.
... 69 select and highlight elements the selected element is the element in the page that the inspector is currently focused on.
Examine and edit CSS - Firefox Developer Tools
highlight matched elements: next to the selector is a target icon: click this to highlight all nodes in the page that match this selector.
... displaying pseudo-elements the rule view displays the following pseudo-elements, if they are applied to the selected element: ::after ::backdrop ::before ::first-letter ::first-line ::selection :-moz-color-swatch :-moz-number-spin-box :-moz-number-spin-down :-moz-number-spin-up :-moz-number-text :-moz-number-wrapper :-moz-placeholder :-moz-progress-bar :-moz-range-progress :-moz-range-thumb :-moz-range-tr...
...ack :-moz-selection if the selected element has pseudo-elements applied to it, they are displayed before the selected element but hidden by a disclosure triangle: clicking the triangle displays them: viewing common pseudo-classes there's a button to the right of the filter box: click the button to see checkboxes that you can use to enable the :hover, :active and :focus, :focus-within and :visited pseudo-classes for the selected element: this feature can also be accessed from the popup menu in the html view.
Work with animations - Firefox Developer Tools
starting in firefox 48, it will show animations applied to the ::before and ::after pseudo-elements.
...transform: 'scale(1)', filter: 'grayscale(100%)' }, { filter: 'grayscale(100%)', offset: 0.333 }, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)' } ]; application to the example applying all this to our example, we can see that: the animation involved two elements, span#note and img#icon.
... hovering over these selectors, we can see that those elements are, respectively, the browser name "firefox developer edition" and the browser icon.
Tips - Firefox Developer Tools
when selecting elements: shift + click to select an element but keep selecting (picker mode doesn't disengage).
... use ←/→ to navigate to parents/children elements (if they're hard to select).
... in the rules view: click the inspector icon () next to any selector to highlight all elements that match it.
ANGLE_instanced_arrays - Web APIs
ext.drawarraysinstancedangle() behaves identically to gl.drawarrays() except that multiple instances of the range of elements are executed, and the instance advances for each iteration.
... ext.drawelementsinstancedangle() behaves identically to gl.drawelements() except that multiple instances of the set of elements are executed and the instance advances between each set.
... ext.vertexattribdivisorangle() modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
AbstractRange - Web APIs
contents of elements when trying to access the contents of an element, keep in mind that the element itself is a node, but so is any text inside it.
...g thing happened on the way to the forum...</p> <aside class="callout"> <h2>aside</h2> <p>an interesting aside to share with you...</p> </aside> </section> </article> <pre id="log"></pre> </div> after loading the html and constructing the dom representation of the document, the resulting dom tree looks like this: in this diagram, the nodes representing html elements are shown in green.
...each element's contents are linked below it in the tree, potentially spawning a series of branches below as elements include other elements and text nodes.
AnalyserNode.getFloatFrequencyData() - Web APIs
if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped.
... if it has more elements than needed, excess elements are ignored.
...microphone input const audioele = new audio(); audioele.src = 'my-audio.mp3';//insert file name here audioele.autoplay = true; audioele.preload = 'auto'; const audiosourcenode = audioctx.createmediaelementsource(audioele); //create analyser node const analysernode = audioctx.createanalyser(); analysernode.fftsize = 256; const bufferlength = analysernode.frequencybincount; const dataarray = new float32array(bufferlength); //set up audio node network audiosourcenode.connect(analysernode); analysernode.connect(audioctx.destination); //create 2d canvas const canvas = document.createelement('canvas');...
CustomElementRegistry - Web APIs
the customelementregistry interface provides methods for registering custom elements and querying registered elements.
... to get an instance of it, use the window.customelements property.
...eate text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); note: the customelementregistry is available through the window.customelements property.
Document.querySelector() - Web APIs
see locating dom elements using selectors for more about selectors and how to manage them.
... if you need a list of all elements matching the specified selectors, you should use queryselectorall() instead.
... css pseudo-elements will never return any elements, as specified in the selectors api.
Document.scripts - Web APIs
WebAPIDocumentscripts
the scripts property of the document interface returns a list of the <script> elements in the document.
...you can use this just like an array to get all the elements in the list.
... example this example looks to see if the page has any <script> elements.
DocumentOrShadowRoot.activeElement - Web APIs
typically a user can press the tab key to move the focus around the page among focusable elements, and use the space bar to activate one (that is, to press a button or toggle a radio button).
... which elements are focusable varies depending on the platform and the browser's current configuration.
... for example, on macos systems, elements that aren't text input elements are not typically focusable by default.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
elements with pointer-events set to none will be ignored, and the element below it will be returned.
... result specifications specification status shadow domthe definition of 'elementsfrompoint()' in that specification.
... obsolete css object model (cssom) view modulethe definition of 'elementsfrompoint()' in that specification.
Element.getAnimations() - Web APIs
it can optionally return animation objects for descendant elements too.
...this includes animations that target any css pseudo-elements attached to element or one of its descendents.
... return value an array of animation objects, each representing an animation currently targetting the element on which this method is called, or one of its descendant elements if { subtree: true } is specified.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
doing so causes the user agent to follow these steps: the specified value is parsed as html or xml (based on the document type), resulting in a documentfragment object representing the new set of dom nodes for the new elements.
... for all other elements, the element's contents are replaced with the nodes in the new documentfragment.
... however, there are ways to execute javascript without using <script> elements, so there is still a security risk whenever you use innerhtml to set strings over which you have no control.
Element.localName - Web APIs
WebAPIElementlocalName
ecomm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partner> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
... in later versions, in compliance with html5, the property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms.
... the tagname property continues to return in the upper case for html elements in html doms.
Event.composed - Web APIs
WebAPIEventcomposed
examples in our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element.
... the first definition looks like this, for example: customelements.define('open-shadow', class extends htmlelement { constructor() { super(); let pelem = document.createelement('p'); pelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log...
... you'll notice a difference in the value of composedpath for the two elements.
Event.composedPath() - Web APIs
examples in our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element.
... the first definition looks like this, for example: customelements.define('open-shadow', class extends htmlelement { constructor() { super(); let pelem = document.createelement('p'); pelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log...
...second, you'll notice a difference in the value of composedpath for the two elements.
HTMLFieldSetElement - Web APIs
the htmlfieldsetelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements.
... htmlfieldsetelement.elementsread only the elements belonging to this field set.
... recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate.
HTMLImageElement - Web APIs
the htmlimageelement interface represents an html <img> element, providing the properties and methods used to manipulate image elements.
...this is different from a client-side image map, specified using an <img> element and a corresponding <map> which contains <area> elements indicating the clickable areas in the image.
...the <map> in turn contains <area> elements indicating the clickable areas in the image.
HTMLScriptElement - Web APIs
html <script> elements expose the htmlscriptelement interface, which provides special properties and methods for manipulating the behavior and execution of <script> elements (beyond the inherited htmlelement interface).
... htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document.
... note: when inserted using the document.write() method, <script> elements execute (typically synchronously), but when inserted using innerhtml or outerhtml, they do not execute at all.
HTMLSelectElement.selectedOptions - Web APIs
the read-only htmlselectelement property selectedoptions contains a list of the <option> elements contained within the <select> element that are currently selected.
... html the html that creates the selection box and the <option> elements representing each of the food choices looks like this: <label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <butto...
...note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected property.
IntersectionObserver.observe() - Web APIs
the intersectionobserver method observe() adds an element to the set of target elements being watched by the intersectionobserver.
... one observer has one set of thresholds and one root, but can watch multiple target elements for visibility changes in keeping with those.
...note that this design allows multiple elements' intersection changes to be processed by a single call to the callback.
Media Session API - Web APIs
the mediasession interface lets users control playback of media through user-agent defined interface elements.
... interaction with these elements even trigger handlers in the web page, playing the media.
...*/ }); } some user agents disable autoplay for media elements on mobile devices and require a user gesture to start media.
Node.localName - Web APIs
WebAPINodelocalName
comm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partners> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
... in later versions, in compliance with html5, the property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms.
... the tagname property continues to return in the upper case for html elements in html doms.
Node.textContent - Web APIs
WebAPINodetextContent
although the names seem similar, there are important differences: textcontent gets the content of all elements, including <script> and <style> elements.
... in contrast, innertext only shows “human-readable” elements.
...in contrast, innertext is aware of styling and won’t return the text of “hidden” elements.
Node - Web APIs
WebAPINode
note: in firefox 3.5 and earlier, the property upper-cases the local name for html elements (but not xhtml elements).
... note: in firefox 3.5 and earlier, html elements are in no namespace.
... in later versions, html elements are in the http://www.w3.org/1999/xhtml/ namespace in both html and xml trees.
NonDocumentTypeChildNode - Web APIs
nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to this node in its parent's children list, or null if there is no element in the list prior to this node.
... nondocumenttypechildnode.nextelementsibling read only returns the element immediately following this node in its parent's children list, or null if there is no element in the list following this node.
...the previouselementsibling and nextelementsibling are now defined on the latter.
OES_element_index_uint - Web APIs
the oes_element_index_uint extension is part of the webgl api and adds support for gl.unsigned_int types to webglrenderingcontext.drawelements().
... extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int.
... examples var ext = gl.getextension('oes_element_index_uint'); gl.drawelements(gl.points, 8, gl.unsigned_int, 0); specifications specification status comment oes_element_index_uintthe definition of 'oes_element_index_uint' in that specification.
ParentNode - Web APIs
see locating dom elements using selectors to learn how to use css selectors to find nodes or elements of interest.
... properties parentnode.childelementcount read only returns the number of children of this parentnode which are elements.
... parentnode.queryselectorall() returns a nodelist representing a list of elements with the current element as root that matches the specified group of selectors.
getBBox() - Web APIs
the coordinates returned are with respect to the current svg space (after the application of all geometry attributes on all the elements contained in the target element).
...this value is irrespective of any transformation attribute applied to it or the parent elements.
... recommendation initial definition (applies to svg elements only).
Visual Viewport API - Web APIs
the layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen.
...the visual viewport lets web developers solve this by positioning elements relative to what's shown on screen.
...these events allow you to position elements relative to the visual viewport that would normally be anchored to the layout viewport.
WebGLRenderingContext.getVertexAttrib() - Web APIs
gl.vertex_attrib_array_stride: returns a glint indicating the number of bytes between successive elements in the array.
... 0 means that the elements are sequential.
... gl.current_vertex_attrib: returns a float32array (with 4 elements) representing the current value of the vertex attribute at the given index.
WebGLRenderingContext - Web APIs
webglrenderingcontext.drawelements() renders primitives from element array data.
... working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions.
...oes not seem to support html5 canvas.</canvas> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : inline-block; width : 120px; height : 80px; margin : auto; padding : 0; border : none; background-color : black; } window.addeventlistener("load", function() { "use strict" var firstcanvas = document.getelementsbytagname("canvas")[0], secondcanvas = document.getelementsbytagname("canvas")[1]; firstcanvas.width = firstcanvas.clientwidth; firstcanvas.height = firstcanvas.clientheight; [firstcanvas, secondcanvas].foreach(function(canvas) { var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "...
Creating 3D objects using WebGL - Web APIs
to do this efficiently, we're going to switch from drawing using the vertices directly by calling the gl.drawarrays() method to using the vertex array as a table, and referencing individual vertices in that table to define the positions of each face's vertices, by calling gl.drawelements().
... drawing the cube next we need to add code to our drawscene() function to draw using the cube's index buffer, adding new gl.bindbuffer() and gl.drawelements() calls: // tell webgl which indices to use to index the vertices gl.bindbuffer(gl.element_array_buffer, buffers.indices); ...
... { const vertexcount = 36; const type = gl.unsigned_short; const offset = 0; gl.drawelements(gl.triangles, vertexcount, type, offset); } since each face of our cube is comprised of two triangles, there are 6 vertices per side, or 36 total vertices in the cube, even though many of them are duplicates.
A simple RTCDataChannel sample - Web APIs
in this example, we will open an rtcdatachannel connection linking two elements on the same page.
...we grab references to all the page elements we'll need to access, then set event listeners on the three buttons.
... sendchannel.close(); receivechannel.close(); // close the rtcpeerconnections localconnection.close(); remoteconnection.close(); sendchannel = null; receivechannel = null; localconnection = null; remoteconnection = null; // update user interface elements connectbutton.disabled = false; disconnectbutton.disabled = true; sendbutton.disabled = true; messageinputbox.value = ""; messageinputbox.disabled = true; } this starts by closing each peer's rtcdatachannel, then, similarly, each rtcpeerconnection.
Using DTMF with WebRTC - Web APIs
each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example.
... html the html for this example is very basic; there are only three elements of importance: an <audio> element to play the audio received by the rtcpeerconnection being "called." a <button> element to trigger creating and connecting the two rtcpeerconnection objects, then sending the dtmf tones.
... initialization when the page loads, we do some basic setup: we fetch references to the dial button and the log output box elements, and we use addeventlistener() to add an event listener to the dial button so that clicking it calls the connectanddial() function to begin the connection process.
Web Video Text Tracks Format (WebVTT) - Web APIs
3 00:02:25.000 --> 00:02:30.000 - ta en kopp styling webvtt cues you can style webvtt cues by looking for elements which match the ::cue pseudo-element.
... within site css video::cue { background-image: linear-gradient(to bottom, dimgray, lightgray); color: papayawhip; } video::cue(b) { color: peachpuff; } here, all video elements are styled to use a gray linear gradient as their backgrounds, with a foreground color of "papayawhip".
... it is one of the good features supported by webvtt is the localization and use of class elements which can be used in same way they are used in html and css to classify the style for particular type of objects, but here these are used for styling and classifying the cues as shown below: webvtt 04:02.500 --> 04:05.000 j’ai commencé le basket à l'âge de 13, 14 ans 04:05.001 --> 04:07.800 sur les <i.foreignphrase><lang en>playground</lang></i>, ici à montpellier in the above example i...
Web Animations API - Web APIs
animation of dom elements.
... concepts and usage the web animations api provides a common language for browsers and developers to describe animations on dom elements.
... document.getanimations() returns an array of animation objects currently in effect on elements in the document.
Window.getComputedStyle() - Web APIs
omitted (or null) for real elements.
...non-elements, like a text node, will throw an error.
... use with pseudo-elements getcomputedstyle can pull style info from pseudo-elements (such as ::after, ::before, ::marker, ::line-marker — see the pseudo-element spec).
Using the presentation role - Accessibility
the presentation role is used to remove semantic meaning from an element and any of its related child elements.
... for example, a table used for layout purposes could have the presentation role applied to the table element to remove any semantic meaning from the table element and any of its table related children elements, such as table headers and table data elements.
... non-table related elements should retain their semantic meaning, however.
ARIA: contentinfo role - Accessibility
contentinfo landmarks present in content embedded via <iframe> elements do not count towards this limit.
... mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer.
... use other content sectioning elements instead.
ARIA: feed role - Accessibility
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.
...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.
ARIA: figure role - Accessibility
again, this can be done semantically, without aria, with html's <figure> and <figcaption> elements <figure> ...
... note: if at all possible in your work, you should use the appropriate semantic html elements to mark up a figure and its caption — <figure> and <figcaption>.
... if at all possible, you should use the appropriate semantic html elements to mark up a figure and its caption — <figure> and <figcaption>.
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.
... 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.
ARIA: dialog role - Accessibility
in addition to the needed control, dialogs can contain any number of focusable elements, even entire forms or other container widgets like tabs.
... for most dialogs, the expected behavior is that the dialog's tab order wraps, which means that when the user tabs through the focusable elements in the dialog, the first focusable element will be focused after the last one has been reached.
...sts</label> <textarea id="interests"></textarea> </p> <p> <input type="checkbox" id="autologin"/> <label for="autologin">auto-login?</label> </p> <p> <input type="submit" value="save information"/> </p> </form> </div> working examples: jquery-ui dialog notes note: while it is possible to prevent keyboard users from moving focus to elements outside of the dialog, screen reader users may still be able to navigate to that content using their screen reader's virtual cursor.
HTML To MSAA - Accessibility
remarks the table below shows how gecko maps html elements to msaa.
... this table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements.
... for example, if name column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from aria markup or @title attribute.
Operable - Accessibility
if you need to place elements in an unusual layout, it is better to make sure the source order is sensible, then use css features like positioning to handle the layout.
...<h2>) and <label> elements clearly describe the purpose of the content and form elements they are supposed to be describing.
... 2.4.7 visible focus for focusable elements (aa) when tabbing through focusable elements such as links or form inputs, there should be a visual indicator to show you which element currently has focus.
Perceivable - Accessibility
ui controls such as form elements and buttons should have text labels that describe their purpose.
...the main situations in which this is relevant are: text labels and the form elements they describe.
...the order should be made obvious by use of correct semantic elements (e.g., headings, paragraphs), with css being used to create any unusual layout styles, irrespective of the markup.
::selection - CSS: Cascading Style Sheets
(wcag defines large text as between 18.66px and 24px and bold, or 24px or larger.) webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 specifications specification status comment css pseudo-elements level 4the definition of '::selection' in that specification.
... note: ::selection was in drafts of css selectors level 3, but it was removed in the candidate recommendation phase because its was under-specified (especially with nested elements) and interoperability wasn't achieved (based on discussion in the w3c style mailing list).
... it returned in pseudo-elements level 4.
:active - CSS: Cascading Style Sheets
WebCSS:active
/* 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>.
...</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.
:first-of-type - CSS: Cascading Style Sheets
the :first-of-type css pseudo-class represents the first element of its type among a group of sibling elements.
... syntax :first-of-type examples styling the first paragraph html <h2>heading</h2> <p>paragraph 1</p> <p>paragraph 2</p> css p:first-of-type { color: red; font-style: italic; } result nested elements this example shows how nested elements can also be targeted.
... working draft matching elements are not required to have a parent.
:host-context() - CSS: Cascading Style Sheets
in other words, this allows a custom element, or anything within that custom element's shadow dom, to apply different styles based on its position within the outer dom or classes/attributes applied to ancestor elements.
... another typical use would be to allow inner elements to react to classes or attributes on any anscestor elements - for example, applying a different text color when a .dark-theme class is applied to <body>.
... in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: un...
:indeterminate - CSS: Cascading Style Sheets
the :indeterminate css pseudo-class represents any form element whose state is indeterminate, such as checkboxes which have their html indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate <progress> elements.
... /* selects any <input> whose state is indeterminate */ input:indeterminate { background: 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 (var i = 0; i < inputs.length; i++) { inputs[i].indeterminate = true; } progress bar html <progress> css progress { margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status comment html living standardthe definition of ':indeterminate' in that specification.
:last-of-type - CSS: Cascading Style Sheets
the :last-of-type css pseudo-class represents the last element of its type among a group of sibling elements.
... syntax :last-of-type examples styling the last paragraph html <h2>heading</h2> <p>paragraph 1</p> <p>paragraph 2</p> css p:last-of-type { color: red; font-style: italic; } result nested elements this example shows how nested elements can also be targeted.
... working draft matching elements are not required to have a parent.
:not() - CSS: Cascading Style Sheets
WebCSS:not
the :not() css pseudo-class represents elements that do not match a list of selectors.
... since pseudo-elements are not simple selectors, they are not valid arguments to :not(); thus, selectors like :not(p::before) will not work.
... examples html <p>i am a paragraph.</p> <p class="fancy">i am so very fancy!</p> <div>i am not a paragraph.</div> css .fancy { text-shadow: 2px 2px 3px gold; } /* <p> elements that are not in the class `.fancy` */ p:not(.fancy) { color: green; } /* elements that are not <p> elements */ body :not(p) { text-decoration: underline; } /* elements that are not <div> and not <span> elements */ body :not(div):not(span) { font-weight: bold; } /* elements that are not `.crazy` or `.fancy` */ /* note that this syntax is not well supported yet.
:nth-last-of-type() - CSS: Cascading Style Sheets
the :nth-last-of-type() css pseudo-class matches elements of a given type, based on their position among a group of siblings, counting from the end.
... syntax the nth-last-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end.
... working draft matching elements are not required to have a parent.
:nth-of-type() - CSS: Cascading Style Sheets
the :nth-of-type() css pseudo-class matches elements of a given type (tag name), based on their position among a group of siblings.
... /* selects every fourth <p> element among any group of siblings */ p:nth-of-type(4n) { color: lime; } syntax the nth-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements.
... working draft matching elements are not required to have a parent.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0:visited no longer matches <link> elementschrome full support 1notes full support 1notes notes chromium has never matched <link> elements with link pseudo-classes.edge full support 12firefox full support 70ie no support ...
... noopera full support 15notes full support 15notes notes chromium has never matched <link> elements with link pseudo-classes.safari full support 12webview android full support 4.4notes full support 4.4notes notes chromium has never matched <link> elements with link pseudo-classes.chrome android full support 18notes full support 18notes notes chromium has never matched <link> elements with link pseudo-classes.firefox android no support noo...
...pera android full support 14notes full support 14notes notes chromium has never matched <link> elements with link pseudo-classes.safari ios full support 12samsung internet android full support 1.0notes full support 1.0notes notes chromium has never matched <link> elements with link pseudo-classes.restrict css properties allowed in a statement using :visited for privacychrome full support 6edge full support 12firefox full support 4ie ...
display-mode - CSS: Cascading Style Sheets
in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar.
... minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation.
... the elements will vary by browser.
Color picker tool - CSS: Cascading Style Sheets
var button = document.createelement('div'); button.classname = 'switch_mode'; button.addeventlistener('click', function() { if (this.picker_mode === 'hsv') this.setpickermode('hsl'); else this.setpickermode('hsv'); }.bind(this)); this.node.appendchild(button); }; /*************************************************************************/ // updates properties of ui elements /*************************************************************************/ colorpicker.prototype.updatecolor = function updatecolor(e) { var x = e.pagex - this.picking_area.offsetleft; var y = e.pagey - this.picking_area.offsettop; var picker_offset = 5; // width and height should be the same var size = this.picking_area.clientwidth; if (x > size) x = size; if (y > size) y = s...
...this.updatepickerposition(); this.updatealphagradient(); this.updatepreviewcolor(); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa()); notify(this.topic, this.color); }; /*************************************************************************/ // update positions of various ui elements /*************************************************************************/ colorpicker.prototype.updatepickerposition = function updatepickerposition() { var size = this.picking_area.clientwidth; var value = 0; var offset = 5; if (this.picker_mode === 'hsv') value = this.color.value; if (this.picker_mode === 'hsl') value = this.color.lightness; var x = (this.color.saturati...
... }; colorpicker.prototype.updatealphagradient = function updatealphagradient() { this.alpha_mask.style.backgroundcolor = this.color.gethexa(); }; colorpicker.prototype.updatepreviewcolor = function updatepreviewcolor() { this.preview_color.style.backgroundcolor = this.color.getcolor(); }; /*************************************************************************/ // update input elements /*************************************************************************/ colorpicker.prototype.inputchangehue = function inputchangehue(e) { var value = parseint(e.target.value); this.sethue(value); this.updatehuepicker(); }; colorpicker.prototype.inputchangesaturation = function inputchangesaturation(e) { var value = parseint(e.target.value); this.color.setsaturation(value); ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
grids can be used to lay out major page areas or small user interface elements.
...elements can be placed onto the grid within these column and row lines.
... in this example, i have a containing div with a class of wrapper and, inside are five child elements.
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
grid and absolutely positioned elements grid interacts with absolutely positioned elements, which can be useful if you want to position an item inside a grid or grid area.
...the contents value of the display property is a new value that is described in the display specification as follows: “the element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal.
... for the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.” if you set an item to display: contents the box it would normally create disappears, and the boxes of the child elements appear as if they have risen up a level.
Stacking without the z-index property - CSS: Cascading Style Sheets
when the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top): the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html descendant positioned elements, in order of appearance in the html keep in mind, when the order property alters rendering from the "order of appearance in the html" within flex containers, it similarly affects the order for stacking context.
... in the example below, elements #1 through #4 are positioned elements.
... element #5 is static, and so is drawn below the other four elements, even though it comes later in the html markup.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
the scroll-snap-align property must be used on child elements in order to set the position that scrolling will snap to.
... margins on scroll children the scroll-margin property can be set set on child elements, essentially defining an outset from the defined box.
... this allows for different amounts of space for different child elements, and can be used in conjunction with scroll-padding on the parent.
Child combinator - CSS: Cascading Style Sheets
it matches only those elements matched by the second selector that are the direct children of elements matched by the first.
... /* list items that are children of the "my-things" list */ ul.my-things > li { margin: 2em; } elements matched by the second selector must be the immediate children of the elements matched by the first selector.
... this is stricter than the descendant combinator, which matches all elements matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of "hops" up the dom.
Layout mode - CSS: Cascading Style Sheets
there are several of them: normal flow — all elements are part of normal flow until you do something to take them out of it.
... positioned layout, designed for positioning elements without much interaction with other elements.
... grid layout, designed for laying out elements relative to a fixed grid.
Pseudo-classes - CSS: Cascading Style Sheets
/* any button over which the user's pointer is hovering */ button:hover { color: blue; } pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
... note: in contrast to pseudo-classes, pseudo-elements can be used to style a specific part of an element.
... html living standard living standard defines when particular selectors match html elements.
Linear-gradient Generator - CSS: Cascading Style Sheets
var button = document.createelement('div'); button.classname = 'switch_mode'; button.addeventlistener('click', function() { if (this.picker_mode === 'hsv') this.setpickermode('hsl'); else this.setpickermode('hsv'); }.bind(this)); this.node.appendchild(button); }; /*************************************************************************/ // updates properties of ui elements /*************************************************************************/ colorpicker.prototype.updatecolor = function updatecolor(e) { var x = e.pagex - this.picking_area.offsetleft; var y = e.pagey - this.picking_area.offsettop; // width and height should be the same var size = this.picking_area.clientwidth; if (x > size) x = size; if (y > size) y = size; if (x < 0) x = 0; ...
...this.updatepickerposition(); this.updatealphagradient(); this.updatepreviewcolor(); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa()); notify(this.topic, this.color); }; /*************************************************************************/ // update positions of various ui elements /*************************************************************************/ colorpicker.prototype.updatepickerposition = function updatepickerposition() { var size = this.picking_area.clientwidth; var value = 0; if (this.picker_mode === 'hsv') value = this.color.value; if (this.picker_mode === 'hsl') value = this.color.lightness; var x = (this.color.saturation * size / 100) |...
... }; colorpicker.prototype.updatealphagradient = function updatealphagradient() { this.alpha_mask.style.backgroundcolor = this.color.gethexa(); }; colorpicker.prototype.updatepreviewcolor = function updatepreviewcolor() { this.preview_color.style.backgroundcolor = this.color.getcolor(); }; /*************************************************************************/ // update input elements /*************************************************************************/ colorpicker.prototype.inputchangehue = function inputchangehue(e) { var value = parseint(e.target.value); this.sethue(value); this.updatehuepicker(); }; colorpicker.prototype.inputchangesaturation = function inputchangesaturation(e) { var value = parseint(e.target.value); this.color.setsaturation(value); ...
Type selectors - CSS: Cascading Style Sheets
the css type selector matches elements by node name.
... in other words, it selects all elements of the given type within a document.
... /* all <a> elements.
Universal selectors - CSS: Cascading Style Sheets
the css universal selector (*) matches elements of any type.
... /* selects all elements */ * { color: green; } beginning with css3, the asterisk may be used in combination with namespaces: ns|* - matches all elements in namespace ns *|* - matches all elements |* - matches all elements without any declared namespace syntax * { style properties } the asterisk is optional with simple selectors.
... recommendation defines behavior regarding namespaces and adds hint that omitting the selector is allowed within pseudo-elements css level 2 (revision 1)the definition of 'universal selector' in that specification.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
in older browsers, even the keyword none does not have the same effect on all form elements across different browsers, and some do not support it at all.
...acts as none on elements with no special styling.
... formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | auto | button | textfield | menulist-button | <compat-auto>where <compat-auto> = searchfield | textarea | push-button | slider-horizontal | checkbox | radio | square-button | menulist | listbox | meter | progress-bar examples the following would make an element look like a menulist button: .exampleone { appeara...
border-radius - CSS: Cascading Style Sheets
the border-radius property does not apply to table elements when border-collapse is collapse.
...is equivalent to: */ border-top-left-radius: 4px 2px; border-top-right-radius: 3px 4px; border-bottom-right-radius: 6px 2px; border-bottom-left-radius: 3px 4px; formal definition initial valueas each of the properties of the shorthand:border-top-left-radius: 0border-top-right-radius: 0border-bottom-right-radius: 0border-bottom-left-radius: 0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
box-orient - CSS: Cascading Style Sheets
description html dom elements lay out their contents along the inline-axis by default.
... this css property will only apply to html elements with a css display value of box or inline-box.
... formal definition initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax horizontal | vertical | inline-axis | block-axis | inherit examples setting horizontal box orientation here, he box-orient property will cause the two <p> sections in the example to display in the same line.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to reference box when specified, otherwise border-boxcomputed valueas specified, but with <url> values made absoluteanimation typeyes, as specified for <basic-shape>, otherwise no formal syntax <clip-source> | [ <basic-shape> | <geometry-box> ] | nonewhere <clip-source> = <u...
... candidate recommendation extends its application to html elements.
... recommendation initial definition (applies to svg elements only).
contain - CSS: Cascading Style Sheets
WebCSScontain
if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | strict | content | [ size | layout | style | paint ] examples simple layout the markup below consists of a number of articles, each with content: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> each <article> and <img> is given a border, and the images are floated: img { float: left; border: 3px solid black; } article { border...
...r article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; } as you can see, because of the way floats work, the first image ends up inside the area of the second article: fixing with contain if we give each article the contain property with a value of content, when new elements are inserted the browser understands it only needs to recalculate the containing element's subtree, and not anything outside it: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> ...
content - CSS: Cascading Style Sheets
WebCSScontent
objects inserted using the content property are anonymous replaced elements.
... normal computes to none for the ::before and ::after pseudo-elements.
... accessibility support for css generated content – tink explanation of wcag, guideline 1.3 – mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal.
float - CSS: Cascading Style Sheets
WebCSSfloat
the float css property places an element on the left or right side of its container, allowing text and inline elements to wrap around it.
... formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it).
...phasellus feugiat est vel leo finibus congue.</p> </section> css section { border: 1px solid blue; width: 100%; float: left; } div { margin: 5px; width: 50px; height: 150px; } .left { float: left; background: pink; } .right { float: right; background: cyan; } result clearing floats sometimes you may want to force an item to move below any floated elements.
font - CSS: Cascading Style Sheets
WebCSSfont
formal definition initial valueas each of the properties of the shorthand:font-style: normalfont-variant: normalfont-weight: normalfont-stretch: normalfont-size: mediumline-height: normalfont-family: depends on user agentapplies toall elements.
...etpropcont { margin-bottom: 1em; } .curcss { border: none; border-bottom: 1px solid black; text-align: center; width: 80px; } .mandatory { border-bottom-color: red; } .cf:before, .cf:after { content: " "; display: table; } .cf:after { clear: both; } .tar { width: 40px; text-align: right; } .fontfamily { display: inline-block; } javascript var textareas = document.getelementsbyclassname("curcss"), shorttext = "", getcheckedvalue, setcss, getproperties, injectcss; getproperties = function () { shorttext = getcheckedvalue("font_style") + " " + getcheckedvalue("font_variant") + " " + getcheckedvalue("font_weight") + " " + getcheckedvalue("font_size") + getcheckedvalue("line_height") + " " + getcheckedvalue("font_...
...family"); return shorttext; } getcheckedvalue = function(radio_name) { oradio = document.forms[0].elements[radio_name]; for (var i = 0; i < oradio.length; i++) { if(oradio[i].checked) { var propinput = "input_" + radio_name, curelemname = "input_" + radio_name, curelem = document.getelementbyid(curelemname); curelem.value = oradio[i].value; return oradio[i].value; } } } setcss = function () { getproperties(); injectcss(shorttext); } injectcss = function(cssfragment) { old = document.body.getelementsbytagname("style"); if (old.length > 1) { old[1].parentelement.removechild(old[1]); } css = document.createelement("style"); css.innerhtml = ".fontshorthand{font: " + cssfragment + "}"; document.body.appendchild(css); } setc...
margin-bottom - CSS: Cascading Style Sheets
this property has no effect on non-replaced inline elements, such as <span> or <code>.
... formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... recommendation removes its effect on inline elements.
margin-left - CSS: Cascading Style Sheets
block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption left or right static or relative 0 block layout mode (floating element) any table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto.
... flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... recommendation like in css1, but removes its effect on inline elements.
margin-right - CSS: Cascading Style Sheets
block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption left or right static or relative 0 block layout mode (floating element) any table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto.
... flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... recommendation removes its effect on inline elements.
margin-top - CSS: Cascading Style Sheets
this property has no effect on non-replaced inline elements, such as <span> or <code>.
... formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
... recommendation removes its effect on inline elements.
mask-origin - CSS: Cascading Style Sheets
n-box; mask-origin: fill-box; mask-origin: stroke-box; mask-origin: view-box; /* multiple values */ mask-origin: padding-box, content-box; mask-origin: view-box, fill-box, border-box; /* non-standard keyword values */ -webkit-mask-origin: content; -webkit-mask-origin: padding; -webkit-mask-origin: border; /* global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; for elements rendered as a single box, this property specifies the mask positioning area.
...for elements rendered as multiple boxes, such as inline boxes on several lines or boxes on several pages, it specifies which boxes box-decoration-break operates upon to determine the mask positioning area.
... formal definition initial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <geometry-box>#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples setting mask origin to border-box css #ma...
opacity - CSS: Cascading Style Sheets
WebCSSopacity
description opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements.
... if you do not want to apply opacity to child elements, use the background property instead.
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial value1.0applies toall elementsinheritednocomputed valuethe specified value, clipped in the range [0,1]animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples setting background opacity html <div class="light">you can barely see this.</div> <div class="medium">this is easier to see.</div> <div class="heavy">this is very easy to see.</div> css div { background-color: yello...
outline - CSS: Cascading Style Sheets
WebCSSoutline
note: the outline will be invisible for many elements if its style is not defined.
...a notable exception is input elements, which are given default styling by browsers.
... how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal definition initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, currentcolor for the otheroutline-style: noneoutline-width: mediumapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:outline-color: for the keyword invert, the computed value is invert.
overflow-wrap - CSS: Cascading Style Sheets
the overflow-wrap css property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
... formal definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-word | anywhere examples comparing overflow-wrap, word-break, and hyphens this example compares the results of overflow-wrap, word-break, and hyphens when breaking up a long word.
... working draft initial definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete ...
overscroll-behavior-y - CSS: Cascading Style Sheets
/* keyword values */ overscroll-behavior-y: auto; /* default */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* global values */ overscroll-behavior-y: inherit; overscroll-behavior-y: initial; overscroll-behavior-y: unset; initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax the overscroll-behavior-y property is specified as a keyword chosen from the list of values below.
...underlying elements will not scroll.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } see overscroll-behavior for a full example and explanation.
page-break-after - CSS: Cascading Style Sheets
/* keyword values */ page-break-after: auto; page-break-after: always; page-break-after: avoid; page-break-after: left; page-break-after: right; page-break-after: recto; page-break-after: verso; /* global values */ page-break-after: inherit; page-break-after: initial; page-break-after: unset; this property applies to block elements that generate a box.
...a subset of values should be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
... user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
page-break-before - CSS: Cascading Style Sheets
this property applies to block elements that generate a box.
...a subset of values should be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
... user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
page-break-inside - CSS: Cascading Style Sheets
a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
... user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid examples avoiding page breaks inside elements html <div class="page"> <p>this is the first paragraph.</p> <section class="list"> <span>a list</span> <ol> <li>one</li> <!-- <li>two</li> --> </ol> </section> <ul> <li>one</li> <!-- <li>two</li> --> </ul> <p>this is the second paragraph.</p> <p>this is the third paragraph, it contains more text.</p> <p>this is the fourth paragraph.
... working draft allows this property on more elements.
perspective - CSS: Cascading Style Sheets
the parts of the 3d elements that are behind the user — i.e.
...also, in that case, the object will act as a containing block for position: fixed elements that it contains.
... formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthcreates stacking contextyes formal syntax none | <length> examples setting perspective this example shows a cube with the perspective set at different positions.
resize - CSS: Cascading Style Sheets
WebCSSresize
resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal definition initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of t...
...extareas in many browsers, <textarea> elements are resizable by default.
... html <textarea>type some text here.</textarea> css textarea { resize: none; /* disables resizability */ } result using resize with arbitrary elements you can use the resize property to make any element resizable.
scroll-margin-inline-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
... the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the righ...
... last of all we specify the scroll margin values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline-end: 1rem; } .scroller > div:nth-child(3) { scroll-margin-inline-end: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline end edge of the second <div>, and 2rems outside the inline end edge of the third <div>.
scroll-margin-inline-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
... the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the ...
... last of all we specify the scroll margin-values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline-start: 1rem; } .scroller > div:nth-child(3) { scroll-margin-inline-start: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline start edge of the second <div>, and 2rems outside the inline start edge of the third <div>.
scroll-margin-inline - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
... the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the righ...
... last of all we specify the scroll margin values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline: 1rem; } .scroller > div:nth-child(3) { scroll-margin-inline: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline end edge of the second <div>, and 2rems outside the inline end edge of the third <div>.
scroll-margin - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,4} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
... the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the ...
... last of all we specify the scroll margin-values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin: 1rem; } .scroller > div:nth-child(3) { scroll-margin: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the left edge of the second <div>, and 2rems outside the left edge of the third <div>.
z-index - CSS: Cascading Style Sheets
WebCSSz-index
overlapping elements with a larger z-index cover those with a smaller one.
...this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element.
... formal definition initial valueautoapplies topositioned elementsinheritednocomputed valueas specifiedanimation typean integercreates stacking contextyes formal syntax auto | <integer> examples visually layering elements html <div class="dashed-box">dashed box <span class="gold-box">gold box</span> <span class="green-box">green box</span> </div> css .dashed-box { position: relative; z-index: 1; border: dashed; height: 8em; margin-bottom: 1em; margin-top: 2em; } .gold-box { position: absolute; z-index: 3; /* put .gold-box above .green-box and .dashed-box */ background: gold; width: 80%; left: 60px; top: 3em; } .green-box { position: absolute; z-index: 2; /* put .green-box above .dashed-box */ background: lightgreen; width: 20%; left: 65%; top: -25...
Event reference
change event dom l2, html5 the change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user.
... overflow uievent mozilla specific an element has been overflowed by its content or has been rendered for the first time in this state (only works for elements styled with overflow != visible).
... touchenter touchevent touch events removed touchleave touchevent touch events removed underflow uievent mozilla specific an element is no longer overflowed by its content (only works for elements styled with overflow != visible).
Audio and video manipulation - Developer guides
html <video id="my-video" controls src="myvideo.mp4" type="video/mp4"> </video> javascript var context = new audiocontext(), audiosource = context.createmediaelementsource(document.getelementbyid("my-video")), filter = context.createbiquadfilter(); audiosource.connect(filter); filter.connect(context.destination); // configure filter filter.type = "lowshelf"; filter.frequency.value = 1000; filter.gain.value = 25; playable code <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.
...ples/6f/08625b424a.m4v" type="video/mp4"> </video> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> filter.type = "lowshelf"; filter.frequency.value = 1000; filter.gain.value = 25;</textarea> var context = new audiocontext(), audiosource = context.createmediaelementsource(document.getelementbyid("my-video")), filter = context.createbiquadfilter(); audiosource.connect(filter); filter.connect(context.destination); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function setfilter() { eval(textarea.value); } reset.addeventlistener('c...
...a panner node—pannernode—lets us define a source cone as well as positional and directional elements, all in 3d space as defined using 3d cartesian coordinates.
Overview of events and handlers - Developer guides
button event handler demo for example, browser <button> elements are intended to emit events named 'click' in response to a mouse click or, when displayed in touch sensitive surfaces, to a finger tap.
... this code relies on the agreement that there is a kind of event called 'click' which will call any listener (or 'handler') function with an event object argument (actually, in this case a derivative mouseevent object) and which will be fired by html button elements after user interaction.
...for example, code might be attached as: var funcinit = function(){ // user code goes here and can safely address all the html elements from the page // since the document has successfully been 'loaded' } document.addeventlistener('domcontentloaded', funcinit); so that this code will only be executed after the document object emits the 'domcontentloaded' event because the html has been parsed and javasript objects created representing each of the nodes of the html document.
Index - Developer guides
WebGuideIndex
6 audio and video delivery audio, guide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same.
... 14 web audio playbackrate explained apps, audio, media, video, playbackrate the playbackrate property of the <audio> and <video> elements allows us to change the speed, or rate, at which a piece of web audio or video is playing 15 writing web audio api code that works in every browser api you probably have already read the announcement on the web audio api coming to firefox, and are totally excited and ready to make your until-now-webkit-only sites work with firefox, which uses the unprefixed version of the spe...
... 20 media events intermediate, media various events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.
disabled - HTML: Hypertext Markup Language
conversely, elements that support the disabled attribute but don't have the attribute set match the :enabled pseudo-class.
...additionally, since the elements become immutable, most other attributes, such as pattern, have no effect, until the control is enabled.
... if present on a supporting elements, the :disabled pseudo class will match.
Date and time formats used in HTML - HTML: Hypertext Markup Language
certain html elements use date and/or time values.
...elements that use such formats include certain forms of the <input> element that let the user choose or specify a date, time, or both, as well as the <ins> and <del> elements, whose datetime attribute specifies the date or date and time at which the insertion or deletion of content occurred.
..., 33 [details] 1977-04-01t14:00:30 30 seconds after 2:00 pm on april 1, 1977 [details] 1901-01-01t00:00z midnight utc on january 1, 1901 [details] 1901-01-01t00:00:01-04:00 1 second past midnight eastern standard time (est) on january 1, 1901 [details] basics before looking at the various formats of date and time related strings used by html elements, it is helpful to understand a few fundamental facts about the way they're defined.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
permitted content zero or more <param> elements, then transparent.
...this attribute might be used to specify the various <param> elements passed to the java applet.
...it indicates the id of the data source object that supplies the data that is bound to the <param> elements associated with the applet.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
do not confuse the <b> element with the <strong>, <em>, or <mark> elements.
...further, stylesheets can change the default style of these elements, with the result that they are not necessarily displayed in bold.
... examples <p> this article describes several <b class="keywords">text-level</b> elements.
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
the obsolete html base font element (<basefont>) sets a default font face, size, and color for the other elements which are descended from its parent element.
... attributes like all other html elements, this element supports the global attributes.
... the <basefont> element was deprecated in the standard at the same time as all elements related to styling only.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
permitted content transparent but with no interactive content descendants except for <a> elements, <button> elements, <input> elements whose type attribute is checkbox, radio, or button.
... it is better to specify your canvas dimensions by setting the width and height attributes directly on the <canvas> elements, either directly in the html or by using javascript.
... mdn hit regions and accessability canvas accessibility use cases canvas element accessibility issues html5 canvas accessibility in firefox 13 – by steve faulkner best practices for interactive canvas elements specifications specification status comment html living standardthe definition of '<canvas>' in that specification.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
WebHTMLElementdatalist
the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls.
... permitted content either phrasing content or zero or more <option> elements.
... 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.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
<input> elements of type checkbox are rendered by default as boxes that are checked (ticked) when activated, like you might see in an official government paper form.
... additional attributes in addition to the common attributes shared by all <input> elements, "checkbox" inputs support the following attributes: attribute description checked boolean; if present, the checkbox is toggled on by default indeterminate a boolean which, if present, indicates that the value of the checkbox is indeterminate rather than true or false value the string to use as the value of the checkbox when submitting the form...
... beyond accessibility, this is another good reason to properly set up <label> elements on your forms.
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
<input> elements of type email are used to let the user enter and edit an e-mail address, or, if the multiple attribute is specified, a list of e-mail addresses.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, email inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be consider...
...by associating the two elements in this way, clicking on the label will focus the input element.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
<input> elements with type="file" let the user choose one or more files from their device storage.
... events change and input supported common attributes required additional attributes accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a file input's value attribute contains a domstring that represents the path to the selected file(s).
... additional attributes in addition to the common attributes shared by all <input> elements, inputs of type file also support the following attributes: attribute description accept one or more unique file type specifiers describing file types to allow capture what source to use for capturing image or video data files a filelist listing the chosen files multiple a boolean which, if present, indicates that the user may choos...
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
<input> elements of type tel are used to let the user enter and edit a telephone number.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, telephone number inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum length, in utf-16 characters, to accept as a valid input minlength the minimum length that is considered valid for the f...
... examples in this example, we present a simple interface with a <select> element that lets the user choose which country they're in, and a set of <input type="tel"> elements to let them enter each part of their phone number; there is no reason why you can't have multiple tel inputs.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
usage notes other elements can be used in tandem with <kbd> to represent more specific scenarios: nesting a <kbd> element within another <kbd> element represents an actual key or other unit of input as a portion of a larger input.
... examples basic example <p>use the command <kbd>help mycommand</kbd> to view documentation for the command "mycommand".</p> representing keystrokes within an input to describe an input comprised of multiple keystrokes, you can nest multiple <kbd> elements, with an outer <kbd> element representing the overall input and each individual keystroke or component of the input enclosed within its own <kbd>.
... result the output looks like this without a style sheet applied: with custom styles we can make more sense of this by adding some css: css we add a new style for <kbd> elements, key, which we can apply when rendering keyboard keys: kbd.key { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } html then we update the html to use this class on the keys in the output to be presented: <p>you can also create a new document by pressing <kbd><kbd class="key">ctrl</kbd>+<kbd class="key">n</kbd></kbd>.</p> result the result is just what we want!
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
attributes this element has no other attributes than the global attributes, common to all elements.
... see also the <pre> and <code> elements to be used instead.
... the <plaintext> and <xmp> elements, similar to <listing> but also obsolete.
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
a <noframes> element can contain any html elements that are allowed within the body of an html document, with the exception of the <frameset> and <frame> elements, since using frames when they aren't supported doesn't make sense.
... in html 5 and later, <noframes> is obsolete and shouldn't be used, since the <frame> and <frameset> elements are also obsolete.
... attributes like all other html elements, this element supports the global attributes.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
for a space-separated list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation.
...(if this attribute is not set, the <output> is associated with its ancestor <form> element, if any.) this attribute lets you associate <output> elements to <form>s anywhere in the document, not just inside a <form>.
...used in the form.elements api.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios.
... it provides a fallback in case none of the offered <source> elements are able to provide a usable image.
... content categories flow content, phrasing content, embedded content permitted content zero or more <source> elements, followed by one <img> element, optionally intermixed with script-supporting elements.
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
WebHTMLElementrb
examples in this example, we provide an annotation for the original character equivalent of "kanji": <ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> note how we've included two <rb> elements, to delimit the two separate parts of the ruby base text.
... the annotation on the other hand is delimited by two <rt> elements.
...in this case we don't need to include <rb> elements: <ruby> 漢 <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> <ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> body { font-size: 22px; } the output looks like so: the html above might look something like this when rendered by a browser without ruby support: 漢字 (kan ji) body { font-size: 22px; } note: see the article about the <ruby> element for further examples.
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
WebHTMLElementrtc
the html ruby text container (<rtc>) element embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element.
... <rb> elements can have both pronunciation (<rt>) and semantic (<rtc>) annotations.
... permitted content phrasing content or <rt> elements.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
WebHTMLElementsummary
default style per the html specification, the default style for <summary> elements includes display: list-item.
... basic example a simple example showing the use of <summary> in a <details> element: <details open> <summary>overview</summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> summaries as headings you can use heading elements in <summary>, like this: <details open> <summary><h4>overview</h4></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> this currently has some spacing issues that could be addressed using 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.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
you should use the more semantically helpful <code>, <kbd>, <samp>, or <var> elements for inline text that needs to be presented in monospace type, or the <pre> tag for content that should be presented as a separate block.
... if none of the semantic elements are appropriate for your use case (for example, if you simply need to show some content in a non-proportional font), you should consider using the <span> element, styling it as desired using css.
... although this element wasn't officially deprecated in html 4.01, its use was discouraged in favor of the semantic elements and/or css.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
permitted content zero or more <li>, <script> and <template> elements.
... the <ul> and <ol> elements may be nested as deeply as desired.
... the <ol> and <ul> elements both represent a list of items.
itemtype - HTML: Hypertext Markup Language
the itemtype attribute can only be specified on elements which have an itemscope attribute specified.
... the itemid attribute can only be specified on elements which have both an itemscope attribute and an itemtype attribute specified.
... they must only be specified on elements with an itemscope attribute, whose itemtype attribute specifies a vocabulary not supporting global identifiers for items, as defined by that vocabulary's specification.
MIME types (IANA media types) - HTTP
note: use application/xml or application/xhtml+xml if you want xml’s strict parsing rules, <![cdata[…]]> sections, or elements that aren't from html/svg/mathml namespaces.
... audio and video types as is the case for images, html doesn't mandate that web browsers support any specific file and codec types for the <audio> and <video> elements, so it's important to consider your target audience and the range of browsers (and versions of those browsers) they may be using when choosing the file type and codecs to use for media.
...only resources with the correct mime type will be played in <video> or <audio> elements.
Configuring servers for Ogg media - HTTP
html <audio> and <video> elements allow media presentation without the need for the user to install any plug-ins or other software to do so.
... consider using the preload attribute the html <audio> and <video> elements provide the preload attribute, which tells the browser to attempt to download the entire media when the page loads.
... preload is off by default, so if getting to video is the point of your web page, your users may appreciate it if you include preload in your video elements.
CSP: child-src - HTTP
the http content-security-policy (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: frame-src - HTTP
the http content-security-policy (csp) frame-src directive specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: script-src-attr - HTTP
this includes only inline script event handlers like onclick, but not urls loaded directly into <script> elements.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: script-src-elem - HTTP
the http content-security-policy (csp) script-src-elem directive specifies valid sources for javascript <script> elements, but not inline script event handlers like onclick.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: style-src-attr - HTTP
the http content-security-policy (csp) style-src-attr directive specifies valid sources for inline styles applied to individual dom elements.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: style-src-elem - HTTP
the http content-security-policy (csp) style-src-elem directive specifies valid sources for stylesheets <style> elements and <link> elements with rel="stylesheet".
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
An overview of HTTP - HTTP
WebHTTPOverview
requests an example http request: requests consists of the following elements: an http method, usually a verb like get, post or a noun like options or head that defines the operation the client wants to perform.
... the path of the resource to fetch; the url of the resource stripped from elements that are obvious from the context, for example without the protocol (http://), the domain (here, developer.mozilla.org), or the tcp port (here, 80).
... responses an example response: responses consist of the following elements: the version of the http protocol they follow.
JavaScript data types and data structures - JavaScript
it is a set of "elements" of 16-bit unsigned integer values.
...the length of a string is the number of elements in it.
...unfortunately, when the separator is used in one of the "list" elements, then, the list is broken.
Loops and iteration - JavaScript
example 1 the following example iterates through the elements in an array until it finds the index of an element whose value is thevalue: for (let i = 0; i < a.length; i++) { if (a[i] === thevalue) { break; } } example 2: breaking to a label let x = 0; let z = 0; labelcancelloops: while (true) { console.log('outer loops: ' + x); x += 1; z = 1; while (true) { console.log('inner loops: ' + z); z += 1; if (z === 10 && x === 10) {...
... function dump_props(obj, obj_name) { let result = ''; for (let i in obj) { result += obj_name + '.' + i + ' = ' + obj[i] + '<br>'; } result += '<hr>'; return result; } for an object car with properties make and model, result would be: car.make = ford car.model = mustang arrays although it may be tempting to use this as a way to iterate over array elements, the for...in statement will return the name of your user-defined properties in addition to the numeric indexes.
... therefore, it is better to use a traditional for loop with a numeric index when iterating over arrays, because the for...in statement iterates over user-defined properties in addition to the array elements, if you modify the array object (such as adding custom properties or methods).
Text formatting - JavaScript
it is a set of "elements" of 16-bit unsigned integer values (utf-16 code units).
...the length of a string is the number of elements in it.
... repeat returns a string consisting of the elements of the object repeated the given times.
Arrow function expressions - JavaScript
shorter functions var elements = [ 'hydrogen', 'helium', 'lithium', 'beryllium' ]; // this statement returns the array: [8, 6, 7, 9] elements.map(function(element) { return element.length; }); // the regular function above can be written as the arrow function below elements.map((element) => { return element.length; }); // [8, 6, 7, 9] // when there is only one parameter, we can remove the surrounding parentheses...
... elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // obviously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any valid variable name you want elements.map(({ length: lengthfoobarx }) => lengthfoobarx); // [8, 6, 7, 9] // this destructuring parameter assignment can also be written as seen below.
...elements.map(({ length }) => length); // [8, 6, 7, 9] no separate this before arrow functions, every new function defined its own this value based on how the function was called: a new object in the case of a constructor.
Array() constructor - JavaScript
syntax [element0, element1, ..., elementn] new array(element0, element1[, ...[, elementn]]) new array(arraylength) parameters elementn a javascript array is initialized with the given elements, except in the case where a single argument is passed to the array constructor and that argument is a number (see the arraylength parameter below).
...an array with its length property set to that number and the array elements are empty slots.
... let fruits = new array(2); console.log(fruits.length); // 2 console.log(fruits[0]); // undefined array constructor with multiple parameters if more than one argument is passed to the constructor, a new array with the given elements is created.
Array.prototype.findIndex() - JavaScript
the range of elements processed by findindex() is set before the first invocation of callback.
... callback will not process the elements appended to the array after the call to findindex() begins.
... elements that are deleted are still visited.
Array.prototype.push() - JavaScript
the push() method adds one or more elements to the end of an array and returns the new length of the array.
... examples adding elements to an array the following code creates the sports array containing two elements, then appends two elements to it.
... let sports = ['soccer', 'baseball'] let total = sports.push('football', 'swimming') console.log(sports) // ['soccer', 'baseball', 'football', 'swimming'] console.log(total) // 4 merging two arrays this example uses apply() to push all elements from a second array.
Array.prototype.reverse() - JavaScript
description the reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.
... examples reversing the elements in an array the following example creates an array a, containing three elements, then reverses the array.
... const a = [1, 2, 3]; console.log(a); // [1, 2, 3] a.reverse(); console.log(a); // [3, 2, 1] reversing the elements in an array-like object the following example creates an array-like object a, containing three elements and a length property, then reverses the array-like object.
Array.prototype.unshift() - JavaScript
the unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.
... syntax arr.unshift(element1[, ...[, elementn]]) parameters elementn the elements to add to the front of the arr.
... please note that, if multiple elements are passed as parameters, they're inserted in chunk at the beginning of the object, in the exact same order they were passed as parameters.
Function.prototype.apply() - JavaScript
and, because push accepts a variable number of arguments, you can also push multiple elements at once.
... but, if you pass an array to push, it will actually add that array as a single element, instead of adding the elements individually.
... const array = ['a', 'b']; const elements = [0, 1, 2]; array.push.apply(array, elements); console.info(array); // ["a", "b", 0, 1, 2] using apply and built-in functions clever usage of apply allows you to use built-in functions for some tasks that would probably have otherwise been written by looping over the array values.
Object.freeze() - JavaScript
as an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added to or removed from the array.
... > object.freeze(1) typeerror: 1 is not an object // es5 code > object.freeze(1) 1 // es2015 code an arraybufferview with elements will cause a typeerror, as they are views over memory and will definitely cause other possible issues: > object.freeze(new uint8array(0)) // no elements uint8array [] > object.freeze(new uint8array(1)) // has elements typeerror: cannot freeze array buffer views with elements > object.freeze(new dataview(new arraybuffer(32))) // no elements dataview {} > object.freeze(new float64array(new arra...
...ybuffer(64), 63, 0)) // no elements float64array [] > object.freeze(new float64array(new arraybuffer(64), 32, 2)) // has elements typeerror: cannot freeze array buffer views with elements note that; as the standard three properties (buf.bytelength, buf.byteoffset and buf.buffer) are read-only (as are those of an arraybuffer or sharedarraybuffer), there is no reason for attempting to freeze these properties.
Set - JavaScript
you can iterate through the elements of a set in insertion order.
... set.prototype.clear() removes all elements from the set object.
...console.log([...myset]) // will show you exactly the same array as myarray remove duplicate elements from the array // use to remove duplicate elements from the array const numbers = [2,3,4,4,2,3,3,4,4,5,5,6,6,7,5,32,3,4,5] console.log([...new set(numbers)]) // [2, 3, 4, 5, 6, 7, 32] relation with strings let text = 'india' let myset = new set(text) // set ['i', 'n', 'd', 'i', 'a'] myset.size // 5 //case sensitive & duplicate ommision new set("firefox") // set(7) [ "f", "i", "r", "e",...
SharedArrayBuffer.prototype.slice() - JavaScript
slice(-2) extracts the last two elements in the sequence.
... for example, slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3).
... return value a new sharedarraybuffer containing the extracted elements.
TypedArray.prototype.find() - JavaScript
the range of elements processed by find is set before the first invocation of callback.
... elements that are appended to the typed array after the call to find begins will not be visited by callback.
... if an existing, unvisited element of the typed array is changed by callback, its value passed to the visiting callback will be the value at the time that find visits that element's index; elements that are deleted are not visited.
TypedArray.prototype.findIndex() - JavaScript
the range of elements processed by findindex is set before the first invocation of callback.
... elements that are appended to the typed array after the call to findindex begins will not be visited by callback.
... if an existing, unvisited element of the typed array is changed by callback, its value passed to the visiting callback will be the value at the time that findindex visits that element's index; elements that are deleted are not visited.
TypedArray.from() - JavaScript
description typedarray.from() lets you create typed arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects where you can get its elements, such as map and set).
...hence, when working with proxy objects, it calls handler.set to create new elements rather than handler.defineproperty().
... { typed_array[i] = copy_data[i]; } return typed_array; } })(); } examples from an iterable object (set) const s = new set([1, 2, 3]); uint8array.from(s); // uint8array [ 1, 2, 3 ] from a string int16array.from('123'); // int16array [ 1, 2, 3 ] use with arrow function and map using an arrow function as the map function to manipulate the elements float32array.from([1, 2, 3], x => x + x); // float32array [ 2, 4, 6 ] generate a sequence of numbers uint8array.from({length: 5}, (v, k) => k); // uint8array [ 0, 1, 2, 3, 4 ] specifications specification ecmascript (ecma-262)the definition of '%typedarray%.from' in that specification.
TypedArray.prototype.join() - JavaScript
the join() method joins all elements of an array into a string.
...if omitted, the typed array elements are separated with a comma (",").
... return value a string with all array elements joined.
TypedArray.prototype.map() - JavaScript
the range of elements processed by map() is set before the first invocation of mapfn.
... elements which are appended to the array after the call to map() begins will not be visited by mapfn.
... if existing elements of the typed array are changed, or deleted, their value as passed to mapfn will be the value at the time map() visits them; elements that are deleted are not visited.
Spread syntax (...) - JavaScript
spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
...spread syntax "expands" an array into its elements, while rest syntax collects multiple elements and "condenses" them into a single element.
... examples spread in function calls replace apply() it is common to use function.prototype.apply() in cases where you want to use the elements of an array as arguments to a function.
display - Web app manifests
in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar.
... minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation.
... the elements will vary by browser.
Authoring MathML - MathML
t insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages).
...use the text field for token elements and buttons to build advanced constructions.
...use the elements and the special chars panels to create various advanced mathematical constructs.
<mtable> - MathML
WebMathMLElementmtable
inside a <mtable> only <mtr> and <mtd> elements may appear.
... these elements are similar to <table> , <tr> and <td> elements of html.
... unimplemented side specifies the position where <mlabeledtr> label elements should be placed.
<semantics> - MathML
the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions.
... the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise).
... beware that <annotation-xml> elements are only recognized, if the encoding attribute is set to one of the following: "application/mathml-presentation+xml" "mathml-presentation" "svg1.1" "text/html" "image/svg+xml" "application/xml".
Web audio codec guide - Web media technologies
latency 5 ms to 66.5 ms browser compatibility feature chrome edge firefox internet explorer opera safari opus support 33 14 15 no 20 11[2] this information refers to support for opus in html <audio> and <video> elements, and not to webrtc.
...dth latency at least 100 ms browser compatibility feature chrome edge firefox internet explorer opera safari vorbis support 4 17 3.5 no 11.5 no this information refers to support for vorbis in html <audio> and <video> elements, and not to webrtc.
...of course, if you can provide multiple formats (for example, by using the <source> element within your <audio> and <video> elements), you can avoid many or all of those exceptions.
Web video codec guide - Web media technologies
for example, each coding tree unit (ctu)—similar to the macroblock used in previous codecs—consists of a tree of luma values for each sample as well as a tree of chroma values for each chroma sample used in the same coding tree unit, as well as any required syntax elements.
...web browsers are required to support vp8 for webrtc, but not all browsers that do so also support it in html audio and video elements.
... <video controls> <source type="video/webm" src="filename.webm"> <source type="video/mp4" src="filename.mp4"> </video> keep in mind that the <video> element requires a closing </video> tag, whether or not you have any <source> elements inside it.
Using images in HTML - Web media technologies
WebMediaimages
references these articles cover some of the html elements and css properties that are used to control how images are displayed on the web.
... <picture> the html <picture> element contains zero or more <source> elements and one <img> element which provides versions of an image for different display/device scenarios.
... mapping the width and height attributes of media container elements to their aspect-ratio this changes how browsers load images so their aspect ratios are calculated by the browser early on and can later be used to correct the display size of an image before it's loaded.
Web media technologies
today, there are a large number of apis available, as well as html elements, dom interfaces, and other features that make it possible to not only perform these tasks, but use media in tandem with other technologies to do truly remarkable things.
... using audio and video in html a guide to using the html <audio> and <video> elements.
...this ranges from simply using the alt attribute on <img> elements to captions to tagging media for screen readers.
Critical rendering path - Web Performance
after the render tree is complete, layout occurs, defining the location and size of all the render tree elements.
...the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other.
...block level elements, by definition, have a default width of 100% of the width of their parent.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
it establishes several filters, which are applied with css to three elements in both the normal and mouse hover states.
... <p class="blur">time to clean my glasses</p> <svg height="0"> <defs> <filter id="wherearemyglasses" x="0" y="0"> <fegaussianblur in="sourcegraphic" stddeviation="1"/> </filter> </defs> </svg> you can apply the svg and the css filter in the same class: .blur { filter: url(#wherearemyglasses); } blurring is computation heavy, so ensure to use it sparingly, especially in elements that get scrolled or animated.
... by creating the text using svg elements combined with html you can make a variety of different text effects.
class - SVG: Scalable Vector Graphics
WebSVGAttributeclass
you may assign the same class name or names to any number of elements, however, multiple class names must be separated by whitespace characters.
... an element's class name serves two key roles: as a style sheet selector, for when an author assigns style information to a set of elements.
... #00cc00; } circle.circleclass { stroke: #006600; fill: #cc0000; } ]]> </style> <rect class="rectclass" x="10" y="10" width="100" height="100"/> <circle class="circleclass" cx="40" cy="50" r="26"/> </svg> </body> </html> elements the following elements can use the class attribute: <a> <altglyph> <circle> <clippath> <defs> <desc> <ellipse> <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <feflood> <fegaussianblur> <feimage> <femerge> <femorphology> <feoffset> <fespecularlighting> <fetile> <feturbulence> <filter> <font> <fo...
clip-path - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> html,body,svg { height:100% } <svg viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <clippath id="myclip" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".5" /> </clippath> <!-- top-left: apply a custom defined clipping path --> <rect x="1" y="1" width="8" height="8" stroke="gr...
... candidate recommendation extends its application to html elements.
... recommendation initial definition (applies to svg elements only).
clip-rule - SVG: Scalable Vector Graphics
« svg attribute reference home the clip-rule attribute only applies to graphics elements that are contained within a <clippath> element.
...- left: evenodd --> <clippath id="emptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <rect clip-path="url(#emptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clippath id="filledstar"> <use xlink:href="#star" clip-rule="nonzero" /> </clippath> <rect clip-path="url(#filledstar)" width="50" height="90" x="50" fill="red" /> </svg> elements the following elements can use the clip-rule attribute, but only if they are inside a <clippath> element.
... graphical elements » browser compatibility the compatibility table on this page is generated from structured data.
enable-background - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <a>, <defs>, <glyph>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, and <symbol> context notes value accumulate | new [ <x> <y> <width> <height> ]?
... default value accumulate animatable no accumulate if an ancestor container element has a property value of enable-background: new, then all graphics elements within the current container element are rendered both onto the parent container elementʼs background image canvas and onto the target device.
... otherwise, there is no current background image canvas, so graphics elements are only rendered onto the target device.
externalResourcesRequired - SVG: Scalable Vector Graphics
the externalresourcesrequired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.
... because setting externalresourcesrequired="true" on a container element will have the effect of disabling progressive display of the contents of that container, if that container includes elements that reference external resources, authors should avoid simply setting externalresourcesrequired="true" on the outermost <svg> element on a universal basis.
... instead, it is better to specify externalresourcesrequired="true" on those particular graphics elements or container elements which specifically need the availability of external resources in order to render properly.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
fourteen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <fegaussianblur>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile> usage notes value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primi...
...tive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes sourcegraphic this keyword represents the graphics elements that were the original input into the <filter> element.
... sourcealpha this keyword represents the graphics elements that were the original input into the <filter> element.
marker-end - SVG: Scalable Vector Graphics
for all shape elements, except <polyline> and <path>, the last vertex is the same as the first vertex.
...for <path> elements, for each closed subpath, the last vertex is the same as the first vertex.
... as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-end="url(#triang...
marker-start - SVG: Scalable Vector Graphics
for all shape elements, except <polyline> and <path>, the last vertex is the same as the first vertex.
...for <path> elements, for each closed subpath, the last vertex is the same as the first vertex.
... as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-start="url(#...
visibility - SVG: Scalable Vector Graphics
the visibility attribute lets you control the visibility of graphical elements.
... depending on the value of attribute pointer-events, graphics elements which have their visibility attribute set to hidden still might receive events.
... as a presentation attribute, it can be applied to any element but it has effect only on the following nineteen elements: <a>, <altglyph>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <iframe>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, <tspan>, <video> html, body, svg { height: 100%; } <svg viewbox="0 0 220 120" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="200" height="100" stroke="black" stroke-width="5" fill="transparent" /> <g stroke="seagreen" stroke-width="5" fill="skyblue"> <rect x="20" y="20" width="80" height="80" visibility="visible" /> <rect x="120" y="20" width...
xlink:href - SVG: Scalable Vector Graphics
22 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use>} html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a xlink:href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> a for <a>, xlink:href defi...
... refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
... recommendation defines href for animation elements.
xml:lang - SVG: Scalable Vector Graphics
the xml:lang attribute specifies the primary language used in contents and attributes containing text content of particular elements.
... all elements are using this attribute.
... candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both.
xml:space - SVG: Scalable Vector Graphics
svg supports the built-in xml xml:space attribute to handle whitespace characters inside elements.
... child elements inside an element may also have an xml:space attribute that overrides the parentʼs one.
... all elements are using this attribute.
<linearGradient> - SVG: Scalable Vector Graphics
the <lineargradient> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
... don't be confused with css linear-gradient() as css gradients can only apply to html elements where svg gradient can only apply to svg elements.
...g, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that specification.
<radialGradient> - SVG: Scalable Vector Graphics
the <radialgradient> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
... don't be confused with css radial-gradient() as css gradients can only apply to html elements where svg gradient can only apply to svg elements.
...g, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<radialgradient>' in that specification.
<switch> - SVG: Scalable Vector Graphics
WebSVGElementswitch
the <switch> svg element evaluates any requiredfeatures, requiredextensions and systemlanguage attributes on its direct child elements in order, and then renders the first child where these attributes evaluate to true.
... usage context categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<a>, <foreignobject>, <g>, <image>, <svg>, <switch>, <text>, <use> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes class style externalresourcesrequired transform dom interface this element implements the svgswitchelement interface.
...the switch element will display the first of its child elements whose systemlanguage attribute matches the user's language, or the fallback element with no systemlanguage attribute if none of them match.
SVG as an Image - SVG: Scalable Vector Graphics
many browsers support svg images in: html <img> or <svg> elements css background-image gecko-specific contexts additionally, gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) introduced support for using svg in these contexts: css list-style-image css content svg <image> element svg <feimage> element canvas drawimage function restrictions for security purposes, gecko places some restrictions on svg content when it's being used as an image: javascript is disabled.
... note that the above restrictions are specific to image contexts; they don't apply when svg content is viewed directly, or when it's embedded as a document via the <iframe>, <object>, or <embed> elements.
... recommendation defines the usage of svg within <img> elements.
Clipping and masking - SVG: Scalable Vector Graphics
clipping refers to removing parts of elements defined by other parts.
...since the rectangle covers only the upper half of the circle, the lower half of the circle will vanish: screenshotlive sample we now have a semicircle without having to deal with arcs in path elements.
...for reverting a previously set display: none it is important to know, that the initial value for all svg elements is inline.
SVG fonts - SVG: Scalable Vector Graphics
you can use literally any other svg elements in here, even <filter>, <a> or <script>.
... the actual glyphs are then defined by <glyph> elements.
... there are two further elements that can be defined inside font: <hkern> and <vkern>.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet.
... extension-element-prefixes specifies a space-separated list of any namespace prefixes for extension elements in this document.
... default-mode defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope.
An Overview - XSLT: Extensible Stylesheet Language Transformations
instead they are simply a way of specifying a unique identifier for a known set of elements.
... the string "http://www.w3.org/1999/xsl/transform" is a constant that designates the elements so marked as belonging to the set of tags designated by the w3c in the 1999 xslt recommendation.
...below the root node are its children, which can be elements, comments, processing instructions and so on.
port - Archive of obsolete content
this example rewrites the content script in the port.removelistener() example so that it uses once(): // content-script.js function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); } self.port.once("get-first-para", getfirstparagraph); removelistener() you can use port.on() to listen for messages.
... // content-script.js function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); self.port.removelistener("get-first-para", getfirstparagraph); } self.port.on("get-first-para", getfirstparagraph); the result is that the paragraph is only logged the first time the button is clicked.
Communicating using "port" - Archive of obsolete content
function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); self.port.removelistener("get-first-para", getfirstparagraph); } self.port.on("get-first-para", getfirstparagraph); the result is that the paragraph is only logged the first time the button is clicked.
... this example rewrites the "listener.js" content script in the port.removelistener() example so that it uses once(): function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); } self.port.once("get-first-para", getfirstparagraph); json-serializable values the payload for an message can be any json-serializable value.
XUL Migration Guide - Archive of obsolete content
xul windows xul windows are used to define completely new windows to host user interface elements specific to the add-on.
... apis like ui and panel are very generic and with the right content can be used to replace many specific xul elements.
context-menu - Archive of obsolete content
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);'...
... this includes non-input elements with the contenteditable attribute set to true.
page-worker - Archive of obsolete content
in this example we fetch the first paragraph of a page from wikipedia, then the first paragraph of a different page: var getfirstparagraph = "var paras = document.getelementsbytagname('p');" + "console.log(paras[0].textcontent);" + "self.port.emit('loaded');" pageworker = require("sdk/page-worker").page({ contentscript: getfirstparagraph, contenturl: "http://en.wikipedia.org/wiki/chalk" }); pageworker.port.on("loaded", function() { pageworker.contenturl = "http://en.wikipedia.org/wiki/cheese" }); scripting page ...
... for example, this add-on loads a page from wikipedia, and runs a content script in it to send all the headers back to the main add-on code: var pageworkers = require("sdk/page-worker"); // this content script sends header titles from the page to the add-on: var script = "var elements = document.queryselectorall('h2 > span'); " + "for (var i = 0; i < elements.length; i++) { " + " postmessage(elements[i].textcontent) " + "}"; // create a page worker that loads wikipedia: pageworkers.page({ contenturl: "http://en.wikipedia.org/wiki/internet", contentscript: script, contentscriptwhen: "ready", onmessage: function(message) { con...
package.json - Archive of obsolete content
these values will be used as the add-on's em:contributor elements in its install.rdf.
... these values will be used as the add-on's em:translator elements in its install.rdf.
Displaying annotations - Archive of obsolete content
in this chapter we'll use a page-mod to locate elements of web pages that have annotations associated with them, and a panel to display the annotations.
... when a page is loaded the matcher searches the dom for elements that match annotations.
Annotator - Archive of obsolete content
the add-on is an annotator: it enables the user to select elements of web pages and enter notes (annotations) associated with them.
...whenever the user loads a page containing annotated elements these elements are highlighted, and if the user moves the mouse over an annotated element its annotation is displayed.
Dialogs and Prompts - Archive of obsolete content
explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your xul file and add a dlgtype attribute to them.
... programmatic button access if you want to access the accept ("ok") and cancel buttons from script, use this: // disable the ok and cancel btns document.documentelement.getbutton("accept").disabled = true; document.documentelement.getbutton("cancel").disabled = true; links dialog.xml — xbl bindings for <dialog> and <dialogheader> elements.
File I/O - Archive of obsolete content
however, you can enumerate available drives using the following code: components.utils.import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(drivesenum.getnext().
... // file is the given directory (nsifile) var entries = file.directoryentries; var array = []; while(entries.hasmoreelements()) { var entry = entries.getnext(); entry.queryinterface(components.interfaces.nsifile); array.push(entry); } reading from a file read into a stream or a string this will allow you to read a file without locking up the ui thread while reading.
Examples and demos from articles - Archive of obsolete content
[article] pure-css lightbox [html] the :target pseudo-class is useful to switch on/off some invisible elements.
...[article] expandable elements [html] this example shows how it is possible to show/hide classes of elements in pure css.
HTML to DOM - Archive of obsolete content
the function below will safely parse simple html and return a dom object which can be manipulated like web page elements.
...the returned <body> object is of type element here is a sample that counts the number of paragraphs in a string: var dompars = htmlparser('<p>foo</p><p>bar</p>'); alert(dompars.getelementsbytagname('p').length); if htmlparser() returns the element name html (instead of body), you have all document object with its complete functions list, therefore you can retrieve info within div tag like this: var dompars = htmlparser("<div id='userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong>.</div>"); alert(dompars.getelementbyid('userinfo').innerhtml); ...
QuerySelector - Archive of obsolete content
'bar'); // add <bar xmlns="somens"/> foo.documentelement.appendchild(bar); alert(foo.$('bar').nodename); // gives 'bar' element.prototype.$ = function (selector) { // works for html, xul, and plain xml return this.queryselector(selector); }; html example: <h1><a>test!<a/></h1> <script> element.prototype.$ = function (selector) { return this.queryselector(selector); }; alert(document.getelementsbytagname('h1')[0].$('a').nodename); // 'a' xul example: <hbox><vbox/></hbox> <script type="text/javascript"><![cdata[ element.prototype.$ = function (selector) { return this.queryselector(selector); }; var xulns = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; alert(document.getelementsbytagnamens(xulns, 'hbox')[0].$('vbox').nodename); // vbox ]]></script> xml example: <fo...
...o xmlns="somens"><bar/></foo> in document earlier var foo = document.getelementsbytagnamens('somens', 'foo')[0]; alert(foo.$('bar')); note that for plain xml, the # 'id' selector will not work with an 'id' attribute (since a such-named attribute need not necessarily be of type id in xml, though it is in html and xul), nor will it work with xml:id.
SVG General - Archive of obsolete content
svg template here is a basic markup template to start building an svg document: <svg xmlns="http://www.w3.org/2000/svg"> <!-- svg elements go here --> </svg> note: it is recommended that you do not use dtd's with svg documents.
... dynamic scripting helper this little helper script can be used to simplify creation of svg elements in script.
Windows - Archive of obsolete content
var wenum = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher) .getwindowenumerator(); var index = 1; var windowname = "yourwindowname"; while (wenum.hasmoreelements()) { var win = wenum.getnext(); if (win.name == windowname) { win.focus(); return; } index++ } window.open("chrome://to/your/window.xul", windowname, "features"); uniquely identifying dom windows requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko, each dom window has a unique 64-bit id number.
... similarly, you can get the current inner window id using the nsidomwindowutils attribute currentinnerwindowid: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.currentinnerwindowid; programatically modifying html when attempting to modify html elements, it is important to specify the namespace.
Interaction between privileged and non-privileged pages - Archive of obsolete content
strongly recommended that third parties adding their own events use their own prefix to avoid confusion and lessen the probability of conflicts with other new events.") in the case where your extension's overlay does not interact directly with browser.xul, such as in a sidebar, it might be easier to add the event listener to the top-level document directly as shown below (also see: accessing the elements of the top-level document from a child window).
... document.addeventlistener("message", function(e) { yourfunction(e); }, false, true); sending data from chrome to unprivileged document to "answer" the web page (e.g., return code), your extension can set an attribute or attach child elements on the event target element (<myextensiondataelement/> in this example).
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
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 attribute) assigned will also have a working docommand method.
JavaScript Object Management - Archive of obsolete content
this allows you to manipulate and possibly change elements in the window without the user noticing the changes.
... a javascript code module is a regular js file that specifies which of the declared elements in it are public.
Supporting search suggestions in search plugins - Archive of obsolete content
(this means that a suggestion-supporting engine plugin will have two <url> elements, the other one being the main text/html search url.) for example, the yahoo search plugin has this <url> entry: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchterms}"/> if the user types "fir" into the search bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-sug...
... for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements.
Creating reusable content with CSS and XBL - Archive of obsolete content
you can use css to provide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element.
...you can use xbl to link selected elements to their own: stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse.
XML data - Archive of obsolete content
you want the document's info elements to be displayed like html paragraphs.
... in the document's stylesheet, you specify how info elements are to be displayed: info { display: block; margin: 1em 0; } the most common values for the display property are: block displayed like html's div (for headings, paragraphs) inline displayed like html's span (for emphasis within text) add your own style rules that specify the font, spacing and other details in the same way as for html.
XUL user interfaces - Archive of obsolete content
copy and paste the content from here, making sure that you scroll to get all of it: // xul demonstration var datebox, daybox, currentday, status; // elements // called by window onload function init() { datebox = document.getelementbyid("date-text") daybox = document.getelementbyid("day-box") status = document.getelementbyid("status") settoday(); } // called by clear button function cleardate() { datebox.value = "" refresh() } // called by today button function settoday() { var d = new date() datebox.value = (d.getmonth() + 1) ...
...it is made up of other elements that are generated by its xbl binding.
Case Sensitivity in class and id Names - Archive of obsolete content
in the authoring of both css and javascript/dom (otherwise known as dhtml) routines, it is a near-certainty that class and id names will be used to identify elements.
...any number of elements may be assigned the same class name or names.
Defining Cross-Browser Tooltips - Archive of obsolete content
unlike the title element, which provides information about an entire document and may only appear once, the title attribute may annotate any number of elements.
...in this approach, the server checks outgoing html for elements that have an alt attribute but no title attribute, and inserts a title attribute with the same content as the alt attribute.
No Proxy For configuration - Archive of obsolete content
entry points: preferences | advanced | proxies control-click menu for off line-online icon (network plug) configuration the no proxy list is composed of either domain elements or ipv4 address elements.
... the elements are separated by either a space (" ") or a comma (",").
Notes on HTML Reflow - Archive of obsolete content
elements later "in the flow" typically do not affect the geometry of elements that are earlier "in the flow", so layout can proceed left-to-right, top-to-bottom through the document.
...the xul box layout model, on the other hand, is constraint based , meaning that geometric preferences and constraints of neighboring elements are taken into consideration before the elements' final geometry can be computed.
Using XML Data Islands in Mozilla - Archive of obsolete content
<name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> <script> function rundemo() { var ordersource = document.getelementbyid("purchase-order").textcontent; var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); var lineitems = doc.getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "lineitem"); var firstprice = lineitems[0].getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "price")[0].textcontent; document.body.textcontent = "the purchase order contains " + lineitems.length + " line items.
...for this demo, you must create an external document called purchase_order.xml: <!doctype html> <html> <head> <title>xml data block demo</title> <script> function rundemo() { var doc = document.getelementbyid("purchase-order").contentdocument; var lineitems = doc.getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "lineitem"); var firstprice = lineitems[0].getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "price")[0].textcontent; document.getelementbyid("output-box").textcontent = "the purchase order contains " + lineitems.length + " line items.
Creating a Firefox sidebar extension - Archive of obsolete content
pre-requisites this article is a quick start, it won't explain all elements of xul, packaging and xpi's.
...other elements can be included, please read the xul tutorials for more information.
Adding the structure - Archive of obsolete content
graphical panels (like the one we are creating here that displays an icon) are given the statusbarpanel-iconic class so they can be styled accordingly by the css stylesheet that defines these elements' appearance.
...all xul elements can be given custom attributes in addition to the ones the xul rendering engine recognizes which get ignored by the engine, so adding this custom attribute does not create any problems or modify the way the widget is displayed (except for the ways we explicitly specify with css).
Creating a Microsummary - Archive of obsolete content
web pages can reference generators via <link rel="microsummary"> elements in their <head> elements.
...wnload count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> <pages> </pages> </generator> the <pages> element can contain a sequence of <include> and <exclude> elements specifying the pages to which a generator does and doesn't apply, respectively.
PyDOM - Archive of obsolete content
this means that if you set the script-type to python for the window, python is the default script type for all child elements in the window.
... xul use a script-type attribute on your elements.
RDF Datasource How-To - Archive of obsolete content
deciding on a vocabulary the vocabulary is the set of properties that you will use to express relationships between elements (resources and literals) in your data model.
...it contains elements for authorship, subject, publication date, etc.
isempty - Archive of obsolete content
true: the rule will only match nodes that contain no child elements.
... false: the rule will only match nodes that contain one or more child elements.
mousethrough - Archive of obsolete content
child elements may override this if they specify mousethrough="never".
... the mousethrough attribute is typically used in conjunction with a stack to allow elements to be stacked above other elements yet allow mouse events to be sent to lower elements.
ordinal - Archive of obsolete content
by default, elements appear in the order they appear in the xul code.
...note the default ordinal for elements is 1.
orient - Archive of obsolete content
horizontal child elements of the element are placed next to each other in a row in the order that they appear in the xul source.
... vertical child elements of the element are placed under each other in a column in the order that they appear in the xul source.
separator.orient - Archive of obsolete content
horizontal the separator separates vertically placed elements.
... vertical the separator separates horizontally placed elements.
targets - Archive of obsolete content
if this attribute is not specified, or you set it to the value '*', all elements are valid.
... the command update will only occur when the event occurs to one of the specified elements.
uri - Archive of obsolete content
ArchiveMozillaXULAttributeuri
elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource.
... elements outside will appear only once.
How to implement a custom XUL query processor component - Archive of obsolete content
// the output for a result has been removed and the result is no longer being used by the builder hasbeenremoved: function() { } }; // basic wrapper for nsisimpleenumerator function templateresultset(aarrayofdata) { this._index = 0; this._array = aarrayofdata; } templateresultset.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsisimpleenumerator]), hasmoreelements: function() { return this._index < this._array.length; }, getnext: function() { return new templateresult(this._array[this._index++]); } }; // the query processor class - implements nsixultemplatequeryprocessor function templatequeryprocessor() { // our basic list of data this._data = [ {name: "mark", age: 36, hair: "brown", eye: "brown"}, {nam...
... we do not make use of any <query/> or <rule/> elements in the xul template block.
Methods - Archive of obsolete content
checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstvisiblerow getindexofitem getitematindex getnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionres...
...sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getattributenodens dom:element.getattributens dom:element.getelementsbytagname dom:element.getelementsbytagnamens dom:element.getfeature fixme: brokenlink dom:element.getuserdata dom:element.hasattribute dom:element.hasattributens dom:element.hasattributes dom:element.haschildnodes dom:element.insertbefore dom:element.isequalnode dom:element.issamenode dom:element.issupported dom:element.lookupnamespaceuri dom:element.lookupprefix dom:el...
MenuButtons - Archive of obsolete content
both the button and the toolbar button elements support two special types used for creating menu buttons.
... when the command is fired, it bubbles up through the chain of elements to the top of the document.
MenuItems - Archive of obsolete content
d-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image: url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } this behavior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level.
...this is an advantage when attaching several menuitems or buttons to the same command, as the disabled state can be adjusted once for the command, and this will propagate to all elements attached to it.
OpenClose - Archive of obsolete content
for menupopups attached to other elements using the popup or context attributes, see opening a popup below.
...for menupopups attached to other elements using the popup or context attributes, see closing a popup below.
boxObject - Archive of obsolete content
« xul reference boxobject type: nsiboxobject this property is available for elements that are derived from boxes, which is most displayable xul elements.
... prior to gecko 1.9.1, you can retrieve the boxobject for non-xul elements using the document.getboxobjectfor method; the method was removed in gecko 1.9.1 because it was non-standard.
richlistitem.label - Archive of obsolete content
« xul reference label type: string gets the concatentation of text from any child label elements.
...use the child elements directly to set label text.
Property - Archive of obsolete content
minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement 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 searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpane...
...ment.baseuri dom:element.childelementcount dom:element.childnodes dom:element.children dom:element.clientheight dom:element.clientleft dom:element.clienttop dom:element.clientwidth dom:element.clonenode dom:element.firstchild dom:element.firstelementchild dom:element.lastchild dom:element.lastelementchild dom:element.localname dom:element.namespaceuri dom:element.nextelementsibling dom:element.nextsibling dom:element.nodename dom:element.nodetype dom:element.nodevalue dom:element.ownerdocument dom:element.parentnode dom:element.prefix dom:element.previouselementsibling dom:element.previoussibling dom:element.scrollheight dom:element.scrollleft dom:element.scrolltop dom:element.scrollwidth dom:element.tagname dom:element.textcontent ...
Bindings - Archive of obsolete content
<query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> it works similarly to the previous triple.
... </query> <rule> <binding subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <action> ...
Building Hierarchical Trees - Archive of obsolete content
<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> </treechildren> </rule> </template> </tree> the first rule is for the houses as indicated by the rule's condition and the second rule is for the streets.
...in this example, the two group elements are displayed at the first level.
Multiple Rule Example - Archive of obsolete content
<vbox id="photoslist" align="start" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?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-padde...
... <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"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?phototitle"/> </conditions> <action> <vbox uri="?photo" class="box-padded"> <label value="?phototitle"/> <image src="?photo"/> </vbox> </action> </rule> </template> </vbox> in this example, the first rule matches only those photos with title, description, and date properties.
Static Content - Archive of obsolete content
ry-ont#country" oncommand="applyfilter(event.target.value);"> <menupopup> <menuitem label="all"/> </menupopup> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?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.
...9/countries/country-ont#country" onselect="applyfilter(event.target.value);"> <radio label="all" selected="true"/> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <radio uri="?country" label="?countrytitle" value="?country"/> </action> </template> </radiogroup> this example doesn't have any other content to generate outside the radio element with the uri attribute, so it will just be copied as is.
Using Multiple Queries to Generate More Results - Archive of obsolete content
<template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title" class="header"/> </action> </rule> </queryset> <queryset> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/people" object="?people"/> <member container="?people" child="?item"/> </query> <rule> <binding subject="?it...
...em" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title"/> </action> </rule> </queryset> </template> you can view the example.
Using Recursive Templates - Archive of obsolete content
<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.
...since the initial reference node is the root of the xml source document, the results are two elements, one for each group element.
The Joy of XUL - Archive of obsolete content
separation of presentation from application logic one of the major downfalls of most web applications is the tight coupling of user interface elements with client application logic.
... xbl the extensible bindings language (xbl) is a markup language that defines special new elements, or "bindings" for xul widgets.
Things I've tried to do with XUL - Archive of obsolete content
html elements have the non-standard clientwidth/clientheight properties (see http://www.mozilla.org/docs/dom/domr...entheight.html); no equivalent exists for xul.
... resize event problems going with the inability to obtain the clientwidth/clientheight of xul elements, it's impossible to handle the "resize" event yourself to grow/shrink content as needed -- as you grow the content, when you shrink the window, the content will simply be clipped (because now it has a bigger size than the window).
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
lette"> <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 <toolbarbutton> in <toolbaritem>.
Creating Dialogs - Archive of obsolete content
://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" ondialogaccept="return dook();" ondialogcancel="return docancel();"> <script> function dook(){ alert("you pressed ok!"); return true; } function docancel(){ alert("you pressed cancel!"); return true; } </script> <description value="select a button"/> </dialog> you may place any elements that you wish in a dialog.
... 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"/> <radio id="violet" selected="true" label="strawberries because of their colour"/> <radio id="yellow" label="bananas because they are pre-packaged"/> </groupbox> </dialog> the buttons elements can be accessed with the following javascript // the accept button var acceptbutt = document.documentelement.getbutton("accept") more examples more examples in dialogs and prompts (code snippets).
More Menu Features - Archive of obsolete content
« previousnext » in this section, we'll look at creating submenus and checked menus creating submenus you can create submenus inside other menus (nested menus) using the existing elements.
...the checks are created in a similar way to the checkbox and radio elements.
Scroll Bars - Archive of obsolete content
some elements, such as text boxes, will also add scroll bars as necessary when the content inside is too large.
...a scroll bar creates all of these elements automatically.
XBL Example - Archive of obsolete content
content of the slideshow first, let's determine what elements need to go in the xbl content.
...the flex attribute has been added to a number of elements so that it stretches in the right way.
XPCOM Examples - Archive of obsolete content
<script> function getcookies() { var menu = document.getelementbyid("cookiemenu"); menu.removeallitems(); var cookiemanager = components.classes["@mozilla.org/cookiemanager;1"] .getservice(components.interfaces.nsicookiemanager); var iter = cookiemanager.enumerator; while (iter.hasmoreelements()){ var cookie = iter.getnext(); if (cookie instanceof components.interfaces.nsicookie){ if (cookie.host == "www.mozillazine.org") menu.appenditem(cookie.name,cookie.value); } } } </script> <hbox> <menulist id="cookiemenu" onpopupshowing="getcookies();"/> </hbox> the getcookies() function will be called whenever the menu is opened, as indicated by the onpopupshowin...
...an enumerator has a hasmoreelements() method which will return true until we get to the last cookie.
XUL Structure - Archive of obsolete content
the three types of chrome packages are: content - windows and scripts the declarations of the windows and the user interface elements contained within them.
...the files located in the global part of a skin package contain the default look for all of the xul interface elements.
Urlbar-icons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons.
... create new image or button child elements to add your own items.
XUL Accesskey FAQ and Policies - Archive of obsolete content
common elements that don't get accesskeys ok buttons.
...look for dependencies of bug 129179 (the xul accesskey hookup meta bug), or look for bugs with "accesskey" or "mnemonic" in the summary, or look for dialogs where there are no elements with underlined letters.
broadcasterset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for broadcaster elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
conditions - Archive of obsolete content
within the conditions can be placed content, member and triple elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
dialog - Archive of obsolete content
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
... related elements dialogheader ...
groupbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the groupbox is used to group related elements together.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
image - Archive of obsolete content
ArchiveMozillaXULimage
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...this and the other icon classes may be used by image elements or other elements which can have an image.
listcol - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcols, listhead, listheader, listitem ...
listcols - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listhead, listheader, listitem ...
member - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used within a rule's conditions element to match elements that are containers or are contained within another element.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
menupopup - Archive of obsolete content
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
... related elements menu, menubar, menuitem, menulist, menuseparator interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
progressmeter - Archive of obsolete content
for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
queryset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for query elements when more than one query is used.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
scrollbox - Archive of obsolete content
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).
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
spacer - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements separator, splitter ...
spinbuttons - Archive of obsolete content
spin buttons are not used as separate elements, but are used in combination with other elements to create a control that can be increased and decreased.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
statusbar - Archive of obsolete content
s, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessibleprovider ...
stringbundleset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for stringbundle elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
tabpanel - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tabbox, tabs, tab, tabpanels.
textnode - Archive of obsolete content
this is useful if you want to use the html element or other elements that have text content inside them instead of in attributes.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
titlebar - Archive of obsolete content
elements inside the titlebar usually don't receive any mouse events, so e.g.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
toolbar - Archive of obsolete content
inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
... related elements toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbargrippy - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbaritem - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarpalette - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarseparator - Archive of obsolete content
s, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarset - Archive of obsolete content
s, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarspacer, toolbox ...
toolbarspacer - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarspring - Archive of obsolete content
s, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessibleprovider ...
tooltip - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
treechildren - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...subject" flex="2"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> related elements tree, treecols, treecol, treeitem, treerow, treecell and treeseparator.
treeseparator - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
...butenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treerow and treecell.
where - Archive of obsolete content
ArchiveMozillaXULwhere
for more information, see where elements.
... ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
wizard - Archive of obsolete content
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(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattribute...
Dialogs in XULRunner - Archive of obsolete content
alogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption label="select favorite fruit"/> <radiogroup> <radio id="1" label="oranges because they are fruity"/> <radio id="2" selected="true" label="strawberries because of color"/> <radio id="3" label="bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open dialogs, called window.opendialog().
...however, xul does support elements to make creating wizards a simple task as well.
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
it brings in atom elements into rss, adding the advantages of atom to rss while maintaining backwards compatibility.
... documentation selected articles atomic rss tim bray talks about using atom 1.0 as a micro format and extension module for rss 2.0; keeping rss 2.0 as your sydication format but bringing in and using selected atom 1.0 elements.
Making sure your theme works with RTL locales - Archive of obsolete content
gecko 1.9.1 (firefox 3.5) and earlier the chromedir attribute firefox, thunderbird and seamonkey expose an attribute named chromedir on certain elements.
... note that not all elements will have the chromedir attribute, so you may need to refer to an ancestor element that does.
Theme changes in Firefox 4 - Archive of obsolete content
controlling the actual icon size used by add-on toolbar buttons the iconsize attribute of the browser's toolbar elements now has a different default value on each toolbar independently.
... use of the iconsize attribute on toolbar elements add-ons use the iconsize attribute to determine which icon they should display when a button is placed in a specific toolbar.
-moz-stack-sizing - Archive of obsolete content
normally, a <xul:stack> will change its size so that all of its child elements are completely visible.
...(the problem does not affect children moved above or to the left of the stack.) initial valuestretch-to-fitapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values stretch-to-fit the child will influence the stack's size.
-ms-content-zooming - Archive of obsolete content
initial valuezoom for the top level element, none for all other elementsapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value of all elements except the top-level element.
... by default, zoom-enabled elements can be zoomed by the user via pinch-zoom.
-ms-scroll-chaining - Archive of obsolete content
initial valuechainedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values chained initial value.
... this property has no effect on non-scrollable elements.
-ms-scroll-limit-x-max - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrollleft property is equal to element.scrollwidth.
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-limit-x-min - Archive of obsolete content
initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrollleft property.
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-limit-y-max - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrolltop property is equal to element.scrollheight.
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-limit-y-min - Archive of obsolete content
initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrolltop property.
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-limit - Archive of obsolete content
initial valueas each of the properties of the shorthand:-ms-scroll-limit-x-min: 0-ms-scroll-limit-y-min: 0-ms-scroll-limit-x-max: auto-ms-scroll-limit-y-max: autoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-limit-x-min: as specified-ms-scroll-limit-y-min: as specified-ms-scroll-limit-x-max: as specified-ms-scroll-limit-y-max: as specifiedanimation typediscrete syntax the -ms-scroll-limit property is specified as one or more of the following scroll limit values, in the order listed, ...
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-rails - Archive of obsolete content
initial valuerailedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the content moves exactly with the user's finger.
... remarks this property has no effect on non-scrollable elements.
-ms-scroll-snap-points-x - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... this property has no effect on non-scrollable elements.
-ms-scroll-snap-points-y - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... this property has no effect on non-scrollable elements.
-ms-scroll-snap-x - Archive of obsolete content
initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-x: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-x: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-x shorthand property is specified as one or both of the following values, in order and separated by spaces.
... this property has no effect on non-scrollable elements.
-ms-scroll-snap-y - Archive of obsolete content
initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-y: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-y: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-y shorthand property is specified as one or both of the following values, in order and separated by spaces.
... this property has no effect on non-scrollable elements.
-ms-scrollbar-3dlight-color - Archive of obsolete content
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the top and left edges of the scroll box and scroll arrows of the scroll bar.
...*/ } </style> </head> <body> <textarea class="blue3dlight">the top and left edges of the thumb and button-face elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-arrow-color - Archive of obsolete content
the -ms-scrollbar-arrow-color css property is a microsoft extension that specifies the color of the arrow elements of a scroll arrow.
... initial valuebuttontextapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll arrows of the scroll bar.
-ms-scrollbar-base-color - Archive of obsolete content
the -ms-scrollbar-base-color css property is a microsoft extension that specifies the base color of the main elements of a scroll bar.
... initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the base color of the main elements of a scroll bar.
-ms-scrollbar-darkshadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll bar's gutter.
... code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-darkshadow-color</title> <style> .blueshadow { scrollbar-darkshadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-shadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
... <!doctype html> <html> <head> <title>scrollbar-shadow-color</title> <style> .blueshadow { scrollbar-shadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-track-color - Archive of obsolete content
initial valuescrollbarapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the track element.
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-track-color, -ms-scrollbar-face-color, and -ms-scrollbar-arrow-color to create two <div> elements with different scroll bar color schemes.
-ms-touch-select - Archive of obsolete content
the -ms-touch-select css property is a microsoft extension that toggles the gripper visual elements that enable touch text selection.
... initial valuegrippersapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values grippers the grippers are always on.
-ms-wrap-through - Archive of obsolete content
initial valuewrapapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values wrap the exclusion element inherits its parent node's wrapping context.
...for more information about exclusion elements' impact on content flow, see the terminology section of the css exclusions module level 1 specification.
display-outside - Archive of obsolete content
other formatting contexts, such as flex formatting contexts, may also work with block-level elements.
...run-in elements act like inlines or blocks, depending on the surrounding elements.
Accessing XML children - Archive of obsolete content
in this case, accessing foo.bar will return an xml list object, of all child elements of the type "bar".
...var a = <foo> <bar/> <baz/> </foo>; var list = a.*; list.length(); // returns 2 element attributes many xml elements have attributes with particular values assigned to them.
Namespaces - Archive of obsolete content
« previousnext » e4x and namespaces oftentimes, xml documents will contain elements from a variety of namespaces.
...info.uri; // returns "http://www.w3.org/1999/xhtml" elements in no namespace return the empty string as their uri.
The global XML object - Archive of obsolete content
xml elements will remember the settings of the xml object from the time of their creation.
...the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignorecomments true by default.
Array.observe() - Archive of obsolete content
an array of the removed elements.
...the number of elements added.
New in JavaScript 1.2 - Archive of obsolete content
it no longer converts undefined elements to null and sorts them to the high end of the array.
... it can take a limit count so that it won't include trailing empty elements in the resulting array.
LiveConnect Overview - Archive of obsolete content
for example, the following code creates the javaarray x with ten elements of type int: var x = java.lang.reflect.array.newinstance(java.lang.integer, 10); like the javascript array object, javaarray has a length property which returns the number of elements in the array.
... unlike array.length, javaarray.length is a read-only property, because the number of elements in a java array are fixed at the time of creation.
JavaArray - Archive of obsolete content
use zero-based indexes to access the elements in a javaarray object, just as you do to access elements in an array in java.
... properties length: the number of elements in the java array represented by javaarray.
XForms Custom Controls - Archive of obsolete content
such elements include upload and case.
...xbl bindings most xforms control elements have at least two bindings applied to themselves.
RFE to the XForms API - Archive of obsolete content
ArchiveWebXFormsRFEXForms API
xforms dom is a list of interfaces that are available from xforms elements directly.
... reflect attributes to properties for the elements that can contain the incremental or selection attributes, it makes sense to expose analogous properties.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
natively, the mozilla xforms implementation supports xforms elements being hosted in xhtml and xul documents.
... enhancements of xforms elements if you find that none of the elements proposed by the xforms spec address your requirements, please post your usecase here.
XForms Styling - Archive of obsolete content
triggers use appearance="minimal" to be able to style buttons portability the mozilla xforms extension is one of the few xforms processors which allow for styling of the xforms elements directly, using mostly standard css.
...however, most of the time the transition is straight-forward: view the source after processing of your xforms document, and map the old styles to the new elements.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
hover and non-link elements section 5.11.3 of css2 defines the three dynamic pseudo-classes (:hover, :active, and :focus) and then goes on to say: css doesn't define which elements may be in the above states, or how the states are entered and left.
... scripting may change whether elements react to user events or not, and different devices and uas may have different ways of pointing to, or activating elements.
Windows Media in Netscape - Archive of obsolete content
the various param elements that can be used and the functionalities behind them is best described by the windows media 9 series sdk.
...e if(window.geckoactivexobject) { player = new geckoactivexobject("wmplayer.ocx.7"); } } catch(e) { ; } if (player) { player.currentplaylist = player.mediacollection.getbyname('preludesteel'); player.controls.play(); } callbacks from within windows media player to web pages: script for event netscape 7.1 supports ie's <script for="activexcontrol" event="activexcontrolevent"> script elements.
Tiles and tilemaps overview - Game development
positioning and camera in all scrolling games, we need a translation between world coordinates (the position where sprites or other elements are located in the level or game world) and screen coordinates (the actual position where those elements are rendered on the screen).
...the most common case is to use this logic grid to handle collisions, but other uses are possible as well: character spawning points, detecting whether some elements are placed together in the right way to trigger a certain action (like in tetris or bejeweled), path-finding algorithms, etc.
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the accessibility tree, or accessibility object model (aom), contains accessibility-related information for most html elements.
...the dom tree contains objects for all the markup’s elements, attributes, and text nodes.
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
the browser applies css style declarations to selected elements to display them properly.
...css usually styles html elements, but can be also used with other markup languages like svg or xml.
Selector (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
a css selector is the part of a css rule that describes what elements in a document the rule will match.
... the matching elements will have the rule's specified style applied to them.
Element - MDN Web Docs Glossary: Definitions of Web-related terms
elements and tags are not the same things.
... tags begin or end an element in source code, whereas elements are part of the dom, the document model for displaying the page in the browser.
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes).
... the empty elements in html are as follows: <area> <base> <br> <col> <embed> <hr> <img> <input> <keygen>(html 5.2 draft removed) <link> <meta> <param> <source> <track> <wbr> ...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
concept and syntax an html document is a plaintext document structured with elements.
... elements are surrounded by matching opening and closing tags.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
semantics in css in css, consider styling a list with li elements representing different types of fruits.
... semantic elements these are some of the roughly 100 semantic elements available: <article> <aside> <details> <figcaption> <figure> <footer> <header> <main> <mark> <nav> <section> <summary> <time> learn more html element reference on mdn using html sections and outlines on mdn the meaning of semantics in computer science on wikipedia ...
Tag - MDN Web Docs Glossary: Definitions of Web-related terms
note that the end tag's name is preceded by a slash character, </p>, and that in empty elements, the end tag is neither required nor allowed.
... learn more general knowledge html element on wikipedia html elements syntax on whatwg technical reference introduction to html ...
caret - MDN Web Docs Glossary: Definitions of Web-related terms
on the web, a caret is used to represent the insertion point in <input> and <textarea> elements, as well as any elements whose contenteditable attribute is set, thereby allowing the contents of the element to be edited by the user.
... html elements that may present a caret these elements provide text entry fields or boxes and therefore make use of the caret.
What is accessibility? - Learn web development
on of accessibility for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; consistent webpage layout and navigation; familiar elements, such as underlined links blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery.
... different operating systems have different accessibility apis available : windows: msaa/iaccessible, uiaexpress, iaccessible2 mac os x: nsaccessibility linux: at-spi android: accessibility framework ios: uiaccessibility where the native semantic information provided by the html elements in your web apps falls down, you can supplement it with features from the wai-aria specification, which add semantic information to the accessibility tree to improve accessibility.
Fundamental CSS comprehension - Learn web development
the default margin applied to the <h2> and <p> elements by the browser will interfere with our design, so write a rule that targets all these elements and sets their margin to 0.
... you should include .card at the start of the selector chain in all your rules, so that these rules wouldn't interfere with the styling of any other elements if the business card were to be put on a page with a load of other content.
Organizing your CSS - Learn web development
if you have a few things you know you will want to apply to lots of different elements, they can come in this section.
... previous overview: building blocks in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Floats - Learn web development
clearing floats we have seen that the float is removed from normal flow and that other elements will display beside it, therefore if we want to stop the following element from moving up we need to clear it; this is achieved with the clear property.
... clearing boxes wrapped around a float you now know how to clear something following a floated element, but let's see what happens if you have a tall float and a short paragraph, with a box wrapped around both elements.
Test your skills: floats - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered.
... floats one in this task you need to float the two elements with a class of float1 and float2 left and right respectively.
CSS layout - Learn web development
normal flow elements on webpages lay themselves out according to normal flow - until we do something to change that.
... positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
How CSS works - Learn web development
some elements are parents of child nodes, and child nodes have siblings.
...its children are a text node and the three nodes corresponding to our <span> elements.
The HTML5 input types - Learn web development
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.
...here's a live example that falls back to <select> elements in non-supporting browsers: let's look at the different available types in brief.
Example 4 - Learn web development
ow) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event bi...
...}); select.addeventlistener('blur', function (event) { deactivateselect(select); }); }); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 27) { deactiv...
Example 5 - Learn web development
ow) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index].setattribute('aria-selected', 'true'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); ...
...}; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('mouseover', ...
Sending forms through JavaScript - Learn web development
form.addeventlistener( "submit", function ( event ) { event.preventdefault(); senddata(); } ); } ); here's the live result: you can even get more involved with the process by using the form's elements property to get a list of all of the data elements in the form and manually manage them one at a time.
... to learn more about that, see the example in accessing the element list's contents in htmlformelement.elements.
Example - Learn web development
d have the same font settings by default, textarea are set with a monospace font */ font: 1em sans-serif; /* to give the same size to all text field */ width: 300px; -moz-box-sizing: border-box; box-sizing: border-box; /* to harmonize the look & feel of text field border */ border: 1px solid #999; } input:focus, textarea:focus { /* to give a little highligh on active elements */ border-color: #000; } textarea { /* to properly align multiline text field with their label */ vertical-align: top; /* to give enough room to type some text */ height: 5em; /* to allow users to resize any textarea vertically it works only on chrome, firefox and safari */ resize: vertical; } .button { /* to position the buttons to the same position of the text fields */...
... padding-left: 90px; /* same size as the label elements */ } button { /* this extra magin represent the same space as the space between the labels and their text fields */ margin-left: .5em; } result ...
The web and web standards - Learn web development
for example, the html living standard describes exactly how html (all the html elements, and their associated apis, and other surrounding technologies) should be implemented.
... html, css, and javascript html, css, and javascript are the main three technologies you'll use to build a website: hypertext markup language, or html, is a markup language consisting of different elements you can wrap (mark up) content in to give it meaning (semantics) and structure.
Tips for authoring fast-loading HTML pages - Learn web development
this technique works best with elements that will have limited dimensions, and will not work for every use of a background image.
... tables should use the css selector: property combination: table-layout: fixed; and should specify widths of columns using the <col> and the <colgroup> elements.
Define terms with HTML - Learn web development
the terms described go inside <dt> elements.
... the matching description follows immediately, contained within one or more <dd> elements.
Test your skills: HTML text basics - Learn web development
html text basics 1 in this task we want you to mark up the provided html using semantic heading and paragraph elements.
... html text basics 3 in this task you are provided with a paragraph, and your aim is to use some inline elements to mark up a couple of appropriate words with strong importance, and a couple with emphasis.
Multimedia and Embedding - Learn web development
video and audio content next, we'll look at how to use the html5 <video> and <audio> elements to embed video and audio on our pages, including basics, providing access to different file formats to different browsers, adding captions and subtitles, and how to add fallbacks for older browsers.
... from <object> to <iframe> — other embedding technologies at this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements.
Structuring the web with HTML - Learn web development
html is used to specify whether your web content should be recognized as a paragraph, list, heading, link, image, multimedia player, form, or one of many other available elements or even a new element that you define.
...n then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
some hints: a click event handler can be added to most elements, including the document <body>.
... it makes more sense to put it on the <body> element if you want to maximize the clickable area — the event bubbles up to its child elements.
Image gallery - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
...the html body looks like this: <h1>image gallery example</h1> <div class="full-img"> <img class="displayed-img" src="images/pic1.jpg"> <div class="overlay"></div> <button class="dark">darken</button> </div> <div class="thumb-bar"> </div> the example looks like this: the most interesting parts of the example's css file: it absolutely positions the three elements inside the full-img <div> — the <img> in which the full-sized image is displayed, an empty <div> that is sized to be the same size as the <img> and put right over the top of it (this is used to apply a darkening effect to the image via a semi-transparent background color), and a <button> that is used to control the darkening effect.
Test your skills: Loops - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list.
Third-party APIs - Learn web development
const audiosource = audioctx.createmediaelementsource(audioelement); // etc.
...if so, we don't try to display any — we create a <p> containing the text "no results returned." and insert it into the.<section> if some articles are returned, we, first of all, create all the elements that we want to use to display each news story, insert the right contents into each one, and then insert them into the dom at the appropriate places.
Client-side web APIs - Learn web development
drawing graphics the browser contains some very powerful graphics programming tools, from the scalable vector graphics (svg) language, to apis for drawing on html <canvas> elements, (see the canvas api and webgl).
... video and audio apis html5 comes with elements for embedding rich media in documents — <video> and <audio> — which in turn come with their own apis for controlling playback, seeking, etc.
Working with JSON - Learn web development
at the moment it only contains two lines, which grab references to the <header> and <section> elements and store them in variables: const header = document.queryselector('header'); const section = document.queryselector('section'); we have made our json data available on our github, at https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json.
...for each one, we: create several new elements: an <article>, an <h2>, three <p>s, and a <ul>.
HTML performance features - Learn web development
objective: to learn about the impact of html elements and attributes on web performance optimization.
... elements & attributes impacting performance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
Web performance resources - Learn web development
<style type="text/css"> // insert your css here </style> javascript avoid javascript blocking by using the async or defer attributes, or link javascript assets after the page's dom elements.
... javascript only block rendering for elements that appear after the script tag in the dom tree.
Componentizing our React app - Learn web development
that second bullet is especially valuable: making a component out of common ui elements allows you to change your code in one place and see those changes everywhere that component is used.
...in app.js, add the following line near the top of the file to import todo: import todo from "./components/todo"; with this component imported, you can replace all of the <li> elements in app.js with <todo /> component calls.
Componentizing our Svelte app - Learn web development
take into account that it won't just show or hide the markup based on the condition — it will dynamically add and remove the elements from the dom, depending on the condition.
...thanks to svelte reactivity, assigning the value of the editing variable will be enough to display the correct html elements.
Working with Svelte stores - Learn web development
the problem is elements that are dynamically added and removed from the page.
... at the end we had a look at using the svelte transition directive to implement animations on dom elements.
Error codes returned by Mozilla APIs
document and node errors the following errors can occur when using documents, nodes and elements.
...57001c) ns_error_xpc_js_threw_null (0x8057001d) ns_error_xpc_js_threw_string (0x8057001e) ns_error_xpc_js_threw_number (0x8057001f) ns_error_xpc_javascript_error (0x80570020) ns_error_xpc_javascript_error_with_details (0x80570021) ns_error_xpc_cant_convert_primitive_to_array (0x80570022) ns_error_xpc_cant_convert_object_to_array (0x80570023) ns_error_xpc_not_enough_elements_in_array (0x80570024) ns_error_xpc_cant_get_array_info (0x80570025) ns_error_xpc_not_enough_chars_in_string (0x80570026) ns_error_xpc_security_manager_veto (0x80570027) ns_error_xpc_interface_not_scriptable (0x80570028) ns_error_xpc_interface_not_from_nsisupports (0x80570029) ns_error_xpc_cant_get_jsobject_of_dom_object (0x8057002a) ns_error_xpc_cant_set_read_only_cons...
Limitations of chrome scripts
for this reason, add-ons that try to access content objects in fresh <browser> elements may run into trouble.
... with the shim the shim intercepts chrome process code that adds listeners to xul elements and sets up listeners in the content process, relaying the result back to the chrome process.
Security best practices for Firefox front-end engineers
we use our built-in sanitizer with the following flags: sanitizerallowstyle sanitizerallowcomments sanitizerdropforms sanitizerlogremovals the sanitizer removes all scripts (script tags, event handlers) and form elements (form, input, keygen, option, optgroup, select, button, datalist).
... the canonical truth for the list of whitelisted elements is the source code.
mozbrowsercontextmenu
contextmenu a menu object (see the menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id.
... 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.
overflow-clip-box
initial valuepadding-boxapplies toall elementsinheritednomediavisualcomputed valueas specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the formal grammar syntax values padding-box this keyword makes the clipping be related to the padding box.
...l <div class="things"> <input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box: padding-box; } js function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow m...
HTML parser threading
the tree builder snapshot contains a copy of the tree builder stack, a copy of the list of open formatting elements and copies of various fields that define the tree builder state.
...speculative loads when the tree builder on the parser thread encounters html script, stylesheet link, video (with a poster frame), base or img or svg script, style or image elements, preload operations are appended to a speculative load queue.
Getting from Content to Layout
changes to a document originate in the content tree (from dom modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/realityripple/uxp/blob/master/layout/base/nscssframeconstructor.cpp the frame constructor implements nsimutationobserver which allows it to "watch" the content tree.
... elements that need to be restyled are marked with flags (e.g element_has_pending_restyle) and are stored in the mpendingrestyles hashtable.
IME handling guide
if ime is available on focused elements, we call that state "enabled".
...and also, when the other elements get focus.
Introduction to Layout in Mozilla
d walk-through incrementalism future tech-talks wrap-up, q&a basic data flow source document arrives via network apis incrementally “pumped” through the single-threaded layout engine parse, compute style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations” style context non-geometric information may be shared by adjacent frames reference counted, owned by frame view clipping, z-order, transparency [0..1] per fr...
... content arrives from network via nsistreamlistener::ondataavailable parser tokenizes & processes content; invokes methods on nsicontentsink with parser node objects some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, contentremoved presshell is registered as document observer receives contentappended, etc.
JavaScript-DOM Prototypes in Mozilla
here are a few of the properties of obj's prototype: obj.__proto__ parentnode (getter function) src (getter and setter functions) getelementsbytagname (function) text_node (number property, constant) ...
...if you think back to the htmlimageelement examples above, those examples let you define new properties on all image elements.
CustomizableUI.jsm
'special' widgets: these are the representations of xul <toolbarseparator>, <toolbarspring> and <toolbarspacer> elements.
... note: unlike button described with xul overlay, widget-button created via createwidget() method cannot have references to other overlay elements transferred directly as parameters.
Mozilla Content Localized in Your Language
user interface elements titles should be brief and precise.
...user interface elements have limited space available for text.
Creating localizable web applications
printf( /* l10n: %s is a date */ _("<strong>added:</strong> %s"), $persona['date']);?></p> the first bad snippet puts the <strong/> html elements inside the gettext function call and concatenates the $persona['date'] variable to it.
... following the rule about wrapping as few html elements with the gettext function call as possible, you could try to put the <strong/> html tag outside of the php code (cf.
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier viewing.
... you can set the width ∑ x y height ∫ x y and depth [ x y ] of mspace elements (click the math text to view the numeric values that are set).
Investigating CSS Performance
for example, hasstatedependentstyle will compute a hint that determines how many elements we'll restyle.
... if we get a erestyle_subtree we will restyle more elements.
Power profiling overview
for example, it can be useful to gradually remove elements from a web page and see how the power-related measurements change.
... if the problem manifests on a particular website, try saving a local copy of the site and then manually removing html elements to see if a particular page feature is causing the problem many power problems are caused by either high cpu usage or high wakeup frequency.
Preferences system
the system is implemented through a few xul elements and attributes.
...ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay.
An overview of NSS Internals
multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules.
...such an operation might fail at runtime if data elements are still being referenced.
Index
multiple elements of nss's own modules have been implemented with this interface, and nss makes use of this interface when talking to those modules.
...such an operation might fail at runtime if data elements are still being referenced.
Index
395 js_newarrayobject jsapi reference, reference, référence(2), spidermonkey js_newarrayobject with contents parameter creates a new array object with the specified contents elements.
...length indicates the number of elements.
Garbage collection
an arena is one page (4096 bytes on almost all platforms) and contains an arenaheader, a few pad bytes, and then an array of aligned elements.
... all elements in an arena have the same allocation kind and size.
JS::AutoVectorRooter
bool appendall(const autovectorrooter<t> &other) appends all elements of other to the array.
... void clear() clears all elements.
JS_ConstructObject
otherwise, the first argc elements of this array must be populated with valid jsval values.
... the caller does not need to ensure that the array elements are rooted.
Web Replay
to prevent this from having an effect on iteration order (and execution behavior) in the table, the main table classes (for now plhashtable and pldhashtable) are instrumented so that they always iterate over elements in the order they were added when recording or replaying.
... media elements are not supported yet, as many of these run third party multithreaded code which hasn't been tested with the infrastructure.
Components.results
elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure...
... if(something_unexpected_happened) throw components.results.ns_error_unexpected; the elements of the components.results object can be enumerated using a for-in loop.
Components.utils.cloneInto
see cloning objects that contain dom elements below.
...from add-on"); } }; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow, {clonefunctions: true}); // page script var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.addonscriptobject.greetme(); }, false); cloning objects that contain dom elements by default, if the object you clone contains objects that are reflected from c++, such as dom elements, the cloning operation will fail with an error.
nsIContentSecurityPolicy
shouldload() delegate method called by the service when sub-elements of the protected document are being loaded.
...short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetypeguess aextra return value shouldprocess() delegate method called by the service when sub-elements of the protected document are being processed.
nsIContentView
note: currently, only <frame> and <iframe> elements are handled as content views.
... support for using this api for all scrollable elements is coming; see bug 618975 for details.
nsIControllers
content/xul/document/public/nsicontrollers.idlscriptable represents a list of nsicontroller elements.
...xul elements can also have controllers, although they do not have any default controllers.
nsIDOMHTMLSourceElement
the nsidomhtmlsourceelement interface is the dom interface to the source child of the audio and video media elements in html.
... last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements.
nsILoginManagerStorage
void getallencryptedlogins( out unsigned long count, optional [retval, array, size_is(count)] out nsilogininfo logins ); parameters count optional the number of elements in the array.
...void searchlogins( out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the logins array.
nsIWebBrowserPersist
output the content of noscript elements.
...output the content of noframes elements.
nsIWindowMediator
var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var enumerator = wm.getenumerator(type); while(enumerator.hasmoreelements()) { var win = enumerator.getnext(); // win is [object chromewindow] (just like window), do something with it } this code iterates over all windows of the specified type, where type you specify is the window type.
... note: in nsiwindowmediator's reference page the return type of getmostrecentwindow and the type of enumerator's elements is said to be nsidomwindow/nsidomwindowinternal.
Address Book examples
let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.interfaces.nsiabmanager); let alladdressbooks = abmanager.directories; while (alladdressbooks.hasmoreelements()) { let addressbook = alladdressbooks.getnext() .queryinterface(components.interfaces.nsiabdirectory); if (addressbook instanceof components.interfaces.nsiabdirectory) { // or nsiabitem or nsiabcollection // alert ("directory name:" + addressbook.dirname); ...
... assuming you wish to search across multiple directories: let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.interfaces.nsiabmanager); let alladdressbooks = abmanager.directories; while (alladdressbooks.hasmoreelements()) { let ab = alladdressbooks.getnext(); if (ab instanceof components.interfaces.nsiabdirectory && !ab.isremote) { let searchresult = abmanager.getdirectory(ab.uri + "?" + searchquery).childcards; // ...
Index
we add widgets by inserting new xul dom elements into the application window and modify them using scripts and attaching event handlers.
... while xul provides the elements of the user interface, actions are written in javascript.
Building a Thunderbird extension 3: install manifest
there are more optional elements that can be specified in install.rdf.
...note that elements can be specified in any order, as long as they are children of the <description> node.
Activity Manager examples
if activity developers would like to extend the default ui representation of the activity types, they can provide their own xbl elements for their own activity types.
... all custom activity xbl elements should inherit from "activity-base" binding.
Declaring types
you may declare your array either with a specific number of elements, or with no predetermined size.
... declaring an array type with a specific length declaring an array type that specifies the array length is as simple as adding a length when calling ctypes.arraytype(), like this: const filearray = new ctypes.arraytype(file, 20); this declares filearray as an array type that can hold 20 elements.
Working with data
using arrays of non-pointers if a function expects an argument that is a pointer to a list of elements, this is how it is accomplished: var myarraytype = ctypes.char.array(5); var myarray = myarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.array() /*same as ctypes.char.ptr*/); somecfunction(myarray); second example: var mystruct = ctypes.structtype('foo', [{bar: ctypes.bool}]); var mystructarraytype = mystruct.array(5); var myar...
...ray = mystructarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, mystruct.ptr); somecfunction(myarray); this shows how to pass a buffer containing 5 elements of mystruct, the elements in myarray are not pointers.
CType
methods available on all ctype objects array() returns a new ctype representing an array of elements of the type on which it was called.
... ctype array( [n] }; parameters n optional the number of elements in the declared array type.
Preferences System
the system is implemented through a few xul elements and attributes.
...ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay.
Aggregate view - Firefox Developer Tools
type this is the default view, which looks something like this: it groups the things on the heap into types, including: javascript objects: such as function or array dom elements: such as htmlspanelement or window strings: listed as "strings" javascript sources: listed as "jsscript" internal objects: such as "js::shape".
... so in the example above, we can see that we made 4002 allocations, accounting for 89% of the total heap, in createtoolbarbutton(), at alloc.js line 9, position 23: that is, the exact point where we create the <span> elements.
Migrating from Firebug - Firefox Developer Tools
search for elements via css selectors or xpaths firebug allows to search for elements within the html panel via css selectors or xpaths.
...it lists all elements matching the entered selector.
Edit fonts - Firefox Developer Tools
empty elements will not have any fonts used and will display the message "no fonts were found for the current element." fonts will be included in this section for one of the following reasons: they are listed in the element's font-family css declaration value.
... they are used by a descendant of the inspected element, for example, when it is a container for other elements which have text content with fonts applied.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
in the html pane in the html pane, elements laid out using a grid have a "grid" marker beside them.
... clicking the icon toggles the display of a grid overlay on the page, which appears over the element, laid out like a grid to show the position of its grid lines and tracks: the overlay is still shown when you select other elements, so you can edit related css properties and see how the grid is affected.
UI Tour - Firefox Developer Tools
it contains two elements: an overview of the waterfall and a frame rate graph.
... correlating events because these elements are synchronized, you can correlate events in one element with events in another.
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
in addition, it can execute multiple instances of the range of elements.
... primcount a glsizei specifying the number of instances of the range of elements to execute.
AudioContext - Web APIs
audiocontext.createmediaelementsource() creates a mediaelementaudiosourcenode associated with an htmlmediaelement.
... this can be used to play and manipulate audio from <video> or <audio> elements.
CSSPseudoElement - Web APIs
examples basic example using element.pseudo using pseudo-elements, most modern browsers will automatically add quotation marks around text inside a <q> element.
... const element = document.queryselector('q'); const csspseudoelement = element.pseudo('::before'); console.log(csspseudoelement.element); // outputs [object htmlquoteelement] console.log(csspseudoelement.type); // outputs '::before' specifications specification status comment css pseudo-elements level 4the definition of 'csspseudoelement' in that specification.
CSSStyleSheet - Web APIs
addrule() adds a new rule to the stylesheet given the selector to which the style applies and the style block to apply to the matching elements.
... stylesheets list getting the owner element/rule given the style sheet object the interface for the owner object getting the cssstylesheet object from the owner <style> and <link> elements in the document yes .ownernode htmllinkelement, htmlstyleelement, or svgstyleelement .sheet css @import rule in other style sheets applied to the document yes .ownerrule cssimportrule .stylesheet <?xml-stylesheet ?> processing instruction in the (non-html) document yes .ownernode processinginstruction .sheet http link header ...
Using dynamic styling information - Web APIs
however, there are cases where actually obtaining or manipulating the rules can be useful (whether for whole stylesheets or individual elements), and that is described in further detail below.
...unlike the individual rules available from the document.stylesheets collection, the style object is accessed from the document or from the elements to which that style is applied.
CanvasCaptureMediaStreamTrack.canvas - Web APIs
example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // do things to the stream ...
... // obtain the canvas associated with the stream var canvas = stream.canvas; specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastreamtrack.canvas' in that specification.
Manipulating video using canvas - Web APIs
div> <video id="video" src="media/video.mp4" controls="true" crossorigin="anonymous"/> </div> <div> <canvas id="c1" width="160" height="96"></canvas> <canvas id="c2" width="160" height="96"></canvas> </div> <script type="text/javascript" src="processor.js"></script> </body> </html> the key bits to take away from this are: this document establishes two canvas elements, with the ids c1 and c2.
...yid('c1'); this.ctx1 = this.c1.getcontext('2d'); this.c2 = document.getelementbyid('c2'); this.ctx2 = this.c2.getcontext('2d'); let self = this; this.video.addeventlistener('play', function() { self.width = self.video.videowidth / 2; self.height = self.video.videoheight / 2; self.timercallback(); }, false); }, this code grabs references to the elements in the xhtml document that are of particular interest, namely the video element and the two canvas elements.
Basic animations - Web APIs
« previousnext » since we're using javascript to control <canvas> elements, it's also very easy to make (interactive) animations.
...} function anima() { c.fillstyle = "rgba(0,0,0,0.11)", c.fillrect(0, 0, cc.width, cc.height), fa.foreach(t => t.put()), s.draw(), document.getelementbyid("time").innertext = tmz(), settimeout(() => { requestanimationframe(anima) }, fw) } function emit(t) { key.keydown(t) } function touch(t) { t.classlist.toggle("off"), document.getelementsbyclassname("keypress")[0].classlist.toggle("hide") } var t = new date + "", d = void 0, cc = document.getelementsbytagname("canvas")[0], c = cc.getcontext("2d"); key = {}, key.keydown = function (t) { var e = document.createevent("keyboardevent"); object.defineproperty(e, "keycode", { get: function () { return this.ke...
Hit regions and accessibility - Web APIs
it allows you to make hit detection easier and lets you route events to dom elements.
...i, false); ctx.fill(); ctx.addhitregion({id: 'circle'}); canvas.addeventlistener('mousemove', function(event) { if (event.region) { alert('hit region: ' + event.region); } }); </script> the addhitregion() method also takes a control option to route events to an element (that is a descendant of the canvas): ctx.addhitregion({control: element}); this can be useful for routing to <input> elements, for example.
CharacterData - Web APIs
nondocumenttypechildnode.nextelementsibling read only returns the element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list.
... nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list.
console.log() - Web APIs
WebAPIConsolelog
another useful difference in chrome exists when sending dom elements to the console.
... notice: console.log prints the element in an html-like tree console.dir prints the element in a json-like tree specifically, console.log gives special treatment to dom elements, whereas console.dir does not.
Console.table() - Web APIs
WebAPIConsoletable
// an array of strings console.table(["apples", "oranges", "bananas"]); // an object whose properties are strings function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var me = new person("john", "smith"); console.table(me); collections of compound types if the elements in the array, or properties in the object, are themselves arrays or objects, then their elements or properties are enumerated in the row, one per column: // an array of arrays var people = [["john", "smith"], ["jane", "doe"], ["emily", "jones"]] console.table(people); // an array of objects function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } v...
... // 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.
Constraint validation API - Web APIs
extensions to other interfaces the constraint validation api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation errors ...
...elements with the htmlobjectelement interface are never candidates for constraint validation.
CustomElementRegistry.get() - Web APIs
syntax constructor = customelements.get(name); parameters name the name of the custom element whose constructor you want to return a reference to.
... examples customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } }) // return a reference to the my-paragraph constructor let ctor = customelements.get('my-paragraph'); specifications specification status comment html living standardthe definition of 'customelements.get()' in that specification.
Document.createNSResolver() - Web APIs
note, xpath defines qnames without prefix to match only elements in the null namespace.
...to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] (this approach works well for dynamic xpath expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
null is the most common and will create a new xpathresult example var headings = document.evaluate("/html/body//h2", document, null, xpathresult.any_type, null); /* search the document for all h2 elements.
...*/ var thisheading = headings.iteratenext(); var alerttext = "level 2 headings in this document are:\n"; while (thisheading) { alerttext += thisheading.textcontent + "\n"; thisheading = headings.iteratenext(); } alert(alerttext); // alerts the text of all h2 elements note, in the above example, a more verbose xpath is preferred over common shortcuts such as //h2.
Document.fullscreenEnabled - Web APIs
full-screen mode is available only for a page that has no windowed plug-ins in any of its documents, and if all <iframe> elements which contain the document have their allowfullscreen attribute set.
... syntax var isfullscreenavailable = document.fullscreenenabled; value a boolean value which is true if the document and the elements within can be placed into full-screen mode by calling element.requestfullscreen().
Document.getAnimations() - Web APIs
the getanimations() method of the document interface returns an array of all animation objects currently in effect whose target elements are descendants of the document.
... return value an array of animation objects, each representing one animation currently associated with elements which are descendants of the document on which it's called.
Document.registerElement() - Web APIs
warning: document.registerelement() is deprecated in favor of customelements.define().
...here is one way to add content to the new tag: var mytag = document.getelementsbytagname("my-tag")[0]; mytag.textcontent = "i am a my-tag element."; ...
DocumentFragment.querySelectorAll() - Web APIs
the documentfragment.queryselectorall() method returns a nodelist of elements within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors.
... examples this example returns a list of all div elements within the documentfragment with a class of either "note" or "alert": var matches = documentfrag.queryselectorall("div.note, div.alert"); specifications specification status comment selectors api level 1the definition of 'documentfragment.queryselectorall' in that specification.
Example - Web APIs
<html> <head> <title>my document</title> <script type="text/javascript"> function change() { // document.getelementsbytagname("h1") returns a nodelist of the h1 // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h1").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document".
... var para = document.getelementsbytagname("p").item(0); para.firstchild.data = "this is the first paragraph."; // create a new text node for the second paragraph var newtext = document.createtextnode("this is the second paragraph."); // create a new element to be the second paragraph var newelement = document.createelement("p"); // put the text in the paragraph newelement.appendchild(newtext); // and put the paragraph on the end of the document by appending it to // the body (which is the parent of para) para.parentnode.appendchild(newelement); } </script> </head> <body> <input type="button" value="change this document." onclick="change()"> <h1>header</h1> <p>paragraph</p> </body> </head> ...
Using the W3C DOM Level 1 Core - Web APIs
the following script would do the job: html content <body> <input type="button" value="change this document." onclick="change()"> <h2>header</h2> <p>paragraph</p> </body> javascript content function change() { // document.getelementsbytagname("h2") returns a nodelist of the <h2> // elements in the document, and the first is number 0: var header = document.getelementsbytagname("h2").item(0); // the firstchild of the header is a text node: header.firstchild.data = "a dynamic document"; // now the header is "a dynamic document".
... var para = document.getelementsbytagname("p").item(0); para.firstchild.data = "this is the first paragraph."; // create a new text node for the second paragraph var newtext = document.createtextnode("this is the second paragraph."); // create a new element to be the second paragraph var newelement = document.createelement("p"); // put the text in the paragraph newelement.appendchild(newtext); // and put the paragraph on the end of the document by appending it to // the body (which is the parent of para) para.parentnode.appendchild(newelement); } you can see this script as a complete example.
Document Object Model (DOM) - Web APIs
in particular, the element interface is enhanced to become htmlelement and various subclasses, each representing one of (or a family of closely related) elements.
...svganimatedstring svganimatedtransformlist smil-related interfaces elementtimecontrol timeevent other svg interfaces getsvgdocument shadowanimation svgcolorprofilerule svgcssrule svgdocument svgexception svgexternalresourcesrequired svgfittoviewbox svglangspace svglocatable svgrenderingintent svgstylable svgtests svgtransformable svgunittypes svguseelementshadowroot svgurireference svgviewspec svgzoomandpan svgzoomevent specifications specification status comment dom living standard ...
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
zoomed elements can expose their zoom level through mscontentzoom (ie.
... this method has no scrolling effect on non-scrollable elements and no zooming effect on non-zoomable elements (e.g., elements with "-ms-content-zooming: none").
Element: select event - Web APIs
bubbles yes cancelable no interface uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages.
... for example, in html, select events can be dispatched only on form <input type="text"> and <textarea> elements.
Event.currentTarget - Web APIs
syntax var currenteventtarget = event.currenttarget; value eventtarget examples event.currenttarget is interesting to use when attaching the same event handler to several elements.
... function hide(e){ e.currenttarget.style.visibility = 'hidden'; console.log(e.currenttarget); // when this function is used as an event handler: this === e.currenttarget } var ps = document.getelementsbytagname('p'); for(var i = 0; i < ps.length; i++){ // console: print the clicked <p> element ps[i].addeventlistener('click', hide, false); } // console: print <body> document.body.addeventlistener('click', hide, false); // click around and make paragraphs disappear note: the value of event.currenttarget is only available while the event is being handled.
Event.eventPhase - Web APIs
WebAPIEventeventPhase
this process starts with the window, then document, then the htmlhtmlelement, and so on through the elements until the target's parent is reached.
... </div> </div> <div id="divinfo"></div> css div { margin: 20px; padding: 4px; border: thin black solid; } #divinfo { margin: 18px; padding: 8px; background-color:white; font-size:80%; } javascript let clear = false, divinfo = null, divs = null, usecapture = false; window.onload = function () { divinfo = document.getelementbyid('divinfo') divs = document.getelementsbytagname('div') chcapture = document.getelementbyid('chcapture') chcapture.onclick = function () { removelisteners() addlisteners() } clear() addlisteners() } function removelisteners() { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "divinfo") { d.removeeventlistener("click", ondivclick, true) d.removeeventlistener("click", ondivclic...
Using the Gamepad API - Web APIs
removegamepad(gamepad) { var d = document.getelementbyid("controller" + gamepad.index); document.body.removechild(d); delete controllers[gamepad.index]; } function updatestatus() { if (!haveevents) { scangamepads(); } var i = 0; var j; for (j in controllers) { var controller = controllers[j]; var d = document.getelementbyid("controller" + j); var buttons = d.getelementsbyclassname("button"); for (i = 0; i < controller.buttons.length; i++) { var b = buttons[i]; var val = controller.buttons[i]; var pressed = val == 1.0; if (typeof(val) == "object") { pressed = val.pressed; val = val.value; } var pct = math.round(val * 100) + "%"; b.style.backgroundsize = pct + " " + pct; if (pressed) { ...
...b.classname = "button pressed"; } else { b.classname = "button"; } } var axes = d.getelementsbyclassname("axis"); for (i = 0; i < controller.axes.length; i++) { var a = axes[i]; a.innerhtml = i + ": " + controller.axes[i].tofixed(4); a.setattribute("value", controller.axes[i] + 1); } } requestanimationframe(updatestatus); } function scangamepads() { var gamepads = navigator.getgamepads ?
GeolocationCoordinates.longitude - Web APIs
ementbyid("longitude"); button.addeventlistener("click", function() { navigator.geolocation.getcurrentposition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element.
...the two <span> elements are updated to display the corresponding values after being converted to a value with two decimal places.
GlobalEventHandlers.oninput - Web APIs
the oninput property of the globaleventhandlers mixin is an eventhandler that processes input events on the <input>, <select>, and <textarea> elements.
... it also handles these events on elements where contenteditable or designmode are turned on.
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.
HTMLCanvasElement - Web APIs
the htmlcanvaselement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements.
... media capture from dom elementsthe definition of 'htmlcanvaselement' in that specification.
HTMLCollection - Web APIs
the htmlcollection interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.
... note: this interface is called htmlcollection for historical reasons (before the modern dom, collections implementing this interface could only have html elements as their items).
HTMLDataListElement - Web APIs
the htmldatalistelement interface provides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content.
...px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldatalistelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement htmldatalistelement.options read only is a htmlcollection representing a collection of the contained option elements.
HTMLElement: beforeinput event - Web APIs
the event also applies to elements with contenteditable enabled, and to any element when designmode is turned on.
...if these properties apply to multiple elements, the editing host is the nearest ancestor element whose parent isn't editable.
HTMLElement: change event - Web APIs
the change event is fired for <input>, <select>, and <textarea> elements when an alteration to the element's value is committed by the user.
...grid; grid-template-areas: "select result"; } select { grid-area: select; } .result { grid-area: result; } javascript const selectelement = document.queryselector('.ice-cream'); selectelement.addeventlistener('change', (event) => { const result = document.queryselector('.result'); result.textcontent = `you like ${event.target.value}`; }); result text input element for some elements, including <input type="text">, the change event doesn't fire until the control loses focus.
HTMLElement.click() - Web APIs
WebAPIHTMLElementclick
when click() is used with supported elements (such as an <input>), it fires the element's click event.
... this event then bubbles up to elements higher in the document tree (or event chain) and fires their click events.
HTMLElement.offsetLeft - Web APIs
for block-level elements, offsettop, offsetleft, offsetwidth, and offsetheight describe the border box of an element relative to the offsetparent.
... however, for inline-level elements (such as span) that can wrap from one line to the next, offsettop and offsetleft describe the positions of the first border box (use element.getclientrects() to get its width and height), while offsetwidth and offsetheight describe the dimensions of the bounding border box (use element.getboundingclientrect() to get its position).
HTMLElement - Web APIs
some elements directly implement this interface, while others implement it via an interface that inherits it.
...it is present on all html elements, though it doesn't have an effect on all of them.
HTMLFormControlsCollection - Web APIs
the htmlformcontrolscollection interface represents a collection of html form control elements.
... it represents the lists returned by the htmlformelement interface's elements property and the htmlfieldsetelement interface's elements property.
HTMLImageElement.loading - Web APIs
preventing element shift during image lazy loads when an image whose loading has been delayed by the loading attribute being set to lazy is finally loaded, the browser will determine the final size of the <img> element based on the style and intrinsic size of the image, then reflow the document as needed to update the positions of elements based on any size change made to the element to fit the image.
...by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows.
HTMLInputElement: invalid event - Web APIs
the validity of submittable elements is checked before submitting their owner <form>, or after the checkvalidity() method of the element or its owner <form> is called.
... 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.
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.
HTMLKeygenElement - Web APIs
the <keygen> elements expose the htmlkeygenelement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements.
... labels read only unimplemented (see bug 556743) is a nodelist that represents a list of label elements associated with this keygen element.
HTMLMapElement - Web APIs
the htmlmapelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements.
... htmlmapelement.areas read only is a live htmlcollection representing the <area> elements associated to this <map>.
HTMLMediaElement.mediaGroup - Web APIs
the htmlmediaelement.mediagroup property reflects the mediagroup html attribute, which indicates the name of the group of elements it belongs to.
... a group of media elements shares a common controller.
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.
HTMLMeterElement - Web APIs
the html <meter> elements expose the htmlmeterelement interface, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements.
... htmlmeterelement.labelsread only a nodelist of <label> elements that are associated with the element.
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.
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.
HTMLProgressElement - Web APIs
the htmlprogresselement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements.
... htmlprogresselement.labelsread only returns nodelist containing the list of <label> elements that are labels for this element.
HTMLSelectElement.add() - Web APIs
the htmlselectelement.add() method adds an element to the collection of option elements for this select element.
... examples creating elements from scratch var sel = document.createelement("select"); var opt1 = document.createelement("option"); var opt2 = document.createelement("option"); opt1.value = "1"; opt1.text = "option: value 1"; opt2.value = "2"; opt2.text = "option: value 2"; sel.add(opt1, null); sel.add(opt2, null); /* produces the following, conceptually: <select> <option value="1">option: value 1</option> <...
HTMLSelectElement.form - Web APIs
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.
...the below code gives all select elements in a particular form a css class of "selectclass": <script type="text/javascript"> var form_element = document.getelementbyid('subscribe_form'); var vist = form_element.style; if (vist.display=='' || vist.display=='none') { vist.display = 'block'; } else { vist.display = 'none'; } </script> specifications specification status comment html living standardthe definition of 'form' in that specification.
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.
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.
HTMLSlotElement - Web APIs
htmlslotelement.assignedelements() returns a sequence of the elements assigned to this slot (and no other nodes).
... if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
HTMLSourceElement - Web APIs
the htmlsourceelement interface provides special properties (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating <source> elements.
... note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically.
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
... htmltablecellelement.headers read only is a domsettabletokenlist describing a list of id of <th> elements that represents headers associated with the cell.
HTMLTableElement.rows - Web APIs
the read-only htmltableelement property rows returns a live htmlcollection of all the rows in the table, including the rows contained within any <thead>, <tfoot>, and <tbody> elements.
... syntax htmlcollectionobject = table.rows; value an htmlcollection providing a live-updating list of the htmltablerowelement objects representing all of the <tr> elements contained in the table.
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.
HTMLTextAreaElement - Web APIs
the htmltextareaelement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements.
... htmltextareaelement.labelsread only nodelist: returns a list of label elements associated with this element.
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
for msislayoutoptimalforplayback to be true, avoid the following: video elements with cascading style sheets (css) outlines set.
... embedding video elements in a scalable vector graphics (svg).
LayoutShift - Web APIs
the layoutshift interface of the layout instability api provides insights into the stability of web pages based on movements of the elements on the page.
... layoutshift.sources returns an array of layoutshiftattribution objects with information on the elements that were shifted.
Media Source API - Web APIs
using mse, media streams can be created via javascript, and played using <audio> and <video> elements.
...mse allows us to replace the usual single track src value fed to media elements with a reference to a mediasource object, which is a container for information like the ready state of the media for being played, and references to multiple sourcebuffer objects that represent the different chunks of media that make up the entire stream.
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
updatedisplay() simply replaces the contents of the <span> elements meant to contain the x and y coordinates with the values of pagex and pagey.
...it has two <span> elements, one with the id "x" and one with the id "y".
MutationObserver.MutationObserver() - Web APIs
example this example simply creates a new mutationobserver configured to watch a node and all of its children for additions and removals of elements to the tree, as well as any changes to attributes on any of the elements in the tree.
... from this point until disconnect() is called, callback() will be called each time an element is added to or removed from the dom tree rooted at targetnode, or any of those elements' attributes are changed.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
two nodes are equal when they have the same type, defining characteristics (for elements, this would be their id, number of children, and so forth), its attributes match, and so on.
... html <div>this is the first element.</div> <div>this is the second element.</div> <div>this is the first element.</div> <p id="output"></p> css #output { width: 440px; border: 2px solid black; border-radius: 5px; padding: 10px; margin-top: 20px; display: block; } javascript let output = document.getelementbyid("output"); let divlist = document.getelementsbytagname("div"); output.innerhtml += "div 0 equals div 0: " + divlist[0].isequalnode(divlist[0]) + "<br/>"; output.innerhtml += "div 0 equals div 1: " + divlist[0].isequalnode(divlist[1]) + "<br/>"; output.innerhtml += "div 0 equals div 2: " + divlist[0].isequalnode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of 'n...
OVR_multiview2 - Web APIs
methods framebuffertexturemultiviewovr() simultaneously renders to multiple elements of a 2d texture array.
...2, 2); ext.framebuffertexturemultiviewovr(gl.draw_framebuffer, gl.color_attachment0, colortex, 0, 0, 2); const depthstenciltex = gl.createtexture(); gl.bindtexture(gl.texture_2d_array, depthstenciltex); gl.texstorage3d(gl.texture_2d_array, 1, gl.depth32f_stencil8, 512, 512, 2); ext.framebuffertexturemultiviewovr(gl.draw_framebuffer, gl.depth_stencil_attachment, depthstenciltex, 0, 0, 2); gl.drawelements(...); // draw will be broadcasted to the layers of colortex and depthstenciltex.
ParentNode.children - Web APIs
the parentnode property children is a read-only property that returns a live htmlcollection which contains all of the child elements of the node upon which it was called.
... syntax let children = node.children; value an htmlcollection which is a live, ordered collection of the dom elements which are children of node.
ParentNode.querySelector() - Web APIs
if you need all the elements matching the selector list, use queryselectorall() instead.
...see locating dom elements using selectors for more information about using selectors to identify elements.
Payment Request API - Web APIs
accessibility: as the browser controls the input elements of the payment sheet, it can assure consistent keyboard and screen reader accessibility on every website without developers needing to do anything.
... note: the api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them.
Multi-touch interaction - Web APIs
function pointerup_handler(ev) { if (logevents) log(ev.type, ev); // remove this touch point from the cache and reset the target's // background and border remove_event(ev); update_background(ev); ev.target.style.border = "1px solid black"; } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and to clear the log.
...false : true; } function log(name, ev) { var o = document.getelementsbytagname('output')[0]; var s = name + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('output')[0]; o.innerhtml = ""; } ...
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
excludecredentials, an optional property of the publickeycredentialcreationoptions dictionary, is an array whose elements are descriptors for the public keys already existing for a given user.
... syntax excludecredentials = publickeycredentialcreationoptions.excludecredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
RTCDataChannel.onmessage - Web APIs
example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it.
... the new elements are then attached to the end of the document.
Range.getBoundingClientRect() - Web APIs
the range.getboundingclientrect() method returns a domrect object that bounds the contents of the range; this is a rectangle enclosing the union of the bounding rectangles for all the elements in the range.
...the bounding client rectangle contains everything selected in the range.</p> css #highlight { background: yellow; position: absolute; z-index: -1; } p { width: 200px; } javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); const clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${clientrect.height}px`; result s...
Range.getClientRects() - Web APIs
this is created by aggregating the results of calls to element.getclientrects() for all the elements in the range.
... syntax rectlist = range.getclientrects() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); rectlist = range.getclientrects(); specification specification status comment css object model (cssom) view modulethe definition of 'range.getclientrects()' in that specification.
SVGGraphicsElement: copy event - Web APIs
the copy event fires on svggraphicselements when the user initiates a copy action through the browser's user interface.
...tp://www.w3.org/2000/svg"> <text x="5" y="10" id="text-to-copy">copy this text</text> <foreignobject x="5" y="20" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
SVGPolygonElement - Web APIs
the svgpolygonelement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them.
... candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpolygonelement' in that specification.
SVGPolylineElement - Web APIs
the svgpolylineelement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them.
... candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpolylineelement' in that specification.
SVGRectElement - Web APIs
the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them.
... candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgrectelement' in that specification.
SVGUseElement - Web APIs
svguseelement.instanceroot read only an svgelement corresponding to the instance root of the given element, which is a direct child of the elements shadow root.
... svguseelement.animatedinstanceroot read only an svgelement corresponding to the instance root of the given element, which is a direct child of the elements shadow root.
Using the Screen Capture API - Web APIs
setup first, some constants are set up to reference the elements on the page to which we'll need access: the <video> into which the captured screen contents will be streamed, a box into which logged output will be drawn, and the start and stop buttons that will turn on and off capture of screen imagery.
... for example, this line in the http headers will enable screen capture api for the document and any embedded <iframe> elements that are loaded from the same origin: feature-policy: display-capture 'self' if you're performing screen capture within an <iframe>, you can request permission just for that frame, which is clearly more secure than requesting a more general permission: <iframe src="https://mycode.example.net/etc" allow="display-capture"> </iframe> ...
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
in addition, it can execute multiple instances of the range of elements.
... instancecount a glsizei specifying the number of instances of the range of elements to execute.
WebGLRenderingContext.getUniform() - Web APIs
return value the returned type depends on the uniform type: uniform type returned type webgl 1 only boolean glboolean int glint float glfloat vec2 float32array (with 2 elements) ivec2 int32array (with 2 elements) bvec2 array of glboolean (with 2 elements) vec3 float32array (with 3 elements) ivec3 int32array (with 3 elements) bvec3 array of glboolean (with 3 elements) vec4 float32array (with 4 elements) ivec4 int32array (with 4 elements) bvec4 array of glboolean (with 4 elemen...
...ts) mat2 float32array (with 4 elements) mat3 float32array (with 9 elements) mat4 float32array (with 16 elements) sampler2d glint samplercube glint additionally available in webgl 2 uint gluint uvec2 uint32array (with 2 elements) uvec3 uint32array (with 3 elements) uvec4 uint32array (with 4 elements) mat2x3 float32array (with 6 elements) mat2x4 float32array (with 8 elements) mat3x2 float32array (with 6 elements) mat3x4 float32array (with 12 elements) mat4x2 float32array (with 8 elements) mat4x3 float32array (with 12 elements) any sampler type glint examples var loc = gl.getuniformlocation(prog...
Using textures in WebGL - Web APIs
note: cors support for webgl textures and the crossorigin attribute for image elements is implemented in gecko 8.0.
... note: cors support for cross-domain videos and the crossorigin attribute for <video> elements is implemented in gecko 12.0.
WebGL best practices - Web APIs
if you have 1000 sprites to paint, try to do it as a single drawarrays() or drawelements() call.
... teximage/texsubimage uploads (particularly with videos) can cause pipeline flushes most texture uploads from dom elements will incur a processing pass that will temporarily switch gl progams internally, causing a pipeline flush.
Movement, orientation, and motion: A WebXR example - Web APIs
the last four variables declared are storage for references to the <div> elements into which we'll output the matrices when we want to show them to the user.
...ons.modelviewmatrix, false, modelviewmatrix); gl.uniformmatrix4fv( programinfo.uniformlocations.normalmatrix, false, normalmatrix); gl.activetexture(gl.texture0); gl.bindtexture(gl.texture_2d, texture); gl.uniform1i(programinfo.uniformlocations.usampler, 0); { const vertexcount = 36; const type = gl.unsigned_short; const offset = 0; gl.drawelements(gl.triangles, vertexcount, type, offset); } } renderscene() begins by calculating how much rotation should occur around each of the three axes in the amount of time that has elapsed since the previous frame was rendered.
Using the Web Animations API - Web APIs
we no longer need to rely on dom-heavy techniques such as writing css properties and scoping classes onto elements to control playback direction.
...queen_alice.updateplaybackrate(redqueen_alice.playbackrate * .9); } }, 3000); but urging them on by clicking or tapping causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * 1.1); } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); the background elements also have playbackrates that are impacted when you click or tap.
Using the Web Speech API - Web APIs
setting variables first of all, we capture references to all the dom elements involved in the ui, but more interestingly, we capture a reference to window.speechsynthesis.
... finally, we set the speechsynthesisutterance.pitch and speechsynthesisutterance.rate to the values of the relevant range form elements.
Using Web Workers - Web APIs
when you want to send a message to the worker, you post messages to it like this (main.js): first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } so here we have two <input> elements represented by the variables first and second; when the value of either is changed, myworker.postmessage([first.value,second.value]) is used to send the value inside both to the worker, as an array.
... embedded workers there is not an "official" way to embed the code of a worker within a web page, like <script> elements do for normal scripts.
Window.getDefaultComputedStyle() - Web APIs
must be null (or not specified) for regular elements.
...er { position: absolute; left: 100px; top: 200px; height: 100px; } </style> <div id="elem-container">dummy</div> <div id="output"></div> <script> var elem = document.getelementbyid("elem-container"); var thecssprop = window.getdefaultcomputedstyle(elem).position; document.getelementbyid("output").innerhtml = thecssprop; // will output "static" </script> use with pseudo-elements the getdefaultcomputedstyle() method can pull style info from pseudo-elements (e.g., ::before or ::after).
Window - Web APIs
WebAPIWindow
for overriding the prototype of built-in elements) are listed in a separate section below.
... window.customelements read only returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart; spart = ""; for (nidx; nidx < asheets.length; scroll(ashe...
...ets[nidx++], 0, false)); clean(); }; } /* usage: */ var otwexample1 = new typewriter(/* elements: */ '#article, h1, #info, #copyleft', /* frame rate (optional): */ 15); /* default frame rate is 100: */ var otwexample2 = new typewriter('#controls'); /* you can also change the frame rate value modifying the "rate" property; for example: */ // otwexample2.rate = 150; onload = function () { otwexample1.play(); otwexample2.play(); }; </script> <style type="text/css"> span.intlink, a, a:visited { cursor: pointer; color: #000000; text-decoration: underline; } #info { width: 180px; height: 150px; float: right; background-color: #eeeeff; padding: 4px; overflow: auto; font-size: 12px; margin: 4px; border-radius: 5px; /* visibility: hidden; */ } </style> </head> <bod...
Using XMLHttpRequest - Web APIs
plainescape : escape; for (var nitem = 0; nitem < otarget.elements.length; nitem++) { ofield = otarget.elements[nitem]; if (!ofield.hasattribute("name")) { continue; } sfieldtype = ofield.nodename.touppercase() === "input" ?
...nsetext); } function ajaxsubmit (oformelement) { if (!oformelement.action) { return; } var oreq = new xmlhttprequest(); oreq.onload = ajaxsuccess; if (oformelement.method.tolowercase() === "post") { oreq.open("post", oformelement.action); oreq.send(new formdata(oformelement)); } else { var ofield, sfieldtype, nfile, ssearch = ""; for (var nitem = 0; nitem < oformelement.elements.length; nitem++) { ofield = oformelement.elements[nitem]; if (!ofield.hasattribute("name")) { continue; } sfieldtype = ofield.nodename.touppercase() === "input" ?
Introduction - Web APIs
xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees.
...this allows xslt to add, remove and reorganize elements from the original xml document and thus allows more fine-grain control of the resulting document's structure.
Using the aria-invalid attribute - Accessibility
this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
... used in aria roles all elements of the base markup related aria techniques using the aria-required attribute using the alert role compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the aria-invalid property wai authoring practices for forms ...
Using the aria-label attribute - Accessibility
this attribute can be used with any typical html element; it is not limited to elements that have an aria role assigned.
... 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-label ...
Using the aria-valuenow attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology for elements with role progressbar and scrollbar, assistive technologies should render the actual value as a percentage, calculated as a position on the range from aria-valuemin to aria-valuemax if both are defined, otherwise the actual value with a percent indicator.
... for elements with role slider and spinbutton, assistive technologies should render the actual value to users.
Using the group role - Accessibility
however, when a group is used in the context of list, authors must limit its children to listitem elements.
... group elements may be nested.
Using the link role - Accessibility
note: where possible, it is recommended that you use a native <a> element rather than the link role, as native elements are more widely supported by older user agents and assistive technology.
... native <a> elements also support keyboard and focus requirements by default, without need for additional customization.
ARIA: timer role - Accessibility
aria-live elements with the role timer have an implicit aria-live value of off.
... recommendation precedence order applying the timer role will cause this and all of the descendant elements of this element to be treated like xxx ...
ARIA: document role - Accessibility
because ats with reading mode default to that mode for all elements except for those with a widget or application role set, document role is only useful for focusable elements within a widget or application that should be read as static rich text.
... in contrast to the article role, the document role does not have any relation to other elements with a document role, it merely has a relationship to the containing composit widget.
ARIA: form role - Accessibility
the form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form.
...it should be declared on the html element that wraps the form elements.
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.
...="wine-2">pinot blanc</label> </li> <li> <input id="wine-3" type="checkbox" value="pinot-grigio"/> <label for="wine-3">pinot grigio</label> </li> <li> <input id="wine-4" type="checkbox" value="gewurztraminer"/> <label for="wine-4">gewürztraminer</label> </li> </ul> </form> labeling with aria the html <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic javascript widget, using <div>s or <span>s.
Mobile accessibility checklist - Accessibility
focus all activatable elements must be focusable: standard controls such as links, buttons, and form fields are focusable by default.
... all form controls must have labels (<label> elements) for the benefit of screen reader users.
-moz-user-focus - CSS: Cascading Style Sheets
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete note: this property doesn't work for xul <xul:textbox> elements, because the textbox itself never takes focus.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | select-same | select-all | none examples html <input class="ignored" value="the user cannot focus on this element."> css .ignored { -moz-user-focus: ignore; } specifications not part of any standard.
-moz-user-input - CSS: Cascading Style Sheets
/* keyword values */ -moz-user-input: none; -moz-user-input: enabled; -moz-user-input: disabled; /* global values */ -moz-user-input: inherit; -moz-user-input: initial; -moz-user-input: unset; for elements that normally take user input, such as a <textarea>, the initial value of -moz-user-input is enabled.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | enabled | disabled examples disabling user input for an element input.example { /* the user will be able to select the text, but not change it.
-webkit-line-clamp - CSS: Cascading Style Sheets
when applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines.
-webkit-mask-position-x - CSS: Cascading Style Sheets
; /* <percentage> values */ -webkit-mask-position-x: 100%; -webkit-mask-position-x: -50%; /* <length> values */ -webkit-mask-position-x: 50px; -webkit-mask-position-x: -1cm; /* multiple values values */ -webkit-mask-position-x: 50px, 25%, -3em; /* global values */ -webkit-mask-position-x: inherit; -webkit-mask-position-x: initial; -webkit-mask-position-x: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the left edge of the image relative to the box's left padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | left | center | right ]#where <length-percentage> = <length> | <percentage> examples horizontally positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: right; ...
-webkit-mask-position-y - CSS: Cascading Style Sheets
; /* <percentage> values */ -webkit-mask-position-y: 100%; -webkit-mask-position-y: -50%; /* <length> values */ -webkit-mask-position-y: 50px; -webkit-mask-position-y: -1cm; /* multiple values values */ -webkit-mask-position-y: 50px, 25%, -3em; /* global values */ -webkit-mask-position-y: inherit; -webkit-mask-position-y: initial; -webkit-mask-position-y: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the top side of the image relative to the box's top padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | top | center | bottom ]#where <length-percentage> = <length> | <percentage> examples vertically positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: bottom; }...
:-moz-only-whitespace - CSS: Cascading Style Sheets
the :-moz-only-whitespace css pseudo-class matches elements that only contains text nodes that only contain whitespace.
... (this includes elements with empty text nodes and elements with no child nodes.) syntax syntax not found in db!
:-moz-suppressed - CSS: Cascading Style Sheets
the :-moz-suppressed css pseudo-class is a mozilla extension that matches elements representing images that were suppressed because loading images from the specified site has been blocked.
... syntax :-moz-suppressed examples styling elements that have been blocked :-moz-suppressed { background: yellow; padding: 8px; } specifications not part of any standard.
:-moz-user-disabled - CSS: Cascading Style Sheets
the :-moz-user-disabled css pseudo-class is a mozilla extension that matches elements representing images that were not loaded because images have been entirely disabled by the user's preferences.
... syntax :-moz-user-disabled examples styling user-disabled elements :-moz-user-disabled { background-color: lightgray; padding: 8px; } specifications not part of any standard.
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
the ::-webkit-outer-spin-button css pseudo-element is used to style the outer part of the spinner button of number picker <input> elements.
... hiding the spinner this example uses input::-webkit-outer-spin-button to find <input> elements' spinner widgets and set their -webkit-appearance to none, thus hiding them.
::-webkit-scrollbar - CSS: Cascading Style Sheets
css scrollbar selectors you can use the following pseudo elements to customize various parts of the scrollbar for webkit browsers: ::-webkit-scrollbar — the entire scrollbar.
... ::-webkit-resizer — the draggable resizing handle that appears at the bottom corner of some elements.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
...p>*the beginning of a special punctuation mark.</p> <p>#the beginning of a special punctuation mark.</p> <p>「特殊的汉字标点符号开头。</p> <p>《特殊的汉字标点符号开头。</p> <p>“特殊的汉字标点符号开头。</p> css p::first-letter { color: red; font-size: 150%; } result specifications specification status comment css pseudo-elements level 4the definition of '::first-letter' in that specification.
::first-line (:first-line) - CSS: Cascading Style Sheets
/* selects the first line of a <p> */ p::first-line { color: red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
...see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue; text-transform: uppercase; /* warning: do not use these */ /* many properties are invalid in ::first-line pseudo-elements */ margin-left: 20px; text-indent: 20px; } result specifications specification status comment css pseudo-elements level 4the definition of '::first-line' in that specification.
::marker - CSS: Cascading Style Sheets
WebCSS::marker
it works on any element or pseudo-element set to display: list-item, such as the <li> and <summary> elements.
... syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status comment css pseudo-elements level 4the definition of '::marker' in that specification.
::placeholder - CSS: Cascading Style Sheets
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.
...ul — nielsen norman group examples red text html <input placeholder="type something here!"> css input::placeholder { color: red; font-size: 1.2em; font-style: italic; } result green text html <input placeholder="type something here..."> css input::placeholder { color: green; } result specifications specification status comment css pseudo-elements level 4the definition of '::placeholder' in that specification.
:default - CSS: Cascading Style Sheets
WebCSS:default
the :default css pseudo-class selects form elements that are the default in a group of related elements.
... what this selector matches is defined in html standard §4.16.3 pseudo-classes — it may match the <button>, <input type="checkbox">, <input type="radio">, and <option> elements: a default option element is the first one with the selected attribute, or the first enabled option in dom order.
:first-child - CSS: Cascading Style Sheets
the :first-child css pseudo-class represents the first element among a group of sibling elements.
... working draft matching elements are not required to have a parent.
:focus-visible - CSS: Cascading Style Sheets
note the difference in behavior from elements styled with :focus.
...for users with cognitive concerns, or who are less technologically literate, this lack of consistent behavior for interactive elements may be confusing.
:fullscreen - CSS: Cascading Style Sheets
if multiple elements have been put into full-screen mode, this selects them all.
... syntax :fullscreen usage notes the :fullscreen pseudo-class lets you configure your stylesheets to automatically adjust the size, style, or layout of content when elements switch back and forth between full-screen and traditional presentations.
:in-range - CSS: Cascading Style Sheets
WebCSS:in-range
note: this pseudo-class only applies to elements that have (and can take) a range limitation.
... living standard defines when :in-range matches elements in html.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
the :lang() css pseudo-class matches elements based on the language they are determined to be in.
... examples in this example, the :lang() pseudo-class is used to match the parents of quote elements (<q>) using child combinators.
:last-child - CSS: Cascading Style Sheets
the :last-child css pseudo-class represents the last element among a group of sibling elements.
... working draft matching elements are not required to have a parent.
:only-child - CSS: Cascading Style Sheets
div>i am the 2nd sibling.</div> <div>i am the 3rd sibling, <div>but this is an only child.</div></div> </div> css div:only-child { color: red; } div { display: inline-block; margin: 6px; outline: 1px solid; } result a list example html <ol> <li>first <ul> <li>this list has just one element.</li> </ul> </li> <li>second <ul> <li>this list has three elements.</li> <li>this list has three elements.</li> <li>this list has three elements.</li> </ul> </li> </ol> css li li { list-style-type: disc; } li:only-child { color: red; list-style-type: square; } result specifications specification status comment selectors level 4the definition of ':only-child' in that specification.
... working draft matching elements are not required to have a parent.
:only-of-type - CSS: Cascading Style Sheets
syntax :only-of-type examples styling elements with no siblings of the same type html <main> <div>i am `div` #1.</div> <p>i am the only `p` among my siblings.</p> <div>i am `div` #2.</div> <div>i am `div` #3.
... working draft matching elements are not required to have a parent.
:out-of-range - CSS: Cascading Style Sheets
note: this pseudo-class only applies to elements that have (and can take) a range limitation.
... living standard defines when :out-of-range matches elements in html.
:scope - CSS: Cascading Style Sheets
WebCSS:scope
the :scope css pseudo-class represents elements that are a reference point for selectors to match against.
...); document.getelementbyid('results').innerhtml = array.prototype.map.call(selected, function (element) { return '#' + element.getattribute('id'); }).join(', '); html <div id="context"> <div id="element-1"> <div id="element-1.1"></div> <div id="element-1.2"></div> </div> <div id="element-2"> <div id="element-2.1"></div> </div> </div> <p> selected elements ids : <span id="results"></span> </p> result specifications specification status comment selectors level 4the definition of ':scope' in that specification.
:target - CSS: Cascading Style Sheets
WebCSS:target
isn't that delightful?</p> css p:target { background-color: gold; } /* add a pseudo-element inside the target element */ p:target::before { font: 70% sans-serif; content: "►"; color: limegreen; margin-right: .25em; } /* style italic elements within the target element */ p:target i { color: red; } result pure-css lightbox you can use the :target pseudo-class to create a lightbox without using any javascript.
... this technique relies on the ability of anchor links to point to elements that are initially hidden on the page.
any-hover - CSS: Cascading Style Sheets
WebCSS@mediaany-hover
the any-hover css media feature can be used to test whether any available input mechanism can hover over elements.
... hover one or more available input mechanisms can conveniently hover over elements.
hover - CSS: Cascading Style Sheets
WebCSS@mediahover
the hover css media feature can be used to test whether the user's primary input mechanism can hover over elements.
... hover the primary input mechanism can conveniently hover over elements.
@media - CSS: Cascading Style Sheets
WebCSS@media
name summary notes any-hover does any available input mechanism allow the user to hover over elements?
... height height of the viewport hover does the primary input mechanism allow the user to hover over elements?
CSS Animations tips and tricks - CSS: Cascading Style Sheets
css animations make it possible to do incredible things with the elements that make up your documents and apps.
...there's no magic resetanimation() method on elements, and you can't even just set the element's animation-play-state to "running" again.
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
applying color to html elements using css an overview of how css color can be used in html, including for borders.
... box-shadow generator this interactive tool lets you visually create shadows behind elements (the box-shadow property).
Mastering margin collapsing - CSS: Cascading Style Sheets
note that the margins of floating and absolutely positioned elements never collapse.
...this applies to both adjacent elements and nested elements.
CSS Basic Box Model - CSS: Cascading Style Sheets
css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual formatting model.
...this model defines how css lays out elements, including their content, padding, border, and margin areas.
Basic Concepts of Multicol - CSS: Cascading Style Sheets
key concepts and terminology multicol is unlike any of the other layout methods we have in css in that it fragments the content, including all descendent elements, into columns.
...this is because a multicol container creates a new block formatting context (bfc) which means margins on child elements do not collapse with any margin on the container.
Handling content breaks in multicol - CSS: Cascading Style Sheets
breaks before and after boxes the break-before and break-after properties are used to control breaks before and after elements.
... when things don’t work as expected if you have small amounts of content and are trying to control breaks in a number of ways or on several elements, your content needs to break somewhere, so you may not always get the result you intended.
CSS Containment - CSS: Cascading Style Sheets
if we give each <article> the contain property with a value of content, when new elements are inserted the browser understands it does not need to relayout or repaint any area outside of the containing element's subtree, although if the <article> is styled such that its size depends on its contents (e.g.
... another advantage is that if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
forms have lots of markup and lots of small elements that we typically want to align with each other.
... patterns like this can make it much easier to create a library of form elements for your design, which easily accommodate additional elements being added.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
replaced elements replaced elements such as images will not change their orientation based on the writing-mode property.
... however, replaced elements such as form controls which include text, should match the writing mode in use.
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method.
... floated elements as we have already seen, float and also clear have no effect on a grid item.
CSS Grid Layout - CSS: Cascading Style Sheets
like tables, grid layout enables an author to align elements into columns and rows.
...for example, a grid container's child elements could position themselves so they actually overlap and layer, similar to css positioned elements.
Consistent list indentation - CSS: Cascading Style Sheets
what's key is that the markers are placed outside the "principal box" of the <li> elements, not the <ul>.
... as we can see, the markers remain attached to the <li> elements, no matter where they are.
Using z-index - CSS: Cascading Style Sheets
top layer (closest to the observer) notes: when no z-index property is specified, elements are rendered on the default rendering layer 0 (zero).
... if several elements share the same z-index value (i.e., they are placed on the same layer), stacking rules explained in the section stacking without the z-index property apply.
Stacking with floated blocks - CSS: Cascading Style Sheets
floating blocks are placed between non-positioned blocks and positioned blocks: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant positioned elements, in order of appearance in the html actually, as you can see in the example below, the background and border of the non-positioned block (div #4) is completely unaffected by floating blocks, but the content is affected.
...this behavior can be shown with an added rule to the above list: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant non-positioned inline elements descendant positioned elements, in order of appearance in the html note: if an opacity value is applied to the non-positioned block (div #4), then something strange happens: the background and border of that block pops up above the floating blocks and the positioned blocks.
Stacking context example 1 - CSS: Cascading Style Sheets
without z-indexes, elements are stacked in order of occurrence.
... in this last example you can see that div #2 and div #4 are not siblings, because they belong to different parents in the html elements' hierarchy.
Stacking context example 2 - CSS: Cascading Style Sheets
you can see that div #2 (z-index: 2) is above div #3 (z-index: 1), because they both belong to the same stacking context (the root one), so z-index values rule how elements are stacked.
...in the stacking context hierarchy, elements that do not create a stacking context are collapsed on their parent.
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
thus, to add a border to the #example fragment, we would write: #example:target { border: 1px solid black; } targeting all elements if the intent is to create a "blanket" style that will apply to all targeted elements, then the universal selector comes in handy: :target { color: red; } example in the following example, there are five links that point to elements in the same document.
...note that the document may jump to a new scroll position, since target elements are placed on the top of the browser window if possible.
CSS Transforms - CSS: Cascading Style Sheets
css transforms is a module of css that defines how elements styled with css can be transformed in two-dimensional or three-dimensional space.
... reference properties backface-visibility perspective perspective-origin rotate scale transform transform-box transform-origin transform-style translate data types <transform-function> guides using css transforms step-by-step tutorial about how to transform elements styled with css.
Class selectors - CSS: Cascading Style Sheets
the css class selector matches elements based on the contents of their class attribute.
... /* all elements with class="spacious" */ .spacious { margin: 2em; } /* all <li> elements with class="spacious" */ li.spacious { margin: 2em; } /* all <li> elements with a class list that includes both "spacious" and "elegant" */ /* for example, class="elegant retro spacious" */ li.spacious.elegant { margin: 2em; } syntax .class_name { style properties } note that this is equivalent to the following attribute selector: [class~=class_name] { style properties } examples css .red { color: #f33; } .yellow-bg { background: #ffa; } .fancy { font-weight: bold; text-shadow: 4px 4px 3px #77f; } html <p class="red">this paragraph has red text.</p> <p class="red yellow-bg">this paragraph has red text and a yellow background.</p> <p class="red fancy">this paragraph has red text a...
Media queries - CSS: Cascading Style Sheets
media queries in html in html, media queries can be applied to various elements: in the <link> element's media attribute, they define the media to which a linked resource (typically css) should be applied.
...(this is only valid inside <picture> elements.) in the <style> element's media attribute, they define the media to which the style should be applied.
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
the basic goal of the cascading stylesheet (css) language is to allow a browser engine to paint elements of the page with specific features, like colors, positioning, or decorations.
...each (valid) declaration block is preceded by one or more comma-separated selectors, which are conditions selecting some elements of the page.
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
as mentioned earlier, you use the custom property value by specifying your custom property name inside the var() function, in place of a regular property value: element { background-color: var(--main-bg-color); } first steps with custom properties let's start with this simple css that applies the same color to elements of different classes: .one { color: white; background-color: brown; margin: 10px; width: 50px; height: 50px; display: inline-block; } .two { color: white; background-color: black; margin: 10px; width: 150px; height: 70px; display: inline-block; } .three { color: white; background-color: brown; margin: 10px; width: 75px; } .four { color: white; background-col...
... custom property fallback values using the var() function, you can define multiple fallback values when the given variable is not yet defined; this can be useful when working with custom elements and shadow dom.
animation-delay - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples.
... 43 full support 3prefixed prefixed implemented with the vendor prefix: -webkit-edge full support 12firefox full support 16notes full support 16notes notes before firefox 57, firefox does not repaint elements outside the viewport that are animated into the viewport with a delay.
aspect-ratio - CSS: Cascading Style Sheets
syntax aspect-ratio: 1 / 1; /* global values */ aspect-ratio: inherit; aspect-ratio: initial; aspect-ratio: unset; values <auto> replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio.
... formal definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes.
background-blend-mode - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
... in svg, it applies to container elements, graphics elements, and graphics referencing elements..
background-clip - CSS: Cascading Style Sheets
see "the backgrounds of special elements." note: for documents whose root element is an html element: if the computed value of background-image on the root element is none and its background-color is transparent, user agents must instead propagate the computed values of the background properties from that element’s first html <body> child element.
... formal definition initial valueborder-boxapplies toall elements.
background-repeat - CSS: Cascading Style Sheets
formal definition initial valuerepeatapplies toall elements.
... candidate recommendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and vertical directions, the space and round keywords, and for backgrounds on inline-level elements by precisely defining the background painting area.
border-block-start-width - CSS: Cascading Style Sheets
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border.
... formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples border width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-start-width: 5px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-width' in that specification.
border-bottom-left-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-bottom-right-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-color - CSS: Cascading Style Sheets
you can find more information about border colors in borders in applying color to html elements using css.
... formal definition initial valueas each of the properties of the shorthand:border-top-color: currentcolorborder-right-color: currentcolorborder-bottom-color: currentcolorborder-left-color: currentcolorapplies toall elements.
border-end-end-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-end-start-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-image - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:border-image-source: noneborder-image-slice: 100%border-image-width: 1border-image-outset: 0border-image-repeat: stretchapplies toall elements, except internal table elements when border-collapse is collapse.
... candidate recommendation initial definition initial valueas each of the properties of the shorthand:border-image-source: noneborder-image-slice: 100%border-image-width: 1border-image-outset: 0border-image-repeat: stretchapplies toall elements, except internal table elements when border-collapse is collapse.
border-inline-end-color - CSS: Cascading Style Sheets
initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border.
... formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-end-color: red; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-color' in that specification.
border-inline-end-width - CSS: Cascading Style Sheets
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border.
... formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples applying a border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-end-width: 5px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-width' in that specification.
border-inline-end - CSS: Cascading Style Sheets
of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the a...
...of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the a...
border-inline-start-style - CSS: Cascading Style Sheets
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-start-style: dashed; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-style' in that specification.
border-inline - CSS: Cascading Style Sheets
initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete constituent properties this property is a shorthand for the following css properties: border-inline-color border-inline-style border-inline-width syntax valu...
... formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentc...
border-start-end-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-start-start-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-top-left-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-top-right-radius - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
... the behavior on internal table elements is undefined for the moment..
border-top-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
... initial valuenoneapplies toall elements.
box-shadow - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
... we added a margin the size of the widest box-shadow to ensure the shadow doesn't overlap adjacent elements or go beyond the border of the containing box.
break-after - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region examples breaking into neat columns in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of <h2>s and paragraphs...
...however, we used break-after: column on the <p> elements to force a column break after each one, meaning that you end up with an <h2> neatly at the top of each column.
break-before - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region examples breaking into neat columns in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of <h2>s and paragraphs...
...however, we used break-before: column on the <h2> elements to force a column break before each one, meaning that you end up with an <h2> neatly at the top of each column.
caret-color - CSS: Cascading Style Sheets
the caret appears in elements such as <input> or those with the contenteditable attribute.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueauto is computed as specified and <color> values are computed as defined for the color property.animation typea color formal syntax auto | <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
clip - CSS: Cascading Style Sheets
WebCSSclip
the clip property applies only to absolutely positioned elements — that is, elements with position:absolute or position:fixed.
... formal definition initial valueautoapplies toabsolutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350p...
color - CSS: Cascading Style Sheets
WebCSScolor
for an overview of using color in html, see applying color to html elements using css.
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valuevaries from one browser to anotherapplies toall elements.
column-count - CSS: Cascading Style Sheets
12prefixed prefixed implemented with the vendor prefix: -webkit-firefox full support 52 full support 52 no support 1.5 — 74prefixed notes prefixed implemented with the vendor prefix: -moz-notes prior to version 37, multiple columns didn't work with display: table-caption elements.ie full support 10opera full support 11.1 full support 11.1 full support 15prefixed prefixed implemented with the vendor prefix: -webkit-safari full support 9 ...
... prefixed implemented with the vendor prefix: -webkit-firefox android full support 52 full support 52 full support 4prefixed notes prefixed implemented with the vendor prefix: -moz-notes prior to version 37, multiple columns didn't work with display: table-caption elements.opera android full support 11.1 full support 11.1 full support 14prefixed prefixed implemented with the vendor prefix: -webkit-safari ios full support 9 full support 9 ...
<display-inside> - CSS: Cascading Style Sheets
table these elements behave like html <table> elements.
...it behaves like the corresponding html <ruby> elements.
<display-outside> - CSS: Cascading Style Sheets
run-in elements act like inlines or blocks, depending on the surrounding elements.
... examples in the following example, span elements (normally displayed as inline elements) are set to display: block and so break onto new lines and expand to fill their container in the inline dimension.
element() - CSS: Cascading Style Sheets
WebCSSelement
this demonstrates that you can use arbitrary elements as background, but doesn't necessarily demonstrate good design practices.
... <div style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">evil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification.
font-variant-ligatures - CSS: Cascading Style Sheets
the font-variant-ligatures css property controls which ligatures and contextual forms are used in textual content of the elements it applies to.
... formal definition initial valuenormalapplies toall elements.
font-variant-position - CSS: Cascading Style Sheets
these glyphs are typically used in <sub> and <sup> elements.
... formal definition initial valuenormalapplies toall elements.
height - CSS: Cascading Style Sheets
WebCSSheight
accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block.
image-orientation - CSS: Cascading Style Sheets
its functionality may be moved into properties on the <img> and/or <picture> elements, with the possible exception of from-image.
... formal definition initial value0degapplies toall elementsinheritedyescomputed valuean <angle>, rounded to the next quarter turn from 0deg and normalized, that is moduloing the value by 1turnanimation typediscrete formal syntax from-image | <angle> | [ <angle>?
isolation - CSS: Cascading Style Sheets
WebCSSisolation
formal definition initial valueautoapplies toall elements.
... in svg, it applies to container elements, graphics elements, and graphics referencing elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | isolate examples forcing a new stacking context for an element html <div id="b" class="a"> <div id="d"> <div class="a c">auto</div> </div> <div id="e"> <div class="a c">isolate</div> </div> </div> css .a { background-color: rgb(0,255,0); } #b { width: 200px; height: 210px; } .c { width: 100px; height: 100px; border: 1px solid black; padding: 2px; mix-blend-mode: difference; } #d { isolation: auto; } #e { isolation: isolate; } result specifications specification status comment compositing and blending level 1the definition of 'isolation' in that sp...
justify-items - CSS: Cascading Style Sheets
for absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
... formal definition initial valuelegacyapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | stretch | <baseline-position> | <overflow-position>?
list-style-position - CSS: Cascading Style Sheets
note: this property is applied to list items, i.e., elements with display: list-item;.
... by default this includes <li> elements.
list-style - CSS: Cascading Style Sheets
note: this property is applied to list items, i.e., elements with display: list-item; .
... by default this includes <li> elements.
mask - CSS: Cascading Style Sheets
WebCSSmask
formal definition initial valueas each of the properties of the shorthand:mask-image: nonemask-mode: match-sourcemask-repeat: no-repeatmask-position: centermask-clip: border-boxmask-origin: border-boxmask-size: automask-composite: addapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesas each of the properties of the shorthand:mask-position: refer to size of mask painting area minus size of mask layer image (see the text for background-position)computed valueas each of the properties of the shorthand:mask-image: as specified, but with <url> values made absolutema...
... candidate recommendation extends its usage to html elements.
mix-blend-mode - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax <blend-mode>where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="co...
... 41chrome android full support 41firefox android full support 32opera android full support 28safari ios full support 8samsung internet android full support 4.0on svg elementschrome full support 41edge full support 79firefox full support 32ie no support noopera full support 28safari no support nowebview ...
object-fit - CSS: Cascading Style Sheets
formal definition initial valuefillapplies toreplaced elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax fill | contain | cover | none | scale-down examples setting object-fit for an image html <section> <h2>object-fit: fill</h2> <img class="fill" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="fill narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="...
...bilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobject-fitchrome full support 31edge full support 16notes full support 16notes notes edge supports object-fit on img elements only.
object-position - CSS: Cascading Style Sheets
formal definition initial value50% 50%applies toreplaced elementsinheritedyespercentagesrefer to width and height of element itselfcomputed valueas specifiedanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
... | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples positioning image content html here we see html that includes two <img> elements, each displaying the mdn logo.
offset-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrelativetowidthandheightcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
... | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting various offset-anchor values in the following example, we have three <div> elements nested in <section> elements.
overscroll-behavior-block - CSS: Cascading Style Sheets
underlying elements will not scroll.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-inline - CSS: Cascading Style Sheets
underlying elements will not scroll.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-x - CSS: Cascading Style Sheets
underlying elements will not scroll.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other.
overscroll-behavior - CSS: Cascading Style Sheets
underlying elements will not scroll.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ contain | none | auto ]{1,2} examples preventing an underlying element from scrolling in our overscroll-behavior example (see the source code also), we present a full-page list of fake contacts, and a dialog box containing a chat window.
quotes - CSS: Cascading Style Sheets
WebCSSquotes
auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e.
... formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be.
scroll-snap-stop - CSS: Cascading Style Sheets
always the scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions.
... formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances.
scroll-snap-type - CSS: Cascading Style Sheets
both the scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis).
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ x | y | block | inline | both ] [ mandatory | proximity ]?
shape-outside - CSS: Cascading Style Sheets
,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* <url> value */ shape-outside: url(image.png); /* <gradient> value */ shape-outside: linear-gradient(45deg, rgba(255, 255, 255, 0) 150px, red 150px); /* global values */ shape-outside: initial; shape-outside: inherit; shape-outside: unset; the shape-outside property is specified using the values from the list below, which define the float area for float elements.
... the float area determines the shape around which inline content (float elements) wrap.
table-layout - CSS: Cascading Style Sheets
fixed table and column widths are set by the widths of table and col elements or by the width of the first row of cells.
... formal definition initial valueautoapplies totable and inline-table elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | fixed examples fixed-width tables with text-overflow this example uses a fixed table layout, combined with the width property, to restrict the table's width.
text-decoration-color - CSS: Cascading Style Sheets
this effect can nevertheless be achieved by nesting elements, applying a different line type to each element (with the text-decoration-line property), and specifying the line color (with text-decoration-color) on a per-element basis.
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valuecurrentcolorapplies toall elements.
text-decoration-skip - CSS: Cascading Style Sheets
thus, adjacent elements receive separate underlines.
... formal definition initial valueobjectsapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ objects | [ spaces | [ leading-spaces | trailing-spaces ] ] | edges | box-decoration ] examples skipping edges html <p>hey, grab a cup of <em>coffee!</em></p> css p { margin: 0; font-size: 3em; text-decoration: underline; text-decoration-skip: edges; } result specifications specification status comment css text d...
text-decoration-thickness - CSS: Cascading Style Sheets
for a given application of this property, the thickness is constant across the whole box it is applied to, even if there are child elements with a different font size.
... formal definition initial valueautoapplies toall elements.
text-decoration - CSS: Cascading Style Sheets
text decorations are drawn across descendant text elements.
... formal definition initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneapplies toall elements.
text-emphasis-position - CSS: Cascading Style Sheets
formal definition initial valueover rightapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ over | under ] && [ right | left ] examples preferring ruby over emphasis marks some editors prefer to hide emphasis marks when they conflict with ruby.
...in html, this can be done with the following pattern: em { text-emphasis: dot; /* set text-emphasis for <em> elements */ } em rt { display: none; /* hide ruby inside <em> elements */ } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-orientation - CSS: Cascading Style Sheets
use-glyph-orientation on svg elements, this keyword leads to use the value of the deprecated svg properties glyph-orientation-vertical and glyph-orientation-horizontal.
... formal definition initial valuemixedapplies toall elements, except table row groups, rows, column groups, and columnsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax mixed | upright | sideways examples html <p>lorem ipsum dolet semper quisquam.</p> css p { writing-mode: vertical-rl; text-orientation: upright; } result specifications specification status comment css writing modes module level 3the definition of 'text-orientation' in that specification.
text-shadow - CSS: Cascading Style Sheets
this property applies to both ::first-line and ::first-letter pseudo-elements.
... formal definition initial valuenoneapplies toall elements.
text-underline-offset - CSS: Cascading Style Sheets
for a given application of this property, the offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or vertical alignment.
... formal definition initial valueautoapplies toall elements.
touch-action - CSS: Cascading Style Sheets
this means that in practice, touch-action is typically applied only to top-level elements which have some custom behavior, without needing to specify touch-action explicitly on any of that element's descendants.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements except: non-replaced inline elements, table rows, row groups, table columns, and column groupsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] | pinch-zoom ] | manipulation examples disabling all gestures the most common usage is to disable all gestures on an element (and its non-scroll...
translate - CSS: Cascading Style Sheets
WebCSStranslate
formal definition initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <length-percentage> [ <length-percentage> <length>?
... initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
white-space - CSS: Cascading Style Sheets
lines are only broken at newline characters in the source and at <br> elements.
... collapse collapse wrap remove nowrap collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <div id="css-code" class="box"> p { white-space...
width - CSS: Cascading Style Sheets
WebCSSwidth
accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples default width p.goldie { background: gold; } <p class="goldie">the mozilla community produces a lot of great software.</p> pixels and ems .px_length { width: 200px; background-color: red; color: white; border: 1...
regexp:match() - EXSLT
WebEXSLTregexpmatch
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:match() performs regular expression matching on a string, returning the submatches found as a result.
... returns a node set of match elements, each of which has the string value equal to a portion of the first parameter string as captured by the regular expression.
str:split() - EXSLT
WebEXSLTstrsplit
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.
... returns a node-set of token elements, each containing one token from the string.
str:tokenize() - EXSLT
WebEXSLTstrtokenize
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
... returns a node-set of token elements, each containing one token from the string.
Media events - Developer guides
various events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.
... you can easily watch for these events, using code such as the following: var v = document.getelementsbytagname("video")[0]; v.addeventlistener("seeked", function() { v.play(); }, true); v.currenttime = 10.0; this example fetches the first video element in the document and attaches an event listener to it, watching for the seeked event, which is sent whenever a seek operation completes.
Introduction to Web development - Developer guides
basic structure of a web page — the doctype and document 'tree' fundamental html elements — structural, head, list, form elements and more, explained by category.
... html elements reference guide — a comprehensive guide to html elements with details on how browsers support them css getting started with css — an absolute beginners guide to css covers basic concepts and fundamentals css reference guide — a complete guide to css with details on the level of gecko/firefox support for each.
User input and controls - Developer guides
using features such as contenteditable elements you can implement fast rich-text editors and with drag&drop let users moving elements inside your app.
...touch events can help you implement interactive elements and common interaction gestures on touchscreen devices.
Writing forward-compatible websites - Developer guides
what this means is that any time you access a global variable in an event handler content attribute, including calling any function declared globally, you can end up with a name collision if a specification adds a new dom property to elements or documents which has the same name as your function or variable, and a browser implements it.
...or, conversely, that they don't have support for some other feature (e.g., don't assume that a browser that supports onload on script elements will never support onreadystatechange on them).
The HTML autocomplete attribute - HTML: Hypertext Markup Language
the html autocomplete attribute is available on <input> elements that take a text or numeric value as input, <textarea> elements, <select> elements, and <form> elements.
... in order to provide autocompletion, user-agents might require <input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a value for this field.
HTML attribute: crossorigin - HTML: Hypertext Markup Language
the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data.
... the crossorigin content attribute on media elements is a cors settings attribute.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and both the <progress> and <meter> elements, the max attribute is a number that specifies the most positive value a form control to be considered valid.
... syntax for max values for other elements input type syntax example <progress> <number> <progress id="file" max="100" value="70"> 70% </progress> <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> ...
HTML attribute: readonly - HTML: Hypertext Markup Language
the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number<input> types and the <textarea> form control elements.
... if present on any of these input types and elements, the :read-only pseudo class will match.
HTML attribute: required - HTML: Hypertext Markup Language
the required attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <input> types along with the <select> and <textarea> form control elements.
... if present on any of these input types and elements, the :required pseudo class will match.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
permitted parents any element that accepts flow content, but always excluding <address> elements (according to the logical principle of symmetry, if <address> tag, as a parent, can not have nested <address> element, then the same <address> content can not have <address> tag as its parent).
...://www.somedomain.com/contact"> www.somedomain.com</a>.<br> if you see any bugs, please <a href="mailto:webmaster@somedomain.com"> contact webmaster</a>.<br> you may also want to visit us:<br> mozilla foundation<br> 331 e evelyn ave<br> mountain view, ca 94041<br> usa </address> result although it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information.
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
for example, the comments of a blog post can be <article> elements nested in the <article> representing the blog post.
... author information of an <article> element can be provided through the <address> element, but it doesn't apply to nested <article> elements.
<col> - HTML: Hypertext Markup Language
WebHTMLElementcol
because <td> elements are not descendant of the <col> element, they won't inherit it.
...because <td> elements are not descendant of the <col> element, they won't inherit it.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
links to <dfn> elements if you include an id attribute on the <dfn> element, you can then link to it using <a> elements.
...this can be done by using the <dfn> and <abbr> elements in tandem, like this: html <p>the <dfn><abbr title="hubble space telescope">hst</abbr></dfn> is among the most productive scientific instruments ever constructed.
<div>: The Content Division element - HTML: Hypertext Markup Language
WebHTMLElementdiv
or (in whatwg html): if the parent is a <dl> element: one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements.
...instead, you should use css properties or techniques such as css grid or css flexbox to align and position <div> elements on the page.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
though once normalized in html 3.2, it was deprecated in html 4.01, at the same time as all elements related to styling only, then made obsolete in html5.
... attributes like all other html elements, this element supports the global attributes.
<frameset> - HTML: Hypertext Markup Language
WebHTMLElementframeset
the html <frameset> element is used to contain <frame> elements.
... attributes like all other html elements, this element supports the global attributes.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
permitted content if the document is an <iframe> srcdoc document, or if title information is available from a higher level protocol (like the subject line in html email), zero or more elements of metadata content.
... otherwise, one or more elements of metadata content where exactly one is a <title> element.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
it groups a set of <h1>–<h6> elements.
... in other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
this can be used in the target attribute of the <a>, <form>, or <base> elements; the formtarget attribute of the <input> or <button> elements; or the windowname parameter in the window.open() method.
... scripting inline frames, like <frame> elements, are included in the window.frames pseudo-array.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
<input> elements of type hidden let web developers include data that cannot be seen or modified by users when a form is submitted.
... additional attributes in addition to the attributes common to all <input> elements, hidden inputs offer the following attributes: attribute description name like all input types, the name of the input to report when submitting the form; the special value _charset_ causes the hidden input's value to be reported as the character encoding used to submit the form name this is actually one of the common attributes, but it has a special meaning av...
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
<input> elements of type password provide a way for the user to securely enter a password.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, password field inputs support the following attributes: attribute description maxlength the maximum length the value may be, in utf-16 characters minlength the minimum length in characters that will be considered valid pattern a regular expression the value must match in order to be valid placeholder an exa...
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
<main> doesn't contribute to the document's outline; that is, unlike elements such as <body>, headings such as <h2>, and such, <main> doesn't affect the dom's concept of the structure of the page.
... <body> <a href="#main-content">skip to main content</a> <!-- navigation and header content --> <main id="main-content"> <!-- main page content --> </main> </body> webaim: "skip navigation" links reader mode browser reader mode functionality looks for the presence of the <main> element, as well as heading and content sectioning elements when converting content into a specialized reader view.
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
for example, to indicate that a document prefers dark mode but does render functionally in light mode as well: <meta name="color-scheme" content="dark light"> this works at the document level in the same way that the css color-scheme property lets individual elements specify their preferred and accepted color schemes.
...if there are more than one, several <meta> elements should be used.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
permitted content zero or more <option> elements.
... implicit aria role group permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag.
... using empty <p> elements to add space between paragraphs is problematic for people who navigate with screen-reading technology.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
if <plaintext> is the first element on the page (other than any non-displayed elements, like <head>), do not use html at all.
... attributes this element has no other attributes than the global attributes common to all elements.
<s> - HTML: Hypertext Markup Language
WebHTMLElements
however, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.
...it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements.
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
permitted parents any element that accepts metadata content, phrasing content, or script-supporting elements.
...} the result is the original html table, with two new rows appended to it via javascript: table { background: #000; } table td { background: #fff; } avoiding documentfragment pitfall a documentfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it.
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
permitted content zero or more <tr> elements.
...to give a similar effect to the bgcolor attribute, use the css property background-color, on the relevant <td> or <th> elements.
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
permitted content zero or more <tr> elements.
...to give a similar effect to the bgcolor attribute, use the css property background-color, on the relevant <td> or <th> elements.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as having some form of non-textual annotation applied.
... other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts t...
class - HTML: Hypertext Markup Language
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
... recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>.
id - HTML: Hypertext Markup Language
in contrast to the class attribute, which allows space-separated values, elements can only have one single id value.
... recommendation supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>.
is - HTML: Hypertext Markup Language
the is global attribute allows you to specify that a standard html element should behave like a defined custom built-in element (see using custom elements for more details).
... } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html living standardthe definition of 'is' in that specification.
lang - HTML: Hypertext Markup Language
the lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user.
... recommendation supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
title - HTML: Hypertext Markup Language
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.
... recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>.
Link types - HTML: Hypertext Markup Language
list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
... although recognized, the rev attribute on <a>, <area> or<link> elements with a link type of made is incorrect and should be replaced by the rel attribute with this link type.
Microdata - HTML: Hypertext Markup Language
microdata is an attempt to provide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic microformats.
...items and properties are represented by regular elements.
CSP: base-uri - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: connect-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: default-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: font-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: form-action - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: img-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: manifest-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: navigate-to - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: prefetch-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: style-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
CSP: worker-src - HTTP
if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
... 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements.
Feature-Policy: unsized-media - HTTP
the http feature-policy header unsized-media directive controls whether the current document is allowed to change the size of media elements after the initial layout is complete.
... default value the default value for unsized-media is '*', that is unsized media elements are allowed for all origins by default.
Feature-Policy - HTTP
the http feature-policy header provides a mechanism to allow and deny the use of browser features in its own frame, and in content within any <iframe> elements in the document.
...the autoplay attribute on <audio> and <video> elements will be ignored.
Referrer-Policy - HTTP
for example, you can set the referrer policy for the entire document with a <meta> element with a name of referrer: <meta name="referrer" content="origin"> or set it for individual requests with the referrerpolicy attribute on <a>, <area>, <img>, <iframe>, <script>, or <link> elements: <a href="http://example.com" referrerpolicy="origin"> alternatively, a noreferrer link relation on an a, area, or link element can be set: <a href="http://example.com" rel="noreferrer"> integration with css css can fetch resources referenced from stylesheets.
... for <style> elements or style attributes, the owner document's referrer policy is used.
Introduction - JavaScript
javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements.
...for example, client-side extensions allow an application to place elements on an html form and respond to user events such as mouse clicks, form input, and page navigation.
Regular expression syntax cheatsheet - JavaScript
matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9).
...the matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9).
Groups and ranges - JavaScript
matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9).
...the matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9).
Array.prototype.copyWithin() - JavaScript
start optional zero-based index at which to start copying elements from.
... end optional zero-based index at which to end copying elements from.
Array.prototype.fill() - JavaScript
the fill() method changes all elements in an array to a static value, from a start index (default 0) to an end index (default array.length).
...(note all elements in the array will be this exact value.) start optional start index, default 0.
Array.prototype.flat() - JavaScript
the flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
... return value a new array with the sub-array elements concatenated into it.
Array.from() - JavaScript
description array.from() lets you create arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects such as map and set).
...// [[1, 2], [2, 4], [4, 8]] const mapper = new map([['1', 'a'], ['2', 'b']]); array.from(mapper.values()); // ['a', 'b']; array.from(mapper.keys()); // ['1', '2']; array from an array-like object (arguments) function f() { return array.from(arguments); } f(1, 2, 3); // [ 1, 2, 3 ] using arrow functions and array.from() // using an arrow function as the map function to // manipulate the elements array.from([1, 2, 3], x => x + x); // [2, 4, 6] // generate a sequence of numbers // since the array is initialized with `undefined` on each position, // the value of `v` below will be `undefined` array.from({length: 5}, (v, i) => i); // [0, 1, 2, 3, 4] sequence generator (range) // sequence generator function (commonly referred to as "range", e.g.
Array.prototype.length - JavaScript
the length property of an object which is an instance of type array sets or returns the number of elements in that array.
...when you extend an array by changing its length property, the number of actual elements increases; for example, if you set length to 3 when it is currently 2, the array now contains 3 elements, which causes the third element to be a non-iterable empty slot.
Array.prototype.pop() - JavaScript
examples removing the last element of an array the following code creates the myfish array containing four elements, then removes its last element.
... var myfish = ['angel', 'clown', 'mandarin', 'sturgeon']; var popped = myfish.pop(); console.log(myfish); // ['angel', 'clown', 'mandarin' ] console.log(popped); // 'sturgeon' using apply( ) or call ( ) on array-like objects the following code creates the myfish array-like object containing four elements and a length parameter, then removes its last element and decrements the length parameter.
Array.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements.
... syntax arr.tostring() return value a string representing the elements of the array.
Map() constructor - JavaScript
syntax new map([iterable]) parameters iterable an array or other iterable object whose elements are key-value pairs.
... (for example, arrays with two elements, such as [[ 1, 'one' ],[ 2, 'two' ]].) each key-value pair is added to the new map.
Math.max() - JavaScript
this should only be used for arrays with relatively few elements.
... function getmaxofarray(numarray) { return math.max.apply(null, numarray); } the new spread operator is a shorter way of writing the apply solution to get the maximum of an array: var arr = [1, 2, 3]; var max = math.max(...arr); however, both spread (...) and apply will either fail or return the wrong result if the array has too many elements, because they try to pass the array elements as function parameters.
Proxy - JavaScript
const target = {}; const p = new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements.
...; } var person = function(name) { this.name = name; }; var boy = extend(person, function(name, age) { this.age = age; }); boy.prototype.gender = 'm'; var peter = new boy('peter', 13); console.log(peter.gender); // "m" console.log(peter.name); // "peter" console.log(peter.age); // 13 manipulating dom nodes sometimes you want to toggle the attribute or class name of two different elements.
Symbol.isConcatSpreadable - JavaScript
the symbol.isconcatspreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the array.prototype.concat() method.
...it can control behavior for arrays and array-like objects: for array objects, the default behavior is to spread (flatten) elements.
TypedArray.prototype.fill() - JavaScript
the fill() method fills all the elements of a typed array from a start index to an end index with a static value.
... description the elements interval to fill is [start, end).
TypedArray.of() - JavaScript
syntax typedarray.of(element0[, element1[, ...[, elementn]]]) where typedarray is one of: int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array parameters elementn elements of which to create the typed array.
...hence, when working with proxy objects, it calls handler.set to create new elements rather than handler.defineproperty.
TypedArray.prototype.some() - JavaScript
examples testing size of all typed array elements the following example tests whether any element in the typed array is bigger than 10.
... function isbiggerthan10(element, index, array) { return element > 10; } new uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements.
... syntax typedarray.tostring() return value a string representing the elements of the typed array.
WebAssembly.Table.prototype.grow() - JavaScript
the grow() prototype method of the webassembly.table object increases the size of the table instance by a specified number of elements.
... syntax table.grow(number); parameters number the number of elements you want to grow the table by.
Comma operator (,) - JavaScript
examples if a is a 2-dimensional array with 10 elements on each side, the following code uses the comma operator to increment i and decrement j at once.
... the following code prints the values of the diagonal elements in the array: for (var i = 0, j = 9; i <= 9; i++, j--) console.log('a[' + i + '][' + j + '] = ' + a[i][j]); note that the comma operators in assignments may appear not to have the normal effect of comma operators because they don't exist within an expression.
Property accessors - JavaScript
x = eval('document.forms.form_name.elements.' + strformcontrol + '.value') eval() is slow and should be avoided whenever possible.
...it is better to use bracket notation instead: x = document.forms['form_name'].elements[strformcontrol].value specifications specification ecmascript (ecma-262)the definition of 'property accessors' in that specification.
for...of - JavaScript
it doesn't log array elements 3, 5, 7 or hello because those are not enumerable properties, in fact they are not properties at all, they are values.
...the object's elements 3, 5, 7 are shown, but none of the object's properties.
<mfenced> - MathML
use the <mrow> and <mo> elements instead.
...use the <mrow> and <mo> elements instead, or, for backwards compatibility, see mathml-polyfills/mfenced.
<mlabeledtr> - MathML
child elements of <mlabeledtr> must be <mtd> elements.
... the first child is the label whereas all other children are representing row contents and are treated identically to children of <mtr> elements.
<mstyle> - MathML
WebMathMLElementmstyle
it accepts all attributes of all mathml presentation elements with some exceptions and additional attributes listed below.
... 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>.
Using audio and video in HTML - Web media technologies
the html <audio> and <video> elements let you embed audio and video content into a web page.
...in this guide, we'll review the media elements and how to use them in html content.
Privacy, permissions, and information security
this is the technology behind the https (hypertext transport protocol secured) protocol not all of these are generally directly used within code; notably, the permissions api, feature policy, and the allow attribute on <iframe> elements are primary tools directly used by code to help secure a site and its content.
... keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider.
Progressive web app structure - Progressive web apps (PWAs)
it's different with html, as the browser is actually streaming the data already and you can see when the elements are loaded and rendered on the website.
... the css the css is also as plain as possible: it uses @font-face to load and use a custom font, and it applies some simple styling of the html elements.
Progressive loading - Progressive web apps (PWAs)
when you include <img> elements in your html, then every referenced image will be fetched and downloaded during initial website access.
...you could try to make your apps more bulletproof by making them work without javascript — either using <noscript> to show the image with final src already assigned, or by wrapping <img> tags with <a> elements pointing at the target images, so the user can click and access them when desired.
Graphic design for responsive sites - Progressive web apps (PWAs)
you could use css3 properties for generating effects like drop shadows, gradients and rounded corners, and you could also consider using svg for other ui elements, instead of raster graphics formats.
...it is good for the visuals of games and complex data visualisions, but for standard user interface elements it is not very efficient.
Mobile first - Progressive web apps (PWAs)
one word of warning about this technique though - positioning doesn't work as expected on elements with display: table set on them.
...ure both of these were not direct children of the <article>, otherwise the following would not work: #bottom, #top { font-size: 0.8em; position:absolute; right: 1em; text-decoration: none; } #top { color: white; top: 0.5em; } #bottom { bottom: 0.5em; } i also set their parents to be positioned relatively, so they would become the positioning contexts of the absolutely positioned elements (you don't want them to be positioned relative to the <body> element.) adding a mobile first layout the above layout is fine for narrower layouts, but it doesn't work very well when you get wider than about 480px.
Structural overview of progressive web apps - Progressive web apps (PWAs)
it's different with html, as the browser is actually streaming the data already and you can see when the elements are loaded and rendered on the website.
... the css the css for this simple example is also as plain as possible: it uses @font-face to load and use a custom font, and it applies some simple styling of the html elements.
Web technology reference
html provides a means to create structured documents made up of blocks called html elements that are delineated by tags, written using angle brackets.
... some introduce content into the page directly, others provide information about document text and may include other tags as sub-elements.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
the global event attributes are available on all svg elements.
... other event attributes are available on a case by case basis for each elements.
alignment-baseline - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <tspan>, <tref>, <altglyph>, and <textpath> usage notes value auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom default value auto animatable yes auto the value is the dominant-baseline of the script to which the character ...
...xt alignment-baseline="baseline" x="60" y="110">a baseline</text> <!-- materialisation of anchors --> <circle cx="60" cy="10" r="3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline.
color - SVG: Scalable Vector Graphics
WebSVGAttributecolor
as a presentation attribute, it can be applied to any element, but as noted above, it has no direct effect on svg elements.
... candidate recommendation removed the restriction to which elements it applies.
direction - SVG: Scalable Vector Graphics
for other cases, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property.
... as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <textpath>, <text>, <tref>, and <tspan>.
dominant-baseline - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on the text content elements, including: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } text { font: bold 14px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 200 120" xmlns="http://www.w3.org/2000/svg"> <path d="m20,20 l180,20 m20,50 l180,50 m20,80 l180,80" stroke="grey" /> <text dominant-baseline="baseline" x="30" y="20">baseline</text> <text dominant...
... if there is no parent text content element, the scaled-baseline-table value is constructed as above for <text> elements.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> usage notes default value none value <end-value-list> animatable no the <end-value-list> is a semicolon-separated list of values.
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
as a presentation attribute, it can be applied to any element but it only has an effect on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan>.
... for animation five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>.
gradientUnits - SVG: Scalable Vector Graphics
the gradientunits attribute defines the coordinate system used for attributes specified on the gradient elements.
... two elements are using this attribute: <lineargradient> and <radialgradient> lineargradient for <lineargradient>, gradientunits defines the coordinate system used for the attributes x1, y1, x2, and y2.
height - SVG: Scalable Vector Graphics
WebSVGAttributeheight
twenty five elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- with a height of 0 or less, nothing will be rendered --> <rect y="0" x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> f...
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for used elements.
horiz-adv-x - SVG: Scalable Vector Graphics
three elements are using this attribute: <font>, <glyph>, and <missing-glyph> font for <font> elements, horiz-adv-x specifies the default horizontal advance of a glyph in horizontal orientation.
... glyph, missing-glyph for <glyph> and <missing-glyph> elements, horiz-adv-x specifies the horizontal advance of the glyph in horizontal orientation.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the css property mask default value none animatable yes specifications specification status comment css masking module level 1the defi...
... candidate recommendation extends its usage to html elements.
overflow - SVG: Scalable Vector Graphics
within svg content, the value auto implies that all rendered content for child elements must be visible, either through a scrolling mechanism, or by rendering with no clip.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <foreignobject>, <iframe>, <image>, <marker>, <pattern>, <symbol>, <svg>, and <text> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg" overflow="auto"> <text y="20">this text is wider than the svg, so there should be a scrollbar shown.</text> </svg> usage notes value visible | hidden | scroll | auto default value ...
u1 - SVG: Scalable Vector Graphics
WebSVGAttributeu1
if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set.
... two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair.
u2 - SVG: Scalable Vector Graphics
WebSVGAttributeu2
if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set.
... two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair.
vert-adv-y - SVG: Scalable Vector Graphics
three elements are using this attribute: <font>, <glyph>, and <missing-glyph> font for <font> elements, vert-adv-y specifies the default vertical advance for a glyph in vertical orientation.
... value <number> default value 1 em as of units-per-em animatable no <number> this value indicates the default vertical advance of the glyph in vertical direction glyph, missing-glyph for <glyph> and <missing-glyph> elements, vert-adv-y specifies the vertical advance for a glyph in vertical orientation.
width - SVG: Scalable Vector Graphics
WebSVGAttributewidth
twenty five elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <!-- with a width of 0 or less, nothing will be rendered --> <rect x="0" y="0" width="0" height="90"/> <rect x="0" y="100" width="60" height="90"/> <rect x="0" y="200" width="100%" height="90"/> </svg> f...
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for used elements.
writing-mode - SVG: Scalable Vector Graphics
the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes default value horizontal-tb value horizontal-tb | vertical-rl | vertical-lr animatable yes horizontal-tb this value defines a top-to-bottom block flow direction.
x - SVG: Scalable Vector Graphics
WebSVGAttributex
thirty seven elements are using this attribute: <altglyph>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <rect x="20" y="20" width="60" height="60" /> <rect x="120" y="20" width="60" height="60" ...
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for used elements.
x1 - SVG: Scalable Vector Graphics
WebSVGAttributex1
elements that only need one coordinate use the x attribute instead.
... two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="5" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="9" x2="5" y1="1" y2="9" stroke="blue" /> </svg> line for <line>, x1 defines the x coordinate of the starting point of the line.
x2 - SVG: Scalable Vector Graphics
WebSVGAttributex2
elements that only need one coordinate use the x attribute instead.
... two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="5" x2="1" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="5" x2="9" y1="1" y2="9" stroke="blue" /> </svg> line for <line>, x2 defines the x coordinate of the ending point of the line.
y - SVG: Scalable Vector Graphics
WebSVGAttributey
thirty seven elements are using this attribute: <altglyph>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <rect y="20" x="20" width="60" height="60" /> <rect y="120" x="20" width="60" height="60" ...
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for used elements.
y1 - SVG: Scalable Vector Graphics
WebSVGAttributey1
elements that only need one coordinate use the y attribute instead.
... two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="1" y2="5" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="9" y2="5" stroke="blue" /> </svg> line for <line>, y1 defines the y coordinate of the starting point of the line.
y2 - SVG: Scalable Vector Graphics
WebSVGAttributey2
elements that only need one coordinate use the y attribute instead.
... two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="5" y2="1" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="5" y2="9" stroke="blue" /> </svg> line for <line>, y2 defines the y coordinate of the ending point of the line.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
svg elements can be modified using attributes that specify details about exactly how the element should be handled or rendered.
... below is a list of all of the attributes available in svg along with links to reference documentation to help you learn which elements support them and how they work.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
circle cx="50" cy="40" r="35"/> </a> <!-- a link around a text --> <a href="/docs/web/svg/element/text"> <text x="50" y="90" text-anchor="middle"> &lt;circle&gt; </text> </a> </svg> /* as svg does not provide a default visual style for links, it's considered best practice to add some */ @namespace svg url(http://www.w3.org/2000/svg); /* necessary to select only svg <a> elements, and not also html’s.
...ia-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 categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2th...
<desc> - SVG: Scalable Vector Graphics
WebSVGElementdesc
the hidden text of a <desc> element can also be concatenated with the visible text of other elements using multiple ids in an aria-describedby value.
... </desc> </circle> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<desc>' in that specification.
<discard> - SVG: Scalable Vector Graphics
WebSVGElementdiscard
the <discard> svg element allows authors to specify the time at which particular elements are to be discarded, thereby reducing the resources required by an svg user agent.
... usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<script> attributes global attributes conditional processing attributes core attributes aria attributes specific attributes begin href (but note that <discard> has never supported xlink:href) specifications specification status comment svg animations level 2the definition of '<discard>' in that specification.
<feComponentTransfer> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<fefunca>, <fefuncr>, <fefuncb>, <fefuncg> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfecomponenttransferelement interface.
... working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity.
<filter> - SVG: Scalable Vector Graphics
WebSVGElementfilter
it is never rendered itself, but must be used by the filter attribute on svg elements, or the filter css property for svg/html elements.
... usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elementsfilter primitive elements<animate>, <set> attributes global attributes core attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes x y width height filterres filterunits primitiveunits xlink:href dom interface this element implements the svgfilterelement interface.
<foreignObject> - SVG: Scalable Vector Graphics
the <foreignobject> svg element includes elements from a different xml namespace.
...-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 categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<foreignobject>' in that specification.
<hatch> - SVG: Scalable Vector Graphics
WebSVGElementhatch
paths are defined by <hatchpath> elements.
... usage context categoriesnever-rendered element, paint server elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<hatchpath>, <script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface.
<image> - SVG: Scalable Vector Graphics
WebSVGElementimage
to include dynamic svg elements, try <use> with an external url.
... usage context categoriesgraphics element, graphics referencing elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired transform specific attributes x: positions the image horizontally from the origin.
<metadata> - SVG: Scalable Vector Graphics
WebSVGElementmetadata
the contents of <metadata> should be elements from other xml namespaces such as rdf, foaf, etc.
... usage context categoriesdescriptive elementpermitted contentany elements or character data attributes global attributes core attributes global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface.
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
the <pattern> is referenced by the fill and/or stroke attributes on other graphics elements to fill or stroke those elements with the referenced pattern.
...cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2th...
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
the use of symbol elements for graphics that are used multiple times in the same document adds structure and semantics.
...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 categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> note: a <symbol> element itself is not meant to be rendered.
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
WebSVGElementtitle
note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent.
... </circle> <rect x="11" y="1" width="8" height="8"> <title>i'm a square</title> </rect> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<title>' in that specification.
Linking - SVG: Scalable Vector Graphics
WebSVGLinking
ocuments are embedded within a parent html document using the tag: page1.html: <html> <body> <p>this is a svg button:</p> <object width="100" height="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should navigate to the html document page2.html when the button graphics are clicked.
... to get around this, requires a little ugly javascript hacking: button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <g onclick="top.document.href='page2.html'" cursor="pointer"> <!-- button graphical elements here --> </g> </svg> example for an example of this solution at work see www.codedread.com.
Basic Transformations - SVG: Scalable Vector Graphics
with this helper, you can assign properties to a complete set of elements.
... embedding svg in svg in contrast to html, svg allows you to embed other svg elements seamlessly.
Fills and Strokes - SVG: Scalable Vector Graphics
<defs> stands for definitions, and it is here that you can create elements that don't appear in the svg directly, but are used by other elements.
...ndalone="no"?> <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <style type="text/css"><![cdata[ #myrect { stroke: black; fill: red; } ]]></style> </defs> <rect x="10" height="180" y="10" width="180" id="myrect"/> </svg> moving styles to an area like this can make it easier to adjust properties on large groups of elements.
Getting started - SVG: Scalable Vector Graphics
basic properties of svg files the first important thing to notice is the order of rendering elements.
... the globally valid rule for svg files is, that later elements are rendered atop previous elements.
Gradients in SVG - SVG: Scalable Vector Graphics
you must give the gradient an id attribute; otherwise it can't be referenced by other elements inside the file.
...this is done the same way you reference elements in css, using a url.
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
in these examples, it would probably be simpler to use the <polygon> or <polyline> elements.
...there are an infinite number of bézier curves, but only two simple ones are available in <path> elements: a cubic one, called with c, and a quadratic one, called with q.
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
here, we've just drawn two rectangle elements inside the pattern (which overlap, and one of which is twice the size of the other and is used to fill in the entire pattern), and one circle.
...by changing the patterncontentunits attribute, we can put all the elements into the same unit system: <pattern id="pattern" width=".25" height=".25" patterncontentunits="objectboundingbox"> <rect x="0" y="0" width=".25" height=".25" fill="skyblue"/> <rect x="0" y="0" width=".125" height=".125" fill="url(#gradient2)"/> <circle cx=".125" cy=".125" r=".1" fill="url(#gradient1)" fill-opacity="0.5"/> </pattern> now, because the pattern content is in the same un...
Positions - SVG: Scalable Vector Graphics
the grid for all elements, svg uses a coordinate system or grid system similar to the one used by canvas (and by a whole lot of other computer drawing routines).
...however, this is the same way elements in html are positioned (by default, ltr documents are considered not the rtl documents which position x from right-to-left).
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
like with the shape elements text can be colorized with the fill attribute and given a stroke with the stroke attribute.
... other text-related elements tspan this element is used to mark up sub-portions of a larger text.
Referer header: privacy and security concerns - Web security
the referrerpolicy attribute on html elements that are in danger of leaking such information (such as <img> and <a>).
... the rel attribute set to noreferrer on html elements that are in danger of leaking such information (such as <img> and <a>).
How to turn off form autocompletion - Web security
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 s...
...however modern browsers have stopped autofilling <input> elements with autocomplete="new-password" for this very reason.
Axes - XPath
WebXPathAxes
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are thirteen different axes in the xpath specification.
...only elements have attributes.
key - XPath
WebXPathFunctionskey
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the key function returns a node-set of nodes that have the given value for the given key.
... notes the xsl:key element defines what attribute on what given elements will be used to match the key.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute> element creates an attribute in the output document, using any values that can be accessed from the stylesheet.
...but it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.).
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementchoose
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:choose> element defines a choice among a number of alternatives.
...it contains one or more <xsl:when> elements, and, optionally, a final <xsl:otherwise> element.
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementelement
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:element> element creates an element in the output document.
...applied attributes can be overridden via nested attribute elements.
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfor-each
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:for-each> element selects a set of nodes and processes each of them in the same way.
...if one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing.
<xsl:preserve-space> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:preserve-space> element defines the elements in the source document for which whitespace should be preserved.
... syntax <xsl:preserve-space elements=list-of-element-names /> required attributes elements specifies the elements for which whitespace should be preserved.
<xsl:strip-space> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:strip-space> element defines the elements in the source document for which whitespace should be removed.
... syntax <xsl:strip-space elements=list-of-element-names /> required attributes elements specifies a space-separated list of elements in the source whose whitespace-only text nodes should be removed.
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtemplate
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:template> element defines an output producing template.
... optional attributes match specifies a pattern that determines the elements for which this template should be used.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
examples set the parameter 'color' to the string 'red': <?xslt-param name="color" value="red"?> set the parameter 'columns' to the number 2: <?xslt-param name="columns" select="2"?> set the parameter 'books' to a nodeset containing all <book> elements in the null namespace: <?xslt-param name="books" select="//book"?> set the parameter 'show-toc' to boolean true: <?xslt-param name="show-toc" select="true()"?> the select attribute context the following context is used to parse and evaluate the expression in the select attribute.
... examples set the parameter 'books' to a nodeset containing all <book> elements in the 'http://www.example.org/mynamespace' namespace: <?xslt-param-namespace prefix="my" namespace="http://www.example.org/mynamespace"?> <?xslt-param name="books" select="//my:book"?> supported versions supported as of firefox 2.0.0.1.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation.
... elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (sup...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes an overview the separation of content and presentation is a key design feature of xml.
... xslt/xpath reference elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mo...
Understanding WebAssembly text format - WebAssembly
note: uninitialized elements are given a default throw-on-call value.
...externref can be used for value types and table elements.
2015 MDN Fellowship Program - Archive of obsolete content
in 2015, mdn will expand the impact of this content by developing kits of key learning materials, including such elements as code samples, videos and other elements being finalized.
Content Scripts - Archive of obsolete content
= require("sdk/page-worker").page({ contentscriptfile: self.data.url("content-script.js"), contenturl: "http://en.wikipedia.org/wiki/internet" }); pageworker.port.on("first-para", function(firstpara) { console.log(firstpara); }); pageworker.port.emit("get-first-para"); // content-script.js self.port.on("get-first-para", getfirstpara); function getfirstpara() { var paras = document.getelementsbytagname("p"); if (paras.length > 0) { var firstpara = paras[0].textcontent; self.port.emit("first-para", firstpara); } } from page-mod a single page-mod object might attach its scripts to multiple pages, each with its own context in which the content scripts are executing, so it needs a separate channel (worker) for each page.
Porting the Library Detector - Archive of obsolete content
this means we'll need two additional content scripts: one in the widget's context, which listens for icon mouseover events and sends a message to main.js containing the name of the corresponding library: function setlibraryinfo(element) { self.port.emit('setlibraryinfo', element.target.title); } var elements = document.getelementsbytagname('img'); for (var i = 0; i &lt; elements.length; i++) { elements[i].addeventlistener('mouseover', setlibraryinfo, false); } one in the panel, which updates the panel's content with the library information: self.on("message", function(libraryinfo) { window.document.body.innerhtml = libraryinfo; }); finally main.js relays the library information from the ...
High-Level APIs - Archive of obsolete content
addon-page create a page that does not contain navigational elements.
frame/hidden-frame - Archive of obsolete content
xul <iframe> elements) that are not displayed to the user.
remote/parent - Archive of obsolete content
this includes the content of every tab in an application like firefox and also some other ui elements.
tabs/utils - Archive of obsolete content
returns array : an array of tab elements.
ui/button/toggle - Archive of obsolete content
the only purpose of the extra event is that change is a more natural event name for a toggle button, as it matches the change event emitted by elements like <select> and <input>.
ui/frame - Archive of obsolete content
for example, this html document defines a <select> element and a couple of <span> elements, and includes a css file to style the content and a javascript script to implement behavior: <!doctype html> <html> <head> <link href="city-info.css" rel="stylesheet"></link> </head> <body> <select name="city" id="city-selector"></select> <span id="time" class="info-element"></span> <span id="weather" class="info-element"></span> <script type="text/javascript" src="ci...
Low-Level APIs - Archive of obsolete content
xul <iframe> elements) that are not displayed to the user.
Localization - Archive of obsolete content
hello_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: arialabel ariavaluetext ariamozhint using...
Bootstrapped extensions - Archive of obsolete content
you need to look up the relevant application ui elements by their id by calling document.getelementbyid(), then manipulate them to inject your ui.
Alerts and Notifications - Archive of obsolete content
.getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, '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).
Cookies - Archive of obsolete content
reading existing cookies cookies for a given host, represented as nsicookie2 objects, can be enumerated as such: let enum = services.cookies.getcookiesfromhost("example.com"); while (enum.hasmoreelements()) { var cookie = enum.getnext().queryinterface(ci.nsicookie2); dump(cookie.host + ";" + cookie.name + "=" + cookie.value + "\n"); } all cookies, regardless of host, can be enumerated using services.cookies.enumerator rather than getcookiesfromhost().
Forms related code snippets - Archive of obsolete content
unction ondayclick () { const othiscal = ainstances[this.id.replace(rbgnandend, "")]; othiscal.target.value = (this.innerhtml / 100).tofixed(2).substr(-2) + "\/" + (othiscal.current.getmonth() + 1) + "\/" + othiscal.current.getfullyear(); othiscal.container.parentnode.removechild(othiscal.container); return false; } function buildcalendars () { const afields = document.getelementsbyclassname(sdpclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sdpclass = "date-picker", smonthsnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /...
HTML in XUL for rich tooltips - Archive of obsolete content
for security reasons, the conversion will strip out some of the more dangerous elements in the html string, like javascript and iframes.
Miscellaneous - Archive of obsolete content
var focusedcontrol; window.addeventlistener("load", function(e) { onwindowload(e); }, false); function onwindowload() { gbrowser.addeventlistener("load", onpageload, true); } function onpageload() { pagedoc = document.commanddispatcher.focusedwindow.document; var inputlist = pagedoc.getelementsbytagname('input'); for (var i=1; i<inputlist.length; i++) { inputlist.item(i).
Rosetta - Archive of obsolete content
getsource(oscript) : createscript(oscript); } } function parsedocument () { for ( var ascripts = document.getelementsbytagname("script"), nidx = 0; nidx < ascripts.length; parsescript(ascripts[nidx++]) ); } var odicts = {}, rignoremimes = /^\s*(?:text\/javascript|text\/ecmascript)\s*$/; this.translatescript = parsescript; this.translateall = parsedocument; this.appendcompiler = function (vmimetypes, fcompiler) { if (arguments.length < 2) { throw new typeer...
Scrollbar - Archive of obsolete content
scrollbars inside browser elements will be styled to.
Sidebar - Archive of obsolete content
atever.xul") { // act on the sidebar content } for example to test if the web panel from firefox is open: var sidebarwindow = document.getelementbyid("sidebar").contentwindow; if (sidebarwindow.location.href == "chrome://browser/content/web-panels.xul") { // act on the sidebar content only if it is the web panels } accessing the browser.xul window from a sidebar script see accessing the elements of the top-level document from a child window section of working with windows in chrome code.
JavaScript timers - Archive of obsolete content
basic animations since we're using script to control canvas elements it's also very easy to make (interactive) animations.
getAttributeNS - Archive of obsolete content
while namespaced attributes are less common than namespaced elements, some standards such as xlink depend on them.
Communication between HTML and your extension - Archive of obsolete content
some of the events only apply to certain types of elements so i included trying to modify the result of the ajax request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example).
Inline options - Archive of obsolete content
group> <radio value="false" label="disabled"/> <radio value="true" label="enabled"/> </radiogroup> </setting> <!-- button example - not tied to a preference, but attached to a command --> <setting title="do something" type="control"> <button id="myaddon-button" label="click me" oncommand="alert('thank you!');"/> </setting> setting element changed notifications most of the setting elements (it might be all i havent really looked), support oninputchanged attribute.
Jetpack Processes - Archive of obsolete content
it returns an array whose elements are the return values of each receiver in the chrome process that was triggered by the message.
Connecting to Remote Content - Archive of obsolete content
request.onload = function(aevent) { let responsexml = aevent.target.responsexml; let rootelement = responsexml.documentelement; if (rootelement && "parseerror" != rootelement.tagname) { let shopelements = rootelement.getelementsbytagname("shop"); let totalelement = rootelement.getelementsbytagname("total")[0]; window.alert(shopelements[1].getelementsbytagname("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation cod...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
[html:]div) or an array of elements in json notation function tag(elemnameorarray, elemattr) { // array of elements?
Intercepting Page Loads - Archive of obsolete content
few modern sites use framesets, but it is common for ads to appear inside iframe elements.
Setting Up a Development Environment - Archive of obsolete content
now that you know how to quickly monitor your project and test changes, we'll learn how to add new ui elements to firefox, through overlays and new windows.
User Notifications and Alerts - Archive of obsolete content
the notificationbox elements can be obtained from the gbrowser object.
XUL School Tutorial - Archive of obsolete content
adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model xpcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul school project was developed by appcoast (formerly glaxs...
Performance best practices in extensions - Archive of obsolete content
avoid animated images animated images are much more expensive than generally expected, especially when used in xul tree elements..
Extensions support in SeaMonkey 2 - Archive of obsolete content
although this doesn't affect the appearance of the display, it may affect your extension if it overlays chrome relative to these elements.
Setting up an extension development environment - Archive of obsolete content
chromebug combines elements of a javascript debugger and dom (firefox, "kinda works for thunderbird") mozrepl explore and modify firefox and other mozilla apps while they run (firefox, thunderbird version is not working) executejs an enhanced javascript console (firefox version, thunderbird version is not working) xpcomviewer an xpcom inspector (firefox and thunderbird) javascript shells to test snippets of javascript (...
Using the Stylesheet Service - Archive of obsolete content
in particular, they can apply styles to native anonymous elements and to css anonymous boxes.
Creating a dynamic status bar extension - Archive of obsolete content
the string is built from a combination of static strings and various elements from the fieldarray array.
Creating a status bar extension - Archive of obsolete content
the chrome is the set of user interface elements outside the content area of the application's window, such as toolbars, status bars, menu bars, and the like.
Index of archived content - Archive of obsolete content
dows and dialogs appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and insertion (html & xul) appendix f: monitoring dom changes connecting to remote content custom xul elements with xbl getting started with firefox extensions handling preferences intercepting page loads introduction javascript object management local storage mozilla documentation roadmap observer notifications setting up a development environment the box model ...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
you may also supply any custom plug-in parameters as additional <param> elements.
Kill the XUL.mfl file for good - Archive of obsolete content
avoiding the creation of the xul.mfl file mozilla creates in its profile directory a file named xul.mfl, which contains pre-compiled ui elements.
Finding the code to modify - Archive of obsolete content
inspectorwidget the inspectorwidget extension adds a toolbar button and context menus for invoking the dom inspector (domi) for either chrome or content elements.thus this makes it possible to save all the above dom inspector user interface diggings.
Finding the file to modify - Archive of obsolete content
it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers).
Developing New Mozilla Features - Archive of obsolete content
try hard to design your feature so that it can be implemented and reviewed in manageable size patches if you can implement and submit core elements first and build on them in subsequent patches, so much the better.
Editor Embedding Guide - Archive of obsolete content
first getnext (returns the next name in the name/value pair list) hasmoreelements getvaluetype (numeric enum type see nsicommandparams for values) if the name/value pair is known or it was obtained using the methods described above, it is possible to call the following methods: getbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an n...
Layout FAQ - Archive of obsolete content
ffa8c[0,4,t] next=035ffb1c {0,0,330,285} [state=41600020] sc=035ffa3c pst=:-moz-non-element< "\nabc" > frame(br)(1)@035ffb1c {330,225,0,0} [state=00000020] [content=035aebf0] > > the linebox is used to contain everything on a single line: example how do you fix inconsistent float behavior in firefox involving a two column layout using display:table and floating div elements?
Introducing the Audio API extension - Archive of obsolete content
the audio data api extension extends the html5 specification of the <audio> and <video> media elements by exposing audio metadata and raw audio data.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
to match links and all elements contained in links, use jetpack.menu.context.page.on("a[href], a[href] *").
UI - Archive of obsolete content
menu accessing, modifying, and creating menus in the browser slidebar ui mechanism for displaying jetpack content in a slide-out animated vertical column toolbar including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users via provided ui mechanisms selection interacting wi...
Modularization techniques - Archive of obsolete content
in house equivalents to the important elements of this technology will be developed as needed.
Prism - Archive of obsolete content
web apps can also point to a complete web app bundle or some elements of a web app (like higher resolution icons).
Space Manager Detailed Design - Archive of obsolete content
the primary goal of the space manager is to provide information about those bands of space to support the css notion of floated elements.
Tamarin build documentation - Archive of obsolete content
preparing your eclipse workspace and perspective open the c/c++ perspective open the 'c/c++ projects' view (window >> show view >> c/c++ projects) add view filter 'non-c elements' (in the top-right of the 'c/c++ projects' view, click the down-arrow, click 'filters...', check 'non-c elements') increase the threshold for 'editor scalability mode' to 20000 lines.
Venkman Internals - Archive of obsolete content
to obtain the antecedent files: doc.getelementsbytagname("script"); then extract the urls from the src attributes.
Venkman Introduction - Archive of obsolete content
this quick stop mode reflects a common scenario in javascript debugging, which is to inspect and debug scripts while they are running, as on a page where elements are moved around dynamically with dhtml.
DOM Interfaces - Archive of obsolete content
any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document.
Event Handlers - Archive of obsolete content
event handlers are defined using handler elements.
Mozilla E4X - Archive of obsolete content
e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists.
XTech 2005 Presentations - Archive of obsolete content
e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists.
bottom - Archive of obsolete content
« xul reference home bottom type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the bottom edge of the element relative to the bottom edge of the stack.
button.type - Archive of obsolete content
panel elements are popups that support any type of content.
container - Archive of obsolete content
« xul reference home container type: boolean set to true if the element is to act as a container which can have child elements.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
datasources - Archive of obsolete content
the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements.
drawintitlebar - Archive of obsolete content
this is supported only from window elements, and is ignored on platforms that don't support drawing into the title bar.
flags - Archive of obsolete content
dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated.
left - Archive of obsolete content
ArchiveMozillaXULAttributeleft
« xul reference home left type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the left edge of the element relative to the left edge of the stack.
modifiers - Archive of obsolete content
access: the access key for activating menus and other elements.
onchange - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
preference-editable - Archive of obsolete content
this is useful for custom elements implemented in xbl.
ref - Archive of obsolete content
ArchiveMozillaXULAttributeref
« xul reference home ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins.
resizeafter - Archive of obsolete content
grow the elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size.
right - Archive of obsolete content
« xul reference home right type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the right edge of the element relative to the right edge of the stack.
spellcheck - Archive of obsolete content
--> <input type="text" spellcheck="false" /><br /> <textarea spellcheck="false"></textarea> <div contenteditable="true" spellcheck="false">i am some content</div> you can use spellcheck on input, textarea, and contenteditable elements.
tabindex - Archive of obsolete content
elements with a higher tabindex are later in the tab sequence.
template - Archive of obsolete content
« xul reference home template type: id for template generated elements, this attribute may optionally be placed on the root node (the element with the datasources attribute) to refer to a template that exists elsewhere in the xul code.
top - Archive of obsolete content
ArchiveMozillaXULAttributetop
« xul reference home 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.
treecol.editable - Archive of obsolete content
individual treecell elements in the column may be marked editable="false" in order to disable editing.
wait-cursor - Archive of obsolete content
usually, you would only use this on the window element or other top-level elements.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
command elements can be activated by any of their observing elements being activated.
findbar - Archive of obsolete content
possible values are: find_normal (0): normal find find_typeahead (1): typeahead find find_links (2): link find methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
appendNotification - Archive of obsolete content
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.
MoveResize - Archive of obsolete content
for instance, the following example will move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar.
Special per-platform menu considerations - Archive of obsolete content
notes for firefox extension developers on the mac, some elements, once moved to the application menu, are no longer accessible from xul overlays or from javascript injected into browser.xul.
PopupEvents - Archive of obsolete content
this event will be fired even for elements that don't have a context menu associated with them.
PopupKeys - Archive of obsolete content
this allows the focus to be shifted to elements within the panel.
Positioning - Archive of obsolete content
these attributes are described below and function the same for all three elements.
browsers - Archive of obsolete content
« xul reference browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser.
children - Archive of obsolete content
« xul reference children type: array of elements returns the list of items in the richlistbox.
database - Archive of obsolete content
set to null for elements that do not have a datasources attribute.
externalToolbars - Archive of obsolete content
« xul reference externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
maxWidth - Archive of obsolete content
note: prior to gecko 6.0, you could use this on <input> elements; this was never intended, was a violation of the html specification, and has been fixed.
preferencePanes - Archive of obsolete content
« xul reference preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window.
prefpane.preferences - Archive of obsolete content
« xul reference preferences type: dom nodelist holds a list of the preference elements in the pane.
selected - Archive of obsolete content
this property is available for menuitem and menuseparator elements in firefox 3.
selectedTab - Archive of obsolete content
« xul reference selectedtab type: tab element a reference to the currently selected tab, which will always be one of the tab elements in the tabs element.
value - Archive of obsolete content
ArchiveMozillaXULPropertyvalue
for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax.
wizardPages - Archive of obsolete content
« xul reference wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard.
Sorting and filtering a custom tree view - Archive of obsolete content
"ascending" : "descending"); tree.setattribute("sortresource", columnname); tree.view = new treeview(table); //set the appropriate attributes to show to indicator var cols = tree.getelementsbytagname("treecol"); for (var i = 0; i < cols.length; i++) { cols[i].removeattribute("sortdirection"); } document.getelementbyid(columnname).setattribute("sortdirection", order == 1 ?
alert-icon - Archive of obsolete content
this and the other icon classes may be used by image elements or other elements which can have an image.
tree-splitter - Archive of obsolete content
« xul reference home tree-splitter this splitter is intended to be used in tree columns (in-between treecol elements).
Namespaces - Archive of obsolete content
n" gender="male"/> <person name="laura secord" gender="female"/> </people> <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <action> <listitem uri="?" label="?ns:name"/> </action> </template> </listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates.
Recursive Generation - Archive of obsolete content
<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.
SQLite Templates - Archive of obsolete content
we retrieve the param elements and set their textcontent properties to the desired value.
XML Assignments - Archive of obsolete content
<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.
Tree Widget Changes - Archive of obsolete content
there are no changes to xul tree tags, however the id attribute is no longer required on treecol elements just to get them to work.
Cross Package Overlays - Archive of obsolete content
it will just have a few elements for entering a filename and directory to search.
Custom Tree Views - Archive of obsolete content
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.
More Tree Features - Archive of obsolete content
remembering state of columns as with all elements, the persist attribute can be used to save the state of the columns in-between sessions.
Persistent Data - Archive of obsolete content
our find files example let's add the persist attribute to some of the elements in the find files dialog.
Progress Meters - Archive of obsolete content
source view in the next section, we will learn how to add additional elements to the window using html.
Property Files - Archive of obsolete content
use a chrome url to read a file from the locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together.
Tree Box Objects - Archive of obsolete content
next, we'll look at rdf which can be used to automatically populate trees and other elements.
Tree View Details - Archive of obsolete content
if we had a row that had no children we would want to implement the iscontainerempty function so that it returned true for those elements.
Updating Commands - Archive of obsolete content
note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event.
XUL Tutorial - Archive of obsolete content
introduction introduction xul structure the chrome url manifest files simple elements creating a window adding buttons adding labels and images input controls numeric controls list controls progress meters adding html elements using spacers more button features the box model the box model element positioning box model details groupboxes adding more elements more layout elements stacks and decks stack positioning tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handle...
Using the standard theme - Archive of obsolete content
you can either provide a complete custom styling, but most of the time you also want to be able to reuse the standard theme (also called the "global skin") of the base application for non-custom elements, transparently with regard to which theme the user has currently chosen.
Writing Skinnable XUL and CSS - Archive of obsolete content
the colors for the toolbar and buttons should be drawn from global by placingclass attributes on the appropriate elements in the xul.
XUL Parser in Python/source - Archive of obsolete content
ms(): el_list[name][strip(attr)] = strip(val) def syntax_error(self, message): pass p = xulparser() cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; background-color: lightgrey;}</style>') elements = el_list.keys() elements.sort() for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item]: w.write('<tr><td class="at">' + a + '</td>') w.write('</table></html>\n') w.close() ...
action - Archive of obsolete content
, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
assign - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
bbox - Archive of obsolete content
ArchiveMozillaXULbbox
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
binding - Archive of obsolete content
s, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
browser - Archive of obsolete content
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
deck - Archive of obsolete content
ArchiveMozillaXULdeck
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
dropmarker - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
editor - Archive of obsolete content
inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
grippy - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
iframe - Archive of obsolete content
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
observes - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
page - Archive of obsolete content
ArchiveMozillaXULpage
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
panel - Archive of obsolete content
ArchiveMozillaXULpanel
methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), ...
param - Archive of obsolete content
ArchiveMozillaXULparam
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
promptBox - Archive of obsolete content
return value a nodelist containing all of the prompt elements on the tabbrowser.
resizer - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
script - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
scrollbar - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
scrollcorner - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
stringbundle - Archive of obsolete content
inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
triple - Archive of obsolete content
ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
wizardpage - Archive of obsolete content
, persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattri...
XUL - Archive of obsolete content
xul reference xul elements, attributes, properties, methods, and event handlers.
Getting started with XULRunner - Archive of obsolete content
for information about mixing html elements into your xul read adding html elements.
XUL Explorer - Archive of obsolete content
there is even simple “keyword” help lookup for xul elements.
mozilla.dev.platform FAQ - Archive of obsolete content
q: when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box, what needs to be implement?
Extentsions FAQ - Archive of obsolete content
the problem with most js frameworks is that they bootstrap by dynamically appending script elements, which doesn't work in xul, last i checked.
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.platform - november 11th - november 17th, 2006 announcements no announcements this week traffic xulrunner: <browser> not allowing javascript popup windows b notes that when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box and asks what needs to be implement.
2006-18-24 - Archive of obsolete content
summary: mozilla.dev.platform - november 18th - november 24th, 2006 announcements no announcements this week traffic xulrunner: <browser> not allowing javascript popup windows b notes that when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box and asks what needs to be implement.
2006-10-27 - Archive of obsolete content
help for getting html element width info discussion on retrieving width information on html elements when using the gecko engine.
2006-10-13 - Archive of obsolete content
discussions wxmozilla and ff1.5 xpcom problems updating wxmozilla to use it with firefox 1.5.7 browser elements, opening links in a new window using javascript to open window in new window.
NPAPI plugin developer guide - Archive of obsolete content
ntime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type overview of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying ...
NPWindow - Archive of obsolete content
clipping to the cliprect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen.
What is RSS - Archive of obsolete content
when you create your own rss feeds, you will likely want to make them more complex than these and include additional rss elements and make use of the various rss modules.
Element - Archive of obsolete content
ArchiveRSSModuleSlashElement
rss slash module elements note: in the list of elements below the slash xml namespace prefix is used (since it is a popular choice).
Element - Archive of obsolete content
rss well-formed web module elements note: in the list of elements below the wfw xml namespace prefix is used (since it is a popular choice).
Proposal - Archive of obsolete content
in development rsshints a module that adds elements to a feed that help an aggregator process them.
RSS - Archive of obsolete content
atomic rss tim bray talks about using atom 1.0 as a micro format and extension module for rss 2.0; keeping rss 2.0 as your sydication format but bringing in and using selected atom 1.0 elements.
title - Archive of obsolete content
why can't i get any tang?</description> </item> </channel> </rss> attributes none sub-elements none parent elements the table below shows a list of rss elements that this element can be a child of.
Element - Archive of obsolete content
rss elements a <author> (rss author element) b c <category> (rss category element) <channel> (rss channel element) <cloud> (rss cloud element) <comments> (rss comments element) <copyright> (rss copyright element) d <day> (rss day element) <description> (rss description element) <docs> (rss docs element) e <enclosure> (rss enclosure element) f g <generator> (rss generator element) <guid> (rss guid element) h <height> (rss height element) <hour> (rss hour element) i <image> (rss image element) <item> (rss item element) j k l <language> (rss language element) <lastbuilddate> (rss last build date element) <link> (rss link element) m <managingeditor> (rss managing editor element) n <name> (rss name element) o p <pubdate> (rss publis...
SAX - Archive of obsolete content
elements, attributes, whitespace, and processing instructions).
Confidentiality, Integrity, and Availability - Archive of obsolete content
if an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like denial of service that would bring down the server, making the website unavailable to legitimate users due to lack of availability.
Table Reflow Internals - Archive of obsolete content
absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more.
Summary of Changes - Archive of obsolete content
proprietary or deprecated feature w3c feature or recommended replacement deprecated font html 4.01 span plus css1 color: ; font-family: ; font-size: ; deprecated center or align="center" css1 text-align: center; for in-line elements like text or image deprecated center or align="center" css1 margin-left: auto; margin-right: auto; for block-level elements deprecated bgcolor css1 background-color: ; non-standard embed html 4.01 object deprecated applet html 4.01 object non-standard marquee html 4.01 div plus scripting non-standard bgsound html 4.01 obj...
Using Web Standards in your Web Pages - Archive of obsolete content
the first 2 sections address exclusively validation issues, benefits of validation, deprecated elements, deprecated attributes.
-moz-binding - Archive of obsolete content
formal definition initial valuenoneapplies toall elements except generated content or pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <url> | none examples .exampleone { -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#radiobutton); } specifications not part of any standard.
-moz-border-bottom-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-left-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-right-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-border-top-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
-moz-text-blink - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none produces no blinking.
-moz-window-shadow - Archive of obsolete content
initial valuedefaultapplies toall elements that create native windows, e.g.
-ms-accelerator - Archive of obsolete content
initial valuefalseapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete 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.
-ms-block-progression - Archive of obsolete content
initial valuetbapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values tb default.
-ms-filter - Archive of obsolete content
initial value"" (the empty string)applies toall elementsinheritednocomputed valueas specifiedanimation typediscrete remarks the following table lists the most popular dx filters and their standards-based alternatives: dx filter standards-based alternative alpha opacity alphaimageloader <img> or background-image and related properties gradient background-image: linear-gradient() dropshadow ...
-ms-flow-from - Archive of obsolete content
initial valuenoneapplies tonon-replaced elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default.
-ms-flow-into - Archive of obsolete content
initial valuenoneapplies toiframe elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default.
-ms-high-contrast-adjust - Archive of obsolete content
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto indicates the applicable css properties will be adjusted as expected when the system is in high contrast mode.
-ms-hyphenate-limit-chars - Archive of obsolete content
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto corresponds to a value of 5 2 2, indicating a 5-character word limit, 2 characters required before a hyphenation break, and 2 characters required following a hyphenation break.
-ms-hyphenate-limit-lines - Archive of obsolete content
initial valueno-limitapplies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values no-limit indicates that hyphenation is not limited based on the number of consecutive hyphenated lines.
-ms-hyphenate-limit-zone - Archive of obsolete content
initial value0applies toblock container elementsinheritedyespercentagescalculated with respect to the width of the line boxcomputed valueas specifiedanimation typediscrete syntax values <percentage> an integer followed by a percent sign (%), which specifies the width of the hyphenation zone, calculated with respect to the line box.
-ms-ime-align - Archive of obsolete content
initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword values */ -ms-ime-align: auto; -ms-ime-align: after; values auto initial value.
-ms-overflow-style - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto the initial value.
-ms-scrollbar-face-color - Archive of obsolete content
initial valuethreedfaceapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll box and scroll arrows.
-ms-scrollbar-highlight-color - Archive of obsolete content
initial valuethreedhighlightapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar.
-ms-text-autospace - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none no effect takes place; that is, no extra space is added.
-ms-wrap-margin - Archive of obsolete content
initial value0applies toexclusion elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the margin size, a non-negative value.
:-moz-full-screen-ancestor - Archive of obsolete content
however, those elements' ancestors have this pseudo-class applied to them.
::-ms-ticks-after - Archive of obsolete content
it is possible to use the ::-ms-ticks-after, ::-ms-ticks-before, and ::-ms-track pseudo-elements together.
::-ms-ticks-before - Archive of obsolete content
it is possible to use the ::-ms-ticks-after, ::-ms-ticks-before, and ::-ms-track pseudo-elements together.
::-ms-track - Archive of obsolete content
it is possible to use the ::-ms-ticks-after, ::-ms-ticks-before, and ::-ms-track pseudo-elements together.
azimuth - Archive of obsolete content
ArchiveWebCSSazimuth
initial valuecenterapplies toall elementsinheritedyescomputed valuenormalized angleanimation typediscrete syntax <angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] | behind ] | leftwards | rightwards values angle audible source position is described as an angle within the range -360deg to 360deg.
display-inside - Archive of obsolete content
if the element's computed <display-outside> value is an layout-specific internal type, this elements acts as normal for its given <display-outside> value.
Descendants and Filters - Archive of obsolete content
consider var element = <dogs> <fido color="brown"/> <spike color="black"/> <killer color="brown"/> </dogs>; var list = element.*.(@color == "brown"); originally, elements.* returns a list with all 3 dogs in it.
VBArray.toArray - Archive of obsolete content
for example, a vbarray with three dimensions and three elements in each dimension is converted into a javascript array as follows: suppose the vbarray contains: (1, 2, 3), (4, 5, 6), (7, 8, 9).
New in JavaScript 1.3 - Archive of obsolete content
in javascript 1.3, splice always returns an array containing the removed elements.
New in JavaScript 1.8 - Archive of obsolete content
when using the javascript shell, javascript xpcom components, or xul <script> elements, the latest js version (js1.8 in mozilla 1.9) is used automatically (bug 381031, bug 385159).
ParallelArray - Archive of obsolete content
syntax new parallelarray() new parallelarray([element0, element1, ...]) new parallelarray(arraylength, elementalfunction) parallelarray instances properties length reflects the number of elements in the parallelarray.
Window.importDialog() - Archive of obsolete content
example var dialog = importdialog(null, "chrome://myextension/content/dialog.xul", myobject); notes the xul passed to importdialog() is very similar to xul passed to window.opendialog(), with some limitations and caveats: only <dialog> top level elements are permitted.
Troubleshooting XForms Forms - Archive of obsolete content
if your binding expression contains a /, look for any containing xf:group, xf:repeat, xf:input or other elements that set the context node.
XForms Group Element - Archive of obsolete content
all content elements (e.g.
XForms Label Element - Archive of obsolete content
every form control other than the output and choices elements must contain a label element.
XForms Select Element - Archive of obsolete content
the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements.
XForms Select1 Element - Archive of obsolete content
the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements.
XForms - Archive of obsolete content
xforms ui elements reference xforms user interface elements documentation.
Anatomy of a video game - Game development
you could draw every pixel individually on a canvas or you could layer dom elements (including multiple webgl canvases with transparent backgrounds if you want) into a complex hierarchy.
Examples - Game development
webgl filters demo showing webgl filters being used to add effects to html elements.
Explaining basic 3D theory - Game development
textures are combined from single texture elements called texels the same way picture elements are combined from pixels.
Building up a basic demo with A-Frame - Game development
rotation there's a special <a-animation> entity that can help us animate elements.
Mobile touch controls - Game development
pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be quite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, moving the space ship around).
Create the Canvas and draw on it - Game development
the body contains <canvas> and <script> elements — we will render the game inside the first one and write the javascript code that controls it in the second one.
2D maze game with device orientation - Game development
this.game.scale.scalemode = phaser.scalemanager.show_all; this.game.scale.pagealignhorizontally = true; this.game.scale.pagealignvertically = true; this.game.state.start('preloader'); } }; the main ball object is defined and we're adding two variables called _width and _height that are the width and the height of the game canvas — they will help us position the elements on the screen.
Visual typescript game engine - Game development
* - dragging is script for dragging dom elements.
Plug-in Development Overview - Gecko Plugin API Reference
for information about the html elements to use, see using html to display plug-ins.
First CPU idle - MDN Web Docs Glossary: Definitions of Web-related terms
generally, it occurs when most, but not necessarily all visible ui elements are interactive, and the user interface responds, on average, to most user input within 50ms.
First interactive - MDN Web Docs Glossary: Definitions of Web-related terms
minimally interactive is defined as when some, but not necessarily all, ui elements on the page have loaded and are interactive, and, on average, respond to user input in a reasonable amount of time.
Flex Item - MDN Web Docs Glossary: Definitions of Web-related terms
the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items.
HTML5 - MDN Web Docs Glossary: Definitions of Web-related terms
among other features, html5 includes new elements and javascript apis to enhance storage, multimedia, and hardware access.
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
unlike low-level programming languages, it may use natural language elements, or may automate (or even entirely hide) significant areas of computing systems, making the process of developing simpler and more understandable relative to a lower-level language.
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page).
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
for example, the default type for <input> elements is "text", so if you set input.type="foobar", the <input> element will be of type text (in the appearance and the behavior) but the "type" content attribute's value will be "foobar".
Intrinsic Size - MDN Web Docs Glossary: Definitions of Web-related terms
for example, inline elements are sized intrinsically: width, height, and vertical margin and padding have no impact, though horizontal margin and padding do.
Media (Audio-visual presentation) - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge multimedia on wikipedia technical reference web media technologies: a guide to all the ways media can be used in web content multimedia and embedding in the mdn learning area <audio> and <video> elements, used to present media in html documents ...
Node (DOM) - MDN Web Docs Glossary: Definitions of Web-related terms
GlossaryNodeDOM
various things that are nodes are the document itself, elements, text, and comments.
Node - MDN Web Docs Glossary: Definitions of Web-related terms
various things that are nodes are the document itself, elements, text, and comments.
Pseudo-class - MDN Web Docs Glossary: Definitions of Web-related terms
in css, a pseudo-class selector targets elements depending on their state rather than on information from the document tree.
Pseudo-element - MDN Web Docs Glossary: Definitions of Web-related terms
learn more technical reference pseudo-elements ...
SVG - MDN Web Docs Glossary: Definitions of Web-related terms
as a vector image format, svg graphics can scale infinitely, making them invaluable in responsive design, since you can create interface elements and graphics that scale to any screen size.
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
just like keyboard navigation without voiceover, you can navigate through interactive elements using the tab key and the arrow keys: next interactive element: tab previous interactive element: shift + tab next radio button in a same named-group: right or down arrow previous radio button in a same named-group: left or up arrow navigating through the content of a page is done with the tab key and a series of other keys along with control + option keys next heading: control + optio...
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
this provides a way to encapsulate implementation details, which is especially useful for custom elements and other advanced design paradigms.
Stacking context - MDN Web Docs Glossary: Definitions of Web-related terms
stacking context refers to how elements on a webpage appear to sit on top of other elements, just as you can arrange index cards on your desk to lie side-by-side or overlap each other.
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
if no other styles are applied to content, the user agent origin's styles are used while rendering elements.
Event - MDN Web Docs Glossary: Definitions of Web-related terms
events are assets generated by dom elements, which can be manipulated by a javascript code.
markup - MDN Web Docs Glossary: Definitions of Web-related terms
within a text file such as an html file, elements are marked up using tags which explain the purpose of that part of the content.
Property (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
here's an example of a css rule: /* "div" is a selector indicating that all the div elements */ /* in the document will be styled by that rule */ div { /* the property "color" with the value "black" indicates */ /* that the text will have the color black */ color: black; /* the property "background-color" with the value "white" indicates */ /* that the background color of the elements will be white */ background-color: white; } learn more general knowledge learn css technical reference the css reference on mdn the css working group current work ...
Test your skills: WAI-ARIA - Learn web development
assuming you are not able to change the elements used, how can you allow screenreader users to recognize this as a list?
Accessibility - Learn web development
html: a good basis for accessibility a great deal of web content can be made accessible just by making sure the correct html elements are always used for the correct purpose .
Backgrounds and borders - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Overflowing content - Learn web development
previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Test your skills: values and units - Learn web development
all <p> elements should be 16 pixels.
Test your skills: Flexbox - Learn web development
flex layout three there are two elements in the html below, a div with a class of .parent which contains another div with a class of .child.
Test Your Skills: Fundamental layout comprehension - Learn web development
the <article> and <aside> elements should display as a two column layout.
Test your skills: Multicol - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered.
Test your skills: position - Learn web development
you will be working through two small tasks which use different elements of the material you have just covered.
Using your new knowledge - Learn web development
font-family color border-bottom font-weight font-size text-decoration i have used a mixture of selectors, styling elements such as h1 and h2, but also creating a class for the job title and styling that.
Use CSS to solve common problems - Learn web development
LearnCSSHowto
common use cases basics how to apply css to the dom how to use whitespace in css how to write comments in css how to select elements via element name, class or id how to select elements via attribute name and content how to use pseudo-classes how to use pseudo-elements how to apply multiple selectors to the same rule how to specify colors in css how to debug css in the browser css and text how to style text how to customize a list of elements how to style links how to add shadows to text boxes and layouts how to size css boxes how to control overflowing content how to control the part of a css box that the background is drawn under how do i define inline, block, and inlin...
Learn to style HTML using CSS - Learn web development
from the beginning, you'll primarily apply colors to html elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements.
What do common web layouts contain? - Learn web development
these elements are quite common in all form factors, but they can be laid out different ways.
How much does it cost to do something on the Web? - Learn web development
likewise, video-editing software can be free (pitivi, openshot for linux, imovie for mac), less than $100 (adobe premiere elements), or several hundred dollars (adobe premiere pro, avid media composer, final cut pro).
What are browser developer tools? - Learn web development
in microsoft edge, or opera, tap/click elements.
What is a URL? - Learn web development
the html language — which will be discussed later on — makes extensive use of urls: to create links to other documents with the <a> element; to link a document with its related resources through various elements such as <link> or <script>; to display media such as images (with the <img> element), videos (with the <video> element), sounds and music (with the <audio> element), etc.; to display other html documents with the <iframe> element.
Test your skills: Basic controls - Learn web development
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.
Test your skills: Form structure - Learn web development
add a suitable set of structural elements around the label/field pairs to separate them out.
Installing basic software - Learn web development
office document editors are not suitable for this use, as they rely on hidden elements that interfere with the rendering engines used by web browsers.
Using data attributes - Learn web development
data-* attributes allow us to store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
how to use data attributes advanced text semantics how to take control of html line breaking how to mark changes (added and removed text) — see the <ins> and <del> elements.
Creating hyperlinks - Learn web development
block level links as mentioned before, almost any content can be made into a link, even block-level elements.
Test your skills: HTML images - Learn web development
what you need to do here is add elements that will associate the image with the caption.
Mozilla splash page - Learn web development
adding responsive images to the further info links inside the <div> with the class of further-info you will find four <a> elements — each one linking to an interesting mozilla-related page.
Assessment: Structuring planet data - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
HTML Tables - Learn web development
LearnHTMLTables
a very common task in html is structuring tabular data, and it has a number of elements and attributes for just this purpose.
Choosing the right approach - Learn web development
only when all three function calls have resolved promise.all([coffee, tea, description]).then(values => { console.log(values); // store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; // display the images in <img> elements let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); }); pitfalls if a promise.all...
Graceful asynchronous programming with Promises - Learn web development
console.log(values); // store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; // display the images in <img> elements let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); save and refresh and you should see your ui com...
Build your own function - Learn web development
const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); the next two sections make use of the same createelement() and appendchild() functions we've already seen to create two new elements — a <p> and a <button> — and insert them in the page as children of the panel <div>.
Function return values - Learn web development
there's also a <script> element, in which we have stored a reference to both html elements in two variables.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Making decisions in your code — conditionals - Learn web development
in the javascript, we are storing a reference to both the <select> and <p> elements, and adding an event listener to the <select> element so that when its value is changed, the setweather() function is run.
Fetching data from the server - Learn web development
this stores a reference to the <select> and <pre> elements in constants and defines an onchange event handler function so that when the select's value is changed, its value is passed to an invoked function updatedisplay() as a parameter.
Introduction to web APIs - Learn web development
we start by creating an audiocontext instance inside which to manipulate our track: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); next, we create constants that store references to our <audio>, <button>, and <input> elements, and use the audiocontext.createmediaelementsource() method to create a mediaelementaudiosourcenode representing the source of our audio — the <audio> element will be played from: const audioelement = document.queryselector('audio'); const playbtn = document.queryselector('button'); const volumeslider = document.queryselector('.volume'); const audiosource = audioctx.createmediaelementsource(a...
Arrays - Learn web development
creating arrays arrays consist of square brackets and elements that are separated by commas.
Adding features to our bouncing balls demo - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
Object building practice - Learn web development
these contain the following, respectively: a very simple html document featuring an <h1> element, a <canvas> element to draw our balls on, and elements to apply our css and javascript to our html.
CSS performance optimization - Learn web development
some elements, including <video>, <canvas> and <iframe>, are also on their own layer.
What is web performance? - Learn web development
the document object model, or dom, is a tree structure that represents the content and elements of your html as a tree of nodes.
Learning area release notes - Learn web development
ou'll now find "test your skills" assessments accompanying the articles in the following modules: css building blocks javascript first steps javascript building blocks introducing javascript objects january 2020 the html forms module has been significantly updated: it has been retitled web forms, and moved out of the html topic area to recognise that it covers more than just html form elements — it also covers styling, validation, the basics of how to send data and process it on the server, and more besides.
Client-Server Overview - Learn web development
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.
Website security - Learn web development
for html this includes elements, such as <script>, <object>, <embed>, and <link>.
Getting started with Ember - Learn web development
there are a couple of github issues open about this on the todomvc family of projects: add keyboard access to demos re-enable outline on focusable elements ember has a strong commitment to being accessible by default and there is an entire section of the ember guides on accessibility on what it means for website / app design.
Framework main features - Learn web development
rendering elements just as with lifecycles, frameworks take different-but-similar approaches to how they render your applications.
React interactivity: Events and state - Learn web development
for example: const btn = document.queryselector('button'); btn.addeventlistener('click', () => { alert("hi!"); }); in react, we write event handlers directly on the elements in our jsx, like this: <button type="button" onclick={() => alert("hi!")} > say hi!
React interactivity: Editing, filtering, conditional rendering - Learn web development
render an array of <filterbutton /> elements that allow users to change the active filter between all, completed, and incomplete.
Starting our Svelte Todo list app - Learn web development
the accessibility rules checked by svelte are taken from eslint-plugin-jsx-a11y, a plugin for eslint that provides static checks for many accessibility rules on jsx elements.
Deployment and next steps - Learn web development
we also saw some advanced concepts and techniques to interact with dom elements and to programmatically extend html element capabilities using the use directive.
Creating our first Vue component - Learn web development
in a similar fashion to how vue uses {{}} expressions to display javascript expressions inside templates, vue has a special syntax to bind javascript expressions to html elements and components: v-bind.
Getting started with Vue - Learn web development
installation to use vue in an existing site, you can drop one of the following <script> elements onto a page.
Adding a new todo form: Vue events, methods, and models - Learn web development
this works very similarly to native events on html elements: a child component can emit an event which can be listened to via v-on.
Implementing feature detection - Learn web development
we will add the html5 shiv to our example too so that the html5 semantic elements will style properly in older versions of ie.
Handling common JavaScript problems - Learn web development
jquery for example provides its own fully-featured selectors and dom manipuation libraries, to allow css-selector type selecting of elements in javascript and easier dom building.
Gecko info for Windows accessibility vendors
hresult get_nodeinfo( /* [out] */ bstr *nodename, // for elements, this is the tag name /* [out] */ short *namespaceid, /* [out] */ bstr *nodevalue, /* [out] */ unsigned int *numchildren, /* [out] */ unsigned int *uniqueid, // see description of unique id's in above section on events /* [out] */ unsigned short *nodetype); the get_attributes method returns the set of attribute, value pairs for a given node...
Theme concepts
for example, the following code, from the dynamic theme example defines the content for the day and night elements of the dynamic theme: const themes = { 'day': { images: { theme_frame: 'sun.jpg', }, colors: { frame: '#cf723f', tab_background_text: '#111', } }, 'night': { images: { theme_frame: 'moon.jpg', }, colors: { frame: '#000', tab_background_text: '#fff', } } }; the theme.theme object is then passed to theme.update() to change the ...
Adding a new CSS property
in any case where the computation you do might vary between elements that match the same list of style rules, you need to set the canstoreinruletree variable to false.
A bird's-eye view of the Mozilla framework
javascript client example suppose the javascript service in figure 2 is getlink() in help.js, which responds to the user clicking on a link in thecontents panel within thehelp viewer window by obtaining the link from thecontents panel elements stored in a dom tree.
Creating reftest-based unit tests
i can create 50 or 100 test files that have spaces between the element name and the attribute of a element for a bunch of different elements, add those to the list of tests to be run, and it causes no problems for anyone.
Debugging Table Reflow
look there especially how the maxelementsize (mes) and desired size are propagated.
Inner and outer windows
consider a document that has three <iframe> elements in it.
SVG Guidelines
here are some commonly seen examples: style="display: none;" on <defs> elements (a <defs> element is hidden by default) type="text/css" on <style> elements stroke: none or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes.
Index
always keep in mind the side effects your changes may have, from blocking other tasks to interfering with other user interface elements.
Frame script environment
in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all the frame scripts running in a tab share this global.
Frame script environment
in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all of the frame scripts running in a tab share this global.
Performance
remove interactive ui elements that would be inert with the addon ...
Multiprocess Firefox
some elements of multiprocess firefox have been retained for compatibility.
Tracking Protection
sometimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements.
Firefox UI considerations for web developers
firefox's top sites box in this article, we take a look at how to influence the appearance of your site in firefox user interface elements such as the top sites box.
Firefox
always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.privacythis document lists privacy-related documentation.security best practices for firefox front-end engineersthis article will help firefox developers understand the security controls in place and avoid common pitfalls when developing front-end code for firefox.site identity buttonthe site identity button is a feature in firefox that gives users more information about the sites they visit.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
aside from the iframe, there are some basic controls: <button> elements, a simple <form> to implement the browser controls, and a search bar.
-moz-window-dragging
initial value drag applies to all elements that create native windows, e.g.
::-moz-tree-image
associated elements <xul:treeitem> <xul:treecell> style properties margin list-style position examples bookmark icons in the places window - mozillazine forum ...
::-moz-tree-cell-text
associated elements <xul:treecell> style properties font visibility color text-decoration ...
::-moz-tree-cell
associated elements <xul:treecell> style properties background border margin outline padding visibility ...
::-moz-tree-column
associated elements <xul:treecol> style properties margin visibility text style ...
::-moz-tree-drop-feedback
associated elements <xul:treerow> style properties margin visibility ...
::-moz-tree-indentation
associated elements <xul:treeitem> style properties position ...
::-moz-tree-line
associated elements <xul:treeitem> style properties border visibility ...
::-moz-tree-progressmeter
associated elements <xul:treecell> style properties margin color ...
::-moz-tree-row
associated elements treerow syntax treechildren::-moz-tree-row { style properties } style properties background border margin outline padding display -moz-appearance examples treechildren::-moz-tree-row( foo bar ) { margin: 2%; } ...where...
::-moz-tree-separator
associated elements <xul:treeseparator> style properties border display -moz-appearance ...
::-moz-tree-twisty
associated elements <xul:treecell> style properties border margin padding display list-style position -moz-appearance ...
overflow-clip-box-block
"things"> <input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-block: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow m...
overflow-clip-box-inline
things"> <input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-inline: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow m...
Embedding the editor
fix existing js and c++ code which explicitly addresses elements in the xul document to go through nsieditoruserinterface.
Gecko Keypress Event
xul application developers should use key elements for handling accel keys, so as to make use of the handling logic already provided for these elements.
Gecko's "Almost Standards" Mode
"almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "quirks" mode: the height calculations for line boxes and some of the inline elements in them.
HTTP Cache
elements in this global hashtable are hashtables of cache entries.
IPDL Tutorial
hild: rpc init(nscstring pluginpath) returns (bool ok); // this part creates constructor messages rpc pplugininstance(nscstring type, nscstring[] args) returns (int rv); }; // ----- file pplugininstance.ipdl include protocol pplugin; rpc protocol pplugininstance { manager pplugin; child: rpc __delete__(); setsize(int width, int height); }; this example has several new elements: `include protocol` imports another protocol declaration into this file.
Http.jsm
the elements of the array will be url-encoded and "application/x-www-form-urlencoded; charset=utf-8" will be enforced as the content type.
L10n testing with xcode
now, you can navigate through the firefox app in the ios simulator, viewing both ui elements and accessibility strings as you go.
Localization sign-off reviews
in principle, they share basic elements, but sign-off reviews are only for evaluating the changes between your latest approved revision and the new revision you've submitted for release approval.
What every Mozilla translator should know
if you choose to make any changes to the productization elements (i.e.
Extras
other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined.
Fonts for Mozilla 2.0's MathML engine
if necessary, you might want to modify the font-family on the <math> elements and, for gecko, the on ::-moz-math-stretchy pseudo element too.
MathML3Testsuite
characters blocks symbols variants entitynames numericrefs utf8 general clipboard genattribs math presentation css dynamicexpressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests errorhandling original document information author(s): frédéric wang other contributors: last updated date: may 26, 2010 copyright information: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative com...
Various MathML Tests
overview of presentation mathml elements testing tensor indices <mmultiscripts>: r i1 j2 k3 ; this with <none/>, a qp i a bit of calculus: ∫ a b f ( x ) dx ∂ ∂ x f ( x , y ) + ∂ ∂ y f ( x , y ) here is the alphabet with invisible portions wrapped by <mphantom> in between: a b c d e f g h i j k l m n o p q r s t u v w x y z .
MathML Demo: <mtable> - tables and matrices
and making floating elements do a multiplication such as the following one which is anchored at a baseline is made simple by using align="baseline1" on both tables [ a b c d ] [ a b c d ] to multiply a matrix a by a vector x, each row of the matrix has to be multiplied to the vector.
Using the viewport meta tag to control layout on mobile browsers
(there are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.) the initial-scale property controls the zoom level when the page is first loaded.
Mozilla DOM Hacking Guide
nswindowsh, nselementsh, ...
Scroll-linked effects
scrolling effects explained often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the css position or transform property.) you can find a sampling of such effects at css scroll api: use cases.
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console.
AsyncTestUtils extended framework
folderswithmsghdrs [getter] return a list where each element is a list with two sub-elements.
Midas
internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable.
Linked Lists
the api is a set of macros for initializing a circular (doubly linked) list, inserting and removing elements from the list.
PR_Calloc
syntax #include <prmem.h> void *pr_calloc ( pruint32 nelem, pruint32 elsize); parameters nelem the number of elements of size elsize to be allocated.
PR_GetDefaultIOMethods
description after using pr_getdefaultiomethods to identify the default i/o methods table, you can select elements from that table with which to build your own layer's methods table.
PR_Poll
npds the number of elements in the pds array.
NSS 3.24 release notes
new elements this section lists and briefly describes the new functions, types, and macros in nss 3.24.
Rhino overview
otherwise the ecma conformant version is used (an array is constructed with no elements but with length property equal to i).
Performance Hints
arrays use the forms of the array constructor that specify a size or take a list of initial elements.
Creating JavaScript jstest reftests
it is easy to make a test silently pass; anyone who has written js code for the web has written this kind of if-statement: if (typeof gc === 'function') { var arr = []; arr[10000] = 'item'; gc(); asserteq(arr[10000], 'item', 'gc must not wipe out sparse array elements'); } else { print('test skipped: no gc function'); } reportcompare(0, 0, 'ok'); handling abnormal test terminations some tests can terminate abnormally even though the test has technically passed.
JIT Optimization Outcomes
argumentslength icsetpropstub_slot icsetpropstub_genericproxy icsetpropstub_domproxyshadowed icsetpropstub_domproxyunshadowed icsetpropstub_callsetter icsetpropstub_addslot icsetpropstub_setunboxed icgetelemstub_readslot icgetelemstub_callgetter icgetelemstub_readunboxed icgetelemstub_dense icgetelemstub_densehole icgetelemstub_typedarray icgetelemstub_argselement icgetelemstub_argselementstrict icsetelemstub_dense icsetelemstub_typedarray icnamestub_readslot icnamestub_callgetter call inlining outcomes optimization outcomes of attempts to inline function calls.
JSFunctionSpec
array elements are actually individual properties.
JS_AliasElement
once you create an alias, you can reassign it to other elements as needed.
JS_DeleteElement
to remove all elements and properties from an object, call js_clearscope.
JS_GetArrayLength
retrieve the number of elements in an array object.
JS_LookupElement
note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings.
JS_ReportOutOfMemory
when a script tries to grow an array beyond 230-1 elements, for example, or concatenate strings such that the result is more than 229-1 characters long, the javascript engine reports an error as though by calling this function.
jschar
jschar is the type of javascript "characters", the 16-bit elements that make up strings.
Shell global objects
collect the nursery every n nursery allocations 8: (incrementalrootsthenfinish) incremental gc in two slices: 1) mark roots 2) finish collection 9: (incrementalmarkallthenfinish) incremental gc in two slices: 1) mark all 2) new marking and finish 10: (incrementalmultipleslices) incremental gc in multiple slices 11: (incrementalmarkingvalidator) verify incremental marking 12: (elementsbarrier) always use the individual element post-write barrier, regardless of elements size 13: (checkhashtablesonminorgc) check internal hashtables on minor gc 14: (compact) perform a shrinking collection every n allocations 15: (checkheapaftergc) walk the heap to check its integrity after every gc 16: (checknursery) check nursery integrity on minor gc schedulegc([num | ob...
WebReplayRoadmap
media elements (bug 1304146) web audio (bug 1304147) webrtc (bug 1304149) webassembly (bug 1481007) webgl (bug 1506467) support more operating systems (not yet implemented) only macos is supported right now.
Mozilla Projects
internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable.
Redis Tips
in addition to getting elements by their rank in the zset, you can get them by score.
Gecko Roles
role_grip represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows.
AT APIs Support
developing a xul window is not that different from developing a web page, but the elements available to add widgets are more powerful and designed to be similar to desktop widgets.
Accessibility API Implementation Details
xforms accessibilitythis article provides a quick guide to how accessibility is handled in gecko for xforms.xul accessibilitythis article shows how xul control elements are mapped to accessibility api.
Avoiding leaks in JavaScript XPCOM components
(but since service is a global variable, just fixing the cycle doesn't fix the leak.) don't store short-lived objects as javascript properties of short-lived dom nodes i mentioned earlier that, in versions of mozilla before 1.8, setting arbitrary javascript properties on elements (or using xbl fields) causes that element's javascript wrapper to be rooted until the document stops being displayed.
Finishing the Component
the other method on the nsicontentpolicy interface is for blocking processing of specific elements in a document, but our policy is more restrictive: if the url isn't on the white list, the entire page should be blocked.
Using XPCOM Components
managing cookies from javascript var cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); cmgr = cmgr.queryinterface(components.interfaces.nsicookiemanager); function loadcookies() { // load cookies into a table var enumerator = cmgr.enumerator; var count = 0; var showpolicyfield = false; while (enumerator.hasmoreelements()) { var nextcookie = enumerator.getnext(); nextcookie = nextcookie.queryinterface(components.interfaces.nsicookie); /* ....
Creating XPCOM components
rn values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri objects building the weblock ui user interface package list client code overview xul the x...
Mozilla internal string guide
mozilla::bulkwritehandle<t> autoconverts to a writable mozilla::span<t> and also provides explicit access to itself as span (asspan()) or via component accessors named consistently with those on span: elements() and length() the latter is not the logical length of the string but the writable length of the buffer.
Components.classesByID
components.classesbyid is exactly like components.classes except that the elements are indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid.
Components.interfacesByID
components.interfacesbyid is exactly like components.interfaces except that the elements are indexed by the canonical form of their iid.
XPConnect wrappers
this includes all dom objects (including window) and chrome elements that are reflected into javascript.
NS_InitXPCOM3
astaticmodulecount [in] the number of elements in astaticmodules.
inIDOMUtils
may be omitted when checking the regular elements.
GroupPosition
refer to accessible web specifications to get an idea what elements expose group information.
nsIAccessible
the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text.
nsIAccessibleRole
role_grip 4 represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows.
nsICacheMetaDataVisitor
netwerk/cache/nsicacheentrydescriptor.idlscriptable this interface is used for visiting the meta data elements for a specified cache entry.
nsIDOMHTMLMediaElement
dom/interfaces/html/nsidomhtmlmediaelement.idlscriptable the basis for the nsidomhtmlaudioelement and nsidomhtmlvideoelement interfaces, which in turn implement the <audio> and <video> html5 elements.
nsIDOMMozNetworkStatsManager
if false or not set, the total traffic, which is generated from both the mozapp and mozbrowser iframe elements, is returned.
nsIDOMNSHTMLDocument
embeds nsidomhtmlcollection equivalent to getelementsbytagname("embed") read only.
nsIDOMProgressEvent
1.0 66 introduced gecko 1.9.1 deprecated gecko 22 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download.
nsIDOMWindow
it represents a single window object that may contain child windows if the document in the window contains an html frameset document, or if the document contains iframe elements.
nsIDOMWindow2
it represents a single window object that may contain child windows if the document in the window contains an html frameset document, or if the document contains <iframe> elements.
nsIDOMXULControlElement
dom/interfaces/xul/nsidomxulcontrolelement.idlscriptable provides additional attributes specific to control elements.
nsIDOMXULLabeledControlElement
dom/interfaces/xul/nsidomxullabeledcontrolel.idlscriptable this interface is used as a basis for labeled control elements in xul.
getFiles
return values the elements of the returned nsisimpleenumerator instance must support nsifile and may support nsilocalfile.
nsIDirectoryServiceProvider2
the elements in the enumeration are nsifile.
nsIDragService
for other types of elements, the element is rendered into an offscreen buffer in the same manner as it is currently displayed.
nsIEventListenerService
acount on return, contains the number of elements in the returned array.
nsIFeedTextConstruct
some extension elements also include "type" parameters, and this interface could be used to represent those as well.
nsIFile
edesc(in long flags, in long mode); void renameto(in nsifile newparentdir, in astring newname); void remove(in boolean recursive); void reveal(); void setrelativedescriptor(in nsifile fromfile, in acstring relativedesc); attributes attribute type description directoryentries nsisimpleenumerator returns an enumeration of the elements in a directory.
nsIFilePicker
var files = fp.files; var paths = []; while (files.hasmoreelements()) { var arg = files.getnext().queryinterface(components.interfaces.nsilocalfile).path; paths.push(arg); } ...
nsIMacDockSupport
two types of elements: menu (if you would like to have sub menu items, make sure to set a label on the "menu" element) menuitem (like in example above) elements can be hidden by adding the hidden attribute to the menu or menuitem and setting it to true .
nsINavHistoryQueryResultNode
there are querycount elements in the array.
nsINavHistoryResultTreeViewer
method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
nsIPlacesView
getremovableselectionranges() returns an array whose elements are themselves arrays of nsinavhistoryresultnode objects that can be removed from the view.
Component; nsIPrefBranch
acount optional from gecko 2.0 receives the number of elements in the array.
nsIPropertyBag
inherits from: nsisupports last changed in gecko 1.0 method overview nsivariant getproperty(in astring name); attributes attribute type description enumerator nsisimpleenumerator get a nsisimpleenumerator whose elements are nsiproperty objects.
nsIStringEnumerator
must be preceded by a call to hasmoreelements() which returns pr_true.
nsISupports proxies
now xpinstall can do its installations while the product renders, but now xpinstall can not access ui elements such as a progress meter or a confirmation dialog.
nsITransferable
contains the serialized ancestor elements.
nsIWebContentHandlerRegistrar
.getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=compose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but its just finding a suitable contentwindow var domwindows = services.wm.getenumerator(null); while (domwindows.hasmoreelements()) { var adomwindow = domwindows.getnext(); if (adomwindow.gbrowser) { if (adomwindow.gbrowser.tabcontainer) { //adomwindow has tabs var tabs = adomwindow.gbrowser.tabcontainer.childnodes; for (var i = 0; i < tabs.length; i++) { console.log(tabs[i].linkedbrowser.contentwindow.location); if (tabs[i].linkedbrowser.c...
nsIWebProgressListener
this includes other document requests (for example corresponding to html <iframe> elements).
nsIWinTaskbar
they don't even have to represent actual gui elements on the window.
nsIXFormsNSInstanceElement
nsixformsnsinstanceelement is implemented by all xforms <instance/> elements, defining mozilla extensions.
nsIXFormsNSModelElement
nsixformsnsmodelelement is implemented by all xforms <model/> elements.
nsIZipWriter
r_create_file creates file if it dne //pr_rdwr opens for reading and writing //recursviely add all var dirarr = [dir]; //adds dirs to this as it finds it for (var i=0; i<dirarr.length; i++) { cu.reporterror('adding contents of dir['+i+']: ' + dirarr[i].leafname + ' path: ' + dirarr[i].path); var direntries = dirarr[i].directoryentries; while (direntries.hasmoreelements()) { var entry = direntries.getnext().queryinterface(ci.nsifile); //entry is instance of nsifile so here https://developer.mozilla.org/docs/xpcom_interface_reference/nsifile if (entry.path == xpi.path) { cu.reporterror('skipping entry - will not add this entry to the zip file - as this is the zip itself: "' + xpi.path + '" leafname:"' + xpi.leafname + '"'); c...
Using nsIPasswordManager
the example below should serve as a starting point: // the host name of the password we are looking for var querystring = 'http://www.example.com'; // ask the password manager for an enumerator: var e = passwordmanager.enumerator; // step through each password in the password manager until we find the one we want: while (e.hasmoreelements()) { try { // get an nsipassword object out of the password manager.
Using nsISimpleEnumerator
using nsisimpleenumerator <stringbundle>.strings var enumerator = document.getelementbyid('astringbundleid').strings; var s = ""; while (enumerator.hasmoreelements()) { var property = enumerator.getnext().queryinterface(components.interfaces.nsipropertyelement); s += property.key + ' = ' + property.value + ';\n'; } alert(s); example using javascript 1.7 features // creates a generator iterating over enum's values function generatorfromsimpleenumerator(enum, interface) { while (enum.hasmoreelements()) { yield enum.getnext().queryinterface(interface); } } var b = document.getelementbyid("stringbundleset").firstchild var props = generatorfromenumerator(b.strings, components.interfaces.nsipropertyelement); var s = ""; for (let property in props) { s += property.key + ' = ...
nsIMsgCloudFileProvider
afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequestobserver acallback); acstring providerurlforerror(in unsigned long aerror); attributes attribute type description type acstring readonly: the type is a unique string identifier which can be used by interface elements for styling.
Thunderbird Configuration Files
userchrome.css this file sets the display rules for various elements in the thunderbird user interface and is located in the sub-folder called chrome in your profile folder.
Building a Thunderbird extension 6: Adding JavaScript
depending on the installed theme the result will look something like this: modify xul elements with javascript save the following javascript code into the content/ folder next to your myhelloworld.xul file and name it overlay.js.
Demo Addon
it lets you iterate over any collection and transforms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");.
UInt64
arithmetic operations const uint64 = ctypes.uint64; const int64 = ctypes.int64; function ensureuint64(aarr) { // makes elements in aarr a uint64 if it can be made, else throws for (var i=0; i<aarr.length; i++) { var ccon = aarr[i].constructor.name; if (ccon != 'uint64') { if (['string', 'number'].indexof(ccon) > -1) { aarr[i] = uint64(aarr[i]); } else { throw new error('invalid type at position ' + i + ' it must be a nu...
Plug-in Development Overview - Plugins
for information about the html elements to use, see using html to display plug-ins.
Gecko Plugin API Reference - Plugins
ntime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type overview of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying ...
Browser Console - Firefox Developer Tools
you can confirm this by evaluating window: this means you can control the browser: opening, closing tabs and windows and changing the content that they host, and modify the browser's ui by creating, changing and removing xul elements.
DOM Property Viewer - Firefox Developer Tools
if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements.
Break on DOM mutation - Firefox Developer Tools
attribute modification execution pauses when any of the elementsʼ attributes are modified.
Access debugging in add-ons - Firefox Developer Tools
ndow.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the debugged scope, or highlight elements on the page that are referenced as variables in the debugged scope.
Set event listener breakpoints - Firefox Developer Tools
if however you have multiple elements, all of which have event listeners attached that you want to break on, this becomes an enormous time saver.
Debugger.Environment - Firefox Developer Tools
the global object and dom elements appear in the chain of environments via object environments.
Debugger.Object - Firefox Developer Tools
if the referent uses destructuring parameters, then the array’s elements reflect the structure of the parameters.
Debugger.Object - Firefox Developer Tools
if the referent uses destructuring parameters, then the array's elements reflect the structure of the parameters.
Dominators view - Firefox Developer Tools
for example: variables allocated on the stack need to be rooted, or internal caches may need to root their​ elements.
Edit CSS filters - Firefox Developer Tools
you can then apply saved filters to new elements.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
clicking the icon toggles the display of an overlay on the page, which appears over the selected flex container that displays an outline around each flex item: the overlay will still be shown when you select other elements from the inspector panel, so you can edit related css properties and see how the flex items are affected by your changes.
Examine Event Listeners - Firefox Developer Tools
the inspector shows the word "event" next to elements in the html pane, that have event listeners bound to them: click the icon, then you'll see a popup listing all the event listeners bound to this element: each line contains: a right-pointing arrowhead; click to expand the row and show the listener function source code a curved arrow pointing to a stack; click it to show the code for the handler in the debugger the name of the event for which a handler was attached to this element the name and line number for the listener; you can also click here to expand the row and view the listener function source code a label indicating whether the event bubbles a label indicating the system that defines the event.
Select an element - Firefox Developer Tools
the highlighted element is the element that's overlaid in the page with a graphic showing the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
Use the Inspector from the Web Console - Firefox Developer Tools
dom elements in the web console output get a target next to them.
How to - Firefox Developer Tools
css flexbox inspector: examine flexbox layoutscss grid inspector: examine grid layoutsedit css filtersedit shape paths in cssedit fontsexamine event listenersexamine and edit cssexamine and edit htmlexamine and edit the box modelinspect and select colorsopen the inspectorreposition elements in the pageselect an elementselect and highlight elementsuse the inspector apiuse the inspector from the web consoleview background imagesvisualize transformswork with animations ...
Page Inspector - Firefox Developer Tools
how to to find out what you can do with the inspector, see the following how to guides: open the inspector examine and edit html examine and edit the box model inspect and select colors reposition elements in the page edit fonts visualize transforms use the inspector api select an element examine and edit css examine event listeners work with animations edit css filters edit css shapes view background images use the inspector from the web console examine css grid layouts examine css flexbox layouts reference keyboard shortcuts settings ...
Toolbox - Firefox Developer Tools
see "selecting elements".
Rich output - Firefox Developer Tools
in particular, it: provides extra information for certain types enables detailed examination of the object's properties provides richer information for dom elements, and enables you to select them in the inspector type-specific rich output the web console provides rich output for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
The JavaScript input interpreter - Firefox Developer Tools
you get autocomplete suggestions for array elements, as well: you can enable or disable autocompletion via the settings ("gear") menu in the web console toolbar.
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
the angle_instanced_arrays.vertexattribdivisorangle() method of the webgl api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
AudioContextLatencyCategory - Web APIs
"interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action.
AudioContextOptions - Web APIs
"interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action.
AudioDestinationNode.maxChannelCount - Web APIs
example the following would set up a simple audio graph, featuring an audiodestinationnode with maxchannelcount of 2: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); audioctx.destination.maxchannelcount = 2; gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin.
AudioDestinationNode - Web APIs
their speakers), so you can get it hooked up inside an audio graph using only a few lines of code: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin.
AudioParam.exponentialRampToValueAtTime() - Web APIs
dio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var exprampplus = document.queryselector('.exp-ramp-plus'); var exprampminus = document.queryselector('.exp-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set its gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick exprampplus.onclick = function() { ga...
AudioParam.linearRampToValueAtTime() - Web APIs
nt.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var linearrampplus = document.queryselector('.linear-ramp-plus'); var linearrampminus = document.queryselector('.linear-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick linearrampplus.onclick = function() { ...
AudioParam.setTargetAtTime() - Web APIs
myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var attimeplus = document.queryselector('.at-time-plus'); var attimeminus = document.queryselector('.at-time-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick attimeplus.onclick = function(...
AudioParam.setValueAtTime() - Web APIs
audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var targetattimeplus = document.queryselector('.set-target-at-time-plus'); var targetattimeminus = document.queryselector('.set-target-at-time-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick targetattimeplus.onclick = fun...
AudioParam.setValueCurveAtTime() - Web APIs
new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var valuecurve = document.queryselector('.value-curve'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set button to do something onclick var wavearray = new float32arr...
AudioTrack - Web APIs
the audiotrack interface represents a single audio track from one of the html media elements, <audio> or <video>.
AuthenticatorAttestationResponse.getTransports() - Web APIs
the elements of this array are supposed to be in lexicographical order.
BaseAudioContext.createDynamicsCompressor() - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
BaseAudioContext.createStereoPanner() - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and t...
CSSPseudoElement.element - Web APIs
st originatingelement = csspseudoelement.element; console.log(myelement === originatingelement); // outputs true console.log(myelement.parentelement === originatingelement); // outputs false console.log(myelement.lastelementchild === csspseudoelement); // outputs false console.log(myelement.lastchild === csspseudoelement); // outputs false console.log(myelement.nextelementsibling === csspseudoelement); // outputs false console.log(myelement.nextsibling === csspseudoelement); // outputs false specifications specification status comment css pseudo-elements level 4the definition of 'element' in that specification.
CSSPseudoElement.type - Web APIs
he relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); // outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' in that specification.
CSSStyleSheet.addRule() - Web APIs
styleblock a domstring indicating the style block to apply to elements matching the selector.
CSSStyleSheet.insertRule() - Web APIs
mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the dom).
CSS Object Model (CSSOM) - Web APIs
positionvalue cssrotate cssscale cssskew cssskewx cssskewy cssstylevalue csstransformcomponent csstransformvalue csstranslate cssunitvalue cssunparsedvalue cssvariablereferencevalue stylepropertymap stylepropertymapreadonly obsolete cssom interfaces cssprimitivevalue cssvalue cssvaluelist tutorials determining the dimensions of elements (it needs some updating as it was made in the dhtml/ajax era).
Using the CSS Painting API - Web APIs
registerpaint('csspaintfunctionname', class { static get inputproperties() { return ['propertyname1', '--custompropertyname2']; } static get inputarguments() { return ['<color>']; } static get contextoptions() { return {alpha: true}; } paint(drawingcontext, elementsize, stylemap) { // paint code goes here.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // send the current state of the canvas as a frame to the stream stream.getvideotracks()[0].requestframe(); specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream.requestframe()' in that specification.
CanvasCaptureMediaStreamTrack - Web APIs
specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastreamtrack' in that specification.
CanvasRenderingContext2D.addHitRegion() - Web APIs
they let you route events to dom elements, and make it possible for users to explore the canvas without seeing it.
CanvasRenderingContext2D.getLineDash() - Web APIs
if the number, when setting the elements, is odd, the elements of the array get copied and concatenated.
CanvasRenderingContext2D.getTransform() - Web APIs
examples in the following example, we have two <canvas> elements.
CanvasRenderingContext2D.setLineDash() - Web APIs
if the number of elements in the array is odd, the elements of the array get copied and concatenated.
CanvasRenderingContext2D.setTransform() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.settransform(1, .2, .8, 1, 0, 0); ctx.fillrect(0, 0, 100, 100); result retrieving and passing a dommatrix object in the following example, we have two <canvas> elements.
Basic usage of canvas - Web APIs
fallback content the <canvas> element differs from an <img> tag in that, like for <video>, <audio>, or <picture> elements, it is easy to define some fallback content, to be displayed in older browsers not supporting it, like versions of internet explorer earlier than version 9 or textual browsers.
Drawing shapes with canvas - Web APIs
all elements are placed relative to this origin.
Optimizing canvas - Web APIs
a possible optimization in this situation is to layer your items using multiple <canvas> elements.
Canvas API - Web APIs
scrawl-canvas is an open-source javascript library for creating and manipulating 2d canvas elements.
ChildNode - Web APIs
WebAPIChildNode
previouselementsibling and nextelementsibling are now defined on the latter.
Console.dirxml() - Web APIs
WebAPIConsoledirxml
displays an interactive tree of the descendant elements of the specified xml/html element.
Crypto.getRandomValues() - Web APIs
all elements in the array are overwritten with random numbers.
CryptoKey - Web APIs
WebAPICryptoKey
possible values for array elements are: "encrypt": the key may be used to encrypt messages.
CustomEvent - Web APIs
this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance).
DOMMatrix - Web APIs
WebAPIDOMMatrix
[m11m21m31m41m12m22m32m42m13m23m33m43m14m24m34m44]\left [ \begin{matrix} m_{11} & m_{21} & m_{31} & m_{41} \\ m_{12} & m_{22} & m_{32} & m_{42} \\ m_{13} & m_{23} & m_{33} & m_{43} \\ m_{14} & m_{24} & m_{34} & m_{44} \end{matrix} \right ] the positions of the 16 elements (m11 through m44) which comprise the 4×4 abstract matrix.
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.dataset attribute, to represent data for custom attributes added to elements.
DOMTokenList.remove() - Web APIs
the order you supply the tokens doesn't have to match the order they appear in the list: let span2 = document.getelementsbytagname("span")[0] let classes2 = span.classlist; classes2.remove("c", "b"); span2.textcontent = classes; specifications specification status comment domthe definition of 'remove()' in that specification.
DataTransfer.clearData() - Web APIs
op zone</span> <div>status: <span id="status">drag to start</span></div> <div>data is: <span id="data">uninitialized</span></div> css span.tweaked { display: inline-block; margin: 1em 0; padding: 1em 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript window.addeventlistener('domcontentloaded', function () { // select html elements var draggable = document.getelementbyid('source'); var dropable = document.getelementbyid('target'); var status = document.getelementbyid('status'); var data = document.getelementbyid('data'); var dropped = false; // register event handlers draggable.addeventlistener('dragstart', dragstarthandler); draggable.addeventlistener('dragend', dragendhandler); dropable.addeventlistener...
Document.all - Web APIs
WebAPIDocumentall
in other words, it returns all of the document's elements, accessible by order (like an array) and by id (like a regular object).
Document.caretRangeFromPoint() - Web APIs
oint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode && textnode.nodetype == 3) { let replacement = textnode.splittext(offset); let br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } let paragraphs = document.getelementsbytagname("p"); for (let i = 0; i < paragraphs.length; i++) { paragraphs[i].addeventlistener('click', insertbreakatpoint, false); } result ...
Document.contentType - Web APIs
note: this property is unaffected by <meta> elements.
Document.createCDATASection() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err.
Document.createComment() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml'); var comment = docu.createcomment('this is a not-so-secret comment in your document'); docu.getelementsbytagname('xml')[0].appendchild(comment); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><!--this is a not-so-secret comment in your document--></xml> specifications specification status comment domthe definition of 'document.createcomment' in that specification.
Document.createDocumentFragment() - Web APIs
the usual use case is to create the document fragment, append elements to the document fragment and then append the document fragment to the dom tree.
Document.createTreeWalker() - Web APIs
example the following example goes through all nodes in the body, reduces the set of nodes to elements, simply passes through as acceptable each node (it could reduce the set in the acceptnode() method instead), and then makes use of tree walker iterator that is created to advance through the nodes (now all elements) and push them into an array.
Document: drag event - Web APIs
target.style.background = "purple"; } }, false); document.addeventlistener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.style.background = ""; } }, false); document.addeventlistener("drop", function(event) { // prevent default action (open as link for some elements) event.preventdefault(); // move dragged elem to the selected drop target if (event.target.classname == "dropzone") { event.target.style.background = ""; dragged.parentnode.removechild( dragged ); event.target.appendchild( dragged ); } }, false); specifications specification status comment html living standardthe definition of 'drag event' in th...
Document.embeds - Web APIs
WebAPIDocumentembeds
the embeds read-only property of the document interface returns a list of the embedded <object> elements within the current document.
Document.getElementById() - Web APIs
elements not in the document are not searched by getelementbyid().
Document.links - Web APIs
WebAPIDocumentlinks
the links read-only property of the document interface returns a collection of all <area> elements and <a> elements in a document with a value for the href attribute.
Document.plugins - Web APIs
WebAPIDocumentplugins
the plugins read-only property of the document interface returns an htmlcollection object containing one or more htmlembedelements representing the <embed> elements in the current document.
Document.readyState - Web APIs
we can now access the dom elements.
Document.vlinkColor - Web APIs
the recommended alternative is to get/set the color of the css :visited pseudo-class on html <a> elements (e.g., a:visited {color:red;}).
Document.write() - Web APIs
WebAPIDocumentwrite
note: starting with version 55, chrome will not execute <script> elements injected via document.write() when specific conditions are met.
DocumentFragment - Web APIs
this interface is also of great use with web components: <template> elements contain a documentfragment in their htmltemplateelement.content property.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode.nodetype == 3) { var replacement = textnode.splittext(offset); var br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications specification status comment css object model (cssom) view modulethe definition of 'caretpositionfrompoint()' in that specification.
DocumentOrShadowRoot.getSelection() - Web APIs
it is worth noting that currently getselection() doesn't work on the content of <input> elements in firefox.
DocumentOrShadowRoot - Web APIs
documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates.
Events and the DOM - Web APIs
accessing event interfaces event handlers may be attached to various objects (including dom elements, document, the window object, etc.).
Examples of web and XML development using the DOM - Web APIs
you might also like to add some elements in the page and call this function from different event handlers.
DynamicsCompressorNode.attack - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
DynamicsCompressorNode.knee - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
DynamicsCompressorNode.ratio - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
DynamicsCompressorNode.release - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
DynamicsCompressorNode.threshold - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
DynamicsCompressorNode - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime)...
EXT_float_blend - Web APIs
with this extension enabled, calling drawarrays() or drawelements() with blending enabled and a draw buffer with 32-bit floating-point components will no longer result in an invalid_operation error.
Element.animate() - Web APIs
WebAPIElementanimate
elements can have multiple animations applied to them.
Element.attributes - Web APIs
syntax var attr = element.attributes; example basic examples // get the first <p> element in the document var para = document.getelementsbytagname("p")[0]; var atts = para.attributes; enumerating elements attributes numerical indexing is useful for going through all of an element's attributes.
Element: auxclick event - Web APIs
when listening for auxclick events originating on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button.
Element.className - Web APIs
WebAPIElementclassName
it is better to get/set the classname of an element using element.getattribute and element.setattribute if you are dealing with svg elements.
Element.clientHeight - Web APIs
the element.clientheight read-only property is zero for elements with no css or inline layout boxes; otherwise, it's the inner height of an element in pixels.
Element.clientWidth - Web APIs
the element.clientwidth property is zero for inline elements and elements with no css; otherwise, it's the inner width of an element in pixels.
Element.insertAdjacentElement() - Web APIs
listener(tempdiv); }); afterbtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } setlistener(tempdiv); }); have a look at our insertadjacentelement.html demo on github (see the source code too.) here we have a sequence of <div> elements inside a container.
Element.insertAdjacentHTML() - Web APIs
it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element.
Element.matches() - Web APIs
WebAPIElementmatches
example <ul id="birds"> <li>orange-winged parrot</li> <li class="endangered">philippine eagle</li> <li>great white pelican</li> </ul> <script type="text/javascript"> var birds = document.getelementsbytagname('li'); for (var i = 0; i < birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> this will log "the philippine eagle is endangered!" to the console, since the element has indeed a class attribute with value endangered.
Element: mouseenter event - Web APIs
here 4 events are sent to the four elements of the hierarchy when the pointer reaches the text.
Element: mouseleave event - Web APIs
here four events are sent to the four elements of the hierarchy when the pointer moves from the text to an area outside of the most outer div represented here.
Element: mouseover event - Web APIs
the mouseover event is fired at an element when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the element or one of its child elements.
Element: msContentZoom event - Web APIs
zoomed elements can expose their zoom level through mscontentzoom (ie.
Element.namespaceURI - Web APIs
in firefox 3.5 and earlier, the namespace uri for html elements in html documents is null.
Element.outerHTML - Web APIs
WebAPIElementouterHTML
for example: var div = document.createelement("div"); div.outerhtml = "<div class=\"test\">test</div>"; console.log(div.outerhtml); // output: "<div></div>" also, while the element will be replaced in the document, the variable whose outerhtml property was set will still hold a reference to the original element: var p = document.getelementsbytagname("p")[0]; console.log(p.nodename); // shows: "p" p.outerhtml = "<div>this div replaced a paragraph.</div>"; console.log(p.nodename); // still "p"; the returned value will contain html escaped attributes: var anc = document.createelement("a"); anc.href = "https://developer.mozilla.org?a=b&c=d"; console.log(anc.outerhtml); // output: "<a href='https://developer.mozilla.org?a=b&amp;c=d'><...
Element: overflow event - Web APIs
the overflow event is fired when an element has been overflowed by its content or has been rendered for the first time in this state (only works for elements styled with overflow != visible).
Element.requestFullscreen() - Web APIs
usage notes compatible elements an element that you wish to place into full-screen mode has to meet a small number of simple requirements: it must be one of the standard html elements or <svg> or <math>.
Element.scrollHeight - Web APIs
it can also include the height of pseudo-elements such as ::before or ::after.
Element.scrollIntoView() - Web APIs
example var element = document.getelementbyid("box"); element.scrollintoview(); element.scrollintoview(false); element.scrollintoview({block: "end"}); element.scrollintoview({behavior: "smooth", block: "end", inline: "nearest"}); notes the element may not be scrolled completely to the top or bottom depending on the layout of other elements.
Element.scrollLeft - Web APIs
if specified as a value less than 0 (greater than 0 for right-to-left elements), scrollleft is set to 0.
Element.scrollWidth - Web APIs
it can also include the width of pseudo-elements such as ::before or ::after.
Element.setCapture() - Web APIs
r("mousemove", mousemoved, false); } function mouseup(e) { e.target.removeeventlistener("mousemove", mousemoved, false); } function mousemoved(e) { var output = document.getelementbyid("output"); output.innerhtml = "position: " + e.clientx + ", " + e.clienty; } </script> </head> <body onload="init()"> <p>this is an example of how to use mouse capture on elements in gecko 2.0.</p> <p><a id="mybutton" href="#">test me</a></p> <div id="output">no events yet</div> </body> </html> view live examples notes the element may not be scrolled completely to the top or bottom, depending on the layout of other elements.
Element.setPointerCapture() - Web APIs
this has the effect of suppressing these events on all other elements.
Element.tabStop - Web APIs
WebAPIElementtabStop
this property was proposed to add tab functionality for custom elements.
Element.tagName - Web APIs
WebAPIElementtagName
the tag names of elements in an xml dom tree are returned in the same case in which they're written in the original xml file.
Element: underflow event - Web APIs
this only works for elements for which overflow is not set to visible.
ElementCSSInlineStyle.style - Web APIs
the following code snippet demonstrates the difference between the values obtained using the element's style property and that obtained using the getcomputedstyle() method: <!doctype html> <html> <body style="font-weight:bold;"> <div style="color:red" id="myelement">..</div> </body> </html> var element = document.getelementbyid("myelement"); var out = ""; var elementstyle = element.style; var computedstyle = window.getcomputedstyle(element, null); for (prop in elementstyle) { if (elementstyle.hasownproperty(prop)) { out += " " + prop + " = '" + elementstyle[prop] + "' > '" + computedstyle[prop] + "'\n"; } } console.log(out) the output would be something like: ...
Event.defaultPrevented - Web APIs
example this example logs attempts to visit links from two <a> elements.
EventTarget - Web APIs
many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes.
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api interacts with other apis the file and directory entries api is designed to be used with other apis and elements on the web platform.
FocusEvent.relatedTarget - Web APIs
focus the eventtarget receiving focus the eventtarget losing focus (if any) focusin the eventtarget receiving focus the eventtarget losing focus (if any) focusout the eventtarget losing focus the eventtarget receiving focus (if any) note that many elements can't have focus, which is a common reason for relatedtarget to be null.
FullscreenOptions - Web APIs
properties navigationuioptional a string controlling whether or not to keep browser user interface elements visible while the element is in full-screen mode.
Guide to the Fullscreen API - Web APIs
for example, <iframe> elements have the allowfullscreen attribute in order to opt-in to allowing their content to be displayed in fullscreen mode.
GlobalEventHandlers.onfocus - Web APIs
for onfocus to fire on non-input elements, they must be given the tabindex attribute (see building keyboard accessibility back in for more details).
GlobalEventHandlers.oninvalid - Web APIs
the validity of submittable elements is checked before submitting their owner form, or after the checkvalidity() method of the element or its owner form is called.
GlobalEventHandlers.onmousemove - Web APIs
s.show = function(event) { node.textcontent = event.target.dataset.tooltip; node.removeattribute('hidden'); }; this.hide = function() { node.setattribute('hidden', ''); }; })(); const links = document.queryselectorall('a'); links.foreach(link => { link.onmouseover = tooltip.show; link.onmousemove = tooltip.follow; link.onmouseout = tooltip.hide; }); result draggable elements we also have an example available showing the use of the onmousemove event handler with draggable objects — view the example in action.
HTMLAnchorElement.rel - Web APIs
syntax var relstr = anchorelt.rel; anchorelt.rel = relstr; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { alert("rel: " + anchors[i].rel); } specifications specification status comment html living standardthe definition of 'rel' in that specification.
HTMLAnchorElement.relList - Web APIs
syntax var relstr = anchorelt.rellist; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { var list = anchors[i].rellist; var listlength = list.length; console.log("new anchor node found with", listlength, "link types in rellist."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html living standardthe ...
HTMLAnchorElement - Web APIs
the htmlanchorelement interface represents hyperlink elements and provides special properties and methods (beyond those of the regular htmlelement object interface that they inherit from) for manipulating the layout and presentation of such elements.
HTMLAreaElement.rel - Web APIs
syntax var relstr = areaelt.rel; areaelt.rel = relstr; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { alert("rel: " + areas[i].rel); } specifications specification status comment html living standardthe definition of 'rel' in that specification.
HTMLAreaElement.relList - Web APIs
syntax var relstr = areaelt.rellist; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { var list = areas[i].rellist; var listlength = list.length; console.log("new area found."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html living standardthe definition of 'rellist' in that specification.
HTMLAreaElement - Web APIs
the htmlareaelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements.
HTMLAudioElement - Web APIs
the htmlaudioelement interface provides access to the properties of <audio> elements, as well as methods to manipulate them.
HTMLBaseElement - Web APIs
htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.
HTMLBaseFontElement - Web APIs
the htmlbasefontelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <basefont> elements.
HTMLBodyElement - Web APIs
the htmlbodyelement interface provides special properties (beyond those inherited from the regular htmlelement interface) for manipulating <body> elements.
HTMLCanvasElement.captureStream() - Web APIs
send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification.
HTMLCanvasElement.toDataURL() - Web APIs
lass="grayscale" src="mypicture.png" alt="description of my picture" /> javascript window.addeventlistener('load', removecolors); function showcolorimg() { this.style.display = 'none'; this.nextsibling.style.display = 'inline'; } function showgrayimg() { this.previoussibling.style.display = 'inline'; this.style.display = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), nimgslen = aimages.length, ocanvas = document.createelement('canvas'), octx = ocanvas.getcontext('2d'); for (var nwidth, nheight, oimgdata, ograyimg, npixel, apix, npixlen, nimgid = 0; nimgid < nimgslen; nimgid++) { ocolorimg = aimages[nimgid]; nwidth = ocolorimg.offsetwidth; nheight = ocolorimg.offsetheight; ocanvas.width = nwidth; ...
HTMLCollection.item - Web APIs
elements appear in an htmlcollection in the same order in which they appear in the document's source.
HTMLContentElement.select - Web APIs
syntax object.select = "cssselector cssselector ..."; example // select <h1> elements and elements with class="error" mycontentobject.select = "h1 .error"; specifications this feature is no longer defined by any standards.
HTMLDListElement - Web APIs
the htmldlistelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements.
HTMLDataElement - Web APIs
the htmldataelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <data> elements.
HTMLDetailsElement - Web APIs
the htmldetailselement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <details> elements.
HTMLDialogElement - Web APIs
the htmldialogelement interface provides methods to manipulate <dialog> elements.
HTMLDivElement - Web APIs
the htmldivelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <div> elements.
HTMLElement.forceSpellCheck() - Web APIs
the forcespellcheck() method of the htmlelement interface forces a spelling and grammar check on html elements, even if the user has not focused on the elements.
HTMLElement.hidden - Web APIs
content that isn't yet relevant but may be needed later content that was previously needed but is not any longer content that is reused by other parts of the page in a template-like fashion creating an offscreen canvas as a drawing buffer inappropriate use cases include: hiding panels in a tabbed dialog box hiding content in one presentation while intending it to be visible in others elements that are not hidden must not link to elements which are.
HTMLElement.innerText - Web APIs
note how innertext is aware of things like <br> elements, and ignores hidden elements.
HTMLElement.offsetParent - Web APIs
if there is no positioned ancestor element, the nearest ancestor td, th, table will be returned, or the body if there are no ancestor table elements either.
HTMLElement.offsetWidth - Web APIs
it does not include the width of pseudo-elements such as ::before or ::after.
HTMLEmbedElement - Web APIs
the htmlembedelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <embed> elements.
HTMLFrameSetElement - Web APIs
the htmlframesetelement interface provides special properties (beyond those of the regular htmlelement interface they also inherit) for manipulating <frameset> elements.
HTMLHRElement - Web APIs
the htmlhrelement interface provides special properties (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating <hr> elements.
HTMLHeadingElement - Web APIs
the htmlheadingelement interface represents the different heading elements, <h1> through <h6>.
contentDocument - Web APIs
example of contentdocument var iframedocument = document.getelementsbytagname("iframe")[0].contentdocument; iframedocument.body.style.backgroundcolor = "blue"; // this would turn the iframe blue.
HTMLIFrameElement.contentWindow - Web APIs
example of contentwindow var x = document.getelementsbytagname("iframe")[0].contentwindow; //x = window.frames[0]; x.document.getelementsbytagname("body")[0].style.backgroundcolor = "blue"; // this would turn the 1st iframe in document blue.
HTMLIFrameElement.referrerPolicy - Web APIs
examples var iframe = document.createelement("iframe"); iframe.src = "/"; iframe.referrerpolicy = "unsafe-url"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification.
HTMLIFrameElement.src - Web APIs
syntax refstr = iframeelt.src; iframeelt.src= refstr; example var iframe = document.createelement("iframe"); iframe.src = "/"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification status comment html living standardthe definition of 'htmliframeelement: src' in that specification.
HTMLIFrameElement - Web APIs
the htmliframeelement interface provides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.
HTMLImageElement.alt - Web APIs
there are separate attributes and elements designed for those purposes.
HTMLImageElement.decoding - Web APIs
this can be useful when applied to <img> elements, but may be even more so when used for offscreen image objects.
HTMLImageElement.name - Web APIs
this has been replaced by the id property available on all elements.
HTMLImageElement.useMap - Web APIs
, 25, 75, 75" href="/index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/index.html" alt="shop"> </map> given the image map named mainmenu-map, the image which uses it should look something like the following: <img src="menubox.png" usemap="#mainmenu-map"> for additional examples (including interactive ones), see the articles about the <map> and <area> elements, as well as the guide to using image maps.
HTMLIsIndexElement - Web APIs
the htmlisindexelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <isindex> elements.
HTMLLIElement - Web APIs
the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements.
HTMLLabelElement - Web APIs
the htmllabelelement interface gives access to properties specific to <label> elements.
HTMLLegendElement - Web APIs
the htmllegendelement is an interface allowing to access properties of the <legend> elements.
HTMLLinkElement.referrerPolicy - Web APIs
syntax domstring htmllinkelement.referrerpolicy example var links = document.getelementsbytagname("link"); links[0].referrerpolicy; // "no-referrer" specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification.
HTMLLinkElement.rel - Web APIs
syntax var relstr = linkelt.rel; linkelt.rel = relstr; example var links = document.getelementsbytagname('link'); var length = links.length; for (var i = 0; i < length; i++) { alert(links[i]); } specifications specification status comment html living standardthe definition of 'rel' in that specification.
HTMLLinkElement.relList - Web APIs
syntax var relstr = linkelt.rellist; example var links = document.getelementsbytagname("link"); var length = links.length; for (var i = 0; i < length; i++) { var list = links[i].rellist; var listlength = list.length; console.log("new link found."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html living standardthe definition of 'rellist' in that specification.
HTMLMarqueeElement - Web APIs
the htmlmarqueeelement interface provides methods to manipulate <marquee> elements.
HTMLMediaElement.autoplay - Web APIs
however, autoplay can be useful when creating media elements whose source will be set at a later time, under user control.
HTMLMediaElement.captureStream() - Web APIs
specifications specification status comment media capture from dom elementsthe definition of 'capturestream()' in that specification.
HTMLMediaElement.load() - Web APIs
this method is generally only useful when you've made dynamic changes to the set of sources available for the media element, either by changing the element's src attribute or by adding or removing <source> elements nested within the media element itself.
HTMLMenuElement - Web APIs
the htmlmenuelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menu> elements.
HTMLMenuItemElement - Web APIs
the htmlmenuitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements.
HTMLModElement - Web APIs
the htmlmodelement interface provides special properties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>.
HTMLOListElement - Web APIs
the htmlolistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered list elements.
HTMLOptGroupElement - Web APIs
the htmloptgroupelement interface provides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements.
HTMLOptionElement - Web APIs
the htmloptionelement interface represents <option> elements and inherits all classes and methods of the htmlelement interface.
HTMLOptionsCollection - Web APIs
the htmloptionscollection interface represents a collection of <option> html elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items.
HTMLOrForeignElement.nonce - Web APIs
in later implementations, elements only expose their nonce attribute to scripts (and not to side-channels like css attribute selectors).
HTMLParagraphElement - Web APIs
the htmlparagraphelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <p> elements.
HTMLParamElement - Web APIs
the htmlparamelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element.
HTMLQuoteElement - Web APIs
the htmlquoteelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element.
HTMLSlotElement.assignedNodes() - Web APIs
the available options are: flatten: a boolean indicating whether to return the assigned nodes of any available child <slot> elements (true) or not (false).
HTMLTableCaptionElement - Web APIs
the htmltablecaptionelement interface special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating table caption elements.
HTMLTableColElement - Web APIs
the htmltablecolelement interface provides special properties (beyond the htmlelement interface it also has available to it inheritance) for manipulating single or grouped table column elements.
HTMLTableElement.cellSpacing - Web APIs
while you should instead use the css border-spacing property, the obsolete htmltableelement interface's cellspacing property represents the spacing around the individual <th> and <td> elements representing a table's cells.
HTMLTableElement.insertRow() - Web APIs
if a table has multiple <tbody> elements, by default, the new row is inserted into the last <tbody>.
HTMLTableElement.tBodies - Web APIs
the collection returned includes implicit <tbody> elements.
HTMLTableRowElement.rowIndex - Web APIs
even when the <thead>, <tbody>, and <tfoot> elements are out of order in the html, browsers render the table in the right order.
HTMLTimeElement - Web APIs
the htmltimeelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <time> elements.
HTMLUListElement - Web APIs
the htmlulistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered list elements.
Recommended Drag Types - Web APIs
dragging nodes nodes and elements in a document may be dragged using the application/x-moz-node type.
History.length - Web APIs
WebAPIHistorylength
the history.length read-only property returns an integer representing the number of elements in the session history, including the currently loaded page.
History - Web APIs
WebAPIHistory
length read only returns an integer representing the number of elements in the session history, including the currently loaded page.
Ajax navigation example - Web APIs
to see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): note: for fully integrating the <form> elements within this mechanism, please take a look at the paragraph submitting forms and uploading files.
databases - Web APIs
return value a promise that resolves either to an error or a list of dictionaries, each with two elements, name and version.
Checking when a deadline is due - Web APIs
<select> elements for inputting the day, month and year of the deadline.
IntersectionObserver.disconnect() - Web APIs
the intersectionobserver method disconnect() stops watching all of its target elements for visibility changes.
IntersectionObserver - Web APIs
the configuration cannot be changed once the intersectionobserver is created, so a given observer object is only useful for watching for specific changes in degree of visibility; however, you can watch multiple target elements with the same observer.
IntersectionObserverEntry.intersectionRect - Web APIs
example in this simple example, an intersection callback stores the intersection rectangle for later use by the code that draws the target elements' contents, so that only the visible area is redrawn.
IntersectionObserverEntry.isIntersecting - Web APIs
example in this simple example, an intersection callback is used to update a counter of how many targeted elements are currently intersecting with the intersection root.
IntersectionObserverEntry.time - Web APIs
example see timing element visibility with the intersection observer api for a complete example which uses the time property to track how long elements are visible to the user.
KeyboardLayoutMap.size - Web APIs
the size read-only property of the keyboardlayoutmap interface returns the number of elements in the map.
KeyboardLayoutMap - Web APIs
keyboardlayoutmap.size read only returns the number of elements in the keyboardlayoutmap object.
KeyframeEffect.setKeyframes() - Web APIs
element.animate({ opacity: [ 0, 1 ], // [ from, to ] color: [ "#fff", "#000" ] // [ from, to ] }, 2000); using this format, the number of elements in each array does not need to be equal.
LargestContentfulPaint - Web APIs
(note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || lastentry.loadtime; }); po.observe({type: 'largest-contentful-paint', buffered: true}); // send data to the server.
LayoutShiftAttribution - Web APIs
the layoutshiftattribution interface of the layout instability api provides debugging information about elements which have shifted.
MediaCapabilities.encodingInfo() - Web APIs
ning three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
MediaDevices.getUserMedia() - Web APIs
for example, this line in the http headers will enable use of a camera for the document and any embedded <iframe> elements that are loaded from the same origin: feature-policy: camera 'self' this will request access to the microphone for the current origin and the specific origin https://developer.mozilla.org: feature-policy: microphone 'self' https://developer.mozilla.org if you're using getusermedia() within an <iframe>, you can request permission just for that frame, which is clearly more secure than requestin...
MediaDevices.ondevicechange - Web APIs
tusermedia({ video: { width: 160, height: 120, framerate: 30 }, audio: { samplerate: 44100, samplesize: 16, volume: 0.25 } }).then(stream => { videoelement.srcobject = stream; updatedevicelist(); }) .catch(err => log(err.name + ": " + err.message)); }, false); we set up global variables that contain references to the <ul> elements that are used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist() itself.
MediaElementAudioSourceNode.mediaElement - Web APIs
this stream was specified when the node was first created, either using the mediaelementaudiosourcenode() constructor or the audiocontext.createmediaelementsource() method.
MediaSession - Web APIs
the mediasession interface of the media session api allows a web page to provide custom behaviors for standard media playback interactions, and to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.
Recording a media element - Web APIs
let preview = document.getelementbyid("preview"); let recording = document.getelementbyid("recording"); let startbutton = document.getelementbyid("startbutton"); let stopbutton = document.getelementbyid("stopbutton"); let downloadbutton = document.getelementbyid("downloadbutton"); let logelement = document.getelementbyid("log"); let recordingtimems = 5000; most of these are references to elements we need to work with.
Using the MediaStream Recording API - Web APIs
first of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <a...
MediaStream Recording API - Web APIs
in this code snippet, enumeratedevices() is used to examine the available input devices, locate those which are audio input devices, and create <option> elements that are then added to a <select> element representing an input source picker.
Media Capture and Streams API (Media Stream) - Web APIs
it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode.
Microsoft API extensions - Web APIs
ngmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilermark ...
MouseEvent.screenX - Web APIs
mouse to see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result routing an event when you trap events on the window, document, or other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) view modulethe ...
msPlayToSource - Web APIs
syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device.
MutationObserverInit.attributeFilter - Web APIs
example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
MutationObserverInit.attributeOldValue - Web APIs
example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
MutationObserverInit.attributes - Web APIs
example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
Navigator.getGamepads() - Web APIs
elements in the array may be null if a gamepad disconnects during a session, so that the remaining gamepads retain the same index.
Node.childNodes - Web APIs
WebAPINodechildNodes
to get a collection of only elements, use parentnode.children instead.
Node.cloneNode() - Web APIs
WebAPINodecloneNode
deep has no effect on empty elements (such as the <img> and <input> elements).
Node.isDefaultNamespace() - Web APIs
example var xulns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var el = document.getelementsbytagnamens(xulns, 'textbox')[0]; alert(el.isdefaultnamespace(xulns)); // true specifications specification status comment domthe definition of 'node: isdefaultnamespace' in that specification.
Node.isSameNode() - Web APIs
WebAPINodeisSameNode
html <div>this is the first element.</div> <div>this is the second element.</div> <div>this is the first element.</div> <p id="output"></p> css #output { width: 440px; border: 2px solid black; border-radius: 5px; padding: 10px; margin-top: 20px; display: block; } javascript let output = document.getelementbyid("output"); let divlist = document.getelementsbytagname("div"); output.innerhtml += "div 0 same as div 0: " + divlist[0].issamenode(divlist[0]) + "<br/>"; output.innerhtml += "div 0 same as div 1: " + divlist[0].issamenode(divlist[1]) + "<br/>"; output.innerhtml += "div 0 same as div 2: " + divlist[0].issamenode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of '...
Node.lastChild - Web APIs
WebAPINodelastChild
it returns null if there are no child elements.
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
in firefox 3.5 and earlier, the namespace uri for html elements in html documents is null.
Node.nextSibling - Web APIs
WebAPINodenextSibling
element.nextelementsibling may be used to obtain the next element skipping any whitespace nodes, other between-element text, or comments.
Node.nodeName - Web APIs
WebAPINodenodeName
however, in html, text_field's value would read "div", because nodename and tagname return in upper case on html elements in doms flagged as html documents.
Node.nodeType - Web APIs
WebAPINodenodeType
it distinguishes different kind of nodes from each other, such as elements, text and comments.
Node.nodeValue - Web APIs
WebAPINodenodeValue
the following table shows the return values for different elements: node value of nodevalue cdatasection content of the cdata section comment content of the comment document null documentfragment null documenttype null element null namednodemap null entityreference null notation null processinginstruction entire content exc...
NodeList.item() - Web APIs
WebAPINodeListitem
alternate syntax javascript also offers an array-like bracketed syntax for obtaining an item from a nodelist by index: nodeitem = nodelist[index] example var tables = document.getelementsbytagname("table"); var firsttable = tables.item(1); // or simply tables[1] - returns the second table in the dom specifications specification status comment domthe definition of 'nodelist: item' in that specification.
NodeList.length - Web APIs
WebAPINodeListlength
// all the paragraphs in the document var items = document.getelementsbytagname("p"); // for each item in the list, // append the entire element as a string of html var gross = ""; for (var i = 0; i < items.length; i++) { gross += items[i].innerhtml; } // gross is now all the html for the paragraphs specifications specification status comment domthe definition of 'nodelist: length' in that specification.
Notification.maxActions - Web APIs
effectively, this is the maximum number of elements in notification.actions array which will be respected by the user agent.
Using the Notifications API - Web APIs
w.addeventlistener('load', function () { // at first, let's check if we have permission for notification // if not, let's ask for it if (window.notification && notification.permission !== "granted") { notification.requestpermission(function (status) { if (notification.permission !== status) { notification.permission = status; } }); } var button = document.getelementsbytagname('button')[0]; button.addeventlistener('click', function () { // if the user agreed to get notified // let's try to send ten notifications if (window.notification && notification.permission === "granted") { var i = 0; // using an interval cause some browsers (including firefox) are blocking notifications if there are too much in a certain time.
NotifyAudioAvailableEvent - Web APIs
the non-standard, obsolete, notifyaudioavailableevent interface defines the event sent to audio elements when the audio buffer is full.
OffscreenCanvas - Web APIs
given these two <canvas> elements <canvas id="one"></canvas> <canvas id="two"></canvas> the following code will provide the rendering using an offscreencanvas as described above.
OrientationSensor.quaternion - Web APIs
the quaternion read-only property of the orientationsensor interface returns a four element array whose elements contain the components of the unit quaternion representing the device's orientation.
OrientationSensor - Web APIs
absoluteorientationsensor relativeorientationsensor properties orientationsensor.quaternion returns a four element array whose elements contain the components of the unit quaternion representing the device's orientation.
ParentNode.childElementCount - Web APIs
the parentnode.childelementcount read-only property returns an unsigned long representing the number of child elements of the given element.
ParentNode.firstElementChild - Web APIs
the parentnode.firstelementchild read-only property returns the object's first child element, or null if there are no child elements.
ParentNode.lastElementChild - Web APIs
the parentnode.lastelementchild read-only property returns the object's last child element or null if there are no child elements.
Using the Performance API - Web APIs
function print_json() { var json; var o = document.getelementsbytagname("output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance...
Using Performance Timeline - Web APIs
function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === ...
PointerEvent - Web APIs
typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media.
Pointer Lock API - Web APIs
requestpointerlock() the pointer lock api, similar to the fullscreen api, extends dom elements by adding a new method, requestpointerlock().
Pinch zoom gestures - Web APIs
false : true; } function log(prefix, ev) { if (!logevents) return; var o = document.getelementsbytagname('output')[0]; var s = prefix + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.pointertype + " ; isprimary = " + ev.isprimary; o.innerhtml += s + " "; } function clearlog(event) { var o = document.getelementsbytagname('output')[0]; o.innerhtml = ""; } ...
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
syntax allowcredentials = publickeycredentialrequestoptions.allowcredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
PushSubscription.getKey() - Web APIs
ubbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting ui elements for subscribed status // and updating subscribers list via push var endpoint = subscription.endpoint; var key = subscription.getkey('p256dh'); var auth = subscription.getkey('auth'); ...
RTCDataChannel: close event - Web APIs
bubbles no cancelable no interface event event handler property rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started.
RTCDataChannel.onopen - Web APIs
it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel.
RadioNodeList.value - Web APIs
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.
RadioNodeList - Web APIs
the radionodelist interface represents a collection of radio elements in a <form> or a <fieldset> element.
Range.cloneContents() - Web APIs
syntax documentfragment = range.clonecontents(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); documentfragment = range.clonecontents(); document.body.appendchild(documentfragment); specifications specification status comment domthe definition of 'range.clonecontents()' in that specification.
Range.cloneRange() - Web APIs
WebAPIRangecloneRange
syntax clone = range.clonerange(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); clone = range.clonerange(); specifications specification status comment domthe definition of 'range.clonerange()' in that specification.
Range.collapse() - Web APIs
WebAPIRangecollapse
example var range = document.createrange(); referencenode = document.getelementsbytagname("div").item(0); range.selectnode(referencenode); range.collapse(true); specifications specification status comment domthe definition of 'range.collapse()' in that specification.
Range.compareBoundaryPoints() - Web APIs
example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoints(range.start_to_end, sourcerange); specifications specification status comment domthe definition of 'range.compareboundarypoints()' in that specification.
Range.compareNode() - Web APIs
WebAPIRangecompareNode
example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); returnvalue = range.comparenode(document.getelementsbytagname("p").item(0)); notes this method is obsolete; you should use the w3c dom range.compareboundarypoints() method.
Range.comparePoint() - Web APIs
example range = document.createrange(); range.selectnode(document.getelementsbytagname('div').item(0)); returnvalue = range.comparepoint(document.getelementsbytagname('p').item(0), 1); specification specification status comment domthe definition of 'range.comparepoint()' in that specification.
Range.createContextualFragment() - Web APIs
example var tagstring = "<div>i am a div node</div>"; var range = document.createrange(); // make the parent of the first div in the document becomes the context node range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.createcontextualfragment(tagstring); document.body.appendchild(documentfragment); specification specification status comment dom parsing and serializationthe definition of 'range.createcontextualfragment()' in that specification.
Range.deleteContents() - Web APIs
syntax range.deletecontents() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.deletecontents(); specifications specification status comment domthe definition of 'range.deletecontents()' in that specification.
Range.detach() - Web APIs
WebAPIRangedetach
syntax range.detach(); example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.detach(); specifications specification status comment domthe definition of 'range.detach()' in that specification.
Range.extractContents() - Web APIs
syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers.
Range.insertNode() - Web APIs
WebAPIRangeinsertNode
example range = document.createrange(); newnode = document.createelement("p"); newnode.appendchild(document.createtextnode("new node inserted here")); range.selectnode(document.getelementsbytagname("div").item(0)); range.insertnode(newnode); specifications specification status comment domthe definition of 'range.insertnode()' in that specification.
Range.intersectsNode() - Web APIs
example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var bool = range.intersectsnode(document.getelementsbytagname("p").item(0)); specification specification status comment domthe definition of 'range.intersectnode()' in that specification.
Range.isPointInRange() - Web APIs
example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); bool = range.ispointinrange(document.getelementsbytagname("p").item(0),1); specification specification status comment domthe definition of 'range.ispointinrange()' in that specification.
Range.selectNode() - Web APIs
WebAPIRangeselectNode
example let range = document.createrange(); let referencenode = document.getelementsbytagname('div').item(0); range.selectnode(referencenode); specifications specification status comment domthe definition of 'range.selectnode()' in that specification.
Range.selectNodeContents() - Web APIs
example range = document.createrange(); referencenode = document.getelementsbytagname("div")[0]; range.selectnodecontents(referencenode); live sample this example lets the user select and deselect a paragraph with buttons.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
example const range = document.createrange(); const endnode = document.getelementsbytagname('p').item(3); const endoffset = endnode.childnodes.length; range.setend(endnode, endoffset); setend() is commonly used in conjunction with setstart() to fully configure a range.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
example var range = document.createrange(); var referencenode = document.getelementsbytagname('div').item(0); range.setendafter(referencenode); specifications specification status comment domthe definition of 'range.setendafter()' in that specification.
Range.setEndBefore() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setendbefore(referencenode); specifications specification status comment domthe definition of 'range.setendbefore()' in that specification.
Range.setStart() - Web APIs
WebAPIRangesetStart
the address contains nine nodes: five text nodes, and four <br> elements.
Range.setStartAfter() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartafter(referencenode); specifications specification status comment domthe definition of 'range.setstartafter()' in that specification.
Range.setStartBefore() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartbefore(referencenode); specifications specification status comment domthe definition of 'range.setstartbefore()' in that specification.
Range.toString() - Web APIs
WebAPIRangetoString
look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification.
Range - Web APIs
WebAPIRange
range.getclientrects() returns a list of domrect objects that aggregates the results of element.getclientrects() for all the elements in the range.
Request.destination - Web APIs
script-based destinations include <script> elements, as well as any of the worklet-based destinations (including audioworklet and paintworklet), and the worker-based destinations, including serviceworker and sharedworker.
Request.mode - Web APIs
WebAPIRequestmode
however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is initiated from markup, unless the crossorigin attribute is present, the request is in most cases made using the no-cors mode — that is, for the <link> or <script> elements (except when used with modules), or <img>, <audio>, <video>, <object>, <embed>, or <iframe> elements.
ResizeObserver - Web APIs
it does this by only processing elements deeper in the dom in subsequent frames.
ResizeObserverEntry.borderBoxSize - Web APIs
the array is necessary to support elements that have multiple fragments, which occur in multi-column scenarios.
Resize Observer API - Web APIs
interfaces resizeobserver provides the ability to register new observers and to start and stop observing elements.
Response.clone() - Web APIs
WebAPIResponseclone
when the fetch resolves successfully, we clone it, extract a blob from both responses using two body.blob calls, create object urls out of the blobs using url.createobjecturl, and display them in two separate <img> elements.
SVGAnimatedPathData - Web APIs
svg animated path data interface the svganimatedpathdata interface supports elements which have a 'd' attribute which holds svg path data, and supports the ability to animate that attribute.
SVGAnimatedPoints - Web APIs
svg animated points interface the svganimatedpoints interface supports elements which have a points attribute which holds a list of coordinate values and which support the ability to animate that attribute.
SVGClipPathElement - Web APIs
the svgclippathelement interface provides access to the properties of <clippath> elements, as well as methods to manipulate them.
SVGCursorElement - Web APIs
the svgcursorelement interface provides access to the properties of <cursor> elements, as well as methods to manipulate them.
SVGDefsElement - Web APIs
candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggraphicselement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgdefselement' in that specification.
SVGElement: resize event - Web APIs
this event is only applicable to outermost svg elements and is dispatched after the resize operation has taken place.
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface.
SVGEllipseElement - Web APIs
the svgellipseelement interface provides access to the properties of <ellipse> elements.
SVGExternalResourcesRequired - Web APIs
the svgexternalresourcesrequired interface defines an interface which applies to all elements where this element or one of its descendants can reference an external resource.
SVGFilterElement - Web APIs
the svgfilterelement interface provides access to the properties of <filter> elements, as well as methods to manipulate them.
SVGFitToViewBox - Web APIs
svg fit to view box interface the svgfittoviewbox interface is used to reflect the viewbox and preserveaspectratio attributes, and is mixed in to other interfaces for elements that support these two attributes.
SVGFontElement - Web APIs
the svgfontelement interface corresponds to the <font> elements.
SVGFontFaceElement - Web APIs
the svgfontfaceelement interface corresponds to the <font-face> elements.
SVGFontFaceFormatElement - Web APIs
the svgfontfaceformatelement interface corresponds to the <font-face-format> elements.
SVGFontFaceNameElement - Web APIs
the svgfontfacenameelement interface corresponds to the <font-face-name> elements.
SVGFontFaceSrcElement - Web APIs
the svgfontfacesrcelement interface corresponds to the <font-face-src> elements.
SVGFontFaceUriElement - Web APIs
the svgfontfaceurielement interface corresponds to the <font-face-uri> elements.
SVGForeignObjectElement - Web APIs
the svgforeignobjectelement interface provides access to the properties of <foreignobject> elements, as well as methods to manipulate them.
SVGGeometryElement - Web APIs
the svggeometryelement interface represents svg elements whose rendering is defined by geometry with an equivalent path, and which can be filled and stroked.
SVGGlyphRefElement - Web APIs
the svgglyphrefelement interface corresponds to the <glyphref> elements.
SVGGraphicsElement: cut event - Web APIs
specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
SVGGraphicsElement: paste event - Web APIs
script document.getelementbyid("element-to-paste-text").addeventlistener("paste", evt => { evt.target.textcontent = evt.clipboarddata.getdata("text/plain").touppercase(); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
SVGGraphicsElement - Web APIs
the svggraphicselement interface represents svg elements whose primary purpose is to directly render graphics into a group.
SVGHKernElement - Web APIs
the svghkernelement interface corresponds to the <hkern> elements.
SVGLineElement - Web APIs
the svglineelement interface provides access to the properties of <line> elements, as well as methods to manipulate them.
SVGMaskElement - Web APIs
the svgmaskelement interface provides access to the properties of <mask> elements, as well as methods to manipulate them.
SVGMeshElement - Web APIs
the svgmeshelement interface provides access to the properties of <mesh> elements.
SVGMissingGlyphElement - Web APIs
the svgmissingglyphelement interface corresponds to the <missing-glyph> elements.
SVGPreserveAspectRatio - Web APIs
svg preserveaspectratio interface the svgpreserveaspectratio interface corresponds to the preserveaspectratio attribute, which is available for some of svg's elements.
SVGStylable - Web APIs
svg stylable interface the svgstylable interface is implemented on all objects corresponding to svg elements that can have style, class and presentation attributes specified on them.
SVGTRefElement - Web APIs
the svgtrefelement interface corresponds to the <tref> elements.
SVGTests - Web APIs
WebAPISVGTests
the svgtests interface is used to reflect conditional processing attributes and is mixed into other interfaces for elements that support these attributes.
SVGTextContentElement - Web APIs
the svgtextcontentelement interface is implemented by elements that support rendering child text content.
SVGTextElement - Web APIs
the svgtextelement interface corresponds to the <text> elements.
SVGTextPositioningElement - Web APIs
the svgtextpositioningelement interface is implemented by elements that support attributes that position individual text glyphs.
SVGTransformList - Web APIs
<svg id="my-svg" viewbox="0 0 300 280" xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>example showing how to transform svg elements that using svgtransform objects</desc> <script type="application/ecmascript"> <![cdata[ function transformme(evt) { // svg root element to access the createsvgtransform() function var svgroot = evt.target.parentnode; // svgtransformlist of the element that has been clicked on var tfmlist = evt.target.transform.baseval; // create a seperate transform object fo...
SVGTransformable - Web APIs
svg transformable interface interface svgtransformable contains properties and methods that apply to all elements which have attribute transform.
SVGURIReference - Web APIs
troke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgurireference</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgurireference.href read only an svganimatedstring that represents the value of the href attribute, and, on elements that are defined to support it, the deprecated xlink:href attribute.
SVGVKernElement - Web APIs
the svgvkernelement interface corresponds to the <vkern> elements.
SVGViewElement - Web APIs
the svgviewelement interface provides access to the properties of <view> elements, as well as methods to manipulate them.
SVGZoomAndPan - Web APIs
the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute.
Screen.availHeight - Web APIs
on a windows system, this would function similarly, by opening the window and sizing it vertically so it uses all available vertical space, leaving room for the taskbar and any other interface elements that reserve space.
Selection.addRange() - Web APIs
html <p>i <strong>insist</strong> that you <strong>try</strong> selecting the <strong>strong words</strong>.</p> <button>select strong words</button> javascript let button = document.queryselector('button'); button.addeventlistener('click', function () { let selection = window.getselection(); let strongs = document.getelementsbytagname('strong'); if (selection.rangecount > 0) { selection.removeallranges(); } for (let i = 0; i < strongs.length; i++) { let range = document.createrange(); range.selectnode(strongs[i]); selection.addrange(range); } }); result specifications specification status comment selection apithe definition of 'selection.addrange()' in that specif...
Selection.collapse() - Web APIs
*/ var body = document.getelementsbytagname("body")[0]; window.getselection().collapse(body,0); specifications specification status comment selection apithe definition of 'selection.collapse()' in that specification.
Selection - Web APIs
WebAPISelection
note: the selection api methods may only move focus to an editing host, not to other focusable elements (e.g., <a>).
ShadowRoot - Web APIs
documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates.
StereoPannerNode.pan - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and t...
StereoPannerNode - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.queryselector('.panning-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and t...
SubmitEvent.submitter - Web APIs
each of the submit elements' id is used to identify which payment processor the button corresponds to.
SubmitEvent - Web APIs
each of the submit elements' id is used to identify which payment processor the button corresponds to.
SubtleCrypto.generateKey() - Web APIs
possible values for array elements are: encrypt: the key may be used to encrypt messages.
TextRange - Web APIs
WebAPITextRange
textrange.pastehtml() paste the html content into the given range and replace any previous text and html elements in the range.
TimeRanges - Web APIs
the timeranges interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements.
Using Touch Events - Web APIs
if the target area is too small, touching it could result in firing other events for adjacent elements.
URL.createObjectURL() - Web APIs
important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly.
ValidityState - Web APIs
note: this property is never true in gecko, because elements' values are prevented from being longer than maxlength.
VisualViewport - Web APIs
dow.visualviewport; function resizehandler() { if (viewport.scale > 1.3) bottombar.style.display = "none"; else bottombar.style.display = "block"; } window.visualviewport.addeventlistener('resize', resizehandler); simulating position: device-fixed this example, also taken from the visual viewport readme, shows how to use this api to simulate position: device-fixed, which fixes elements to the visual viewport.
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
syntax sequence<domstring> ext.getsupportedprofiles(); return value an array of domstring elements indicating which astc profiles are supported by the implementation.
WebGL2RenderingContext.getActiveUniforms() - Web APIs
gl.uniform_array_stride: returns an array of glint indicating the strides between the elements.
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
the webgl2renderingcontext.vertexattribdivisor() method of the webgl 2 api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced().
Basic scissoring - Web APIs
in other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene).
Canvas size and WebGL - Web APIs
oes not seem to support html5 canvas.</canvas> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : inline-block; width : 120px; height : 80px; margin : auto; padding : 0; border : none; background-color : black; } window.addeventlistener("load", function() { "use strict" var firstcanvas = document.getelementsbytagname("canvas")[0], secondcanvas = document.getelementsbytagname("canvas")[1]; firstcanvas.width = firstcanvas.clientwidth; firstcanvas.height = firstcanvas.clientheight; [firstcanvas, secondcanvas].foreach(function(canvas) { var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "...
Clearing with colors - Web APIs
window.removeeventlistener(evt.type, setupwebgl, false); // references to the document elements.
Getting started with WebGL - Web APIs
webgl elements can be mixed with other html elements and composited with other parts of the page or page background.
WebGL tutorial - Web APIs
webgl elements can be mixed with other html elements and composited with other parts of the page or page background.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
webgl does so by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
const constraints = { audio: true, video: true }; const config = { iceservers: [{ urls: "stun:stun.mystunserver.tld" }] }; const selfvideo = document.queryselector("video.selfview"); const remotevideo = document.queryselector("video.remoteview"); const signaler = new signalingchannel(); const pc = new rtcpeerconnection(config); this code also gets the <video> elements using the classes "selfview" and "remoteview"; these will contain, respectively, the local user's self-view and the view of the incoming stream from the remote peer.
Taking still photos with WebRTC - Web APIs
getting element references first, we grab references to the major elements we need to be able to access.
WebRTC API - Web APIs
media capture from dom elements working draft the initial definition on how to obtain stream of content from dom elements in additions to these specifications defining the api needed to use webrtc, there are several protocols, listed under resources.
Geometry and reference spaces in WebXR - Web APIs
a space will typically have foreground, mid-distance, and background elements.
Inputs and input sources - Web APIs
you also need to be able to determine which input source to use for what activities; for example, if the user has two controllers, which one will be tracked for manipulating ui elements, or will both?
Rendering and the WebXR frame animation callback - Web APIs
in this context, "repaint" simply means the process of ensuring that the screen's displayed content matches what the dom and the elements within are trying to present at the moment.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment.
Keyframe Formats - Web APIs
element.animate({ opacity: [ 0, 1 ], // [ from, to ] color: [ "#fff", "#000" ] // [ from, to ] }, 2000); using this format, the number of elements in each array does not need to be equal.
Web Animations API Concepts - Web APIs
while four out of five browsers supported smil, it only animated svg elements, could not be used from css, and was very complex — often leading to inconsistent implementations.
Basic concepts behind Web Audio API - Web APIs
taken from html media elements (such as <video> or <audio>).
Web Audio API best practices - Web APIs
media elements have streaming support out of the box.
Controlling multiple parameters with ConstantSourceNode - Web APIs
playbutton and volumecontrol references to the play button and volume control elements.
Using the Web Audio API - Web APIs
lucky for us there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the audio element const audioelement = document.queryselector('audio'); // pass it into the audio context const track = audiocontext.createmediaelementsource(audioelement); note: the <audio> element above is represented in the dom by an object of type htmlmediaelement, which comes with its own set of functionality.
Web audio spatialization basics - Web APIs
first, we'll get references to the elements we want to move, then we'll store references to the values we'll change when we set up css transforms to actually do the movement.
Using the Web Storage API - Web APIs
next, we set the values displayed in the form elements to those values, so that they keep in sync when you reload the page.
Window.content - Web APIs
WebAPIWindowcontent
syntax var windowobject = window.content; example executing the following code in a chrome xul window with a <browser type="content-primary"/> element in it draws a red border around the first div on the page currently displayed in the browser: content.document.getelementsbytagname("div")[0].style.border = "solid red 1px"; specification none.
Window.frames - Web APIs
WebAPIWindowframes
each item in the window.frames pseudo-array represents the window object corresponding to the given <frame>'s or <iframe>'s content, not the (i)frame dom element (i.e., window.frames[0] is the same thing as document.getelementsbytagname("iframe")[0].contentwindow).
Window.getSelection() - Web APIs
it is worth noting that currently getselection() doesn't work on the content of <textarea> and <input> elements in firefox, edge (legacy) and internet explorer.
Window.length - Web APIs
WebAPIWindowlength
returns the number of frames (either <frame> or <iframe> elements) in the window.
Window: load event - Web APIs
WebAPIWindowload event
'load' events are fired at many elements too.
Privileged features - Web APIs
chrome if on, the page is loaded as window's only content, without any of the browser's interface elements.
Window.open() - Web APIs
WebAPIWindowopen
this name can be used as the target for the target attribute of <a> or <form> elements.
Window.pageYOffset - Web APIs
html the html is extremely simple and has just two elements: an <iframe> that contains the document we're going to scroll, and a <div> into which we'll output the value of pageyoffset when we've finished the scroll.
Window: resize event - Web APIs
there is a proposal to allow all elements to be notified of resize changes.
Window.scroll() - Web APIs
WebAPIWindowscroll
for scrolling elements, see element.scrolltop and element.scrollleft.
Window.scrollTo() - Web APIs
WebAPIWindowscrollTo
for scrolling elements, see element.scrolltop and element.scrollleft.
Worklet - Web APIs
WebAPIWorklet
compositor thread css animation worklet api layoutworklet for defining the positioning and dimensions of custom elements.
XMLSerializer.serializeToString() - Web APIs
elements in the html namespace that have no child nodes (thereby representing empty tags) are serialized with both begin and end tags ("<someelement></someelement>") instead of using the empty-element tag ("<someelement/>").
XRSession.end() - Web APIs
WebAPIXRSessionend
you can use the promise to do things like update ui elements to reflect the shut down connection, trigger application shut down, or whatever else you might need to do.
msGetRegionContent - Web APIs
this is only available to regions that are document elements and not to regions that are pseudo-elements.
msRegionOverflow - Web APIs
however, it is only available to regions that are document elements and not to regions that are pseudo-elements.
Using the aria-hidden attribute - Accessibility
</p> children elements can be omitted from accessibility apis: <p> this is not hidden <span aria-hidden="true">but this is</span>!
Using the aria-required attribute - Accessibility
this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
Using the article role - Accessibility
assistive technologies may provide a feature allowing the user to navigate the hierarchy of any nested article elements.
Using the progressbar role - Accessibility
note: elements with the role progressbar have an implicit aria-readonly value of true.
Using ARIA: Roles, states, and properties - Accessibility
aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role.
ARIA: Mark role - Accessibility
the mark landmark role semantically denotes html elements containing text that is marked/highlighted for reference purposes.
ARIA: Suggestion role - Accessibility
if at all possible, prefer using the html elements.
ARIA: checkbox role - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.
ARIA: textbox role - Accessibility
el">enter your five-digit zipcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-required="true"></div> semantic elements are more concise and require no javascript to support textbox features.
Web applications and ARIA FAQ - Accessibility
browsers expose aria-enabled elements to the assistive technology api as if they were native widgets.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name.
Accessibility and Spacial Patterns - Accessibility
they can be parallel, radial, curved or straight, and may be formed by rows of repeating elements.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
msaa is by no means perfect, but it is the only thing that will make your custom ui elements work with most assistive technologies.
Robust - Accessibility
when using semantic elements correctly for their intended purpose, this criterion should be passed automatically.
Understandable - Accessibility
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).
Understanding the Web Content Accessibility Guidelines - Accessibility
operable: users must be able to control ui elements (e.g.
Accessibility
html: a good basis for accessibility a great deal of web content can be made accessible just by making sure the correct html elements are used for the correct purpose at all times.
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
initial valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token.
-moz-float-edge - CSS: Cascading Style Sheets
formal definition initial valuecontent-boxapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax border-box | content-box | margin-box | padding-box examples html <div class="box"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> css .box { display: block; height: 5px; margin: 0.5em auto 0.5em auto; color: gray; -moz-float-edge: margin-box; box-sizing: border-box; } result ...
-moz-orient - CSS: Cascading Style Sheets
formal definition initial valueinlineapplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax inline | block | horizontal | vertical examples html <p> the following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> the following progress meter is vertical: </p> <progress class="vert" max="100" value="75"></progress> css .vert { -moz-orient: vertical; wid...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than fire...
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomrig...
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-topright - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2e...
-moz-outline-radius - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:-moz-outline-radius-topleft: 0-moz-outline-radius-topright: 0-moz-outline-radius-bottomright: 0-moz-outline-radius-bottomleft: 0applies toall elementsinheritednopercentagesas each of the properties of the shorthand:-moz-outline-radius-topleft: refer to the corresponding dimension of the border box-moz-outline-radius-topright: refer to the corresponding dimension of the border box-moz-outline-radius-bottomright: refer to the corresponding dimension of the border box-moz-outline-radius-bottomleft: refer to the corresponding dimension of the borde...
-webkit-border-before - CSS: Cascading Style Sheets
of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritedyespercentagesas each of the properties of the shorthand:-webkit-border-before-width: logical-width of containing blockcomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none...
-webkit-box-reflect - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ above | below | right | left ]?
-webkit-mask-attachment - CSS: Cascading Style Sheets
formal definition initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard.
-webkit-mask-box-image - CSS: Cascading Style Sheets
initial value: none applies to: all elements inherited: no media: visual computed value: as specified syntax -webkit-mask-box-image: <mask-box-image> [<top> <right> <bottom> <left> <x-repeat> <y-repeat>] where: <mask-box-image> <uri> | <gradient> | none <top> <right> <bottom> <left> <length> | <percentage> <x-repeat> <y-repeat> repeat | stretch | round | space values <uri> the location of the image resource to be used as a mask image.
-webkit-mask-composite - CSS: Cascading Style Sheets
formal definition initial valuesource-overapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <composite-style>#where <composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor examples compositing with xor .example { -webkit-mask-image: url(mask1.png), url('mask2.png'); -webkit-mask-composite: xor, sour...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
formal definition initial valuerepeatapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-x: repeat; } .exampletwo { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-x: no-repeat; } using multiple mask images you can specify a dif...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
formal definition initial valuerepeatapplies toall elementsinheritednocomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: repeat; } .exampletwo { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: no-repeat; } using ...
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
formal definition initial valueblackapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-text-fill-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritedyescomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-text-stroke-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritedyescomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
-webkit-text-stroke-width - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples varying stroke widths css p { margin: 0; font-size: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5mm; } html <p id="thin">thin stroke</p> <p id="medium">medium...
-webkit-text-stroke - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:-webkit-text-stroke-width: 0-webkit-text-stroke-color: currentcolorapplies toall elementsinheritedyescomputed valueas each of the properties of the shorthand:-webkit-text-stroke-width: absolute <length>-webkit-text-stroke-color: computed coloranimation typeas each of the properties of the shorthand:-webkit-text-stroke-width: discrete-webkit-text-stroke-color: a color formal syntax <length> | <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color>...
-webkit-touch-callout - CSS: Cascading Style Sheets
formal definition initial valuedefaultapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax default | none examples turn off touch callout .example { -webkit-touch-callout: none; } specifications not part of any standard.
:-moz-broken - CSS: Cascading Style Sheets
the :-moz-broken css pseudo-class is a mozilla extension that matches elements representing broken image links.
:-moz-handler-blocked - CSS: Cascading Style Sheets
the :-moz-handler-blocked css pseudo-class is a mozilla extension that matches elements that can't be displayed because their handlers have been blocked.
:-moz-handler-crashed - CSS: Cascading Style Sheets
the :-moz-handler-crashed css pseudo-class is a mozilla extension that matches elements that can't be displayed because the plugin responsible for drawing them has crashed.
:-moz-handler-disabled - CSS: Cascading Style Sheets
the :-moz-handler-disabled css pseudo-class is a mozilla extension that matches elements that can't be displayed because their handlers have been disabled by the user.
:-moz-loading - CSS: Cascading Style Sheets
the :-moz-loading css pseudo-class is a mozilla extension that matches elements that can't be displayed because they have not started loading, such as images that haven't started to arrive yet.
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
the ::-webkit-inner-spin-button css pseudo-element is used to style the inner part of the spinner button of number picker input elements.
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
the clear button is only shown on non-empty search <input> elements.
::-webkit-search-results-button - CSS: Cascading Style Sheets
the search results button is only shown on search <input> elements that have a results attribute.
::grammar-error - CSS: Cascading Style Sheets
html <p>my friends is coming to the party tonight.</p> css ::grammar-error { text-decoration: underline red; color: red; } result specifications specification status comment css pseudo-elements level 4the definition of '::grammar-error' in that specification.
::part() - CSS: Cascading Style Sheets
WebCSS::part
::part(tab):hover:active { background-color: #0c0c0d33; } tabbed-custom-element::part(tab):focus { box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3); } tabbed-custom-element::part(active) { color: #0060df; border-color: #0a84ff !important; } javascript let template = document.queryselector("#tabbed-custom-element"); globalthis.customelements.define(template.id, class extends htmlelement { constructor() { super(); this.attachshadow({ mode: "open" }); this.shadowroot.appendchild(template.content); } }); result specifications specification status comment shadow partsthe definition of '::part' in that specification.
::spelling-error - CSS: Cascading Style Sheets
html <p contenteditable spellcheck="true">my friends are coegdfgfddffbgning to the party tonight.</p> css ::spelling-error { text-decoration: wavy red; } result specifications specification status comment css pseudo-elements level 4the definition of '::spelling-error' in that specification.
:any-link - CSS: Cascading Style Sheets
WebCSS:any-link
thus, it matches all elements that match :link or :visited.
:blank - CSS: Cascading Style Sheets
WebCSS:blank
the :blank css pseudo-class selects empty user input elements (eg.
:empty - CSS: Cascading Style Sheets
WebCSS:empty
--> </div> <div class="box"> <p><!-- i will be pink in all browsers because of the non-collapsible whitespace and elements around this comment.
:enabled - CSS: Cascading Style Sheets
WebCSS:enabled
this helps the user understand which elements can be interacted with.
:has() - CSS: Cascading Style Sheets
WebCSS:has
examples matching <a> elements that directly contain an <img> the following selector matches only <a> elements that directly contain an <img> child: a:has(> img) matching <h1> elements that are followed by a <p> the following selector matches <h1> elements only if they have a <p> element directly following them: h1:has(+ p) specifications specification status comment selectors level 4the def...
:host() - CSS: Cascading Style Sheets
WebCSS:host()
in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: un...
:host - CSS: Cascading Style Sheets
WebCSS:host
in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: un...
:invalid - CSS: Cascading Style Sheets
WebCSS:invalid
syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't.
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
for example, without :is(), styling all the <h1> elements at different depths could be very complicated: /* level 0 */ h1 { font-size: 30px; } /* level 1 */ section h1, article h1, aside h1, nav h1 { font-size: 25px; } /* level 2 */ section section h1, section article h1, section aside h1, section nav h1, article section h1, article article h1, article aside h1, article nav h1, aside section h1, aside article h1, aside aside h1, aside nav h1, nav s...
:read-only - CSS: Cascading Style Sheets
d-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-only non-form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that cannot be edited by the user.
:read-write - CSS: Cascading Style Sheets
-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-write non-form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that can be edited by the user, such as a <p> element with contenteditable set on it.
:where() - CSS: Cascading Style Sheets
WebCSS:where
they differ by the classes used to mark the child elements.
font-display - CSS: Cascading Style Sheets
the timeline is divided into the three periods below which dictate the rendering behavior of any elements using the font face.
color - CSS: Cascading Style Sheets
WebCSS@mediacolor
see applying color to html elements using css to learn more about using css to apply color to html.
prefers-color-scheme - CSS: Cascading Style Sheets
examples the elements below have an initial color theme.
prefers-reduced-transparency - CSS: Cascading Style Sheets
the prefers-reduced-transparency css media feature is used to detect if the user has requested that the system minimize the amount of transparency used across elements.
Coordinate systems - CSS: Cascading Style Sheets
note that within the <div> with the id "log", we have a paragraph for each coordinate system, with span used for each of the elements to receive and display the coordinates in each model.
Detecting CSS animation support - CSS: Cascading Style Sheets
'from {' + keyframeprefix + 'transform:rotate( 0deg ) }'+ 'to {' + keyframeprefix + 'transform:rotate( 360deg ) }'+ '}'; if( document.stylesheets && document.stylesheets.length ) { document.stylesheets[0].insertrule( keyframes, 0 ); } else { var s = document.createelement( 'style' ); s.innerhtml = keyframes; document.getelementsbytagname( 'head' )[ 0 ].appendchild( s ); } } this code looks at the value of animation; if it's false, we know we need to use our javascript fallback code to perform our animation.
Using CSS animations - CSS: Cascading Style Sheets
the html just for the sake of completeness, here’s the html that displays the page content, including the list into which the script inserts information about the received events: <h1 id="watchme">watch me move</h1> <p> this example shows how to use css animations to make <code>h1</code> elements move across the page.
Using multiple backgrounds - CSS: Cascading Style Sheets
you can apply multiple backgrounds to elements.
CSS Box Alignment - CSS: Cascading Style Sheets
the block axis is the axis along which blocks, such as paragraph elements, are laid out and it runs across the inline axis.
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
finally, note that for non-replaced inline elements, the amount of space taken up (the contribution to the height of the line) is determined by the line-height property, even though the borders and padding are still displayed around the content.
CSS Color - CSS: Cascading Style Sheets
WebCSSCSS Color
reference properties color color-adjust opacity data types <color> guides applying color to html elements using css a guide to using css to apply color to a variety of types of content.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
in this guide we look at how to make elements span across columns inside the multicol container and how to control how the columns are filled.
Styling Columns - CSS: Cascading Style Sheets
in the next guide we will take a look at making elements inside a container span across all columns.
CSS Multi-column Layout - CSS: Cascading Style Sheets
spanning and balancing how to make elements span across all columns and controlling the way columns are filled.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in the live example below for instance i have two paragraph elements that contain a string of text.
OpenType font features guide - CSS: Cascading Style Sheets
this is one of the key benefits over using the <sub> or sup elements.
Variable fonts guide - CSS: Cascading Style Sheets
the term 'grade' refers to the relative weight or density of the typeface design, but differs from traditional 'weight' in that the physical space the text occupies does not change, so changing the text grade doesn't change the overall layout of the text or elements around it.
CSS Generated Content - CSS: Cascading Style Sheets
generated content can be used to add content to anonymous replaced elements or replace the content of a dom node in very limited circumstances with a generated value.
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
if we update align-content to space-between, you can see how the elements on our grid space out: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 100px); grid-template-rows: repea...
Grid template areas - CSS: Cascading Style Sheets
@media (min-width: 700px) { .wrapper { grid-template-areas: "hd hd hd hd hd hd hd hd hd" "sd sd main main main main main ft ft"; } } <div class="wrapper"> <div class="header">header</div> <div class="sidebar">sidebar</div> <div class="content">content</div> <div class="footer">footer</div> </div> using grid-template-areas for ui elements many of the grid examples you will find online make the assumption that you will use grid for main page layout, however grid can be just as useful for small elements as those larger ones.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
inside our grid container i have four child elements.
Using CSS counters - CSS: Cascading Style Sheets
of section counter, and a colon before the content of each h3 */ } html <h3>introduction</h3> <h3>body</h3> <h3>conclusion</h3> result nesting counters a css counter can be especially useful for making outlined lists, because a new instance of the counter is automatically created in child elements.
Logical properties for sizing - CSS: Cascading Style Sheets
in this guide we will explain the flow-relative mappings between physical dimension properties and logical properties used for sizing elements on our pages.
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements.
Stacking context example 3 - CSS: Cascading Style Sheets
« css « understanding css z-index stacking context example 3 this last example shows problems that arise when mixing several positioned elements in a multi-level html hierarchy and when z-indexes are assigned using class selectors.
CSS Positioned Layout - CSS: Cascading Style Sheets
css positioned layout is a module of css that defines how to position elements on the page.
Shapes from box values - CSS: Cascading Style Sheets
in my final example of this section, i have floated two elements left and right, giving each a border-radius of 100% in the direction closest to the text.
Overview of CSS Shapes - CSS: Cascading Style Sheets
this property, along with the possibility of creating shapes on non-floated elements, has been moved to level 2 of the specification.
CSS Shapes - CSS: Cascading Style Sheets
for the level 1 specification, css shapes can be applied to floating elements.
Column combinator - CSS: Cascading Style Sheets
it matches only those elements matched by the second selector that belong to the column elements matched by the first.
Compositing and Blending - CSS: Cascading Style Sheets
compositing and blending is a css module that defines how shapes of different elements are combined into a single image.
Descendant combinator - CSS: Cascading Style Sheets
the descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector.
Questions about CSS - CSS: Cascading Style Sheets
WebCSSFAQ
cascading style sheets (css) is a rule-based language allowing developers to define styles to apply to html elements (or other markup structures).
Inline formatting context - CSS: Cascading Style Sheets
in the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context.
Card - CSS: Cascading Style Sheets
note: the various elements in separate cards do not align with each other, as each card is an independent grid.
Center an element - CSS: Cascading Style Sheets
in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are specified to apply to block layout too.
Column layouts - CSS: Cascading Style Sheets
a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column.
Recipe: Media objects - CSS: Cascading Style Sheets
download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float.
Split Navigation - CSS: Cascading Style Sheets
a navigation pattern where one or more elements are separated from the rest of the navigation items.
Sticky footers - CSS: Cascading Style Sheets
then we set our main content to flex-grow: 1 and the other two elements to flex-shrink: 0 — this prevents them from shrinking smaller when content fills the main area.
Microsoft CSS extensions - CSS: Cascading Style Sheets
-ms-scrollbar-track-color -ms-scroll-chaining -ms-scroll-limit -ms-scroll-limit-x-max -ms-scroll-limit-x-min -ms-scroll-limit-y-max -ms-scroll-limit-y-min -ms-scroll-rails -ms-scroll-snap-points-x -ms-scroll-snap-points-y -ms-scroll-snap-x -ms-scroll-snap-y -ms-scroll-translation -ms-text-autospace -ms-touch-select -ms-wrap-flow -ms-wrap-margin -ms-wrap-through zoom pseudo-elements ::-ms-browse ::-ms-check ::-ms-clear ::-ms-expand ::-ms-fill ::-ms-fill-lower ::-ms-fill-upper ::-ms-reveal ::-ms-thumb ::-ms-ticks-after ::-ms-ticks-before ::-ms-tooltip ::-ms-track ::-ms-value media features -ms-high-contrast css-related dom apis mscontentzoomfactor msgetpropertyenabled msgetregioncontent msrangecollection msregionoverflow ...
Paged media - CSS: Cascading Style Sheets
it allows you to set page breaks, control printable area, style left and right pages differently, and control breaks inside elements.
Privacy and the :visited selector - CSS: Cascading Style Sheets
in rare scenarios, if you're using nested link elements and the element being matched is different from the link whose presence in history is being tested, the element will be rendered as if the link were unvisited, as well.
Selector list - CSS: Cascading Style Sheets
/* selects all matching elements */ span, div { border: red 2px solid; } to reduce the size of style sheets, one can group selectors in comma-separated lists.
Shorthand properties - CSS: Cascading Style Sheets
definitions of value syntax, shorthand properties and replaced elements.
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
css transforms transforms allow you to change the position of elements by modifying their coordinate space: it allows for translating, rotating, and deforming them in the 2d or 3d spaces.
WebKit CSS extensions - CSS: Cascading Style Sheets
pseudo-elements for web-compatibility reasons, blink, webkit, and gecko browsers treat all pseudo-elements starting with ::-webkit- as valid.
align-items - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | stretch | <baseline-position> | [ <overflow-position>?
align-self - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toflex items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent.
all - CSS: Cascading Style Sheets
WebCSSall
formal definition initial valuethere is no practical initial value for it.applies toall elementsinheritednocomputed valueas the specified value applies to each property this is a shorthand for.animation typeas each of the properties of the shorthand (all properties but unicode-bidi and direction) formal syntax initial | inherit | unset | revert examples html <blockquote id="quote"> lorem ipsum dolor sit amet, consectetur adipiscing elit.
animation-direction - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-direction>#where <single-animation-direction> = normal | reverse | alternate | alternate-reverse examples see css animations for examples.
animation-duration - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples.
animation-fill-mode - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-fill-mode>#where <single-animation-fill-mode> = none | forwards | backwards | both examples you can see the effect of animation-fill-mode in the following example.
animation-iteration-count - CSS: Cascading Style Sheets
formal definition initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-iteration-count>#where <single-animation-iteration-count> = infinite | <number> examples see css animations for examples.
animation-name - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples.
animation-play-state - CSS: Cascading Style Sheets
formal definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-play-state>#where <single-animation-play-state> = running | paused examples see css animations for examples.
animation-timing-function - CSS: Cascading Style Sheets
formal definition initial valueeaseapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclos...
animation - CSS: Cascading Style Sheets
WebCSSanimation
anding wcag, guideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:animation-name: noneanimation-duration: 0sanimation-timing-function: easeanimation-delay: 0sanimation-iteration-count: 1animation-direction: normalanimation-fill-mode: noneanimation-play-state: runningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:animation-name: as specifiedanimation-duration: as specifiedanimation-timing-function: as specifiedanimation-delay: as specifiedanimation-direction: as specifiedanimation-iteration-count: as specifiedanimation-fill-mode: as specifiedanimation-play-state: as specifiedanimation typediscrete for...
attr() - CSS: Cascading Style Sheets
WebCSSattr
it can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned.
backdrop-filter - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typea filter function list formal syntax none | <filter-function-list>where <filter-function-list> = [ <filter-function> | <url> ]+where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <inve...
backface-visibility - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax visible | hidden examples cube with transparent and opaque faces this example shows a cube with transparent faces, and one with opaque faces.
background-attachment - CSS: Cascading Style Sheets
(it is effectively attached to the element's border.) formal definition initial valuescrollapplies toall elements.
background-color - CSS: Cascading Style Sheets
webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valuetransparentapplies toall elements.
background-image - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements.
background-origin - CSS: Cascading Style Sheets
formal definition initial valuepadding-boxapplies toall elements.
background-position-x - CSS: Cascading Style Sheets
formal definition initial valueleftapplies toall elementsinheritednopercentagesrefer to width of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ left | right | x-start | x-end ]?
background-position-y - CSS: Cascading Style Sheets
formal definition initial valuetopapplies toall elementsinheritednopercentagesrefer to height of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ top | bottom | y-start | y-end ]?
background-position - CSS: Cascading Style Sheets
formal definition initial value0% 0%applies toall elements.
background-size - CSS: Cascading Style Sheets
formal definition initial valueauto autoapplies toall elements.
background - CSS: Cascading Style Sheets
guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:background-image: nonebackground-position: 0% 0%background-size: auto autobackground-repeat: repeatbackground-origin: padding-boxbackground-clip: border-boxbackground-attachment: scrollbackground-color: transparentapplies toall elements.
<blend-mode> - CSS: Cascading Style Sheets
the <blend-mode> css data type describes how colors should appear when elements overlap.
border-block-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-color: red; } results specific...
border-block-end-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-end-color: red; } results spec...
border-block-end-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-end-style: dashed; } results sp...
border-block-end-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples border width with veritcal text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: ve...
border-block-end - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-block-end-color: a colorborder-block-end-style: discreteborder-block-end-width: a length formal syntax <'border-top-width'> ...
border-block-start-color - CSS: Cascading Style Sheets
values <'color'> see border-color formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-start-color: red; } results sp...
border-block-start-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border wtih vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-start-style: dashed; } results ...
border-block-start - CSS: Cascading Style Sheets
of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the a...
border-block-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-style: dashed; } results specif...
border-block-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typediscrete formal syntax <'border-top-width'> examples border width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: ve...
border-block - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typediscrete formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentc...
border-bottom-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elements.
border-bottom-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
border-bottom-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elements.
border-bottom - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-bottom-width: mediumborder-bottom-style: noneborder-bottom-color: currentcolorapplies toall elements.
border-collapse - CSS: Cascading Style Sheets
formal definition initial valueseparateapplies totable and inline-table elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax collapse | separate examples a colorful table of browser engines html <table class="separate"> <caption><code>border-collapse: separate</code></caption> <tbody> <tr><th>browser</th> <th>layout engine</th></tr> <tr><td class="fx">firefox</td> <td class="gk">gecko</td></tr> <tr><td class="ed">edge</td> <...
border-image-outset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except internal table elements when border-collapse is collapse.
border-image-repeat - CSS: Cascading Style Sheets
formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse.
border-image-slice - CSS: Cascading Style Sheets
formal definition initial value100%applies toall elements, except internal table elements when border-collapse is collapse.
border-image-source - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, except internal table elements when border-collapse is collapse.
border-image-width - CSS: Cascading Style Sheets
formal definition initial value1applies toall elements, except internal table elements when border-collapse is collapse.
border-inline-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-color: red; } results s...
border-inline-end-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-end-style: dashed; } results specifications specificat...
border-inline-start-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-start-color: red; } specifications specification s...
border-inline-start-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid bl...
border-inline-start - CSS: Cascading Style Sheets
of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the a...
border-inline-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-style: dashed; } specifications specifi...
border-inline-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typediscrete formal syntax <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid bl...
border-left-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elements.
border-left-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
border-left-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elements.
border-left - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-left-width: mediumborder-left-style: noneborder-left-color: currentcolorapplies toall elements.
border-right-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elements.
border-right-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
border-right-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elements.
border-right - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-right-width: mediumborder-right-style: noneborder-right-color: currentcolorapplies toall elements.
border-spacing - CSS: Cascading Style Sheets
formal definition initial value0applies totable and inline-table elementsinheritedyescomputed valuetwo absolute lengthsanimation typediscrete formal syntax <length> <length>?
border-style - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: noneapplies toall elements.
border-top-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elements.
border-top-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elements.
border-top - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elements.
border-width - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumapplies toall elements.
border - CSS: Cascading Style Sheets
WebCSSborder
border-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: noneborder-color: as each of the properties of the shorthand:border-top-color: currentcolorborder-right-color: currentcolorborder-bottom-color: currentcolorborder-left-color: currentcolorapplies toall elements.
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
formal definition initial valuestretchapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax start | center | end | baseline | stretch examples setting box alignment <!doctype html> <html> <head> <title>css box-align example</title> <style> div.example { display: box; /* as specified */ display: -moz-box; /* mozilla */ display: -...
box-decoration-break - CSS: Cascading Style Sheets
formal definition initial valuesliceapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax slice | clone examples inline box fragments an inline element that contains line breaks styled with: .example { background: linear-gradient(to bottom right, yellow, green); box-shadow: 8px 8px 10px 0px deeppink, -5px -5px 5px 0px blue, 5px 5px 15px 0px yellow; padding: 0em 1em; border-radius: 16px; ...
box-direction - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as specified */ } specifications not...
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
formal definition initial valuestartapplies toelements with a css display value of -moz-box, -moz-inline-box, -webkit-box or -webkit-inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax start | center | end | justify examples div.example { border-style: solid; display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pac...
break-inside - CSS: Cascading Style Sheets
a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | avoid-page | avoid-column | avoid-region examples avoiding breaking inside a figure in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of paragraphs laid out in multiple columns using column-width: 200px.
caption-side - CSS: Cascading Style Sheets
formal definition initial valuetopapplies totable-caption elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax top | bottom | block-start | block-end | inline-start | inline-end examples setting captions above and below html <table class="top"> <caption>caption above the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> <br> <table class="bottom"> <caption>caption below the table<...
color-adjust - CSS: Cascading Style Sheets
formal definition initial valueeconomyapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax economy | exact examples preserving low contrast in this example, a box is shown which uses a background-image and a translucent linear-gradient() function atop a black background color to have a dark blue gradient behind medium red text.
column-fill - CSS: Cascading Style Sheets
formal definition initial valuebalanceapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | balance | balance-all examples splitting text evenly across columns html <p class="content-box"> this is a bunch of text split into multiple columns.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typea length, percentage or calc(); formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> examples flex layout html <d...
column-rule-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies tomulticol elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
column-rule-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-style'> examples setting a dashed column rule html <p>this is a bunch of text split into three columns.
column-rule-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns.
column-rule - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:column-rule-width: mediumcolumn-rule-style: nonecolumn-rule-color: currentcolorapplies tomulticol elementsinheritednocomputed valueas each of the properties of the shorthand:column-rule-color: computed colorcolumn-rule-style: as specifiedcolumn-rule-width: the absolute length; 0 if the column-rule-style is none or hiddenanimation typeas each of the properties of the shorthand:column-rule-color: a colorcolumn-rule-style: discretecolumn-rule-width: a length formal syntax <'column-rule-width'> | <'colu...
column-span - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toin-flow block-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | all examples making a heading span columns in this example, the heading is made to span across all the columns of the article.
counter-increment - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter-reset - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter-set - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>?
counter() - CSS: Cascading Style Sheets
WebCSScounter
it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported.
counters() - CSS: Cascading Style Sheets
WebCSScounters
it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported.
cursor - CSS: Cascading Style Sheets
WebCSScursor
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax [ [ <url> [ <x> <y> ]?
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
one of the first things we learn about css is that some elements are block-level and some are inline-level.
empty-cells - CSS: Cascading Style Sheets
formal definition initial valueshowapplies totable-cell elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax show | hide example showing and hiding empty table cells html <table class="table_1"> <tr> <td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </tr> </table> <br> <table class="table_2"> <tr> <td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </t...
filter - CSS: Cascading Style Sheets
WebCSSfilter
{ border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left; font-weight: bold; } table.standard-table td { padding: 5px; border: 1px solid rgb(204, 204, 204); text-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typea filter function list formal syntax none | <filter-function-list>where <filter-function-list> = [ <filter-function> | <url> ]+where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <inve...
flex-basis - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toflex items, including in-flow pseudo-elementsinheritednopercentagesrefer to the flex container's inner main sizecomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length, percentage or calc(); formal syntax content | <'width'> examples setting flex item initial sizes html <ul class="container"> <li class="flex flex1">1: flex-basis test</li> <li class="flex flex2">2: flex-basis test<...
flex-grow - CSS: Cascading Style Sheets
WebCSSflex-grow
formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 .
flex-shrink - CSS: Cascading Style Sheets
formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set.
flex - CSS: Cascading Style Sheets
WebCSSflex
formal definition initial valueas each of the properties of the shorthand:flex-grow: 0flex-shrink: 1flex-basis: autoapplies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:flex-grow: as specifiedflex-shrink: as specifiedflex-basis: as specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:flex-grow: a numberflex-shrink: a numberflex-basis: a length, percentage or calc(); formal syntax none | [ <'flex-grow'> <'flex-shrink'>?
font-family - CSS: Cascading Style Sheets
kletter 1911", sans-serif; the following declarations are invalid: font-family: goudy bookletter 1911, sans-serif; font-family: red/black, sans-serif; font-family: "lucida" grande, sans-serif; font-family: ahem!, sans-serif; font-family: test@foo, sans-serif; font-family: #pound, sans-serif; font-family: hawaii 5-0, sans-serif; formal definition initial valuedepends on user agentapplies toall elements.
font-feature-settings - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-kerning - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements.
font-language-override - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-optical-sizing - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements.
font-size-adjust - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
formal definition initial valuemediumapplies toall elements.
font-smooth - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | never | always | <absolute-size> | <length>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large examples basic usage example the following example shows the safari/chromium and firefox equivalents that turn on font-smoothing on macos.
font-stretch - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-style - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements.
font-synthesis - CSS: Cascading Style Sheets
formal definition initial valueweight styleapplies toall elements.
font-variant-alternates - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-variant-caps - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements.
font-variant-east-asian - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-variant-numeric - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-variant - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-variation-settings - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elements.
font-weight - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies toall elements.
gap (grid-gap) - CSS: Cascading Style Sheets
WebCSSgap
formal definition initial valueas each of the properties of the shorthand:row-gap: normalcolumn-gap: normalapplies tomulti-column elements, flex containers, grid containersinheritednocomputed valueas each of the properties of the shorthand:row-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementscolumn-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typeas each of the properties of the shorthand:row-gap: a l...
grid - CSS: Cascading Style Sheets
WebCSSgrid
id-auto-rows: the percentage as specified or the absolute lengthgrid-auto-columns: the percentage as specified or the absolute lengthgrid-auto-flow: as specifiedgrid-column-gap: the percentage as specified or the absolute lengthgrid-row-gap: the percentage as specified or the absolute lengthcolumn-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsrow-gap: as specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typediscrete formal syntax <'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense?
hanging-punctuation - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
formal definition initial valuemanualapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | manual | auto examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property.
image-rendering - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
examples exclude selected elements from a rule /* make second-level headers green */ h2 { color: green; } /* ...but leave those in the sidebar alone so they use their parent's color */ #sidebar h2 { color: inherit; } in this example the h2 elements inside the sidebar might be different colors.
Inheritance - CSS: Cascading Style Sheets
definitions of value syntax, shorthand properties and replaced elements.
initial-letter-align - CSS: Cascading Style Sheets
formal definition initial valueautoapplies to::first-letter pseudo-elements and inline-level first child of a block containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ auto | alphabetic | hanging | ideographic ] examples aligning initial letter html <p class="auto ">initial letter - auto</p> <p class="alphabetic">initial letter - alphabetic</p> <p class="hanging">initial letter - hanging</p> <p class="ideographic">initial letter - i...
initial-letter - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies to::first-letter pseudo-elements and inline-level first child of a block containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | [ <number> <integer>?
Initial value - CSS: Cascading Style Sheets
for non-inherited properties, the initial value is used on all elements, as long as no specified value is supplied.
inset-block-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120p...
inset-block-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 12...
inset-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting block start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px...
inset-inline-end - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px...
inset-inline-start - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 12...
inset-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting inline start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px...
inset - CSS: Cascading Style Sheets
WebCSSinset
formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,4} examples setting offsets for an element html <div> <span class="exampletext">example text</span> </div> css div { background-color: yellow; width: 150p...
justify-self - CSS: Cascading Style Sheets
for absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
letter-spacing - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies toall elements.
line-break - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | loose | normal | strict | anywhere examples setting text wrapping see whether the text is wrapped before "々", "ぁ" and "。".
list-style-image - CSS: Cascading Style Sheets
elements with display: list-item; by default this includes <li> elements.
list-style-type - CSS: Cascading Style Sheets
only a few elements (<li> and <summary>) have a default value of display: list-item.
mask-border-mode - CSS: Cascading Style Sheets
formal definition initial valuealphaapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples basic usage this property doesn't yet seem to have support anywhere.
mask-border-outset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-repeat - CSS: Cascading Style Sheets
formal definition initial valuestretchapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-slice - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of the mask border imagecomputed valueas specifiedanimation typediscrete formal syntax <number-percentage>{1,4} fill?where <number-percentage> = <number> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet.
mask-border-source - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
mask-border-width - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrelative to width/height of the mask border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> exampl...
mask-border - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:mask-border-mode: alphamask-border-outset: 0mask-border-repeat: stretchmask-border-slice: 0mask-border-source: nonemask-border-width: autoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesas each of the properties of the shorthand:mask-border-slice: refer to size of the mask border imagemask-border-width: relative to width/height of the mask border image areacomputed valueas each of the properties of the shorthand:mask-border-mode: as specifiedmask-border-outset: as ...
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
formal definition initial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <geometry-box> | no-clip ]#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples clipping a mask to the border ...
mask-composite - CSS: Cascading Style Sheets
formal definition initial valueaddapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <compositing-operator>#where <compositing-operator> = add | subtract | intersect | exclude examples compositing mask layers with addition css #masked { width: 100px; height: 100px; background-color: #8cffa0; mask-imag...
mask-image - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <mask-reference>#where <mask-reference> = none | <image> | <mask-source>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><mask-source> =...
mask-mode - CSS: Cascading Style Sheets
WebCSSmask-mode
formal definition initial valuematch-sourceapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <masking-mode>#where <masking-mode> = alpha | luminance | match-source examples using alpha mask mode css #masked { width: 227px; height: 200px; background: blue linear-gradient(red, blue); mask-image: url(https://mdn.
mask-position - CSS: Cascading Style Sheets
formal definition initial valuecenterapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of mask painting area minus size of mask layer image (see the text for background-position)computed valueconsists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage...
mask-repeat - CSS: Cascading Style Sheets
formal definition initial valueno-repeatapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueconsists of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting repeat for a single mask css #masked { width: 250px; height: 250px; ...
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
formal definition initial valueautoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length>...
mask-type - CSS: Cascading Style Sheets
WebCSSmask-type
formal definition initial valueluminanceapplies to<mask> elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples setting an alpha mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:alpha"> <rect x=".1" ...
min-height - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block.
offset-distance - CSS: Cascading Style Sheets
formal definition initial value0applies totransformable elementsinheritednopercentagesrefer to the total path lengthcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion path typically comes from animating the offset-distance property...
offset-path - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()>creates stacking contextyes formal syntax none | ray( [ <angle> && <size>?
offset-position - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrefertosizeofcontainingblockcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
offset-rotate - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednocomputed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); ani...
offset - CSS: Cascading Style Sheets
WebCSSoffset
e.svg) 30deg; offset: url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset: url(arc.svg) 2cm / 0.5cm 3cm; offset: url(arc.svg) 30deg / 50px 100px; formal definition initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as specifiedoffset-distance: for <length> the absolute value, ...
order - CSS: Cascading Style Sheets
WebCSSorder
syntax /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order.
orphans - CSS: Cascading Style Sheets
WebCSSorphans
formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples setting a minimum orphan size of three lines html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one.
outline-color - CSS: Cascading Style Sheets
webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert.
outline-offset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <length> examples setting outline offset in pixels html <p>gallia est omnis divisa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications ...
outline-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <'border-style'> examples setting outline style to auto the auto value indicates a custom outline style — typically a style [that] is either a user interface default for the platform, or perhaps a style that is richer than can be described in detail in css, e.g.
outline-width - CSS: Cascading Style Sheets
formal definition initial valuemediumapplies toall elementsinheritednocomputed valuean absolute length; if the keyword none is specified, the computed value is 0animation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples setting an element's outline width html <span id="thin">thin</span> <span id="medium">medium</span> <span id="thick">thick</span> <span id="twopixels">2px</span> <span id="oneex">1...
Guide to scroll anchoring - CSS: Cascading Style Sheets
this has happened because large images or some other elements have just loaded further up in the content.
overflow-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
disables scrolling of xml root elements, <html>, and <body> with the keyboard's arrow keys and the mouse wheel.
padding-block-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block end padding for vertical text html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; paddin...
padding-block-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 2...
padding-block - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting block padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-block: 20px 40p...
padding-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
padding-inline-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline end padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-end: 20p...
padding-inline-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start:...
padding-inline - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting inline padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-inline: 20px 4...
padding-left - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
padding-right - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
padding-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
padding - CSS: Cascading Style Sheets
WebCSSpadding
formal definition initial valueas each of the properties of the shorthand:padding-bottom: 0padding-left: 0padding-right: 0padding-top: 0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.
paint-order - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ fill | stroke | markers ] examples reversing the paint order of stroke and fill svg <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"> <text x="10" y="75">stroke in front</text> <text x="10" y="150" class="stroke-behind">stroke behind</text> </svg> css text { font-family: sans-serif; ...
perspective-origin - CSS: Cascading Style Sheets
formal definition initial value50% 50%applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
place-items - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:align-items: normaljustify-items: legacyapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:align-items: as specifiedjustify-items: as specifiedanimation typediscrete formal syntax <'align-items'> <'justify-items'>?
place-self - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:align-self: autojustify-self: autoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas each of the properties of the shorthand:align-self: auto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent.
revert - CSS: Cascading Style Sheets
WebCSSrevert
examples revert vs unset although revert and unset are similar they differ for some properties for some elements.
rotate - CSS: Cascading Style Sheets
WebCSSrotate
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typea transformcreates stacking contextyes formal syntax none | <angle> | [ x | y | z | <number>{3} ] && <angle> examples rotate an element on hover html <div> <p class="rotate">rotation</p> </div> css * { box-sizing: border-box; } html { font-family: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; ...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
WebCSSrow-gap
formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typea length, percentage or calc(); formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> examples flex layout html ...
scale - CSS: Cascading Style Sheets
WebCSSscale
formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typea transformcreates stacking contextyes formal syntax none | <number>{1,3} examples scaling an element on hover html <div> <p class="scale">scaling</p> </div> css * { box-sizing: border-box; } html { font-family: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-rad...
scroll-margin-block-end - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-end' in that specification.
scroll-margin-block-start - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification.
scroll-margin-block - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block' in that specification.
scroll-margin-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-bottom' in that specification.
scroll-margin-left - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-left' in that specification.
scroll-margin-right - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-right' in that specification.
scroll-margin-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-top' in that specification.
scroll-snap-align - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification.
scroll-snap-coordinate - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednopercentagesrefer to the element’s border boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea position formal syntax none | <position>#where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
scroll-snap-points-x - CSS: Cascading Style Sheets
elements within the scroll container may still define snap points on behalf of the scroll container.
scroll-snap-points-y - CSS: Cascading Style Sheets
elements within the scroll container may still define snap points on behalf of the scroll container.
text-combine-upright - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete formal syntax none | all | [ digits <integer>?
text-decoration-line - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements.
text-decoration-skip-ink - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | all | none examples html <p>you should go on a quest for a cup of coffee.</p> <p class="no-skip-ink">or maybe you'd prefer some tea?</p> <p>この文は、 text-decoration-skip-ink: auto の使用例を示しています。</p> <p class="skip-ink-all">この文は、 text-decoration-skip-ink: all の使用例を...
text-decoration-style - CSS: Cascading Style Sheets
formal definition initial valuesolidapplies toall elements.
text-emphasis-color - CSS: Cascading Style Sheets
formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
text-emphasis-style - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-emphasis - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:text-emphasis-style: nonetext-emphasis-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:text-emphasis-style: as specifiedtext-emphasis-color: computed coloranimation typeas each of the properties of the shorthand:text-emphasis-color: a colortext-emphasis-style: discrete formal syntax <'text-emphasis-style'> | <'text-emphasis-color'> examples a heading with emphasis shape and color this example draws a heading w...
text-justify - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toinline-level and table-cell elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | inter-character | inter-word | none examples <p class="none"><code>text-justify: none</code> —<br>lorem ipsum dolor sit amet, consectetur adipiscing elit.
text-overflow - CSS: Cascading Style Sheets
formal definition initial valueclipapplies toblock container elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ clip | ellipsis | <string> ]{1,2} examples css p { width: 200px; border: 1px solid; padding: 2px 5px; /* both of the following are required for text-overflow */ white-space: nowrap; overflow: hidden; } .overflow-visible { white-space: initial; } .overflow-clip { text-overflow: clip; } .overflow-el...
text-rendering - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | optimizespeed | optimizelegibility | geometricprecision examples automatic application of optimizelegibility this demonstrates how optimizelegibility is used by browsers automatically when the font-size is smaller than 20px.
text-size-adjust - CSS: Cascading Style Sheets
formal definition initial valueauto for smartphone browsers supporting inflation, none in other cases (and then not modifiable).applies toall elementsinheritedyespercentagesyes, refer to the corresponding size of the text fontcomputed valueas specifiedanimation typediscrete formal syntax none | auto | <percentage> examples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlaue of none: p { -webkit-text-size...
text-transform - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenoneapplies toall elements.
text-underline-position - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | from-font | [ under | [ left | right ] ] examples a simple example let's take a couple of simple example paragraphs: <p class="horizontal">lorem ipsum dolor sit amet, consectetur adipiscing elit.
transform-box - CSS: Cascading Style Sheets
formal definition initial valueview-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box | view-box examples svg transform-origin scoping in this example we have an svg: <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 50 50"> <g> <circle id="center" fill="red" r="1" transform="translate(25 25)" /> <circle id="boxcenter" fill="blue" r=...
matrix3d() - CSS: Cascading Style Sheets
a1a2a3a4b1b2b3b4c1c2c3c4d1d2d3d4 examples cube squashing example the following example shows a 3d cube created from dom elements and transforms, which can be hovered/focused to apply a matrix3d() transform to it.
translateZ() - CSS: Cascading Style Sheets
this transformation is defined by a <length> which specifies how far inward or outward the element or elements move.
<transform-function> - CSS: Cascading Style Sheets
examples transform function comparison the following example provides a 3d cube created from dom elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types.
transform-origin - CSS: Cascading Style Sheets
the keywords are convenience shorthands and match the following <percentage> values: keyword value left 0% center 50% right 100% top 0% bottom 100% formal definition initial value50% 50% 0applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> ...
transform-style - CSS: Cascading Style Sheets
formal definition initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform style demonstration in this example we have a 3d cube created using transforms.
transition-delay - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-delay: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:abs...
transition-duration - CSS: Cascading Style Sheets
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-duration: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:...
transition-property - CSS: Cascading Style Sheets
formal definition initial valueallapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <single-transition-property>#where <single-transition-property> = all | <custom-ident> examples there are several examples of css transitions included in the main css transitions article.
transition-timing-function - CSS: Cascading Style Sheets
formal definition initial valueeaseapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclos...
transition - CSS: Cascading Style Sheets
formal definition initial valueas each of the properties of the shorthand:transition-delay: 0stransition-duration: 0stransition-property: alltransition-timing-function: easeapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:transition-delay: as specifiedtransition-duration: as specifiedtransition-property: as specifiedtransition-timing-function: as specifiedanimation typediscrete formal syntax <single-transition>#where <single-transition> = [ none | <single-transition-property> ] | <time> | <timing-function> | ...
Used value - CSS: Cascading Style Sheets
example this example computes and displays the used width value of three elements (updates on resize): html <div id="no-width"> <p>no explicit width.</p> <p class="show-used-width">..</p> <div id="width-50"> <p>explicit width: 50%.</p> <p class="show-used-width">..</p> <div id="width-inherit"> <p>explicit width: inherit.</p> <p class="show-used-width">..</p> </div> </div> </div> css #no-width { width: auto; } #width-50 { width: 5...
widows - CSS: Cascading Style Sheets
WebCSSwidows
formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples controlling column widows html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one.
word-break - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-all | keep-all | break-word examples html <p>1.
word-spacing - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies toall elements.
writing-mode - CSS: Cascading Style Sheets
formal definition initial valuehorizontal-tbapplies toall elements except table row groups, table column groups, table rows, and table columnsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr examples using multiple writing modes this example demonstrates all of the writing modes, showing each with text in various languages.
zoom - CSS: Cascading Style Sheets
WebCSSzoom
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typean integer formal syntax normal | reset | <number> | <percentage> examples first example html <p class="small">small</p> <p class="normal">normal</p> <p class="big">big</p> css p.small { zoom: 75%; } p.normal { zoom: normal; } p.big { zoom: 2.5; } p { display: inline-block; } p:hover { zoom: reset; } result second example h...
CSS: Cascading Style Sheets
WebCSS
css describes how elements should be rendered on screen, on paper, in speech, or on other media.
exsl:node-set() - EXSLT
WebEXSLTexslnode-set
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
exsl:object-type() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:object-type() returns a string that indicates the type of the specified object.
Common (exsl) - EXSLT
WebEXSLTexsl
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt common package provides basic functions that expand upon the capabilities of xslt.
math:highest() - EXSLT
WebEXSLTmathhighest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:highest() returns the node in the specified node-set with the highest value (where the highest value calculated using math:max()).
math:lowest() - EXSLT
WebEXSLTmathlowest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:lowest() returns the node in the specified node-set with the lowest value (where the lowest value calculated using math:min()).
math:max() - EXSLT
WebEXSLTmathmax
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:max() returns the maximum value of a node-set.
math:min() - EXSLT
WebEXSLTmathmin
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:min() returns the minimum value of a node-set.
Math (math) - EXSLT
WebEXSLTmath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt math package provides functions for working with numeric values and comparing nodes.
regexp:replace() - EXSLT
WebEXSLTregexpreplace
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.
regexp:test() - EXSLT
WebEXSLTregexptest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:test() tests to see whether a string matches a specified regular expression.
Regular expressions (regexp) - EXSLT
WebEXSLTregexp
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.
set:difference() - EXSLT
WebEXSLTsetdifference
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:difference() returns the difference between two node-sets.
set:distinct() - EXSLT
WebEXSLTsetdistinct
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.
set:has-same-node() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:has-same-node() determines whether two node-sets have any nodes in common.
set:intersection() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:intersection() returns the intersection of two node-sets.
set:leading() - EXSLT
WebEXSLTsetleading
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:leading() returns the nodes in one node-set that come before the first node in the other node-set.
set:trailing() - EXSLT
WebEXSLTsettrailing
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:trailing() returns the nodes in one node-set that come after the first node in the other node-set.
Sets (set) - EXSLT
WebEXSLTset
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt sets package offers functions that let you perform set manipulation.
str:concat() - EXSLT
WebEXSLTstrconcat
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:concat() returns a string containing all the string values in a node-set concatenated together.
Strings (str) - EXSLT
WebEXSLTstr
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt strings package provides functions that allow the manipulation of strings.
EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exslt is a set of extensions to xslt.
Getting Started - Developer guides
then in alertcontents(), we need to replace the line alert(httprequest.responsetext); with: var xmldoc = httprequest.responsexml; var root_node = xmldoc.getelementsbytagname('root').item(0); alert(root_node.firstchild.data); this code takes the xmldocument object given by responsexml and uses dom methods to access some of the data contained in the xml document.
Cross-browser audio basics - Developer guides
however any supported text or elements that you define within <audio> will be displayed or acted upon.
Web Audio playbackRate explained - Developer guides
the playbackrate property of the <audio> and <video> elements allows us to change the speed, or rate, at which a piece of web audio or video is playing.
Creating a cross-browser video player - Developer guides
a number of variables pointing to html elements are required: var videocontainer = document.getelementbyid('videocontainer'); var video = document.getelementbyid('video'); var videocontrols = document.getelementbyid('video-controls'); as mentioned earlier, the browser's default controls now need to be disabled, and the custom controls need to be displayed: // hide the default controls video.controls = false; // display the user defined vi...
Challenge solutions - Developer guides
solution the following rule puts borders around only <td> elements that are inside the <tbody> element of the table with id=demo-table: #demo-table tbody td { border:1px solid #7a7; } media separate print style file challenge move the print-specific style rules to a separate css file and import them into your style4.css stylesheet.
Creating and triggering events - Developer guides
om "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); form.addeventlistener('awesome', e => console.log(e.detail.text())); textarea.addeventlistener('input', function() { // create and dispatch/trigger an event on the fly // note: optionally, we've also ...
Event developer guide - Developer guides
WebGuideEvents
two common styles are: the generalized addeventlistener() and a set of specific on-event handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures.
Graphics on the Web - Developer guides
static images can easily be displayed using the <img> element, or by setting the background of html elements using the background-image property.
A hybrid approach - Developer guides
we used some elements of responsive web design to give the site a mobile layout, along with user-agent detection to provide mobile-friendly videos and to re-order the demos if the user is on a phone.
Mobile-friendliness - Developer guides
a slimmed-down, linearized page layout with elements sized for a touchscreen would be much more appropriate.
Printing - Developer guides
you can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process).
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
syntax for min values for other elements input type syntax example <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> impact on step the value of min and step define what are valid values, even if the step attribute is not included, as step defaults to 0.
<acronym> - HTML: Hypertext Markup Language
WebHTMLElementacronym
attributes this element only has global attributes, which are common to all elements.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
firefox 79+) setting target="_blank" on <area> elements implicitly provides the same rel behavior as setting rel="noopener".
<big>: The Bigger Text element - HTML: Hypertext Markup Language
WebHTMLElementbig
attributes this element has no other attributes than the global attributes, common to all elements.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
<p>so will this paragraph.</p></div> example 3 (css alternative) <p style="text-align:center">this line will be centered.<br> and so will this line.</p> note applying text-align:center to a <div> or <p> element centers the contents of those elements while leaving their overall dimensions unchanged.
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
permitted parent elements <colgroup> only, though it can be implicitly defined as its start tag is not mandatory.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
permitted parent elements any element that accepts flow content.
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
events in addition to the usual events supported by html elements, the <details> element supports the toggle event, which is dispatched to the <details> element whenever its state changes between open and closed.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
usage notes <form> elements can close a dialog if they have the attribute method="dialog".
<dir>: The Directory element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementdir
attributes like all other html elements, this element supports the global attributes.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
it is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
<em> new developers are often confused at seeing multiple elements that produce similar results.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
note that form elements inside the <legend> element won't be disabled.
<footer> - HTML: Hypertext Markup Language
WebHTMLElementfooter
webkit bugzilla: 146930 – ax: html native elements (header, footer, main, aside, nav) should work the same as aria landmarks, sometimes they don't specifications specification status comment html living standardthe definition of '<footer>' in that specification.
<frame> - HTML: Hypertext Markup Language
WebHTMLElementframe
attributes like all other html elements, this element supports the global attributes.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
it may contain some heading elements but also a logo, a search form, an author name, and other elements.
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
WebHTMLElementhr
the html <hr> element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
all other elements must be descendants of this element.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
<input> elements of type color provide a user interface element that lets a user specify a color, either by using a visual color picker interface or by entering the color into a text field in #rrggbb hexadecimal format.
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
<input> elements of type "reset" are rendered as buttons, with a default click event handler that resets all of the inputs in the form to their initial values.
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
attributes like all other html elements, this element accepted the global attributes.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
this attribute enables you to place <keygen> elements anywhere within a document, not just as descendants of their form elements.
<legend> - HTML: Hypertext Markup Language
WebHTMLElementlegend
permitted content phrasing content and headings (h1–h6 elements).
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
the html <map> element is used with <area> elements to define an image map (a clickable link area).
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements.
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
(menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) content categories none.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>.
<multicol>: The HTML Multi-Column Layout element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmulticol
in order to implement a multi-column layout, you should be using the regular html elements, like <div> in conjunction with css columns.
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
WebHTMLElementnav
a document may have several <nav> elements, for example, one for site navigation and one for intra-page navigation.
<noscript> - HTML: Hypertext Markup Language
WebHTMLElementnoscript
permitted content when scripting is disabled and when it is a descendant of the <head> element: in any order, zero or more <link> elements, zero or more <style> elements, and zero or more <meta> elements.
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
permitted content zero or more <param> elements, then transparent.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
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.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
crossorigin normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard cors checks.
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
as an example, a navigation menu should be wrapped in a <nav> element, but a list of search results and a map display and its controls don't have specific elements, and could be put inside a <section>.
<small>: the side comment element - HTML: Hypertext Markup Language
WebHTMLElementsmall
recommendation notes although the <small> element, like the <b> and <i> elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in html5.
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
picture example in this example, two <source> elements are included within the <picture>, providing versions of an image to use when the available space exceeds certain widths.
<spacer> - HTML: Hypertext Markup Language
WebHTMLElementspacer
attributes like all other html elements, this element supports the global attributes.
<span> - HTML: Hypertext Markup Language
WebHTMLElementspan
it can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
it may help to realize that both are valid and semantic elements in html5 and that it's a coincidence that they both have the same default styling (boldface) in most browsers (although some older browsers actually underline <strong>).
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
headers this attribute contains a list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
headers this attribute contains a list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
the html <track> element is used as a child of the media elements, <audio> and <video>.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input element <samp>: the html sample output element if you encounter code that is mistakenly using <var> for style purposes rather than semantic purposes, you should either use a <span> with appropriate css or, an appropriate semantic element among the ...
<xmp> - HTML: Hypertext Markup Language
WebHTMLElementxmp
attributes this element has no other attributes than the global attributes, common to all elements.
data-* - HTML: Hypertext Markup Language
usage by adding data-* attributes, even ordinary html elements can become rather complex and powerful program-objects.
dir - HTML: Hypertext Markup Language
recommendation supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
draggable - HTML: Hypertext Markup Language
for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example.
itemid - HTML: Hypertext Markup Language
also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers.
itemref - HTML: Hypertext Markup Language
itemref provides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an itemscope attribute specified.
itemscope - HTML: Hypertext Markup Language
for elements with an itemscope attribute and an itemtype attribute, you may also specify an id attribute.
part - HTML: Hypertext Markup Language
part names allows css to select and style specific elements in a shadow tree via the ::part pseudo-element.
spellcheck - HTML: Hypertext Markup Language
typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking.
style - HTML: Hypertext Markup Language
recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>.
Link types: noopener - HTML: Hypertext Markup Language
the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null).
Link types: noreferrer - HTML: Hypertext Markup Language
the noreferrer keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser, when navigating to the target resource, to omit the referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified.
Microformats - HTML: Hypertext Markup Language
on certain html elements, use special attributes first, e.g.
Browser detection using the user agent - HTTP
can you prevent it by adding some non-semantic <div> or <span> elements?
HTTP caching - HTTP
WebHTTPCaching
this is very important when web sites have css stylesheets or js scripts that have mutual dependencies, i.e., they depend on each other because they refer to the same html elements.
HTTP conditional requests - HTTP
building a system of etags that creates weak validation may be complex, as it involves knowing the importance of the different elements of a page, but is very useful towards optimizing cache performance.
Cross-Origin Resource Policy (CORP) - HTTP
cross-origin resource policy is a policy set by the cross-origin-resource-policy http header that lets web sites and applications opt in to protection against certain requests from other origins (such as those issued with elements like <script> and <img>), to mitigate speculative side-channel attacks, like spectre, as well as cross-site script inclusion attacks.
Content-Language - HTTP
examples indicating the language a document is written in the global lang attribute is used on html elements to indicate the language of an entire html document or parts of it.
CSP: require-sri-for - HTTP
examples if you set your site to require sri for script and styles using this directive: content-security-policy: require-sri-for script style <script> elements like the following will be loaded as they use a valid integrity attribute.
Feature-Policy: autoplay - HTTP
the autoplay attribute on <audio> and <video> elements will be ignored.
HTTP Messages - HTTP
WebHTTPMessages
their start-line contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed.
POST - HTTP
WebHTTPMethodsPOST
in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button> elements: application/x-www-form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value.
A re-introduction to JavaScript (JS tutorial) - JavaScript
count, you can iterate over an array using the following for loop: for (var i = 0; i < a.length; i++) { // do something with a[i] } es2015 introduced the more concise for...of loop for iterable objects such as arrays: for (const currentvalue of a) { // do something with currentvalue } you could also iterate over an array using a for...in loop, however this does not iterate over the array elements, but the array indices.
Closures - JavaScript
one way of doing this is to specify the font-size of the body element (in pixels), and then set the size of the other elements on the page (such as headers) using the relative em unit: body { font-family: helvetica, arial, sans-serif; font-size: 12px; } h1 { font-size: 1.5em; } h2 { font-size: 1.2em; } such interactive text size buttons can change the font-size property of the body element, and the adjustments are picked up by other elements on the page thanks to the relative units.
Memory Management - JavaScript
var a = ['ouais ouais', 'nan nan']; var a2 = ['generation', 'nan nan']; var a3 = a.concat(a2); // new array with 4 elements being // the concatenation of a and a2 elements.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
10 // 20 } or, using for...of (es2015) and object.values (es2017), you can get an array of the specified object values and iterate over the array like this: var object = { a: 10, b: 20 }; for (var x of object.values(object)) { console.log(x); // 10 // 20 } array iteration for each...in has been used to iterate over specified array elements.
Rest parameters - JavaScript
// using the same function definition from example above myfun("one", "two") // a, one // b, two // manymoreargs, [] argument length since theargs is an array, a count of its elements is given by the length property: function fun1(...theargs) { console.log(theargs.length) } fun1() // 0 fun1(5) // 1 fun1(5, 6, 7) // 3 ordinary parameter and rest parameters in the next example, a rest parameter is used to collect all parameters after the first into an array.
Array.prototype.flatMap() - JavaScript
alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatmap(x => [x, x * 2]); // is equivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] note, however, that this is inefficient and should be avoided for large arrays: in each iteration, it creates a new temporary array that must be garbage-collected, and it copies elements from the current accumulator array into a new array instead of just adding the new elements to the existing array.
Array.prototype.includes() - JavaScript
the first element to be searched is found at fromindex for positive values of fromindex, or at arr.length + fromindex for negative values of fromindex (using the absolute value of fromindex as the number of elements from the end of the array at which to start the search).
Array.prototype.indexOf() - JavaScript
description indexof() compares searchelement to elements of the array using strict equality (the same method used by the === or triple-equals operator).
Array.prototype.lastIndexOf() - JavaScript
description lastindexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator).
Array.of() - JavaScript
array.of(7); // [7] array.of(1, 2, 3); // [1, 2, 3] array(7); // array of 7 empty slots array(1, 2, 3); // [1, 2, 3] syntax array.of(element0[, element1[, ...[, elementn]]]) parameters elementn elements used to create the array.
BigInt64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
BigUint64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
DataView() constructor - JavaScript
bytelength optional the number of elements in the byte array.
Float32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Float64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Function.prototype.bind() - JavaScript
[[boundarguments]] a list of values whose elements are used as the first arguments to any call to the wrapped function.
Int16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Int32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Int8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Intl​.ListFormat.prototype​.format() - JavaScript
syntax listformat.format([list]); parameters list an iterable object, such as an array return value a language-specific formatted string representing the elements of the list description the format() method returns a string that has been formatted based on parameters provided in the intl.listformat object.
Intl.ListFormat - JavaScript
instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list.
Intl.getCanonicalLocales() - JavaScript
duplicates will be omitted and elements will be validated as structurally valid language tags.
Intl - JavaScript
multiple locales may be specified (and a best-supported locale determined by evaluating each of them in order and comparing against the locales supported by the implementation) by passing an array (or array-like object, with a length property and corresponding indexed elements) whose elements are either intl.locale objects or values that convert to unicode bcp 47 locale identifier strings.
JSON.stringify() - JavaScript
false]); // '[1,"false",false]' json.stringify([nan, null, infinity]); // '[null,null,null]' json.stringify({ x: 5 }); // '{"x":5}' json.stringify(new date(2006, 0, 2, 15, 4, 5)) // '"2006-01-02t15:04:05.000z"' json.stringify({ x: 5, y: 6 }); // '{"x":5,"y":6}' json.stringify([new number(3), new string('false'), new boolean(false)]); // '[3,"false",false]' // string-keyed array elements are not enumerable and make no sense in json let a = ['foo', 'bar']; a['baz'] = 'quux'; // a: [ 0: 'foo', 1: 'bar', baz: 'quux' ] json.stringify(a); // '["foo","bar"]' json.stringify({ x: [10, undefined, function(){}, symbol('')] }); // '{"x":[10,null,null,null]}' // standard data structures json.stringify([new set([1]), new map([[1, 2]]), new weakset([{a: 1}]), new weakmap([[{a: 1}, 2]])]...
JSON - JavaScript
pt " or \ or u+0000 through u+001f or escapesequence escapesequence = \" or \/ or \\ or \b or \f or \n or \r or \t or \u hexdigit hexdigit hexdigit hexdigit hexdigit = 0 through 9 or a through f or a through f jsonobject = { } or { members } members = jsonstring : json or members , jsonstring : json jsonarray = [ ] or [ arrayelements ] arrayelements = json or arrayelements , json insignificant whitespace may be present anywhere except within a jsonnumber (numbers must contain no whitespace) or jsonstring (where it is interpreted as the corresponding character in the string, or would cause an error).
Map.prototype.clear() - JavaScript
the clear() method removes all elements from a map object.
Map.prototype.forEach() - JavaScript
examples printing the contents of a map object the following code logs a line for each element in an map object: function logmapelements(value, key, map) { console.log(`map.get('${key}') = ${value}`) } new map([['foo', 3], ['bar', {}], ['baz', undefined]]).foreach(logmapelements) // logs: // "map.get('foo') = 3" // "map.get('bar') = [object object]" // "map.get('baz') = undefined" specifications specification ecmascript (ecma-262)the definition of 'map.prototype.foreach' in that specification.
Map.prototype.set() - JavaScript
examples using set() let mymap = new map() // add new elements to the map mymap.set('bar', 'foo') mymap.set(1, 'foobar') // update an element in the map mymap.set('bar', 'baz') using the set() with chaining since the set() method returns back the same map object, you can chain the method call like below: // add new elements to the map with chaining.
Map.prototype.size - JavaScript
the size accessor property returns the number of elements in a map object.
Map - JavaScript
description a map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration.
Object.entries() - JavaScript
description object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object.
Object.getOwnPropertyNames() - JavaScript
description object.getownpropertynames() returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object obj.
Object.keys() - JavaScript
description object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object.
Object.values() - JavaScript
description object.values() returns an array whose elements are the enumerable property values found on the object.
Object - JavaScript
for example, in the call myfn(a, b, c), the arguments within myfn's body will contain 3 array-like elements corresponding to (a, b, c).
Promise.all() - JavaScript
be done asynchronously console.log(p); console.log(p2) settimeout(function() { console.log('the stack is now empty'); console.log(p2); }); // logs // promise { <state>: "fulfilled", <value>: array[0] } // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: array[2] } promise.all fail-fast behaviour promise.all is rejected if any of the elements are rejected.
handler.ownKeys() - JavaScript
const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: true, value: 10 } ); const p = new proxy(obj, { ownkeys: function(target) { return [123, 12.5, true, false, undefined, null, {}, []]; } }); console.log(object.getownpropertynames(p)); // typeerror: proxy [[ownpropertykeys]] must return an array // with only string and symbol elements specifications specification ecmascript (ecma-262)the definition of '[[ownpropertykeys]]' in that specification.
RegExp.prototype[@@split]() - JavaScript
return value an array containing substrings as its elements.
Set() constructor - JavaScript
syntax new set([iterable]) parameters iterable optional if an iterable object is passed, all of its elements will be added to the new set.
Set.prototype.clear() - JavaScript
the clear() method removes all elements from a set object.
Set.prototype.forEach() - JavaScript
examples logging the contents of a set object the following code logs a line for each element in a set object: function logsetelements(value1, value2, set) { console.log('s[' + value1 + '] = ' + value2); } new set(['foo', 'bar', undefined]).foreach(logsetelements); // logs: // "s[foo] = foo" // "s[bar] = bar" // "s[undefined] = undefined" specifications specification ecmascript (ecma-262)the definition of 'set.prototype.foreach' in that specification.
Set.prototype.size - JavaScript
the size accessor property returns the number of (unique) elements in a set object.
Set.prototype.values() - JavaScript
the keys() method is an alias for this method (for similarity with map objects); it behaves exactly the same and returns values of set elements.
String.prototype.codePointAt() - JavaScript
https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; ...
String.fromCodePoint() - JavaScript
int >> 10) + 0xd800, // highsurrogate (codepoint % 0x400) + 0xdc00 // lowsurrogate ); } if (codelen >= 0x3fff) { result += stringfromcharcode.apply(null, codeunits); codeunits.length = 0; } } return result + stringfromcharcode.apply(null, codeunits); }; try { // ie 8 only supports `object.defineproperty` on dom elements object.defineproperty(string, "fromcodepoint", { "value": fromcodepoint, "configurable": true, "writable": true }); } catch(e) { string.fromcodepoint = fromcodepoint; } }(string.fromcharcode)); examples using fromcodepoint() valid input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404"...
String length - JavaScript
7) established a maximum length of 2^53 - 1 elements.
String.prototype.link() - JavaScript
links created with the link() method become elements in the links array of the document object.
String - JavaScript
string.prototype.repeat(count) returns a string consisting of the elements of the object repeated count times.
Symbol - JavaScript
symbol.isconcatspreadable a boolean value indicating if an object should be flattened to its array elements.
TypedArray.prototype.indexOf() - JavaScript
description indexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator).
TypedArray.prototype.lastIndexOf() - JavaScript
description lastindexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator).
TypedArray.prototype.length - JavaScript
the length accessor property represents the length (in elements) of a typed array.
TypedArray.prototype.sort() - JavaScript
the sort() method sorts the elements of a typed array numerically in place and returns the typed array.
TypedArray.prototype.subarray() - JavaScript
if not specified, all elements from the one specified by begin to the end of the array are included in the new view.
Uint16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Uint32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Uint8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Uint8ClampedArray() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
WeakMap() constructor - JavaScript
syntax new weakmap([iterable]) parameters iterable iterable is an array or other iterable object whose elements are key-value pairs (2-element arrays).
WeakMap.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakmap object, but is no longer part of ecmascript and its implementations.
WeakMap.prototype.set() - JavaScript
examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.set' in that specification.
WeakMap - JavaScript
setting elements on this map would involve pushing a key and value onto the end of each of those arrays simultaneously.
WeakSet() constructor - JavaScript
syntax new weakset([iterable]); parameters iterable if an iterable object is passed, all of its elements will be added to the new weakset.
WeakSet.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakset object, but is no longer part of ecmascript and its implementations.
WebAssembly.Table.prototype.length - JavaScript
the number of elements in the table.
Standard built-in objects - JavaScript
the iterable collections (map and set) contain elements which are easily iterated in the order of insertion.
Lexical grammar - JavaScript
the source text of ecmascript scripts gets scanned from left to right and is converted into a sequence of input elements which are tokens, control characters, line terminators, comments or white space.
delete operator - JavaScript
console.log(foo.bar); // undefined deleting array elements when you delete an array element, the array length is not affected.
this - JavaScript
// when called as a listener, turns the related element blue function bluify(e) { // always true console.log(this === e.currenttarget); // true when currenttarget and target are the same object console.log(this === e.target); this.style.backgroundcolor = '#a5d9f3'; } // get a list of every element in the document var elements = document.getelementsbytagname('*'); // add bluify as a click listener so when the // element is clicked on, it turns blue for (var i = 0; i < elements.length; i++) { elements[i].addeventlistener('click', bluify, false); } in an inline event handler when the code is called from an inline on-event handler, its this is set to the dom element on which the listener is placed: <button onclick="...
Expressions and operators - JavaScript
...obj spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.
for...in - JavaScript
because the order of iteration is implementation-dependent, iterating over an array may not visit elements in a consistent order.
Trailing commas - JavaScript
trailing commas (sometimes called "final commas") can be useful when adding new elements, parameters, or properties to javascript code.
JavaScript typed arrays - JavaScript
a view provides a context — that is, a data type, starting offset, and the number of elements — that turns the data into a typed array.
Values - MathML
lengths several mathml presentation elements have attributes that accept length values used for size or spacing.
<maction> - MathML
to specify which child elements are addressed by the action, you can make use of the selection attribute.
<math> - MathML
WebMathMLElementmath
in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
<menclose> - MathML
notation a list of notations, separated by white space, to apply to the child elements.
<mglyph> - MathML
WebMathMLElementmglyph
it may be used within token elements.
<mrow> - MathML
WebMathMLElementmrow
when writing a mathml expression, you should group elements within an <mrow> in the same way as they are grouped in the mathematical interpretation of the expression.
<ms> - MathML
WebMathMLElementms
the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements.
MathML
mathml attribute reference information about mathml attributes that modify the appearance or behavior of elements.
Media container formats (file types) - Web media technologies
then add child <source> elements within the <video> element, one for each version of the video you offer.
CSS and JavaScript animation performance - Web Performance
running the performance test initially in the test seen below, a total of 1000 <div> elements are transformed by css animation.
Using dns-prefetch - Web Performance
the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples <html> <head> <link rel="dns-prefetch" href="https://fonts.gstatic.com/"> <!-- and all other head elements --> </head> <body> <!-- your page content --> </body> </html> you should place dns-prefetch hints in the <head> element any time your site references resources on cross-origin domains, but there are some things to keep in mind.
Web Performance
intersection observer api learn to time element visibility with the intersection observer api and be asynchronously notified when elements of interest becomes visible.
Add to Home screen - Progressive web apps (PWAs)
to make it feel like a distinct app (and not just a web page), you should choose a value such as fullscreen (no ui is shown at all) or standalone (very similar, but system-level ui elements such as the status bar might be visible).
Web API reference - Web technology reference
WebReferenceAPI
html, xml and svg have extended it to manipulate their specific elements.
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered.
SVG Core Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeCore
value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in.
accumulate - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value none | sum default value none animatable no sum specifies that each repeat iteration after the first builds upon the last value of the previous iteration.
additive - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value replace | sum default value replace animatable no sum specifies that the animation will add to the underlying value of the attribute and other lower priority animations.
amplitude - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'amplitude' in that specification.
attributeName - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated.
attributeType - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable.
baseline-shift - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts.
by - SVG: Scalable Vector Graphics
WebSVGAttributeby
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributename="width" fill="freeze" by="50" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be...
calcMode - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value discrete | linear | paced | spline default value linear animatable no discrete this specifies that the animation function will jump from one value to the next without any interpolation.
clip - SVG: Scalable Vector Graphics
WebSVGAttributeclip
as a presentation attribute, it can be applied to any element but it has effect only on the following six elements: <svg>, <symbol>, <image>, <foreignobject>, <pattern>, <marker> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" cli...
color-interpolation-filters - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has an effect on the following eighteen elements: <fespotlight>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> usage notes value auto | srgb | linearrgb default value linearrgb animatable ...
color-interpolation - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradient>, <marker>, <mask>, <missing-glyph>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, and <use> usage notes value auto | srgb | linearrgb default value srgb ...
color-rendering - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradient>, <marker>, <mask>, <missing-glyph>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.o...
contentStyleType - SVG: Scalable Vector Graphics
this language is used for all instances of style that do not specify their own styling language, such as the style attribute that is available on many elements.
cursor - SVG: Scalable Vector Graphics
WebSVGAttributecursor
elements the following elements can use the cursor attribute container elements » graphics elements » browser compatibility the compatibility table on this page is generated from structured data.
cx - SVG: Scalable Vector Graphics
WebSVGAttributecx
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <radialgradient cx="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="45"/> <ellipse cx="150" cy="50" rx="45" ry="25" /> <rect x="205" y="5" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cx defines the x-axis coordinate of the center of the shape.
cy - SVG: Scalable Vector Graphics
WebSVGAttributecy
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <radialgradient cy="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cy="50" cx="50" r="45"/> <ellipse cy="150" cx="50" rx="45" ry="25" /> <rect x="5" y="205" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cy defines the y-axis coordinate of the center of the shape.
d - SVG: Scalable Vector Graphics
WebSVGAttributed
three elements have this attribute: <path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg> path for <path>, d is a string containing a series of path commands that define the path to be drawn.
dx - SVG: Scalable Vector Graphics
WebSVGAttributedx
seven elements are using this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="0" x2="100%" y1="50%" y2="50%" /> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="60%" x2="60%" y1="0" y2="100%" /> <!-- some reference text --> <text x="10%" y="50%" fill="grey">svg</text> <!-- the same text with a shift along the x-axis --> <text dx="50%" x="10%" y="50%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: as of sv...
dy - SVG: Scalable Vector Graphics
WebSVGAttributedy
seven elements utilize this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="0" x2="100%" y1="30%" y2="30%" /> <line x1="0" x2="100%" y1="80%" y2="80%" /> <!-- some reference text --> <text x="10%" y="30%" fill="grey">svg</text> <!-- the same text with a shift along the y-axis --> <text dy="50%" x="10%" y="30%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: as of ...
edgeMode - SVG: Scalable Vector Graphics
two elements are using this attribute: <feconvolvematrix> and <fegaussianblur> feconvolvematrix for <feconvolvematrix>, edgemode determines how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image.
exponent - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="1"/> <fefuncg type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfer> <...
fill-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 400 100" xmlns="http://www.w3.org/2000/svg"> <!-- default fill opacity: 1 --> <circle cx="50" cy="50" r="40" /> <!-- fill opacity as a number --> <circle cx="150" cy="50" r="40" fill-opacity="0.7" /> <!-- fill opacity as a percentage --> <circle cx="250" cy="50" r="40" ...
fill-rule - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polygon>, <polyline>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- default value for fill-rule --> <polygon fill-rule="nonzero" stroke="red" points="50,0 21,90 98,35 2,35 79,90"/> <!-- the center of the shape has two path segments (shown by the red stroke) between it and infinity.
filter - SVG: Scalable Vector Graphics
WebSVGAttributefilter
as a presentation attribute, it can be applied to any element but it only has effect on container elements without the <defs> element, all graphics elements and the <use> element.
flood-color - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="skyblue" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); tra...
flood-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="seagreen" flood-opacity="1" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" flood-opacity="0.3" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="20...
font-family - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="arial, helvetica, sans-serif">sans serif</text> <text x="100" y="20" font-family="monospace">monospace</text> </svg> usage notes value [ <family-name> | <generic-family> ]#where <family-name> = <s...
font-size-adjust - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="600" height="80" viewbox="0 0 500 80" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="times, serif" font-size="10px"> this text uses the times font (10px), which is hard to read in small sizes.
font-size - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-size="smaller">smaller</text> <text x="100" y="20" font-size="2em">2em</text> </svg> usage notes value <absolute-size> | <relative-size> | <length-percentage> default value medium anima...
font-stretch - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes value <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status comment css...
font-style - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but only has an effect on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-style="normal">normal font style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the val...
font-variant - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-...
font-weight - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animata...
format - SVG: Scalable Vector Graphics
WebSVGAttributeformat
two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the format of the given font.
from - SVG: Scalable Vector Graphics
WebSVGAttributefrom
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no...
g1 - SVG: Scalable Vector Graphics
WebSVGAttributeg1
two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair.
g2 - SVG: Scalable Vector Graphics
WebSVGAttributeg2
two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair.
glyph-name - SVG: Scalable Vector Graphics
the glyph names can be referenced in kerning definitions created by <hkern> and <vkern> elements.
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value <angle> default value 0deg animatable no <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees.
glyph-orientation-vertical - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees.
glyphRef - SVG: Scalable Vector Graphics
two elements are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier.
gradientTransform - SVG: Scalable Vector Graphics
two elements are using this attribute: <lineargradient> and <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient id="gradient1" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%...
id - SVG: Scalable Vector Graphics
WebSVGAttributeid
all elements are using this attribute.
in2 - SVG: Scalable Vector Graphics
WebSVGAttributein2
three elements use this attribute: <feblend>, <fecomposite> and <fedisplacementmap>.
intercept - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0"/> <fefuncg type="linear" intercept="0...
k - SVG: Scalable Vector Graphics
WebSVGAttributek
two elements are using this attribute: <hkern> and <vkern> context notes value <number> default value none animatable no <number> this value indicates the amount for decreasing the spacing between the two glyphs in the kerning pair.
kernelUnitLength - SVG: Scalable Vector Graphics
three elements are using this attribute: <feconvolvematrix>, <fediffuselighting>, and <fespecularlighting> feconvolvematrix for the <feconvolvematrix>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of primitiveunits attribute) between successive columns and rows, respectively, in the kernelmatrix.
kerning - SVG: Scalable Vector Graphics
WebSVGAttributekerning
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> html, body, svg { height: 100%; font: 36px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 150 125" xmlns="http://www.w3.org/2000/svg"> <text x="10" y="30" kerning="auto">auto</text> <text x="10" y="70" kerning="0">number</text> <text x="10" y="110" kerning="20px">length</text> </svg> usage notes value ...
keyPoints - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="motionpath"/> <circle cx="10" cy="110" r="3" fill="lightgrey"/> <circle cx="110" cy="10" r="3" fill="lightgrey"/> <circle r="5" fill="red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <mpath xlink:href="#motionpath"/> </animatemotion> </circle> </sv...
keySplines - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" calcmode="spline" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" keysplines="...
keyTimes - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attribute...
lengthAdjust - SVG: Scalable Vector Graphics
four elements are using this attribute: <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="300" height="150" xmlns="http://www.w3.org/2000/svg"> <g font-face="sans-serif"> <text x="0" y="20" textlength="300" lengthadjust="spacing"> stretched using spacing only.
letter-spacing - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 400 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" letter-spacing="2">bigger letter-spacing</text> <text x="200" y="20" letter-spacing="-0.5">smaller letter-spacing</text> </svg> usage notes value normal | <length> default value normal ani...
lighting-color - SVG: Scalable Vector Graphics
two elements are using this attribute: <fediffuselighting> and <fespecularlighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="white"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="blue"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1...
marker-mid - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="circle" markerwidth="8" markerheight="8" refx="4" refy="4"> <circle cx="4" cy="4" r="4" stroke="none" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" point...
max - SVG: Scalable Vector Graphics
WebSVGAttributemax
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" max="6s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" max="6s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value none animatable no <clock-value> specifies the...
min - SVG: Scalable Vector Graphics
WebSVGAttributemin
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" min="2s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" min="2s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value 0 animatable no <clock-value> specifies the le...
name - SVG: Scalable Vector Graphics
WebSVGAttributename
two elements are using this attribute: <color-profile> and <font-face-name> color-profile for <color-profile>, name defines the name of the color profile.
onclick - SVG: Scalable Vector Graphics
WebSVGAttributeonclick
thirty-seven elements are using this attribute: <a>, <altglyph>, <animate>, <animatemotion>, <animatetransform>, <circle>, <defs>, <desc>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <lineargradient>, <marker>, <metadata>, <mpath>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <script>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <view> html, body, svg { height: 100%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none ...
opacity - SVG: Scalable Vector Graphics
WebSVGAttributeopacity
as a presentation attribute, it can be applied to any element but it has effect only on the following elements: <a>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <marker>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use>, <unknown>, and <video> html, body, svg { height: 100%; } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" x1="0%" y1="0%" x2="0" y2="1...
operator - SVG: Scalable Vector Graphics
two elements are using this attribute: <fecomposite> and <femorphology> html, body, svg { height: 100%; font: 20px arial, helvetica, sans-serif; } <svg viewbox="0 0 120 70" xmlns="http://www.w3.org/2000/svg"> <filter id="erode"> <femorphology operator="erode" radius="0.4"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="0.8"/> </filter> <text x="0" y="15">normal text</text> <text x="0" y="40" filter="url(#erode)">thin text</text> <text x="0" y="65" filter="url(#dilate)">fat text</text> </svg> fecomposite for <fecomposite>, operator defines the compositing operation that is to be performed.
overline-position - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the overline-position attribute: <font-face> ...
overline-thickness - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the overline-thickness attribute: <font-face> ...
paint-order - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, and <tspan> usage notes value normal | [ fill || stroke || markers ] default value normal animatable yes normal this value indicates that the fill will be painted first, then the stroke, and finally the markers.
path - SVG: Scalable Vector Graphics
WebSVGAttributepath
two elements are using this attribute: <animatemotion> and <textpath> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path id="mypath" fill="none" stroke="silver" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <text> <textpath path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog.
pathLength - SVG: Scalable Vector Graphics
seven elements are using this attribute: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style> path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- no pathlength, the real length of the path is used.
pointer-events - SVG: Scalable Vector Graphics
#ffffff const color = math.round(math.random() * 0xffffff) // let's format the color to fit css requirements const fill = '#' + color.tostring(16).padstart(6,'0') // let's apply our color in the // element we actually clicked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use> usage notes value bounding-box | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | none default value visiblepainted ...
points - SVG: Scalable Vector Graphics
WebSVGAttributepoints
two elements are using this attribute: <polyline>, and <polygon> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> <!-- polygon is a closed shape --> <polygon stroke="black" fill="none" transform="translate(100,0)" points="50,0 21,90 98,35 2,35 79,90"/> <!-- it is usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by a spa...
preserveAspectRatio - SVG: Scalable Vector Graphics
elements seven elements are using this attribute: <svg>, <symbol>, <image>, <feimage>, <marker>, <pattern>, and <view>.
r - SVG: Scalable Vector Graphics
WebSVGAttributer
two elements are using this attribute: <circle>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient r="0" id="mygradient000"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="50%" id="mygradient050"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="100%" id="mygradient100"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="0"/> <circle cx="150" cy="50" r="25"/> <circle cx="250" cy="50" r="50"/> <rect ...
refX - SVG: Scalable Vector Graphics
WebSVGAttributerefX
two elements are using this attribute: <marker> and <symbol> marker for <marker>, refx defines the x coordinate of the marker’s reference point, which is to be placed exactly at the marker’s position on the shape.
refY - SVG: Scalable Vector Graphics
WebSVGAttributerefY
two elements are using this attribute: <marker> and <symbol> marker for <marker>, refy defines the y coordinate of the marker’s reference point, which is to be placed exactly at the marker’s position on the shape.
repeatCount - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> </svg> usage notes value <number> | indefinite default value none animatable no <number> this value specifies the number o...
repeatDur - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indefinite"/> </rect> </svg> usage notes value <clock-value> | indefinite default values none animatable no <clock-value> this value specifies the dur...
restart - SVG: Scalable Vector Graphics
WebSVGAttributerestart
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.getele...
result - SVG: Scalable Vector Graphics
WebSVGAttributeresult
seventeen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, and <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/s...
rx - SVG: Scalable Vector Graphics
WebSVGAttributerx
two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" rx="0" ry="25" /> <ellipse cx="150" cy="50" rx="25" ry="25" /> <ellipse cx="250" cy="50" rx="50" ry="25" /> <rect x="20" y="120" width="60" height="60" rx="0" ry="15"/> <rect x="120" y="120" width="60" height="60" rx="15" ry="15"/> <rect x="220" y="120" width="60" height="60" rx="150" ry="15"/> </svg> ellipse for <ellipse>, rx defines the x-radius of the shape.
ry - SVG: Scalable Vector Graphics
WebSVGAttributery
two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" ry="0" rx="25" /> <ellipse cx="150" cy="50" ry="25" rx="25" /> <ellipse cx="250" cy="50" ry="50" rx="25" /> <rect x="20" y="120" width="60" height="60" ry="0" rx="15"/> <rect x="120" y="120" width="60" height="60" ry="15" rx="15"/> <rect x="220" y="120" width="60" height="60" ry="150" rx="15"/> </svg> ellipse for <ellipse>, ry defines the y-radius of the shape.
shape-rendering - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" shape-rendering="geometricprecision"/> <circle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | optimizespeed | crispedges | geometricprecision default value auto ani...
specularExponent - SVG: Scalable Vector Graphics
two elements are using this attribute: <fespecularlighting> and <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="1"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="5"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#dif...
spreadMethod - SVG: Scalable Vector Graphics
two elements are using this attribute: <lineargradient> and <radialgradient> context notes value pad | reflect | repeat initial value pad animatable yes pad this value indicates that the final color of the gradient fills the shape beyond the gradient's edges.
strikethrough-position - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the strikethrough-position attribute: <font-face> ...
strikethrough-thickness - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the strikethrough-thickness attribute: <font-face> ...
stroke-dasharray - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element, but it only has effect on the following twelve elements: <altglyph> <circle> <ellipse> <path> <line> <polygon> <polyline> <rect> <text> <textpath> <tref> <tspan> html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dashes nor gaps --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- dashes and gaps of the same size --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="4" /> <!-- dashes and gaps of ...
stroke-dashoffset - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-3 0 33 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dash array --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- no dash offset --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="3 1" /> <!-- the start of the dash array computation is pulled by ...
stroke-linecap - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polyline>, <line>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the (default) "butt" value --> <line x1="1" y1="1" x2="5" y2="1" stroke="black" stroke-linecap="butt" /> <!-- effect of the "round" value --> <line x1="1" y1="3" x2="5" y2="3" stroke="black" stroke-linecap="round" /> <!-- effect of the "square" valu...
stroke-linejoin - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 18 12" xmlns="http://www.w3.org/2000/svg"> <!-- upper left path: effect of the "miter" value --> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="miter" /> <!-- center path: effect of the "round" value --> <path d="m7,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5"...
stroke-miterlimit - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 38 30" xmlns="http://www.w3.org/2000/svg"> <!-- impact of the default miter limit --> <path stroke="black" fill="none" stroke-linejoin="miter" id="p1" d="m1,9 l7 ,-3 l7 ,3 m2,0 l3.5 ,-3 l3.5 ,3 m2,0 l2 ,-3 l2 ,3 ...
stroke-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 40 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke opacity: 1 --> <circle cx="5" cy="5" r="4" stroke="green" /> <!-- stroke opacity as a number --> <circle cx="15" cy="5" r="4" stroke="green" stroke-opacity="0.7" /> <!-- stroke opacity...
stroke-width - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke width: 1 --> <circle cx="5" cy="5" r="3" stroke="green" /> <!-- stroke width as a number --> <circle cx="15" cy="5" r="3" stroke="green" stroke-width="3" /> <!-- stroke width as a percentage --> <circle cx="25" cy="5" r="3" stroke="green" stroke-width="2%" /> </svg> usage notes ...
stroke - SVG: Scalable Vector Graphics
WebSVGAttributestroke
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- simple color stroke --> <circle cx="5" cy="5" r="4" fill="none" stroke="green" /> <!-- stroke a circle with a gradient --> <defs> <lineargradient id="mygradient"> <stop offset="0%" stop-color="green"...
style - SVG: Scalable Vector Graphics
WebSVGAttributestyle
all elements are using this attribute.
surfaceScale - SVG: Scalable Vector Graphics
two elements are using this attribute: <fediffuselighting> and <fespecularlighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="15"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect ...
systemLanguage - SVG: Scalable Vector Graphics
35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47.
tabindex - SVG: Scalable Vector Graphics
all elements are using this attribute.
tableValues - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues="0 1"...
text-anchor - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,15 l60,110 m30,40 l90,40 m30,75 l90,75 m30,110 l90,110" stroke="grey" /> <!-- anchors in action --> <text text-anchor="start" x="60" y="40">a</text> <text text-anchor="middle" x="60"...
text-decoration - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" text-decoration="underline">underlined text</text> <text x="0" y="40" text-decoration="line-through">struck-through text</text> </svg> usage notes value <'text-decoration-line'> || <'text-decoration-style'> ||...
to - SVG: Scalable Vector Graphics
WebSVGAttributeto
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, to specifies the ending value of the animation.
transform - SVG: Scalable Vector Graphics
as a presentation attribute, transform can be used by any element (in svg 1.1, only these 16 elements were allowed to use it: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <switch>, <text>, and <use>).
underline-position - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the underline-position attribute: <font-face> ...
underline-thickness - SVG: Scalable Vector Graphics
usage context categories none value <number> animatable no normative document svg 1.1 (2nd edition) elements the following elements can use the underline-thickness attribute: <font-face> ...
unicode-bidi - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property.
values - SVG: Scalable Vector Graphics
WebSVGAttributevalues
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <fecolormatrix> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, values is a list of values defining the sequence of values over the course of the animation.
vector-effect - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <foreignobject>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath> <tspan>, and <use> usage notes value none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position default value none animatable yes none this value specifies that no vector effect shall be applied, i.e.
viewBox - SVG: Scalable Vector Graphics
WebSVGAttributeviewBox
five elements are using this attribute: <marker>, <pattern>, <svg>, <symbol>, and <view>.
word-spacing - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" word-spacing="2">bigger spacing between words</text> <text x="0" y="40" word-spacing="-0.5">smaller spacing between words</text> </svg> usage notes value normal | <length> animatable yes d...
xlink:arcrole - SVG: Scalable Vector Graphics
for example, a resource might generically represent a "person," but in the context of a particular arc it might have the role of "mother" and in the context of a different arc it might have the role of "daughter." twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value <iri> default value none animatable no <ir...
xlink:title - SVG: Scalable Vector Graphics
these elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage context value <anything> default value none animatable no ...
xlink:type - SVG: Scalable Vector Graphics
twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link.
xml:base - SVG: Scalable Vector Graphics
all elements are using this attribute.
z - SVG: Scalable Vector Graphics
WebSVGAttributez
two elements are using this attribute: <fepointlight> and <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="10" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <...
zoomAndPan - SVG: Scalable Vector Graphics
two elements are using this attribute: <svg> and <view> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" zoomandpan="disable"> <filter id="diffuselighting" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" zoomandpan="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style...
Compatibility sources - SVG: Scalable Vector Graphics
the following sources are used for the compatibility tables on svg elements and attributes: https://developer.mozilla.org/en/svg_in_firefox together with its revision history for firefox http://www.webkit.org/projects/svg/status.xml together with its recorded archive for webkit, safari and chrome http://www.opera.com/docs/specs/opera9/svg/ and accompanying pages for opera >= 9, http://www.opera.com/docs/specs/opera8/ for opera 8 http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx for hints on ie9 support status the svg support charts at codedread.com for basic checks against the w3c test suite wikipedia for basic hints, not normative ...
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
usage context categoriestext content element, text content child elementpermitted contentany elements or character data attributes x this attribute defines the corresponding absolute x-coordinates for rendering the element.
<altGlyphDef> - SVG: Scalable Vector Graphics
usage context categoriestext content elementpermitted contenteither: one or more <glyphref> elements, or one or more <altglyphitem> elements attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphdefelement interface.
<altGlyphItem> - SVG: Scalable Vector Graphics
usage context categoriestext content elementpermitted contentone or more <glyphref> elements example attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphitemelement interface.
<animateColor> - SVG: Scalable Vector Graphics
usage context categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes animation event attributes xlink attributes animation attribute target attributes animation timing attributes animation value attributes animation addition attributes externalresourcesrequired specific attributes by from to dom interface this element implements ...
<animateMotion> - SVG: Scalable Vector Graphics
mlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="lightgrey" d="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> <circle r="5" fill="red"> <animatemotion dur="10s" repeatcount="indefinite" path="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> </circle> </svg> usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<mpath> attributes keypoints this attribute indicate, in the range [0,1], how far is the object along the path for each keytimes associated values.
<animateTransform> - SVG: Scalable Vector Graphics
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <polygon points="60,30 90,90 30,90"> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0 60 70" to="360 60 70" dur="10s" repeatcount="indefinite"/> </polygon> </svg> live sample attribut...
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<circle>' in that specification.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
stemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<text>, <use> specifications specification status comment css masking module level 1the definition of '<clippath>' in that specification.
<color-profile> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » specific attributes local name rendering-intent xlink:href dom interface this element implements the svgcolorprofileelement interface.
<cursor> - SVG: Scalable Vector Graphics
WebSVGElementcursor
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes xlink attributes externalresourcesrequired specific attributes x y xlink:href dom interface this element implements the svgcursorelement interface.
<defs> - SVG: Scalable Vector Graphics
WebSVGElementdefs
lation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2th...
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<ellipse>' in that specification.
<feBlend> - SVG: Scalable Vector Graphics
WebSVGElementfeBlend
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 mode dom interface this element implements the svgfeblendelement interface.
<feColorMatrix> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in type values dom interface this element implements the svgfecolormatrixelement interface.
<feComposite> - SVG: Scalable Vector Graphics
, each result pixel is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 where: i1 and i2 indicate the corresponding pixel channel values of the input image, which map to in and in2 respectively k1, k2, k3 and k4 indicate the values of the attributes with the same name usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes » presentation attributes » filter primitive attributes » class style specific attributes in in2 operator k1 k2 k3 k4 dom interface this element implements the svgfecompositeelement interface.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
here the input image's pixel grid aligns perfectly with the kernel's pixel grid) and assuming default values for attributes ‘divisor’, ‘targetx’ and ‘targety’, then resulting color value will be: (9* 0 + 8* 20 + 7* 40 + 6*100 + 5*120 + 4*140 + 3*200 + 2*220 + 1*240) / (9+8+7+6+5+4+3+2+1) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in order kernelmatrix divisor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface.
<feDiffuseLighting> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of descriptive elements and exactly one light source element, in any order.
<feDisplacementMap> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 scale xchannelselector ychannelselector dom interface this element implements the svgfedisplacementmapelement interface.
<feDistantLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes azimuth elevation dom interface this element implements the svgfedistantlightelement interface.
<feDropShadow> - SVG: Scalable Vector Graphics
value type: <number>; default value: 2; animatable: yes global attributes core attributes most notably: id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the definition of '<fedropshadow>' in that specification.
<feFlood> - SVG: Scalable Vector Graphics
WebSVGElementfeFlood
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes flood-color flood-opacity dom interface this element implements the svgfefloodelement interface.
<feFuncA> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncA
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncaelement interface.
<feFuncB> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncB
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncbelement interface.
<feFuncG> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncG
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncgelement interface.
<feFuncR> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncR
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncrelement interface.
<feGaussianBlur> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stddeviation edgemode dom interface this element implements the svgfegaussianblurelement interface.
<feImage> - SVG: Scalable Vector Graphics
WebSVGElementfeImage
the <feimage> svg filter primitive fetches image data from an external source and provides the pixel data as output (meaning if the external source is an svg image, it is rasterized.) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatetransform>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes xlink attributes class style externalresourcesrequired specific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface.
<feMerge> - SVG: Scalable Vector Graphics
WebSVGElementfeMerge
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<femergenode> example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur stddeviation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000;...
<feMergeNode> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> example <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur in="sourcegraphic" stddeviation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> <rect...
<feMorphology> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in operator radius dom interface this element implements the svgfemorphologyelement interface.
<feOffset> - SVG: Scalable Vector Graphics
WebSVGElementfeOffset
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface.
<fePointLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z dom interface this element implements the svgfepointlightelement interface.
<feSpecularLighting> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentexactly one light source element first and any number of descriptive elements in any order.
<feSpotLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z pointsatx pointsaty pointsatz specularexponent limitingconeangle dom interface this element implements the svgfespotlightelement interface.
<feTile> - SVG: Scalable Vector Graphics
WebSVGElementfeTile
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface.
<feTurbulence> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes basefrequency numoctaves seed stitchtiles type dom interface this element implements the svgfeturbulenceelement interface.
<font-face-src> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentone or more of the following elements, in any order:<font-face-name>, <font-face-uri> attributes global attributes core attributes specific attributes none dom interface this element implements the svgfontfacesrcelement interface.
<font-face-uri> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentany number of the following elements, in any order:<font-face-format> attributes global attributes core attributes xlink attributes specific attributes xlink:href dom interface this element implements the svgfontfaceurielement interface.
<font-face> - SVG: Scalable Vector Graphics
WebSVGElementfont-face
usage context categoriesfont elementpermitted contentany number of descriptive elements » and at most one <font-face> element, in any order.
<font> - SVG: Scalable Vector Graphics
WebSVGElementfont
usage context categoriesfont elementpermitted contentany number of the following elements, in any order:descriptive elements<font-face>, <glyph>, <hkern>, <missing-glyph>, <vkern> attributes global attributes core attributes presentation attributes class style externalresourcesrequired specific attributes horiz-origin-x horiz-origin-y horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgfontelement interface.
<glyph> - SVG: Scalable Vector Graphics
WebSVGElementglyph
usage context categoriestext content elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface.
<hatchpath> - SVG: Scalable Vector Graphics
WebSVGElementhatchpath
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface.
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<line>' in that specification.
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
ia-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 categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment svg markersthe definition of '<mar...
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the defi...
<missing-glyph> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface.
<mpath> - SVG: Scalable Vector Graphics
WebSVGElementmpath
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgmpathelement interface.
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
able, 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 categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsthe definition of '<path>' in that specification.
<polygon> - SVG: Scalable Vector Graphics
WebSVGElementpolygon
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polygon>' in that specification.
<polyline> - SVG: Scalable Vector Graphics
WebSVGElementpolyline
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polyline>' in that specification.
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
n, 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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<rect>' in that specification.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
value type: <url> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<script>' in that specification.
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
t, repeatdur, fill other animation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements specifications specification status comment svg animations level 2the definition of '<set>' in that specification.
<stop> - SVG: Scalable Vector Graphics
WebSVGElementstop
type: <opacity>; default value: 1; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status comment scalable vector graphics (svg) 2the definition of '<stop>' in that specification.
<style> - SVG: Scalable Vector Graphics
WebSVGElementstyle
value type: <string>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<style>' in that specification.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
ia-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 categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment scalable vector graphics (svg) 2the definition of '<text>' in that specification.
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
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 attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<textpath>' in that specification.
<tref> - SVG: Scalable Vector Graphics
WebSVGElementtref
usage context categoriestext content element, text content child elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatecolor>, <set> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgtrefelement interface.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
ria-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 categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<tspan>' in that specification.
<view> - SVG: Scalable Vector Graphics
WebSVGElementview
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes aria attributes » core attributes » global event attributes » externalresourcesrequired specific attributes viewbox preserveaspectratio zoomandpan viewtarget example svg <svg width="600" height="200" viewbox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="gradient"> <stop offset="0%" stop-color="#8cffa0" /> <stop offset="100%" stop-color="#8ca0ff" /> </radialgradient> </defs> <circle r="50" cx="180" cy="50" style="fill:url(#gradient)"/> <view ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
element implementation status a quick overview of the svg 1.1 elements and the current status of the native support.
SVG animation with SMIL - SVG: Scalable Vector Graphics
if you want to animate more attributes inside the same element, just add more <animate> elements.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
the best way to get access to the document representing an svg document is to look at htmliframeelement.contentdocument (if the document is presented in an <iframe>) or htmlobjectelement.contentdocument (if the document is presented in an <object> element), like this: var svgdoc = document.getelementbyid("iframe_element").contentdocument; in addition, the <iframe>, <embed>, and <object> elements offer a method, getsvgdocument(), which returns the xmldocument representing the element's embedded svg or null if the element doesn't represent an svg document.
Basic shapes - SVG: Scalable Vector Graphics
different elements correspond to different shapes and take different parameters to describe the size and position of those shapes.
Filter effects - SVG: Scalable Vector Graphics
e in="specout" in2="sourcealpha" operator="in" result="specout"/> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> <!-- merge offsetblur + litpaint --> <femerge> <femergenode in="offsetblur"/> <femergenode in="litpaint"/> </femerge> </filter> </defs> <!-- graphic elements --> <g filter="url(#myfilter)"> <path fill="none" stroke="#d90000" stroke-width="10" d="m50,66 c-50,0 -50,-60 0,-60 h100 c50,0 50,60 0,60z" /> <path fill="#d90000" d="m60,56 c-30,0 -30,-40 0,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg...
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
Tools for SVG - SVG: Scalable Vector Graphics
to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
fix for os file associations your os may be associating the wrong media type with the .svg filename extension if you have installed an old program such as photoshop elements 1.0 and chose to install the *very* old adobe svg viewer that comes bundled with it.
Types of attacks - Web security
a csrf token should be included in <form> elements via a hidden input field.
Tutorials
mdn html element reference a comprehensive reference for html elements, and how the different browsers support them.
attribute - XPath
WebXPathAxesattribute
only elements have attributes.
Comparison of CSS Selectors and XPath - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes this article seeks to document the difference between css selectors and xpath for web developers to be able to better choose the right tool for the right job.
boolean - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the boolean function evaluates an expression and returns true or false.
ceiling - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the ceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number.
choose - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the choose function returns one of the specified objects based on a boolean parameter.
concat - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the concat function concatenates two or more strings and returns the resulting string.
contains - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the contains function determines whether the first argument string contains the second argument string and returns boolean true or false.
count - XPath
WebXPathFunctionscount
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the count function counts the number of nodes in a node-set and returns an integer.
current - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the current function can be used to get the context node in an xslt instruction.
document - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the document finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.
element-available - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the element-available function determines if an element is available and returns true or false.
false - XPath
WebXPathFunctionsfalse
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the false function returns boolean false.
floor - XPath
WebXPathFunctionsfloor
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the floor function evaluates a decimal number and returns the largest integer less than or equal to the decimal number.
format-number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the format-number function evaluates a number and returns a string representing the number in a given format.
function-available - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the function-available function determines if a given function is available and returns boolean true or false.
generate-id - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.
id - XPath
WebXPathFunctionsid
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the id function finds nodes matching the given ids and returns a node-set containing the identified nodes.
lang - XPath
WebXPathFunctionslang
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the lang function determines whether the context node matches the given language and returns boolean true or false.
last - XPath
WebXPathFunctionslast
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the last function returns a number equal to the context size from the expression evaluation context.
local-name - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the local-name function returns a string representing the local name of the first node in a given node-set.
name - XPath
WebXPathFunctionsname
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the name function returns a string representing the qname of the first node in a given node-set.
namespace-uri - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the namespace-uri function returns a string representing the namespace uri of the first node in a given node-set.
normalize-space - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the normalize-space function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.
not - XPath
WebXPathFunctionsnot
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the not function evaluates a boolean expression and returns the opposite value.
number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the number function converts an object to a number and returns the number.
position - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the position function returns a number equal to the context position from the expression evaluation context.
round - XPath
WebXPathFunctionsround
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the round function returns a number that is the nearest integer to the given number.
starts-with - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the starts-with checks whether the first string starts with the second string and returns true or false.
string-length - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string-length function returns a number equal to the number of characters in a given string.
string - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string function converts the given argument to a string.
substring-after - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-after function returns a string that is the rest of a given string after a given substring.
substring-before - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-before function returns a string that is the part of a given string before a given substring.
substring - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring function returns a part of a given string.
sum - XPath
WebXPathFunctionssum
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the sum function returns a number that is the sum of the numeric values of each node in a given node-set.
system-property - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the system-property function returns an object representing the given system-property.
translate - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the translate function evaluates a string and a set of characters to translate and returns the translated string.
true - XPath
WebXPathFunctionstrue
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the true function returns a boolean value of true.
unparsed-entity-url - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the unparsed-entity-url() function returns the uri of the unparsed entity with the given name.
Functions - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the following is an annotated list of core xpath functions and xslt-specific additions to xpath, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support.
Index - XPath
WebXPathIndex
only elements have attributes.
XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes xpath stands for xml path language.
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-imports> element is fairly arcane, used mostly in complex stylesheets.
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-templates> element selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in css.
<xsl:call-template> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:call-template> element invokes a named template.
<xsl:comment> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcomment
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:comment> element writes a comment to the output document.
<xsl:copy-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy-of
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:copy-of> element makes a deep copy (including descendant nodes) of whatever the select attribute specifies to the output document.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:copy> element transfers a shallow copy (the node and any associated namespace node) of the current node to the output document.
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function.
<xsl:fallback> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfallback
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:fallback> element specifies what template to use if a given extension (or, eventually, newer version) element is not supported.
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:if> element contains a test attribute and a template.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:import> element is a top-level element that serves to import the contents of one stylesheet into another stylesheet.
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementinclude
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:include> element merges the contents of one stylesheet with another.
<xsl:key> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementkey
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:key> element declares a named key which can be used elsewhere in the stylesheet with the key( ) function.
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementmessage
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:message> element outputs a message (to the javascript console in ns) and optionally terminates execution of the stylesheet.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:namespace-alias> element is a rarely used device that maps a namespace in the stylesheet to a different namespace in the output tree.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:number> element counts things sequentially.
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply.
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementparam
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:param> element establishes a parameter by name and, optionally, a default value for that parameter.
<xsl:processing-instruction> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:processing-instruction> element writes a processing instruction to the output document.
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementsort
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:sort> element defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:text> element writes literal text to the output tree.
<xsl:transform> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:transform> element is exactly equivalent to the <xsl:stylesheet> element.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:value-of> element evaluates an xpath expression, converts it to a string, and writes that string to the result tree.
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvariable
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value.
<xsl:when> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementwhen
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement.
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:with-param> element sets the value of a parameter to be passed into a template.
Introduction - XSLT: Extensible Stylesheet Language Transformations
for example, it permits the rearranging and sorting of elements; it also provides more fine-grained control of the resulting document's structure.
XSLT: Extensible Stylesheet Language Transformations
WebXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes extensible stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents.
Loading and running WebAssembly code - WebAssembly
your code might look something like this: webassembly.instantiatestreaming(fetch('mymodule.wasm'), importobject) .then(obj => { // call an exported function: obj.instance.exports.exported_func(); // or access the buffer contents of an exported memory: var i32 = new uint32array(obj.instance.exports.memory.buffer); // or access the elements of an exported table: var table = obj.instance.exports.table; console.log(table.get(0)()); }) note: for more information on how exporting from a webassembly module works, have a read of using the webassembly javascript api, and understanding webassembly text format.
Using the WebAssembly JavaScript API - WebAssembly
a table example let’s look at a simple table example — a webassembly module that creates and exports a table with two elements: element 0 returns 13 and element 1 returns 42.