Search completed in 1.24 seconds.
Shorthand properties - CSS: Cascading Style Sheets
Shorthand
properties are CSS
properties that let you set the values of multiple other CSS
properties simultaneously. Using a shorthand property, you can write more concise (and often more readable) style sheets, saving time and energy. The CSS specification defines shorthand
properties to group the definition of common
properties acting on the same theme. For instance, the CSS background property is a shorthand property that's able to define the values of background-color, background-image, background-repeat, and background-position. Similarly, the most common font-related
properties can be defined using the shorthand font, and the different margins around a box can be defined using the margin shorthand. Tricky edge cases Even if they are very convenient to use, there are a few edge cases to kee...
...using them: A value which is not specified is set to its initial value. That sounds anecdotal, but it really means that it overrides previously set values. Therefore: background-color: red; background: url(images/bg.gif) no-repeat left top; will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence. Only the individual
properties values can inherit. As missing values are replaced by their initial value, it is impossible to allow inheritance of individual
properties by omitting them. The keyword inherit can be applied to a property, but only as a whole, not as a keyword for one value or another. That means that the only way to make some specific value to be inherited is to use the longhand property with the keyword inherit...
...nherit. As missing values are replaced by their initial value, it is impossible to allow inheritance of individual
properties by omitting them. The keyword inherit can be applied to a property, but only as a whole, not as a keyword for one value or another. That means that the only way to make some specific value to be inherited is to use the longhand property with the keyword inherit. Shorthand
properties try not to force a specific order for the values of the
properties they replace. This works well when these
properties use values of different types, as the order has no importance, but this does not work as easily when several
properties can have identical values. ...
...And 12 more matches
Logical properties for floating and positioning - CSS: Cascading Style Sheets
This guide takes a look at how to use these. Mapped
properties and values The table below details the
properties and values discussed in this guide along with their physical mappings. They assume a horizontal writing-mode, with a left-to-right direction. ...
...They assume a horizontal writing-mode, with a left-to-right direction. ...
... Logical property Purpose inset-inline Sets both of the above inset values for the inline dimension simultaneously. inset-block Sets both of the above inset values for...
...And 9 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
An additional benefit is semantic identifiers. ...
...t a document. They are set using custom property notation (e.g., --main-color: black;) and are accessed using the var() function (e.g., color: var(--main-color);). Complex websites have very large amounts of CSS, often with a lot of repeated values. For example, the same color might be used in hundreds of different places, requiring global search and replace if that color needs to change. Custom
properties allow a value to be stored in one place, then referenced in multiple other places. An additional benefit is semantic identifiers. For example, --main-text-color is easier to understand than #00ff00, especially if this same color is also used in other contexts. Custom
properties are subject to the cascade and inherit their value from their parent. Basic usage Declaring a custom property is done...
...ustom property is done using a custom property name that begins with a double hyphen (--), and a property value that can be any valid CSS value. Like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } Note that the selector given to the ruleset defines the scope that the custom property can be used in. A common best practice is to define custom
properties on the :root pseudo-class, so that it can be applied globally across your HTML document: :root { --main-bg-color: brown; } However, this doesn't always have to be the case: you maybe have a good reason for limiting the scope of your custom
properties. Note: Custom property names are case sensitive -- --my-color will be treated as a separate custom property to --My-color. As mentioned earl...
...And 9 more matches
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
start and end as opposed to left and right/top and bottom. ...
...Therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. The Logical
Properties and Values specification defines mappings for these physical values to their logical, or flow relative, counterparts -- e.g. ...
...duces the specification, and explains flow relative
properties and values. Why do we need logical
properties? CSS traditionally has sized things according to the physical dimensions of the screen. Therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. The Logical
Properties and Values specification defines mappings for these physical values to their logical, or flow relative, counterparts -- e.g. start and end as opposed to left and right/top and bottom. An example of why these mappings might be needed is as follows. I have a Layout using CSS Grid, the grid container has a width applied and I am using the align-self and justify-self
properties to align the items. T...
...And 7 more matches
Object.defineProperties() - JavaScript
props An object whose keys represent the names of
properties to be defined or modified and whose values are objects describing those
properties. Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see Object.defineProperty() for more details). ...
... props An object whose keys represent the names of
properties to be defined or modified and whose values are objects describing those
properties. Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see Object.defineProperty() for more details). ...
...Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see Object.defineProperty() for more details). ...
...And 7 more matches
Private Properties - Archive of obsolete content
A private property is a property that is only accessible to member functions of instances of the same class. Unlike other languages, JavaScript does not have native support for private
properties. People have come up with several ways to emulate private
properties using existing language features. This article discusses two common techniques: one using prefixes, the other closures. Both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. A better alternative is to use WeakMap objects, which solve both these problems. ...
...g prefixes, the other closures. Both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. A better alternative is to use WeakMap objects, which solve both these problems. However, note that WeakMaps might not be supported by all implementations yet. Also shown here is how to generalize the idea of using WeakMaps, from associating one or more private
properties with an object, to associating one or more namespaces with each object. A namespace is simply an object on which one or more private
properties are defined. The SDK uses namespaces internally to implement private
properties. The final section explains how to work with the particular namespace implementation used by the SDK. It is possible to read this section on its own, but to fully appreciate ...
...SDK uses namespaces internally to implement private
properties. The final section explains how to work with the particular namespace implementation used by the SDK. It is possible to read this section on its own, but to fully appreciate how namespaces work, and the problem they set out to solve, it is recommended to read the entire article. Using Prefixes A common technique to implement private
properties is to prefix each private property name with an underscore. Consider the following example: function Point(x, y) { this._x = x; this._y = y; } The
properties _x and _y are intended to be private, and should only be accessed by member functions. To make a private property readable/writable from any function, it's common to define getter/setter functions for the property, respectively: ...
...And 6 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
There are three types of items you can add. Fields are used to hold a simple value.
Properties can also be used to hold a value but may have code execute when an attempt is made to retrieve or modify the value. ...
...There are three types of items you can add. Fields are used to hold a simple value.
Properties can also be used to hold a value but may have code execute when an attempt is made to retrieve or modify the value. ...
...There are three types of items you can add. Fields are used to hold a simple value.
Properties can also be used to hold a value but may have code execute when an attempt is made to retrieve or modify the value. Methods are functions which may be executed. ...
...And 5 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
This is mostly due to the fact that there are four longhand values each for margin, border, and padding side, plus all the shorthand values. Mappings for margins, borders, and padding The specification details mappings for each logical value to a physical counterpart. In the table below I have given these mapped values assuming that the writing-mode in use is horizontal-tb -- with a left to right direction. ...
... border-inline-style Sets border-style for both inline borders. border-inline-width Sets border-width for both inline borders. margin-block Sets all the block margins. margin-inline Sets all the inline margins. padding-block Sets the block padding. padding-inline Sets the inline padding. Margin examples The mapped margin
properties of margin-inline-start, margin-inline-end, margin-block-start, and margin-inline-end can be used instead of their physical counterparts. In the example below I have created two boxes and added different sized margins to each edge. I have added an extra container with a border in order to make the margin more obvious to see. One box uses physical
properties and the other logical
properties. Try ...
...here are new shorthands available, margin-inline and margin-block, which accept two values. The first value will apply to the start of that dimension, the second to the end. If you only use one value it is applied to both. In a horizontal writing mode this CSS would apply a 5px margin to the top of the box and a 10px margin to the bottom. ...
...And 5 more matches
CSS Logical Properties and Values - CSS: Cascading Style Sheets
The module also defines logical
properties and values for
properties previously defined in CSS 2.1. Logical
properties define direction-relative equivalents of their corresponding physical
properties. Block vs. inline Logical
properties and values use the abstract terms block and inline to describe the direction in which they flow. The physical meaning of these terms depends on the writing mode. ...
...The physical meaning of these terms depends on the writing mode. ...
...The physical meaning of these terms depends on the writing mode. Block dimension The dimension perpendicular to the flow of text within a line, i.e., the vertical dimension in horizontal writing modes, and the horizontal dimension in vertical writing modes. ...
...And 5 more matches
Enumerability and ownership of properties - JavaScript
Some sample code follows which demonstrates how to obtain the missing categories. ...
...Some sample code follows which demonstrates how to obtain the missing categories. ...
...Some sample code follows which demonstrates how to obtain the missing categories. ...
...And 4 more matches
-moz-context-properties - CSS: Cascading Style Sheets
The -moz-context-
properties property can be used within privileged contexts in Firefox to share the values of specified
properties of the element with a child SVG image. If you reference an SVG image in a webpage (such as with the <img> element or as a background image), the SVG image can coordinate with the embedding element (its context) to have the image adopt property values set on the embedding element. To do this the embedding element needs to list the
properties that are to be made available to the image by listing them as values of the -moz-context-
properties property, and the image needs to opt in to using those
properties by using values such as the context-fill value. ...
...s context) to have the image adopt property values set on the embedding element. To do this the embedding element needs to list the
properties that are to be made available to the image by listing them as values of the -moz-context-
properties property, and the image needs to opt in to using those
properties by using values such as the context-fill value. Syntax /* Keyword values */ -moz-context-
properties: fill; -moz-context-
properties: fill, stroke; /* Global values */ -moz-context-
properties: inherit; -moz-context-
properties: initial; -moz-context-
properties: unset; Values fill Expose the fill value set on the image to the embedded SVG. stroke Expose the stroke value set on the image to the embedded SVG. fill-opacity Expose the fill-opacity value set on the image to the embedded SVG. ...
...e applied to it, for example as a background-image, border-image, or list-style-image.InheritedyesComputed valueas specifiedAnimation typediscrete Formal syntax none | [ fill | fill-opacity | stroke | stroke-opacity ]# Examples Exposing fill and stroke to an SVG image In this example we have a simple SVG embedded using an <img> element. ...
...And 3 more matches
Animating CSS properties - Firefox Developer Tools
The Frame rate and Waterfall can give you insight into the work the browser's doing in a CSS animation, to help diagnose performance problems. With CSS animations you specify a number of keyframes, each of which uses CSS to define the appearance of the element at a particular stage of the animation. The browser creates the animation as a transition from each keyframe to the next. Compared with animating elements using JavaScript, CSS animations can be easier to create. ...
...as a transition from each keyframe to the next. Compared with animating elements using JavaScript, CSS animations can be easier to create. They can also give better performance, as they give the browser more control over when to render frames, and to drop frames if necessary. However, the performance cost of modifying a CSS property can vary from one property to another. Animating expensive CSS
properties can result in jank as the browser struggles to hit a smooth frame rate. The CSS rendering waterfall The process the browser uses to update the page when a CSS property has changed can be described as a waterfall consisting of the following steps: Recalculate Style: every time a CSS property for an element changes, the browser must recalculate computed styles. Layout: next, the browser use...
...alled "Composition". This sequence needs to fit into a single frame, since the screen isn't updated until it is complete. It's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. For a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. CSS property cost In the context of the rendering waterfall, some
properties are more expensive than others: Property type Cost Examples
Properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size
Properties that don't affect geometry or position, but are not rendered in their own layer, do n...
...And 2 more matches
Using the CSS properties and values API - Web APIs
Registering a custom property Registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is. There are two ways to register a property, in JavaScript or in CSS. Note: The JavaScript option has working implementations. The CSS option does not. ...
... tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is. There are two ways to register a property, in JavaScript or in CSS. Note: The JavaScript option has working implementations. The CSS option does not. ...
...terProperty The following will register a css custom
properties, --my-prop, using CSS.registerProperty, as a color, give it a default value, and have it not inherit its value: window.CSS.registerProperty({ name: '--my-prop', syntax: '<color>', inherits: false, initialValue: '#c0ffee', }); @property The same registration can take place in CSS. ...
...And 2 more matches
TypeError: "x" has no properties - JavaScript
The JavaScript exception "null (or undefined) has no
properties" occurs when you attempt to access
properties of null and undefined. They don't have any. Message TypeError: Unable to get property {x} of undefined or null reference (Edge) TypeError: null has no
properties (Firefox) TypeError: undefined has no
properties (Firefox) Error type TypeError. What went wrong? ...
...ipt exception "null (or undefined) has no
properties" occurs when you attempt to access
properties of null and undefined. They don't have any. Message TypeError: Unable to get property {x} of undefined or null reference (Edge) TypeError: null has no
properties (Firefox) TypeError: undefined has no
properties (Firefox) Error type TypeError. What went wrong? ...
...ou attempt to access
properties of null and undefined. They don't have any. Message TypeError: Unable to get property {x} of undefined or null reference (Edge) TypeError: null has no
properties (Firefox) TypeError: undefined has no
properties (Firefox) Error type TypeError. What went wrong? ...
...And 2 more matches
Using Vue computed properties - Learn web development
These work similarly to methods, but only re-run when one of their dependencies changes. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages, knowledge of the terminal/command line. Vue components are written as a combination of JavaScript objects that manage the app's data and an HTML-based template syntax that maps to the underlying DOM structure. ...
...e components are written as a combination of JavaScript objects that manage the app's data and an HTML-based template syntax that maps to the underlying DOM structure. For installation, and to use some of the more advanced features of Vue (like Single File Components or render functions), you'll need a terminal with node + npm installed. Objective: To learn how to use Vue computed
properties. Using computed
properties The aim here is to add a summary count of our to-do list. This can be useful for users, while also serving to label the list for assistive technology. If we have 2 of 5 items completed in our to-do list, our summary could read "3 items completed out of 5". While it might be tempting to do something like this: <h2>{{ToDoItems.filter(item => item.done).length}} ...
... tempting to do something like this: <h2>{{ToDoItems.filter(item => item.done).length}} out of {{ToDoItems.length}} items completed</h2> It would be recalculated on every render. For a small app like this, that probably doesn't matter too much. For bigger apps, or when the expression is more complicated, that could cause a serious performance problem. A better solution is to use Vue's computed
properties. Computed
Properties work similarly to methods, but only re-run when one of their dependencies changes. In our case, this would only re-run when the ToDoItems array changes. To create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. Adding a summary counter Add the following code to your App component object,...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
JS_DefineProperties
The last array element must contain 0-valued members. In SpiderMonkey versions prior to SpiderMonkey 24, the last argument to JS_DefinePropeties was not const. ...
...The last array element must contain 0-valued members. In SpiderMonkey versions prior to SpiderMonkey 24, the last argument to JS_DefinePropeties was not const. ...
...perties for a single object. Syntax bool JS_Define
Properties(JSContext *cx, JS::HandleObject obj, const JSPropertySpec *ps); Name Type Description cx JSContext * The context in which to define the
properties. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JSObject * The object on which to define new
properties. ps const JSPropertySpec * Pointer to the first element of an array containing names, ids, flags, and getProperty and setProperty method for the
properties to create. The last array element must contain 0-valued members. In SpiderMonkey versions prior to SpiderMonkey 24, the last argument to JS_DefinePropeties was not const. Description JS_Define
Properties creates properti...
...ersions prior to SpiderMonkey 24, the last argument to JS_DefinePropeties was not const. Description JS_Define
Properties creates
properties on a specified object, obj. ps is a pointer to the first element of an array of JSPropertySpec structures. Each array element defines a single property: its name, attributes, getter, and setter. The name field of the last array element must be NULL. JS_Define
Properties creates one property for each element in the array before the element with a null name field. Each property is defined as though by calling JS_Define
Properties. The initial stored value of each property created is undefined. On success, JS_Define
Properties returns true, indicating it has created all
properties listed in the array. Otherwise it returns false. See Also MXR ID Search for JS_DefineP...
CSS Properties and Values API - Web APIs
Interfaces CSS.registerProperty Defines how a browser should parse a css custom
properties. Access this interface through CSS.registerProperty in JavaScript. @property Defines how a browser should parse a css custom
properties. Access this interface through @property in CSS. ...
... The CSS
Properties and Values API -- part of the CSS Houdini umbrella of APIs -- allows developers to explicitly define their css custom
properties, allowing for property type checking, default values, and
properties that do or do not inherit their value. Interfaces CSS.registerProperty Defines how a browser should parse a css custom
properties. Access this interface through CSS.registerProperty in JavaScript. @property Defines how a browser should parse a css custom
properties. Access this interface through @property in CSS. ...
... not inherit their value. Interfaces CSS.registerProperty Defines how a browser should parse a css custom
properties. Access this interface through CSS.registerProperty in JavaScript. @property Defines how a browser should parse a css custom
properties. Access this interface through @property in CSS. ...
... ...
Using ARIA: Roles, states, and properties - Accessibility
Addition of ARIA semantics only exposes extra information to a browser's accessibility API, and does not affect a page's DOM. ...
...Addition of ARIA semantics only exposes extra information to a browser's accessibility API, and does not affect a page's DOM. ...
...inition directory document feed figure group heading img list listitem math none note presentation row rowgroup rowheader separator table term textbox toolbar tooltip Landmark roles banner complementary contentinfo form main navigation region search Live Region Roles alert log marquee status timer Window Roles alertdialog dialog States and
properties Widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetex...
...ria-relevant aria-atomic aria-busy Drag & drop attributes aria-dropeffect aria-dragged Relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize MicrosoftEdge-specific
properties x-ms-aria-flowfrom ...
Test your skills: Writing Modes and Logical Properties - Learn web development
The things you need to know to complete these tasks are covered in the lesson on Handling different text directions. Note: You can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Task One The box in the example is displayed with a horizontal writing mode. ...
... Can you add a line of CSS to change it so it uses a vertical writing mode with right to left text? Your example should look like the image below. Try updating the live code below to recreate the finished example: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Task Two In the example below use logical
properties to replace width and height in order to maintain the aspect ratio of the box as it is turned vertically. Your end result should look like the image below. Try updating the live code below to recreate the example as displayed in the image: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Task Three Use l...
...he aspect ratio of the box as it is turned vertically. Your end result should look like the image below. Try updating the live code below to recreate the example as displayed in the image: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Task Three Use logical versions of the margin, border, and padding
properties so that the edges of the box relate to the text rather than following top, left, bottom and right. You can see how this should look in the image below. Try updating the live code below to recreate the finished example: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Assessment or further help You can p...
Components.utils.importGlobalProperties
s various objects into a system scope. System scopes such as JSMs and frame scripts don't have certain objects, such as indexedDB and XMLHttpRequest, that are available to DOM window globals. Using this API you can import these objects into such a system scope. This function is not intended for sandboxes but for system-privileged scopes. To import these objects into a sandbox, use the wantGlobal
Properties option in the Sandbox constructor. This function is passed an array of strings. Each string is the name of an object to import, and will be defined on the importing scope's global. The following strings are supported: String/Object XPCOM Component atob Blob btoa crypto CSS fetch File...
... TextDecoder TextEncoder URL URLSearchParams XMLHttpRequest nsIXMLHttpRequest Obsolete since Gecko 60 For string/object in table without a minimum firefox version, it is not exactly known since when it was available, however it is guranteed available from Firefox 28 and up. ...
...ly known since when it was available, however it is guranteed available from Firefox 28 and up. Syntax void Components.utils.importGlobal
Properties([string1, string2, ...]); Parameters [string1, string2, ...] An array of strings. Each string is the name of an object to import. Example Components.utils.import("resource://gre/modules/devtools/Console.jsm"); Components.utils.importGlobal
Properties(["atob", "btoa"]); var encoded = btoa("Hello"); console.log(encoded); // "SGVsbG8=" console.log(atob(encoded)); // "Hello" Alternative Methods If importGlobal
Properties does not support the targeted Firefox version, here are some alternative methods to import these objects. Import from JSM This method worked until Blob and File were no longer apart of JSM modules. It is ...
BluetoothCharacteristicProperties - Web APIs
broadcastRead only Returns a boolean that is true if the broadcast of the characteristic value is permitted using the Server Characteristic Configuration Descriptor. indicateRead only Returns a boolean that is true if indications of the characteristic value with acknowledgement is permitted. ...
...es The following example shows how tell if a GATT characteristic supports value change notifications. let device = await navigator.bluetooth.requestDevice({ filters: [{services: ['heart_rate']}] }); let gatt = await device.gatt.connect(); let service = await gatt.getPrimaryService('heart_rate'); let characteristic = await service.getCharacteristic('heart_rate_measurement'); if (characteristic.
properties.notify) { characteristics.addEventListener('characteristicvaluechanged', function(event) { console.log(`Received heart rate measurement: ${event.target.value}`); } await characteristic.startNotifications(); } Specifications Specification Status Comment Web BluetoothThe definition of 'BluetoothCharacteristic
Properties' in that specification. Draft I...
...er Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBluetoothCharacteristic
Properties ExperimentalChrome Full support 56Notes Full support 56Notes Notes ChromeOS and macOS only. Full support 56Notes Disabled Notes Linux and versions of Windows earlier than 10.Disabled From version 56: this feature is behind the #enable-experimental-web-platform-fe...
CSS Custom Properties for Cascading Variables - CSS: Cascading Style Sheets
CSS Custom
Properties for Cascading Variables is a CSS module that allows for the creation of custom
properties that can be used over and over. ...
... CSS Custom
Properties for Cascading Variables is a CSS module that allows for the creation of custom
properties that can be used over and over. ...
... CSS Custom
Properties for Cascading Variables is a CSS module that allows for the creation of custom
properties that can be used over and over. ...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
Property names that are prefixed with --, like --example-name, represent custom
properties that contain a value that can be used in other declarations using the var() function. Custom
properties are scoped to the element(s) they are declared on, and participate in the cascade: the value of such a custom property is that from the declaration decided by the cascading algorithm. 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. It represents the entirety of what a valid declaration can...
... Candidate Recommendation Initial definition. ...
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. When specifying the size of an item, the Logical
Properties and Values specification gives you the ability to indicate sizing as it relates to the flow of text (inline and block) rather than physical sizing which relates to the physical dimensions of horizontal and vertical (e.g. left and right). While these flow relative mappings may well become the default for many of us, in a design you may well use both physical and logical sizing. You might want some features to always relate to the physical dimensions whatever the writing mode. Mappings for dimensions The table below provides mappings between logical and physical
properties. These mapp...
... the same size in each dimension, despite the text becoming vertical. The second example -- which uses inline-size and block-size -- will follow the text direction as if the entire block has rotated. Min-width and min-height example There are also mappings for min-width and min-height -- these are min-inline-size and min-block-size. These work in the same way as the inline-size and block-size
properties, but setting a minimum rather than a fixed size. Try changing the example below to vertical-rl, as with the first example, to see the effect it has. I am using min-height in the first example and min-block-size in the second. Max-width and max-height example Finally you can use max-inline-size and max-block-size as logical replacements for max-width and max-height. Try playing with the below...
CSS Properties Reference - CSS: Cascading Style Sheets
For more CSS
properties see The main CSS reference and Mozilla CSS Extensions. The reference articles also include examples on how to use all the
properties. ...
... Common CSS
Properties Reference The following is a basic list of the most common CSS
properties with the equivalent of the DOM notation which is usually accessed from JavaScript: Note: This list is incomplete. For more CSS
properties see The main CSS reference and Mozilla CSS Extensions. The reference articles also include examples on how to use all the
properties. CSS JavaScript background background background-attachment backgroundAttachment background-color backgroundColor background-image backgroundImage background-position backgroundPosition background-repeat backgroundRepeat border border border-bottom borderBottom border-bottom-color borderBottomColor ...
Animatable CSS properties - CSS: Cascading Style Sheets
Certain CSS
properties can be animated using CSS Animations or CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
... Certain CSS
properties can be animated using CSS Animations or CSS Transitions. Animation means that their values can be made to change gradually over a given amount of time. ...
Properties - Archive of obsolete content
e.g. major version of Netscape 6 is "6" minor Second most siginificant element of the InstallVersion object.e.g. minor version of Netscape Communicator 4.7 is "7" release Second least siginificant element of the InstallVersion object. build Least siginificant element of the InstallVersion object.e.g. buildID of Netscape 6 is represented by a time stamp of teh format:YYYYMMDDHH: 2001031808 means in the year 2001, in the month of March, on the 18th day of the month, at 8:00am. the product was built. ...
Properties - Archive of obsolete content
Parts of this page show the use of the XPInstall API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension.
Properties archive Full local path of the archive after it is downloaded to the platform specific temp folder. (e.g. C:\TEMP\argstest.xpi) arguments args can be passed in through the triggering APIs by attaching a ? and then the rg string to the xpi URL: (e.g. startSoftwareUpdate("http://webserver/argstest.xpi?ARGUMENT_STRING") will result in the value of Install.arguments being ARGUMENT_STRING #). No...
nsIProperties
xpcom/ds/nsI
Properties.idlScriptable This interface provides methods to access a map of named XPCOM object values. Inherits from: nsISupports Last changed in Gecko 1.2 Implemented by: @mozilla.org/file/directory_service;1. To get an instance, use: var
properties = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsI
Properties); Method overview void get(in string prop, in nsIIDRef iid, [iid_is(iid),retval] out nsQIResult result); void getKeys(out PRUint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsISupports value); void undefine(in string prop); Methods get() Gets the XPCOM object associated with a particular name. void get( in string ...
Details of the object model - JavaScript
<< PreviousNext >> JavaScript is an object-based language based on prototypes, rather than being class-based. Because of this different basis, it can be less apparent how JavaScript allows you to create hierarchies of objects and to have inheritance of
properties and their values. This chapter attempts to clarify the situation. This chapter assumes that you are already somewhat familiar with JavaScript and that you have used JavaScript functions to create simple objects. Class-based vs. ...
...hapter attempts to clarify the situation. This chapter assumes that you are already somewhat familiar with JavaScript and that you have used JavaScript functions to create simple objects. Class-based vs. prototype-based languages Class-based object-oriented languages, such as Java and C++, are founded on the concept of two distinct entities: classes and instances. A class defines all of the
properties that characterize a certain set of objects (considering methods and fields in Java, or members in C++, to be
properties). A class is abstract rather than any particular member in a set of objects it describes. For example, the Employee class could represent the set of all employees. An instance, on the other hand, is the instantiation of a class; that is. For example, Victoria could be an instan...
...operties). A class is abstract rather than any particular member in a set of objects it describes. For example, the Employee class could represent the set of all employees. An instance, on the other hand, is the instantiation of a class; that is. For example, Victoria could be an instance of the Employee class, representing a particular individual as an employee. An instance has exactly the same
properties of its parent class (no more, no less). A prototype-based language, such as JavaScript, does not make this distinction: it simply has objects. A prototype-based language has the notion of a prototypical object, an object used as a template from which to get the initial
properties for a new object. Any object can specify its own
properties, either when you create it or at run time. In addition, ...
...And 27 more matches
Index
wningCompileOptions and JS::CompileOptions return the instance itself to allow method chain. 35 JS::Construct JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::Construct calls a specified function as a constructor, fun. 36 JS::CreateError JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::CreateError creates an Error object with specified
properties. 37 JS::CurrentGlobalOrNull JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::CurrentGlobalOrNull() returns the global object for whatever function is currently running on the context. In other words, it returns the global object on the current scope chain. 38 JS::DeflateStringToUTF8Buffer JSAPI Reference, Refere, SpiderMonkey JS::DeflateStringTo...
...JSNative is the this argument, not the custom object that was called! 92 JSClass.flags JSAPI Reference, SpiderMonkey The flags field is of type uint32_t. Its value is the logical OR of zero or more of the following constants: 93 JSConstDoubleSpec JSAPI Reference, SpiderMonkey JSConstDoubleSpecs is used to define a set of double values that are assigned as
properties to an object using JS_DefineConstDoubles. 94 JSConvertOp JSAPI Reference, Reference, Reference(2), SpiderMonkey JSConvertOp callback specifies conversion behavior for objects having this class, implementing the ECMAScript [[DefaultValue]] behavior for them. On success it must return a primitive value in *vp. 95 JSDeletePropertyOp JSAPI Reference, Reference, Spi...
...hat applications may install to be called at some point during property access. A JSDeletePropertyOp may be installed on a JSClass to hook property deletes. 96 JSEnumerateOp JSAPI Reference, SpiderMonkey JSEnumerateOp is called just before an object is enumerated (via a for...in statement, an array comprehension, or a call to JS_Enumerate). It should define any remaining lazy
properties that should be enumerable but are not yet defined in obj. This hook does not implement iteration: once the
properties are defined, the JavaScript engine can enumerate them. 97 JSErrorFormatString JSAPI Reference, Reference, Reference(2), SpiderMonkey JSErrorFormatString is a struct to represent error message and type, returned by JS_ReportErrorNumber function. 98 J...
...And 19 more matches
Capabilities, constraints, and settings - Web APIs
ious things work or not and determining what errors occur, and so forth. The result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. The twin concepts of constraints and capabilities let the browser and Web site or app exchange information about what constrainable
properties the browser's implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. The Constraint Exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's A/V input devices (...
...ou experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's A/V input devices (such as its webcam and microphone). ...
...s.getSupportedConstraints() to get the list of supported constraints, which tells you what constrainable
properties the browser knows about. This isn't always necessary, since any that aren't known will simply be ignored when you specify them--but if you have any that you can't get by without, you can start by checking to be sure they're on the list. Once the script knows whether the property or
properties it wishes to use are supported, it can then check the capabilities of the API and its implementation by examining the object returned by the track's getCapabilities() method; this object lists each supported constraint and the values or range of values which are supported. Finally, the track's applyConstraints() method is called to configure the API as desired by specifying the values or ranges ...
...And 19 more matches
Repackaging Firefox - Archive of obsolete content
o get started is probably to look at a simple DEX and modify it for your own purposes. Download the sample. XPI files are specially crafted ZIP files in disguise. You can use any ZIP program (WinZIP on Windows, zip on Mac or Linux, etc) to extract it. ...
...look at a simple DEX and modify it for your own purposes. Download the sample. XPI files are specially crafted ZIP files in disguise. You can use any ZIP program (WinZIP on Windows, zip on Mac or Linux, etc) to extract it. ...
...fy it for your own purposes. Download the sample. XPI files are specially crafted ZIP files in disguise. You can use any ZIP program (WinZIP on Windows, zip on Mac or Linux, etc) to extract it. ...
...And 17 more matches
Debugger.Object - Firefox Developer Tools
Debugger.Object A Debugger.Object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent. The referent's
properties do not appear directly as
properties of the Debugger.Object instance; the debugger can access them only through methods like Debugger.Object.prototype.getOwnPropertyDescriptor and Debugger.Object.prototype.defineProperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters. SpiderMonkey creates exactly one Debugger.Object instance for each debuggee object it presents to a given Debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), SpiderMonkey presents the same Debugger.Object instance to ...
...sents to a given Debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), SpiderMonkey presents the same Debugger.Object instance to the debugger each time. This means that the debugger can use the == operator to recognize when two Debugger.Object instances refer to the same debuggee object, and place its own
properties on a Debugger.Object instance to store metadata about particular debuggee objects. JavaScript code in different compartments can have different views of the same object. For example, in Firefox, code in privileged compartments sees content DOM element objects without redefinitions or extensions made to that object's
properties by content code. (In Firefox terminology, privileged code sees the el...
...debugger came across the referent. As a consequence, a single Debugger instance may actually have several Debugger.Object instances: one for each compartment from which the referent is viewed. If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Object instance for a given object. This allows the code using each Debugger instance to place whatever
properties it likes on its own Debugger.Object instances, without worrying about interfering with other debuggers. While most Debugger.Object instances are created by SpiderMonkey in the process of exposing debuggee's behavior and state to the debugger, the debugger can use Debugger.Object.prototype.makeDebuggeeValue to create Debugger.Object instances for given debuggee objects, or use Debugger.Object.pro...
...And 17 more matches
JSAPI User Guide
cated. Every JSContext and every object in an application lives within a JSRuntime. They cannot travel to other runtimes or be shared across runtimes. You will need at least one JSRuntime per thread that uses the JSAPI. Contexts. A JSContext, or context, is like a little machine that can do many things involving JavaScript code and objects. It can compile and execute scripts, get and set object
properties, call JavaScript functions, convert JavaScript data from one type to another, create objects, and so on. Almost all JSAPI functions require a JSContext * as the first argument, just like most <stdio.h> functions require a FILE *. Global objects. Lastly, the global object contains all the classes, functions, and variables that are available for JavaScript code to use. Whenever JavaScript code doe...
... argument, just like most <stdio.h> functions require a FILE *. Global objects. Lastly, the global object contains all the classes, functions, and variables that are available for JavaScript code to use. Whenever JavaScript code does something like window.open("http://www.mozilla.org/"), it is accessing a global property, in this case window. JSAPI applications have full control over what global
properties scripts can see. The application starts out by creating an object and populating it with the standard JavaScript classes, like Array and Object. Then it adds whatever custom classes, functions, and variables (like window) the application wants to provide; see Custom objects below. Each time the application runs a JS script (using, for example, JS_EvaluateScript), it provides the global object for...
...whatever custom classes, functions, and variables (like window) the application wants to provide; see Custom objects below. Each time the application runs a JS script (using, for example, JS_EvaluateScript), it provides the global object for that script to use. As the script runs, it can create global functions and variables of its own. All of these functions, classes, and variables are stored as
properties of the 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. When your application is done with SpiderMonkey altogether, use JS_ShutDown to free any remaining cached resources. (This is a mere nicety if the process is ab...
...And 16 more matches
Using the CSS Painting API - Web APIs
ow, and then call fillRect() to create a rectangle of that color. The fillRect() parameters are, in order, x-axis origin, y-axis origin, width, and height. fillRect(0, 15, 200, 20) results in the creation of a rectangle that is 200 units wide by 20 units tall, positioned 0 units from the left and 15 units from the top of the content box. We can use the CSS background-size and background-position
properties to re-size or relocate this background image, but this is the default size and placement of the yellow box we created in our paint worklet. We tried to keep the example simple. For more options, look at the canvas documentation. We also add a little bit of complexity later in this tutorial. Using the paint worklet To use the paint worklet, we need to register it using addModule() and include i...
...e example has two differences from our first example: We've included a second argument, which is the paint size. We've changed the dimensions and positioning of our rectangle to be relative to the size of the element box rather than absolute values. We can pass the second parameter into the paint() function to give us access to the width and the height of the element, via .width and .height
properties. Our header now has a highlight that changes according to it's size. CSS.paintWorklet.addModule('https://mdn.github.io/houdini-examples/cssPaint/intro/02partTwo/header-highlight.js'); .fancy { background-image: paint(headerHighlight); } .half { width: 50%; } <h1 class="fancy">Largest Header</h1> <h6 class="fancy">Smallest Header</h6> <h3 class="fancy half">50% width header</h3> Whil...
...half { width: 50%; } <h1 class="fancy">Largest Header</h1> <h6 class="fancy">Smallest Header</h6> <h3 class="fancy half">50% width header</h3> While you can't play with the worklet's script, you can alter the element's font-size and width to change the size of the background image. In browsers that support the CSS Paint API, the example below should appear like the image above. Custom
properties In addition to accessing the size of the element, the worklet can also have access to CSS custom
properties and regular CSS
properties. registerPaint('cssPaintFunctionName', class { static get input
Properties() { return ['PropertyName1', '--customPropertyName2']; } static get inputArguments() { return ['<color>']; } static get contextOptions() { return {alpha: true}; } pain...
...And 15 more matches
CSS3 - Archive of obsolete content
h specific OpenType features via the CSS font-feature-settings property. The control of the aspect ratio to use when fallback fonts are selected via the CSS font-size-adjust property. The choice of alternative font faces using the CSS font-stretch, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, and font-variant-position
properties. It also extends the related CSS font-variant shorthand property and introduces the @font-feature-values at-rule. The control of the automatic generation of an oblique or bold face when none are found via the CSS font-synthesis property. CSS Basic User Interface Module Level 3 Recommendation since June 21st, 2018 Adds: The ability to tweak...
...bility to define the hotspot of a cursor as well as the new none, context-menu, cell, vertical-text, alias, copy, no-drop, not-allowed, nesw-resize, nwse-resize, col-resize, row-resize, all-scroll, zoom-in, zoom-out, extending the cursor property. The ability to specify the sequential navigation order (that is the tabbing order ) using the CSS nav-index, nav-up, nav-right, nav-left, nav-down
properties. At risk: due to insufficient browser support, standardization of the navigation
properties may be postponed to the next iteration of this module. The ability to control the usage of an IME editor, using the CSS ime-mode property. At risk: due to insufficient browser support, standardization of the ime-mode property may be postponed to the next iteration of this module. ...
...andidate Recommendation Adds: Support, on backgrounds, for any type of <image>, and not only for uri() defined ones. Support for multiple background images. The background-repeat space and round values, and for the 2-value syntax of this CSS property. The background-attachment local value. The CSS background-origin, background-size, and background-clip
properties. Support for curved border corners, with the CSS border-radius, border-top-left-radius, border-top-right-radius, border-bottom-left-radius, and border-bottom-right-radius
properties. Support for the use of an <image> as the border with the CSS border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, and border-image-repeat
properties. Support ...
...And 14 more matches
TPS Bookmark Lists
folder ("menu", "toolbar", and "unfiled" are all children of this) Sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". TPS does not support forward slashes as part of a folder name. Folder contents The contents for a folder are given as an array of objects, representing various bookmark types, described below. Bookmark objects Valid
properties are: uri: the bookmark uri. Required. title: the bookmark title. Optional. Defaults to the bookmark uri. loadInSidebar: true or false. Optional. Toggles the "load in sidebar" property. description: the bookmark description. Optional. tags: an array of tags for the bookmark. Optional. keyword: the keyword for the bookmark. Optional. after: the title of the bookmark item expected to be found AFTER...
... description. Optional. tags: an array of tags for the bookmark. Optional. keyword: the keyword for the bookmark. Optional. after: the title of the bookmark item expected to be found AFTER this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found BEFORE this bookmark; used only in verify and modify actions. ...
...ord for the bookmark. Optional. after: the title of the bookmark item expected to be found AFTER this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found BEFORE this bookmark; used only in verify and modify actions. changes: an object containing new
properties to be set for this bookmark when this asset list is used in a modify action. ...
...And 14 more matches
ui/button/toggle - Archive of obsolete content
nsole.log("You clicked '" + state.label + "' again"); } function firstChange(state) { console.log("You changed '" + state.label + "'"); button.removeListener("change", firstChange); button.on("change", subsequentChanges); } function subsequentChanges(state) { console.log("You changed '" + state.label + "' again"); } The listener is passed a state object that contains all the button's
properties. You can generate click and change events programmatically with the button's click() method. Attaching panels to buttons You can attach panels to buttons by passing the button as the position option to the panel's show() method or the panel's constructor: var { ToggleButton } = require('sdk/ui/button/toggle'); var panels = require("sdk/panel"); var self = require("sdk/self"); var button = To...
...eChange(state) { if (state.checked) { panel.show({ position: button }); } } function handleHide() { button.state('window', {checked: false}); } Disabling buttons You can disable a button by setting its disabled property to true. A disabled button will not generate click or change events and its icon will appear disabled: Updating state You can update all the button's
properties, except for its id. Depending on your application, you might want a button to have different state in different browser windows or different tabs. For example, you might want to give it a different appearance when the current page is being served over HTTPS. The button API handles this by defining a tree of potential states. At the root is the global state, then there's a state you can set for e...
...To set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active ta...
...And 12 more matches
source-editor.jsm
You can then use this value to detect when the contents of the text are different from your most recent save. In addition, when this value changes, the "DirtyChanged" event is sent. editorElement Ele...
..., the "DirtyChanged" event is sent. editorElement Element The element containing the editor. When using the default Orion editor, this is a XUL <xul:iframe> element. Read only. lastFind Object An object describing the result of the last find operation performed using the find(), findNext(), or findPrevious() method. Read only. This object has the following
properties: Property Type Description str String The last string that was searched for. index Number An integer value indicating the result of the most recent find operation; this is the index into the text at which str was found, or -1 if the string wasn't found. lastFound ...
...rposes of undo operations. void endCompoundChange(); Parameters None. find() Finds a string in the editor's text. Number find( [optional] String aString [optional] Object aOptions ); Parameters aString Optional The string for which to search. If not specified, the currently selected text in the editor is used as the search string. ...
...And 12 more matches
Styling a Tree - Archive of obsolete content
ee. Adding a style to the treecol element does not cause the style to be applied to the column but only to the header. 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. The outer treechildren is the only real element in the tree body. The inner elements are just placeholders. Setting
Properties Instead, you must use the
properties attribute on the rows or cells to set one or more named
properties. This can be used with trees with static content, RDF built content or with those with a custom view. Let's say we want a particular row to have a blue background color. This would be used to implement Mozilla Mail's labels feature. We'll use a property called 'makeItBlue'. You can use whateve...
... attribute on the rows or cells to set one or more named
properties. This can be used with trees with static content, RDF built content or with those with a custom view. Let's say we want a particular row to have a blue background color. This would be used to implement Mozilla Mail's labels feature. We'll use a property called 'makeItBlue'. You can use whatever name you want. You can set multiple
properties by separating them with spaces. Set the property on a row or cell, as in the following example: <treerow
properties="makeItBlue"> CSS Selectors for the Tree The style sheet can take this property and use it to change the appearance of the row for unread messages or labels. ...
...This is because you can specify the style for a number of parts of the cell individually. You can style not only the cell and its text, but the twisty and indentation. ...
...And 11 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
a trusted user and sends a website unwanted commands. 55 CSS CSS, CodingScripting, Glossary, Web, l10n:priority CSS (Cascading Style Sheets) is a declarative language that controls how webpages look in the browser. 56 CSS Object Model (CSSOM) CSS, CSSOM, DOM, Glossary, Web Performance The CSS Object Model (CSSOM) is a map of all CSS selectors and relevant
properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship. The CSSOM is very similar to the Document Object Model (DOM). Both of them are part of the critical rendering path which is a series of steps that must happen to properly render a website. 57 CSS pixel CSS, CSS Pixel, Glossary, height, length, pixel, size, unit, width ...
...pher and the right secret (usually a key), reproducing the original cleartext. A ciphertext's security, and therefore the secrecy of the contained information, depends on using a secure cipher and keeping the key secret. 78 Class CodingScripting, Glossary In object-oriented programming, a class defines an object's characteristics. Class is a template definition of an object's
properties and methods, the "blueprint" from which other more specific instances of the object are drawn. 79 Client hints Client hints, Glossary, Performance, Reference, Web Performance Client Hints are a set of HTTP request header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences. 80 Closure CodingScrip...
...is, the "<!DOCTYPE html>" doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications. 117 Document directive CSP, Directive, Document, Glossary, HTTP, Security CSP document directives are used in a Content-Security-Policy header and govern the
properties of a document or worker environment to which a policy applies. 118 Domain Browser, Domain, Glossary, Infrastructure, Networking A domain is an authority within the internet that controls its own resources. Its "domain name" is a way to address this authority as part of the hierarchy in a URL - usually the most memorable part of it, for instance a brand name. 119 Do...
...And 11 more matches
The box model - Learn web development
ms of page flow, and in relation to other boxes on the page: If a box is defined as a block, it will behave in the following ways: The box will break onto a new line. The box will extend in the inline direction to fill the space available in its container. In most cases this means that the box will become as wide as its container, filling up 100% of the space available. ...
... Vertical padding, margins, and borders will apply but will not cause other inline boxes to move away from the box. Horizontal padding, margins, and borders will apply and will cause other inline boxes to move away from the box. The <a> element, used for links, <span>, <em> and <strong> are all examples of elements that will display inline by default. ...
...ed in the box model. The model defines how the different parts of a box -- margin, border, padding, and content -- work together to create a box that you can see on the page. To add some additional complexity, there is a standard and an alternate box model. Parts of a box Making up a block box in CSS we have the: Content box: The area where your content is displayed, which can be sized using
properties like width and height. Padding box: The padding sits around the content as white space; its size can be controlled using padding and related
properties. Border box: The border box wraps the content and any padding. Its size and style can be controlled using border and related
properties. Margin box: The margin is the outermost layer, wrapping the content, padding and border as whitespace betwe...
...And 11 more matches
Fundamental text and font styling - Learn web development
th CSS. Here we'll go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. Prerequisites: Basic computer literacy, HTML basics (study Introduction to HTML), CSS basics (study Introduction to CSS). Objective: To learn the fundamental
properties and techniques needed to style text on web pages. What is involved in styling text in CSS? As you'll have already experienced in your work with HTML and CSS, text inside an element is laid out inside the element's content box. It starts at the top left of the content area (or the top right, in the case of RTL language content), and flows towards the end of the line. Once it reaches the en...
...e 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. Note: If the above paragraph leaves you feeling confused, then no matter -- go back and review our Box model article, to brush up on the box model theory, before carrying on. The CSS
properties used to style text generally fall into two categories, which we'll look at separately in this article: Font styles:
Properties that affect the font that is applied to the text, affecting what font is applied, how big it is, whether it is bold, italic, etc. Text layout styles:
Properties that affect the spacing and other layout features of the text, allowing manipulation of, for example, the s...
...Many a fat alley rat had met its demise while staring point blank d...
...And 11 more matches
Index
de better diagnostics in the error console if not caught than simply throwing an nsresult's value will. 19 Components.ID XPCOM:Language Bindings, XPConnect Components.ID is a constructor that creates native objects that conform to the nsIJSID interface. 20 Components.classes XPCOM:Language Bindings, XPConnect Components.classes is a read-only object whose
properties are classes indexed by ContractID. 21 Components.classesByID XPCOM:Language Bindings, XPConnect Components.classesByID is a read-only object whose
properties are classes indexed by CID. 22 Components.interfaces XPCOM:Language Bindings, XPConnect Components.interfaces is a read-only object whose
properties are interfaces indexed by their names. 23 ...
...y! 26 Components.manager XPCOM:Language Bindings, XPConnect Components.manager is a convenience reflection of the global native component manager service. The scriptable methods on the nsIComponentManager interface can be called directly on this object. 27 Components.results XPCOM:Language Bindings, XPConnect Components.results is a read-only object whose
properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at Table Of Errors), with the value of each corresponding to that constant's value. 28 Components.returnCode XPCOM:Language Bindings, XPConnect No summary! 29 Components.stack XPCOM:Language Bindings, XPConnect Components.stack is a read only property of type nsIS...
...g object. 40 Components.utils.import NeedsContent, XPCOM:Language Bindings, XPConnect Components.utils.import was introduced in Firefox 3 and is used for sharing code between different scopes easily. For example, you can import XPCOMUtils.jsm to avoid copy/pasting long XPCOM component registration boilerplate in your component files. 41 Components.utils.importGlobal
Properties Imports various objects into a system scope. 42 Components.utils.isXrayWrapper When privileged JavaScript in Gecko accesses objects belonging to less-privileged code (such as untrusted web content), it does so, by default, with "Xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. For example...
...And 11 more matches
Debugger.Object - Firefox Developer Tools
Debugger.Object A Debugger.Object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent. The referent's
properties do not appear directly as
properties of the Debugger.Object instance; the debugger can access them only through methods like Debugger.Object.prototype.getOwnPropertyDescriptor and Debugger.Object.prototype.defineProperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters. SpiderMonkey creates exactly one Debugger.Object instance for each debuggee object it presents to a given Debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), SpiderMonkey presents the same Debugger.Object instance to ...
...sents to a given Debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), SpiderMonkey presents the same Debugger.Object instance to the debugger each time. This means that the debugger can use the == operator to recognize when two Debugger.Object instances refer to the same debuggee object, and place its own
properties on a Debugger.Object instance to store metadata about particular debuggee objects. JavaScript code in different compartments can have different views of the same object. For example, in Firefox, code in privileged compartments sees content DOM element objects without redefinitions or extensions made to that object's
properties by content code. (In Firefox terminology, privileged code sees the el...
...debugger came across the referent. As a consequence, a single Debugger instance may actually have several Debugger.Object instances: one for each compartment from which the referent is viewed. If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Object instance for a given object. This allows the code using each Debugger instance to place whatever
properties it likes on its own Debugger.Object instances, without worrying about interfering with other debuggers. While most Debugger.Object instances are created by SpiderMonkey in the process of exposing debuggee's behavior and state to the debugger, the debugger can use Debugger.Object.prototype.makeDebuggeeValue to create Debugger.Object instances for given debuggee objects, or use Debugger.Object.pro...
...And 11 more matches
Using the CSS Typed Object Model - Web APIs
can incur a significant performance overhead. The CSS Typed OM makes CSS manipulation more logical and performant by providing object features (rather than CSSOM string manipulation), providing access to types, methods, and an object model for CSS values. This article provides an introduction to all of its main features. computedStyleMap() With the CSS Typed OM API, we can access all the CSS
properties and values -- including custom
properties -- that are impacting an element. Let's see how this works by creating our first example, which explores computedStyleMap(). We start with some HTML: a paragraph with a link, as well as a definition list to which we will add all the CSS Property / Value pairs. <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> We add JavaSc...
... all the default CSS property values impacting the link using computedStyleMap(). ...
...Element = document.querySelector('a'); // get the <dl> we'll be populating const stylesList = document.querySelector('#regurgitation'); // Retrieve all computed styles with computedStyleMap() const defaultComputedStyles = myElement.computedStyleMap(); // iterate thru the map of all the
properties and values, adding a <dt> and <dd> for each for (const [prop, val] of defaultComputedStyles) { //
properties const cssProperty = document.createElement('dt'); cssProperty.appendChild(document.createTextNode(prop)); stylesList.appendChild(cssProperty); // values const cssValue = document.createElement('dd'); cssValue.appendChild(document.createTextNode(val)); stylesList.appendChild(cssValue); } The computedStyleMap() method returns a StylePropertyMapReadOnly object containing the size property, ...
...And 11 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
bilities. We were able to align text using text-align, center blocks using auto margins, and in table or inline-block layouts using the vertical-align property. Alignment of text is now covered by the Inline Layout and CSS Text modules, and for the first time in Box Alignment we have full horizontal and vertical alignment capabilities. If you initially learned Flexbox then you may consider these
properties to be part of the Flexbox specification, and some of the
properties are indeed listed in Level 1 of Flexbox. However the specification notes that the Box Alignment specification should be referred to as it may add additional capabilities over what is currently in Flexbox. Basic examples The following examples demonstrate how some of the Box Alignment
Properties are applied in Grid and Flexbox. ...
...align-self to center. Flexbox Alignment Example In this example, three flex items are aligned on the main axis using justify-content and on the Cross Axis using align-items. The first item overrides the align-items set on the group by setting align-self to center. Key concepts and terminology The specification details some alignment terminology to make it easier to discuss these alignment
properties outside of their implementation within a particular layout method. There are also some key concepts which are common to all layout methods. Relationship to writing modes Alignment is linked to writing modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom and left. Instead we describe alignment in terms of the start and...
...modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom and left. Instead we describe alignment in terms of the start and end of the particular dimension we are working with. This ensures that alignment works in the same way whichever writing mode the document has. Two dimensions of alignment When using the box alignment
properties you will align content on one of two axes -- the inline (or main) axis, and the block (or cross) axis. The inline axis is the axis along which words in a sentence flow in the writing mode being used -- for English, for example, the inline axis is horizontal. The block axis is the axis along which blocks, such as paragraph elements, are laid out and it runs across the Inline axis. When aligning...
...And 11 more matches
tabs - Archive of obsolete content
tabs.on('open', function onOpen(tab) { myOpenTabs.push(tab); }); // Listen for tab content loads. ...
...By setting the url property you can load a new page in the tab: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.url = "http://www.example.com"; }); Run scripts in a tab You can attach a content script to the page hos...
...By setting the url property you can load a new page in the tab: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.url = "http://www.example.com"; }); Run scripts in a tab You can attach a content script to the page hosted in a tab, and use that to acce...
...And 10 more matches
Localization - Archive of obsolete content
metadata the title and description fields of your add-on's preferences. It doesn't, yet, support localization of CSS or content scripts, or the add-on's title and description that appear in the Add-ons Manager. See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
... fields of your add-on's preferences. It doesn't, yet, support localization of CSS or content scripts, or the add-on's title and description that appear in the Add-ons Manager. See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...ormat identifier=translation need to use UTF-8 without BOM encoding Lines starting with "#" (after optional whitespace) are comments Suppose your add-on contains a single localizable string, represented in English as "Hello!", and you want to supply US English and French French localizations. You'd add two files to the "locale" directory: my-addon/ data lib locale/ en-US.
properties fr.
properties "en-US.
properties" contains this: hello_id= Hello! "fr.
properties" contains this: hello_id= Bonjour ! Now whenever your JavaScript or HTML asks the localization system for the translation of the hello_id identifier, it will get the correct translation for the current locale. Using localized strings in HTML This example uses the action button API, which is only ava...
...And 10 more matches
XPIDL
s Guide (Not as out of date) Explanation of IDL semantics A full guide to the syntax can be found at XPIDL:Syntax, which is written in an ABNF form. An xpidl file is essentially just a series of declarations. At the top level, we can define typedefs, native types, or interfaces. Interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. Most declarations can have
properties applied to them. Types There are three ways to make types: a typedef, a native, or an interface. In addition, there are a few built-in native types. The built-in native types are those listed under the type_spec production above. The following is the correspondence table: Table 1: Standard IDL types IDL C++ in parameter C++ out parameter JS type Notes boolean...
... The contents of the parentheses of a native type declaration (although native declarations without parentheses are parsable, I do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the C++ type. XPIDL itself does not interpret this string, it just literally pastes it anywhere the native type is used. The interpretation of the type can be modified by having
properties on the native declaration: Table 3: Native type definitions astring This is an nsAString declaration. Overrides native string. cstring This is an nsACString declaration. Overrides native string. jsval This type gets const when an in type. Special in typelib. nsid This type gets const when an in type. Special in typelib. ptr The type is...
...declaration. Overrides native string. jsval This type gets const when an in type. Special in typelib. nsid This type gets const when an in type. Special in typelib. ptr The type is really (native str)* ref The type is really (native str)& utf8string This is an nsACString declaration whose text is UTF-8. As far as I can tell, these
properties also apply to typedefs. Need to verify. WebIDL interfaces are also valid XPIDL types. To declare a WebIDL interface in XPIDL, write webidl InterfaceName;. WebIDL types will be passed as mozilla::dom::InterfaceName* when used as in-parameters, as mozilla::dom::InterfaceName** when used as out or inout-parameters, and as RefPtr<mozilla::dom::InterfaceName> when used as an array element. Other We...
...And 10 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
In these guides, I have already touched on an important feature of grid layout: the support for different writing modes that is built into the specification. For this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical
properties as we do so. Logical and physical
properties and values CSS is full of physical positioning keywords - left and right, top and bottom. If we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. In the code snippet below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container: .container { position: relative; } .item { position: absolute; top: 20px; left: 30px; } <div cla...
...et below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container: .container { position: relative; } .item { position: absolute; top: 20px; left: 30px; } <div class="container"> <div class="item">Item</div> </div> Another place you might see physical keywords in use, is when using text-align: right to align text to the right. There are also physical
properties in CSS. We add margins, padding, and borders using these physical
properties of margin-left, padding-left, and so on. We call these keywords and
properties physical because they relate to the screen you are looking at. Left is always left, no matter what direction your text is running. This can become an issue when developing a site that has to work in multiple languages, including languages th...
... set to left. I have added dir="rtl" to the html element, which switches the writing mode from the default for an English language document of ltr. You can see that the first paragraph remains left to right, due to the text-align value being left . The second however, switches direction and the text runs from right to left . This is a very simple example of the problem with physical values and
properties being used in CSS. They prevent the browser being able to do the work to switch writing mode, as they make the assumption that the text is flowing left to right and top to bottom. Logical
properties and values Logical
properties and values do not make an assumption about text direction. Which is why in Grid Layout we use the keyword start when aligning something to the start of the container. F...
...And 10 more matches
border-inline-end - CSS: Cascading Style Sheets
rder-inline-end CSS property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: border-inline-end-color border-inline-end-style border-inline-end-width Syntax border-inline-end: 1px; border-inline-end: 2px dashed; border-inline-end: medium dashed blue; The physical border to which border-inline-end maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the b...
...er-inline-end: 1px; border-inline-end: 2px dashed; border-inline-end: medium dashed blue; The physical border to which border-inline-end maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
... the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. Related
properties are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element. ...
...And 10 more matches
Microformats - HTML: Hypertext Markup Language
mantics & structured data in HTML, and provide an API to be used by search engines, aggregators, and other tools. These minimal patterns of HTML are used for marking up entities that range from fundamental to domain-specific information, such as people, organizations, events, and locations. Microformats use supporting vocabularies to describe objects and name-value pairs to assign values to their
properties. The
properties are carried in class attributes that can be added to any HTML element, while the data values re-use HTML element content and semantic attributes. Microformats2 is an update to microformats that provides a simpler way of annotating HTML structured syntax & vocabularies than previous approaches of using RDFa and microdata which require learning new attributes. Microformats are supp...
...arser encounters this data, it will know that this page contains a "card" which describes a person or organization named Alice Blogger with a URL of http://alice.example.com/. The parser makes this data available via APIs that can be used for different applications. As in this example, some markup patterns require only a single microformat root class name, which parsers use to find a few generic
properties such as name, url, photo. Microformats Prefixes All microformats consist of a root, and a collection of
properties.
Properties are all optional and potentially multivalued - applications needing a singular value may use the first instance of a property. Hierarchical data is represented with nested microformats, typically as property values themselves. All microformats class names use prefixes...
...rarchical data is represented with nested microformats, typically as property values themselves. All microformats class names use prefixes. Prefixes are syntax independent from vocabularies, which are developed separately. "h-*" for root class names, e.g. "h-card", "h-entry", "h-feed", and many more. These top-level root classes usually indicate a type and corresponding expected vocabulary of
properties. For example: h-card describes a person or organization h-entry describes episodic or date stamped online content like a blog post h-feed describes a stream or feed of posts You can find many more vocabularies on the microformats2 wiki. "p-*" for plain (text)
properties, e.g. "p-name", "p-summary" Generic plain text parsing, element text in general. On certain HTML elements, u...
...And 10 more matches
Object.create() - JavaScript
The Object.create() method creates a new object, using an existing object as the prototype of the newly created object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.create(proto, [
propertiesObject]) Parameters proto The object which should be the prototype of the newly-created object.
propertiesObject Optional If specified and not undefined, an object whose enumerable own
properties (that is, those
properties defined upon itself and not enumerable
properties along its prototype chain) specify property descriptors to be added to the newly-created object, with the corresponding property names. These...
... Exceptions The proto parameter has to be either null or an Object excluding primitive wrapper objects. If proto is neither of these a TypeError is thrown. ...
...y-created object.
propertiesObject Optional If specified and not undefined, an object whose enumerable own
properties (that is, those
properties defined upon itself and not enumerable
properties along its prototype chain) specify property descriptors to be added to the newly-created object, with the corresponding property names. These
properties correspond to the second argument of Object.define
Properties(). Return value A new object with the specified prototype object and
properties. Exceptions The proto parameter has to be either null or an Object excluding primitive wrapper objects. If proto is neither of these a TypeError is thrown. Custom and Null objects A new object created from a completely custom object (especially one created from the null object, which is basically a custom...
...And 10 more matches
jspage - Archive of obsolete content
f(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,iframe:$defined}); var d=f.
properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); new Document(c.contentWindow.documen...
...rtBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); }break;case"string":var l=Element.
Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.
Properties.get(m); return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.
Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); return this;},setProperty:function(m,n){var l=e[m];if(n==undefi...
...){var l=Element.
Properties.get(m); return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.
Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); return this;},set
Properties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); return(b[m])?!!n:(l)?n:n||null;},get
Properties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; (l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},remove
Properties:...
...And 9 more matches
Places utilities for JavaScript
showAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI, string aTitle, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker); boolean showMinimalAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI, string aTitle, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker); boolean showMinimalAddMultiBookmarkUI(array nsIURI aURIList); boolean showBookmark
Properties(int aId); boolean showFolder
Properties(int aId); boolean showAddFolderUI(string aTitle, int aDefaultInsertionPoint, boolean aShowPicker); array object getAnnotationsForURI(nsIURI aURI); array object getAnnotationsForItem(int aItemId); void setAnnotationsForURI(nsIURI aURI, object aAnnos); void setAnnotationsForURI(int aItemId, object aAnnos); ...
...stitute into the bundle at designated points See XUL:stringbundle for more information. Return type Returns a string from the default places stringbundle. getString() string getString(string key) Parameters key The name of the string to get. Return type Returns a string from the default places stringbundle. nodeIs() There are a ton of nodeIs(something) functions in here to check
properties of a bookmark node. The all take in the same argument and return a boolean true or false, so I'm just going to list them all in one lump: boolean nodeIsFolder(aNode) Determines whether or not a ResultNode is a Bookmark folder or not. boolean nodeIsBookmark(aNode) Determines whether or not a ResultNode represents a bookmarked URI. boolean nodeIsSeparator(aNode) Determines whether or not a ...
...sed on the left places pane so you just get a folder hierarchy. [optional] expandQueries True to make query items expand as new containers. For managing,you want this to be false, for menus and such, you want this to be true. Return type Returns a nsINavHistoryResult containing the contents of the folder. The result.root is guaranteed to be open. Bookmark Dialog Methods to show the bookmark
Properties dialog in its various modes. The showMinimalAdd methods open the dialog by its alternative URI. Thus they persist the dialog dimensions separately from the showAdd methods. Note these variants also do not return the dialog "performed" state since they may not open the dialog modally. showAddBookmarkUI() Shows the "Add Bookmark" dialog. showAddBookmarkUI(aURI, aTitle, ...
...And 9 more matches
Debugger - Firefox Developer Tools
The Debugger Object When called as a constructor, the Debugger object creates a new Debugger instance. new Debugger([global, ...]) Create a debugger object, and apply its addDebuggee method to each of the givenglobal objects to add them as the initial debuggees. Accessor
Properties of the Debugger Prototype Object A Debugger instance inherits the following accessor
properties from its prototype: enabled A boolean value indicating whether this Debugger instance's handlers, breakpoints, and the like are currently enabled. It is an accessor property with a getter and setter: assigning to it enables or disables this Debugger instance; reading it produces true if the instance is enabled, or false otherwise. This property is initially true in a freshly created Debugger instance. Th...
...rt of backstop, even if imperfect, will make life easier for debugger developers. For example, an uncaught exception hook may have access to browser-level features like the alert function, which this API's implementation does not, making it possible to present debugger errors to the developer in a way suited to the context.) Debugger Handler Functions Each Debugger instance inherits accessor
properties with which you can store handler functions for SpiderMonkey to call when given events occur in debuggee code. When one of the events described below occurs in debuggee code, the engine pauses the debuggee and calls the corresponding debugging handler on each Debugger instance that is observing the debuggee. The handler functions receive the Debugger instance as their this value. Most handler fun...
...escribed below occurs in debuggee code, the engine pauses the debuggee and calls the corresponding debugging handler on each Debugger instance that is observing the debuggee. The handler functions receive the Debugger instance as their this value. Most handler functions can return a resumption value indicating how the debuggee's execution should proceed. On a new Debugger instance, each of these
properties is initially undefined. Any value assigned to a debugging handler must be either a function or undefined; otherwise a TypeError is thrown. Handler functions run in the same thread in which the event occurred. They run in the compartment to which they belong, not in a debuggee compartment. onNewScript(script,global) New code, represented by the Debugger.Script instancescript, has been loade...
...And 9 more matches
HTMLInputElement - Web APIs
The HTMLInputElement interface provides special
properties and methods for manipulating the options, layout, and presentation of <input> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,...
... formAction string: Returns / Sets the element's formaction attribute, containing the URI of a program that processes information submitted by the element. This overrides the action attribute of the parent form. formEncType string...
... formAction string: Returns / Sets the element's formaction attribute, containing the URI of a program that processes information submitted by the element. This overrides the action attribute of the parent form. formEncType string: Returns / Se...
...And 9 more matches
Microdata DOM API - Web APIs
tting the string on spaces. If there are no tokens specified in the argument, then the method must return a NodeList containing all the top-level microdata items in the document. When the method is invoked on a Document object again with the same argument, the user agent may return the same object as the object returned by the earlier call. In other cases, a new NodeList object must be returned.
Properties element . itemValue [ = value ] Returns the element's value. Can be set, to change the element's value. Setting the value when the element has no itemprop attribute or when the element's value is an item throws an InvalidAccessError exception. element .
properties If the element has an itemscope attribute, returns an HTML
PropertiesCollection object with all the element's
properties. Otherwis...
...Value [ = value ] Returns the element's value. Can be set, to change the element's value. Setting the value when the element has no itemprop attribute or when the element's value is an item throws an InvalidAccessError exception. element .
properties If the element has an itemscope attribute, returns an HTML
PropertiesCollection object with all the element's
properties. Otherwise, an empty HTML
PropertiesCollection object. Code example This sample shows how the getItems() method can be used to obtain a list of all the top-level microdata items of a particular type given in the document: var cats = document.getItems("http://example.com/feline"); Once an element representing an item has been obtained, its
properties can be extracted using the
properties IDL attribute. This attribute returns an H...
...lection object. Code example This sample shows how the getItems() method can be used to obtain a list of all the top-level microdata items of a particular type given in the document: var cats = document.getItems("http://example.com/feline"); Once an element representing an item has been obtained, its
properties can be extracted using the
properties IDL attribute. This attribute returns an HTML
PropertiesCollection, which can be enumerated to go through each element that adds one or more
properties to the item. It can also be indexed by name, which will return an object with a list of the elements that add
properties with that name. Each element that adds a property also has an itemValue IDL attribute that returns its value. Code example This sample gets the first item of type "http://example.n...
...And 9 more matches
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. Three
properties with values that are strings <div itemscope> <p>My name is <span itemprop="name">Neil</span>.</p> <p>My band is called <...
...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. Three
properties with values that are strings <div itemscope> <p>My name is <span itemprop="name">Neil</span>.</p> <p>My band is called <span itempro...
...And 9 more matches
ui/button/action - Archive of obsolete content
"32": "./firefox-32.png" }, onClick: firstClick }); function firstClick(state) { console.log("You clicked '" + state.label + "'"); button.removeListener("click", firstClick); button.on("click", subsequentClicks); } function subsequentClicks(state) { console.log("You clicked '" + state.label + "' again"); } The listener is passed a state object that contains all the button's
properties. You can generate click events programmatically with the button's click() method. Disabling buttons You can disable a button by setting its disabled property to true. A disabled button will not generate click events and its icon will appear disabled: Updating state You can update all the button's
properties except for its id. By default, the button has global state: that is, its propertie...
...ss all open windows and tabs. You can set state to be specific to a window or tab using the button's state() method. To set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active tab the second parameter is an object containing the state
properties you wish to update. Here's an add-on with a button that disables itself when you click it, but only for the currently active window: var { ActionButton } = require("sdk/ui/button/action"); var button = ActionButton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onClick: disableForThisWindow }); function d...
...he state for a specific window or tab, call state(), passing in the window or tab you are interested in, and it will return the state: var labelForActiveTab = button.state("tab").label; To learn more about this, see the API documentation for state(). Destroying buttons When you've finished with a button, destroy it by calling its destroy() method. After that, any attempts to access any of its
properties or to call any of its methods will throw exceptions. Globals Constructors ActionButton(options) Creates an action button. Parameters options : object Required options: Name Type id string The button's ID. This is used internally to keep track of this button. The ID must be unique within your add-on. label string The button's...
...And 8 more matches
JXON - Archive of obsolete content
tributes names is case insensitive (always rendered in lower case), so objects' local property names set using JavaScript must always have some kind of capitalization (that is, at least one capital letter somewhere in their names), as you can see below. The following algorithms are somewhat based on the Parker convention, version 0.4, which prescribes the transformation of tags names into object
properties names and the recognition of the typeof of all the collected text content of each tag (plain text parsing); but with some differences (so, one can say that we follow a our convention). Moreover, all algorithms are equally lossless for the contemplated nodes. We consider the third algorithm as the most representative and practical JXON parsing algorithm. Now let's serialize doc -- the DOM tree -...
... JXONTree.prototype.valueOf = function () { return this.keyValue; }; JXONTree.prototype.toString = function () { return String(this.keyValue); }; JXONTree.prototype.getItem = function (nItem) { ...
...ttributes.length; nAttrLen++) { oAttrib = oXMLParent.attributes.item(nAttrLen); this.keyAttributes[oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim()); } } /* * Optional
properties... this.keyLength = nLength; this.attributesLength = nAttrLen; // this.DOMNode = oXMLParent; */ /* Object.freeze(this); */ } /* * Optional methods... ...
...And 8 more matches
Box Objects - Archive of obsolete content
content or structure of the document. It's relatively simple to determine what kind of content tree node will be created for a given element. A XUL element, for example, will have a XULElement type of content node. The layout objects that will be created are determined in a more complex manner. 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. However, there are a number of subt...
...mplies, they are available for all box-based elements. There are several subtypes of box object, although only a couple of them are generally used. The others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element. ...
... All values returned are in pixels. ...
...And 8 more matches
Document Object Model - Archive of obsolete content
avaScript. The various DOM objects have functions which may be accessed in script, however, it is important to note that the DOM is an API that is accessible by JavaScript. JavaScript itself is just a scripting language that can access these objects because Mozilla provides these objects for use. In JavaScript, there is always a single global object that is always available. You can refer to the
properties and methods of the global object without having to qualify them with an object. For example, if the global object has a 'name' property, you can change the name with the code 'name = 7', without having to specify any object to use. In a browser context, the window is the global object, and the same is also true for XUL. Naturally, this global object will be different for each window. Each frame w...
...typically be available yet. The window object isn't defined by any DOM specification, but in Mozilla is sometimes considered part of DOM Level 0, a name used by some developers to refer to the DOM-like functions before they were added to specifications. The actual document displayed in a window can be retrieved using the window's document property. Since it is one of the most commonly referenced
properties of the window, the document property is usually referenced without the 'window.' qualifier. Mozilla provides several different document objects depending on the kind of document. The three main documents are HTMLDocument, XMLDocument, and XULDocument, for HTML, XML and XUL documents respectively. Obviously, it is this latter type of document used for XUL. The three document types are very simila...
...Id('progmeter'); meter.hidden = false; var searchtext=document.getElementById('find-text').value; alert("Searching for \"" + searchtext + "\""); } Now, with that alert box in there, we know what should happen when we click the Find button. We could add additional code to get the selections from the drop-down boxes too. XUL Element DOM Every XUL element has a set of attributes, a set of
properties and a set of children. The attributes are declared in the source, for example, flex="1", is a flex attribute set to the value 1.
Properties are available in JavaScript using the dot syntax. For example, element.hidden refers to the hidden property of an element. The children are the child tags of the element and will be nested inside the element in the source. It is possible to manipulate ...
...And 8 more matches
Using the W3C DOM - Archive of obsolete content
The W3C Document Object Model provides interfaces DOM elements to scriptable objects. W3C DOM standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. ...
... standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. Using W3C standards means that code will run in compliant browsers with minimal need for cross-browser support, whereas code based on proprietary standards requires much more effort to be compatible with multiple user agents. ...
... the standards are moving target so support for newer features should be tested before use. Using W3C standards means that code will run in compliant browsers with minimal need for cross-browser support, whereas code based on proprietary standards requires much more effort to be compatible with multiple user agents. ...
...And 8 more matches
Index - Learn web development
l10n:priority, object literal, theory, this Congratulations, you've reached the end of our first JS objects article -- you should now have a good idea of how to work with objects in JavaScript -- including creating your own simple objects. You should also appreciate that objects are very useful as structures for storing related data and functionality -- if you tried to keep track of all the
properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names. Objects let us keep the information safely locked away in their own package, out of harm's way. 68 Object building practice Article, Beginner, Canvas, CodingScripting, Guide, Jav...
...'ve covered a lot in this module, so it must feel good to have reached the end! The final step before you move on is to attempt the assessment for the module -- this involves a number of related exercises that must be completed in order to create the final design -- a business card/gamer card/social media profile. 119 Handling different text directions Beginner, CSS, Learn, logical
properties, writing modes The concepts explained in this lesson are becoming increasingly important in CSS. An understanding of the block and inline direction -- and how text flow changes with a change in writing mode -- will be very useful going forward. It will help you in understanding CSS even if you never use a writing mode other than a horizontal one. 120 Images, media, and form eleme...
...different layout methods, so it is worth understanding the concepts here before moving on. 124 Styling tables Article, Beginner, CSS, CodingScripting, Guide, NeedsUpdate, Styling, Tables With styling tables now behind us, we need something else to occupy our time. The next article explores debugging CSS -- how to solve problems such as layouts not looking like they should, or
properties not applying when you think they should. This includes information on using browser DevTools to find solutions to your problems. 125 Test your skills: Images and Form elements Beginner, CSS 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. 126 Test your sk...
...And 8 more matches
Object prototypes - Learn web development
ee Introduction to objects). Objective: To understand JavaScript object prototypes, how prototype chains work, and how to add new methods onto the prototype property. A prototype-based language? JavaScript is often described as a prototype-based language -- to provide inheritance, objects can have a prototype object, which acts as a template object that it inherits methods and
properties from. An object's prototype object may also have a prototype object, which it inherits methods and
properties from, and so on. This is often referred to as a prototype chain, and explains why different objects have
properties and methods defined on other objects available to them. In JavaScript, a link is made between the object instance and its prototype (its __proto__ property, which is deriv...
... Note: It's important to understand that there is a distinction between an object's prototype (available via Object.getPrototypeOf(obj), or via the deprecated __proto__ property) and the prototype property on constructor functions. ...
...on1 object has a valueOf() method available on it, as defined on its constructor, Person(), and it doesn't. So the browser checks to see if the person1's prototype object has a valueOf() method available on it. It doesn't, then the browser checks person1's prototype object's prototype object, and it has. So the method is called, and all is good! Note: We want to reiterate that the methods and
properties are not copied from one object to another in the prototype chain. They are accessed by walking up the chain as described above. Note: Before ECMAScript 2015, there wasn't officially a way to access an object's prototype directly -- the "links" between the items in the chain are defined in an internal property, referred to as [[prototype]] in the specification for the JavaScript language (see E...
...And 8 more matches
nsITreeView
aTransfer); boolean canDropBeforeAfter(in long index, in boolean before); Obsolete since Gecko 1.8 boolean canDropOn(in long index); Obsolete since Gecko 1.8 void cycleCell(in long row, in nsITreeColumn col); void cycleHeader(in nsITreeColumn col); void drop(in long row, in long orientation, in nsIDOMDataTransfer dataTransfer); AString getCell
Properties(in long row, in nsITreeColumn col, in nsISupportsArray
properties Obsolete since Gecko 22); AString getCellText(in long row, in nsITreeColumn col); AString getCellValue(in long row, in nsITreeColumn col); AString getColumn
Properties(in nsITreeColumn col, in nsISupportsArray
properties Obsolete since Gecko 22); AString getImageSrc(in long row, in nsITreeColumn c...
...lValue(in long row, in nsITreeColumn col); AString getColumn
Properties(in nsITreeColumn col, in nsISupportsArray
properties Obsolete since Gecko 22); AString getImageSrc(in long row, in nsITreeColumn col); long getLevel(in long index); long getParentIndex(in long rowIndex); long getProgressMode(in long row, in nsITreeColumn col); AString getRow
Properties(in long index, in nsISupportsArray
properties Obsolete since Gecko 22); boolean hasNextSibling(in long rowIndex, in long afterIndex); boolean isContainer(in long index); boolean isContainerEmpty(in long index); boolean isContainerOpen(in long index); boolean isEditable(in long row, in nsITreeColumn col); boolean isSelectable(in long row, in ns...
... something on this view. The orientation paramater specifies before/on/after the given row. void drop( in long row, in long orientation, in nsIDOMDataTransfer dataTransfer ); Parameters row The index of the row. orientation The position around the given row. Defined in constants. dataTransfer This parameter, added in Gecko 1.9.2, provides the data that has been dropped. getCell
Properties() An atomized list of
properties for a given cell. Each property, x, that the view gives back will cause the CSS ::moz-tree-cell-*(x) pseudoelement to be matched on the treechildren element. See getRow
Properties() for an example. AString getCell
Properties( in long row, in nsITreeColumn col, in nsISupportsArray
properties ); Parameters row The index of the row. col The current col...
...And 8 more matches
Examples of web and XML development using the DOM - Web APIs
This chapter provides some longer examples of web and XML development using the DOM. Wherever possible, the examples use common APIs, tricks, and patterns in JavaScript for manipulating the document object. ...
...In this case, you are manipulating the individual styles directly. In the next example (see Example 4), you can use stylesheets and their rules to change styles for whole documents. <!DOCTYPE html> <html lang="en"> <head> <title>Chan...
...In this case, you are manipulating the individual styles directly. ...
...And 8 more matches
Using CSS transitions - CSS: Cascading Style Sheets
CSS transitions provide a way to control animation speed when changing CSS
properties. Instead of having property changes take effect immediately, you can cause the changes in a property to take place over a period of time. For example, if you change the color of an element from white to black, usually the change is instantaneous. With CSS transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized. Animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser. ...
...black, usually the change is instantaneous. With CSS transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized. Animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser. CSS transitions let you decide which
properties to animate (by listing them explicitly), when the animation will start (by setting a delay), how long the transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g. linearly or quick at the beginning, slow at the end). Which CSS
properties can be transitioned? The Web author can define which property has to be animated and in which way. Th...
... The auto value is often a very complex case. ...
...And 8 more matches
Object.defineProperty() - JavaScript
bj The object on which to define the property. prop The name or Symbol of the property to be defined or modified. descriptor The descriptor for the property being defined or modified. Return value The object that was passed to the function. Description This method allows a precise addition to or modification of a property on an object. Normal property addition through assignment creates
properties which show up during property enumeration (for...in loop or Object.keys method), whose values may be changed, and which may be deleted. This method allows these extra details to be changed from their defaults. By default, values added using Object.defineProperty() are immutable and not enumerable. Property descriptors present in objects come in two main flavors: data descriptors and accessor des...
...nd accessor descriptors. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter pair of functions. A descriptor must be one of these two flavors; it cannot be both. Both data and accessor descriptors are objects. They share the following optional keys (note: the default value is in the case of defining
properties using Object.defineProperty()): configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. Defaults to false. enumerable true if and only if this property shows up during enumeration of the
properties on the corresponding object. Defaults to false. A data descriptor also has the following optiona...
...ue being assigned to the property) and with this set to the object through which the property is assigned. Defaults to undefined. If a descriptor has neither of value, writable, get and set keys, it is treated as a data descriptor. If a descriptor has both value or writable and get or set keys, an exception is thrown. Bear in mind that these attributes are not necessarily the descriptor's own
properties. ...
...And 8 more matches
passwords - Archive of obsolete content
redentials in the Password Manager. You can store different sorts of credentials, as outlined in the "Credentials" section below. Remove stored credentials from the Password Manager. Credentials In this API, credentials are represented by objects. You create credential objects to pass into the API, and the API also returns credential objects to you. The sections below explain both the
properties you should define on credential objects and the
properties you can expect on credential objects returned by the API. All credential objects include username and password
properties. Different sorts of stored credentials include various additional
properties, as outlined in this section. You can use the Passwords API with three sorts of credentials: Add-on credentials HTML form credentials ...
... password The password. url For an add-on credential, this property is of the form: addon:<addon-id>, where <addon-id> is the add-on's Program ID. You don't supply this value when storing an add-on credential: it is automatically generated for you. ...
...r, under "Site", in brackets after the URL. For example, if the realm for a credential is "User Registration", then its "Site" field will look something like: addon:jid0-01mBBFyu0ZAXCFuB1JYKooSTKIc (User Registration) HTML Form Credential If a web service uses HTML forms to authenticate its users, then the corresponding credential is an HTML Form credential. It contains the following
properties: username The username. password The password. url The URL for the web service which requires the credential. You should omit anything after the hostname and (optional) port. formSubmitURL The value of the form's "action" attribute. You should omit anything after the hostname and (optional) port. If the form doesn't contain an "action" attri...
...And 7 more matches
places/bookmarks - Archive of obsolete content
nce, unsaved let bookmark = Bookmark({ title: "Mozilla", url: "http://mozilla.org" }); // Attempt to save the bookmark instance to the Bookmarks database // and store the emitter let emitter = save(bookmark); // Listen for events emitter.on("data", function (saved, inputItem) { // on a "data" event, an item has been updated, passing in the // latest snapshot from the server as `saved` (with
properties // such as `updated` and `id`), as well as the initial input // item as `inputItem` console.log(saved.title === inputItem.title); // true console.log(saved !== inputItem); // true console.log(inputItem === bookmark); // true }).on("end", function (savedItems, inputItems) { // Similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `sa...
...l of our updated saves. Only explicitly saved // items are returned in this array -- the `group` won't be // present here. console.log(saves[0].title); // "Ran" console.log(saves[2].group.title); // "Guitars" }); Searching for bookmarks Bookmarks can be queried with the search() function, which accepts a query object or an array of query objects, as well as a query options object. Query
properties are AND'd together within a single query object, but are OR'd together across multiple query objects. let { search, UNSORTED } = require("sdk/places/bookmarks"); // Simple query with one object search( { query: "firefox" }, { sort: "title" } ).on("end", function (results) { // results matching any bookmark that has "firefox" // in its URL, title or tag, sorted by title }); // Multiple ...
...; // Multiple queries are OR'd together search( [{ query: "firefox" }, { group: UNSORTED, tags: ["mozilla"] }], { sort: "title" } ).on("end", function (results) { // Our first query is the same as the simple query above; // all of those results are also returned here. Since multiple // queries are OR'd together, we also get bookmarks that // match the second query. The second query's
properties // are AND'd together, so results that are in the platform's unsorted // bookmarks folder, AND are also tagged with 'mozilla', get returned // as well in this query }); Globals Constructors Bookmark(options) Creates an unsaved bookmark instance. Parameters options : object Required options: Name Type title string The title for the bookmark. R...
...And 7 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
he preferences window; find the preferences listed in Table 1 and double-click on them to set them accordingly. Some of these preferences do not exist--to create them, right-click, select "New>Boolean", and type in the name and set the value accordingly. Install the DOM Inspector The DOM Inspector is an extension that lets you examine HTML and XUL DOM tree structures, JavaScript objects and CSS
properties, etc. This is not required for developing extensions, but it is handy to have around. Install extensions for Firefox from the Mozilla Add-ons website. Optional - Install Firebug and Chromebug Chromebug is used by the Firebug development team to develop Firebug. You can use it to help debug Firefox extensions as well as to inspect and learn how the Firefox UI (Chrome) is constructed. You can l...
...sting 9). The clock.dtd file inside the fr-FR folder must be encoded as UTF-8. Listing 9: Content for clock.dtd locale\en-US\clock.dtd: <!ENTITY helloworld.clock "Clock"> <!ENTITY helloworld.currentTime "Current Time"> locale\fr-FR\clock.dtd: <!ENTITY helloworld.clock "Horloge"> <!ENTITY helloworld.currentTime "Heure courante"> Replacing User Interface messages within JavaScript files with
properties references It may happen your extension displays some useful messages such as alerts to the user. Though they are nested in JavaScript, the strings should be localized too, for the sake of UI consistency. Suppose you have these strings nested in a .js file: if ( password == userPassword ) { oPrefs.setBoolPref("access.authenticated", true); } else { alert ("Invalid password"); ...... functio...
... user. Though they are nested in JavaScript, the strings should be localized too, for the sake of UI consistency. Suppose you have these strings nested in a .js file: if ( password == userPassword ) { oPrefs.setBoolPref("access.authenticated", true); } else { alert ("Invalid password"); ...... function clear() { sure = confirm("Are you sure?"); First, you have to find or create a myextension.
properties file in your locale folder (Notice: always stick to UTF-8). Then you simply write variable names and the sentences or words that should appear to the final user. Something like : wrongPassMessage=Invalid password areYouSureMessage=Are you sure? (where Invalid password and Are you sure? are the strings to be displayed to the final user) Notice : a simple sign is enough Now you go back to the...
...And 7 more matches
Introduction to CSS layout - Learn web development
ws you to precisely control the placement of boxes inside other boxes. static positioning is the default in normal flow, but you can cause elements to be laid out differently using other values, for example always fixed to the top of the browser viewport. Table layout -- features designed for styling the parts of an HTML table can be used on non-table elements using display: table and associated
properties. Multi-column layout -- The Multi-column layout
properties can cause the content of a block to layout in columns, as you might see in a newspaper. The display property The main methods of achieving page layout in CSS are all values of the display property. This property allows us to change the default way something displays. Everything in normal flow has a value of display, used as the defaul...
...ents for their semantic meaning, without being concerned about how they will look. The way they look is something that you can change. In addition to being able to change the default presentation by turning an item from block to inline and vice versa, there are some bigger layout methods that start out as a value of display. However, when using these, you will generally need to invoke additional
properties. The two values most important for our purposes when discussing layout are display: flex and display: grid. Flexbox Flexbox is the short name for the Flexible Box Layout Module, designed to make it easy for us to lay things out in one dimension -- either as a row or as a column. To use flexbox, you apply display: flex to the parent element of the elements you want to lay out; all its direct chi...
...container, leaving any extra space at the end of the row. Flexbox Example 1 * {box-sizing: border-box;} .wrapper > div { border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .wrapper { display: flex; } <div class="wrapper"> <div class="box1">One</div> <div class="box2">Two</div> <div class="box3">Three</div> </div> In addition to the above
properties that can be applied to the flex container, there are
properties that can be applied to the flex items. These
properties, among other things, can change the way that the items flex, enabling them to expand and contract to fit into the available space. As a simple example of this, we can add the flex property to all of our child items, with a value of 1. This will cause all of the items to grow an...
...And 7 more matches
Inheritance in JavaScript - Learn web development
avaScript that inherits from another object? Let's explore how to do this with a concrete example. Getting started First of all, make yourself a local copy of our oojs-class-inheritance-start.html file (see it running live also). Inside here you'll find the same Person() constructor example that we've been using all the way through the module, with a slight difference -- we've defined only the
properties inside the constructor: function Person(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; }; The methods are all defined on the constructor's prototype. For example: Person.prototype.greeting = function() { alert('Hi! I\'m ' + this.name.first + '.'); }; Note: In the source code, you'll als...
...nstructor simply defines the new subject property that teachers are going to have, which generic people don't have. As a note, we could have simply done this: function Teacher(first, last, age, gender, interests, subject) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; this.subject = subject; } But this is just redefining the
properties anew, not inheriting them from Person(), so it defeats the point of what we are trying to do. It also takes more lines of code. Inheriting from a constructor with no parameters Note that if the constructor you are inheriting from doesn't take its property values from parameters, you don't need to specify them as additional arguments in call(). So, for example, if you had something really simple...
... lines of code. Inheriting from a constructor with no parameters Note that if the constructor you are inheriting from doesn't take its property values from parameters, you don't need to specify them as additional arguments in call(). So, for example, if you had something really simple like this: function Brick() { this.width = 10; this.height = 20; } You could inherit the width and height
properties by doing this (as well as the other steps described below, of course): function BlueGlassBrick() { Brick.call(this); this.opacity = 0.5; this.color = 'blue'; } Note that we've only specified this inside call() -- no other parameters are required as we are not inheriting any
properties from the parent that are set via parameters. Setting Teacher()'s prototype and constructor reference A...
...And 7 more matches
JS_InitClass
Syntax JSObject * JS_InitClass(JSContext *cx, JS::HandleObject obj, JS::HandleObject parent_proto, const JSClass *clasp, JSNative constructor, unsigned nargs, const JSPropertySpec *ps, const JSFunctionSpec *fs, const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs); Name Type Description cx JSContext * Pointer to a JS context from which to derive runtime information. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. ...
...nlike other JSNatives, this function must not call JS_THIS or JS_THIS_OBJECT. Instead it must create a new object and return it. nargs unsigned Number of arguments for the constructor. ps JSPropertySpec * Either NULL or a pointer to the first element of an array of JSPropertySpecs, terminated by the null JSPropertySpec, which can be written {0, 0, 0, 0, 0}. These
properties, if any, are added to the class's new prototype object. All instances of the new class will inherit these
properties via the prototype chain. fs JSFunctionSpec * Either NULL or a pointer to the first element of an array of JSFunctionSpecs, terminated by JS_FS_END. These functions, if any, are added to the class's new prototype object. All instances of the new class will inherit the...
...ese functions, if any, are added to the class's new prototype object. All instances of the new class will inherit these methods via the prototype chain. (This is the JavaScript equivalent of public, non-static methods in C++ or Java.) static_ps JSPropertySpec * Either NULL or a pointer to the first element of an array of JSPropertySpecs, terminated by the null JSPropertySpec. These
properties, if any, are added to the new class's constructor. (This is the nearest JavaScript equivalent of public static member variables in C++ or public static fields in Java.) static_fs JSFunctionSpec * Either NULL or a pointer to the first element of an array of JSFunctionSpecs, terminated by JS_FS_END. These functions, if any, are added to the new class's constructor. (This is the JavaS...
...And 7 more matches
Xray vision
n Gecko ensures that there's asymmetric access between code at different privilege levels: so for example, content code can't access objects created by chrome code, but chrome code can access objects created by content. However, even the ability to access content objects can be a security risk for chrome code. JavaScript's a highly malleable language. Scripts running in web pages can add extra
properties to DOM objects (also known as expando
properties) and even redefine standard DOM objects to do something unexpected. If chrome code relies on such modified objects, it can be tricked into doing things it shouldn't. For example: window.confirm() is a DOM API that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "OK" or "Cancel". A web page ...
...s result to represent user confirmation would be deceived. This would be very naive, of course, but there are more subtle ways in which accessing content objects from chrome can cause security problems. This is the problem that Xray vision is designed to solve. When a script accesses an object using Xray vision it sees only the native version of the object. Any expandos are invisible, and if any
properties of the object have been redefined, it sees the original implementation, not the redefined version. So in the example above, chrome code calling the content's window.confirm() would get the original version of confirm(), not the redefined version. It's worth emphasizing that even if content tricks chrome into running some unexpected code, that code does not run with chrome privileges. So this...
...to illustrate how Xray vision works. Waiving Xray vision Xray vision is a kind of security heuristic, designed to make most common operations on untrusted objects simple and safe. However, there are some operations for which they are too restrictive: for example, if you need to see expandos on DOM objects. In cases like this you can waive Xray protection, but then you can no longer rely on any
properties or functions being, or doing, what you expect. Any of them, even setters and getters, could have been redefined by untrusted code. To waive Xray vision for an object you can use Components.utils.waiveXrays(object), or use the object's wrappedJSObject property: // chrome code var waivedWindow = Components.utils.waiveXrays(gBrowser.contentWindow); var transfer = waivedWindow.confirm("Transfer a...
...And 7 more matches
Debugger.Frame - Firefox Developer Tools
ch the execution is taking place, and so on. For a given Debugger instance, SpiderMonkey creates only one Debugger.Frame instance for a given visible frame. Every handler method called while the debuggee is running in a given frame is given the same frame object. Similarly, walking the stack back to a previously accessed frame yields the same frame object as before. ...
...me frame object as before. Debugger code can add its own
properties to a frame object and expect to find them later, use == to decide whether two expressions refer to the same frame, and so on. (If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Frame instance for a given frame. ...
...Note that frames only become inactive at times that are predictable for the debugger: when the debuggee runs, or when the debugger removes frames from the stack itself. ...
...And 7 more matches
border - CSS: Cascading Style Sheets
The border shorthand CSS property sets an element's border. It sets the values of border-width, border-style, and border-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ty sets an element's border. It sets the values of border-width, border-style, and border-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: border-color border-style border-width Syntax /* style */ border: solid; /* width | style */ border: 2px dotted; /* style | color */ border: outset #f33; /* width | style | color */ border: medium dashed green; /* Global values */ border: inherit; border: initial; border: unset; The border property may be specified using one, two, or three of the values listed below. The order of t...
...its style is not defined. This is because the style defaults to none. Values <line-width> Sets the thickness of the border. Defaults to medium if absent. See border-width. <line-style> Sets the style of the border. Defaults to none if absent. See border-style. <color> Sets the color of the border. Defaults to currentcolor if absent. See border-color. Description As with all shorthand
properties, any omitted sub-values will be set to their initial value. Importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its initial value, i.e., none. The border shorthand is especially useful when you want all four borders to be the same. To make them different from each other, however, you can use the longhand border-width, border-style, and border-col...
...And 7 more matches
font - CSS: Cascading Style Sheets
The font CSS shorthand property sets all the different
properties of an element's font. Alternatively, it sets an element's font to a system font. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand
properties). Though not directly settable by font, the longhands font-size-adjust and font-kerning are also reset to their initial values. ...
...://github.com/mdn/interactive-examples and send us a pull request. As with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand
properties). Though not directly settable by font, the longhands font-size-adjust and font-kerning are also reset to their initial values. Constituent
properties This property is a shorthand for the following CSS
properties: font-family font-size font-stretch font-style font-variant font-weight line-height Syntax The font property may be specified as either a single keyword, which will select a system font, or as a shorthand for various font-related
properties. If font is specified as a system keyword, it must be one of: caption, icon, menu,...
...h font-style font-variant font-weight line-height Syntax The font property may be specified as either a single keyword, which will select a system font, or as a shorthand for various font-related
properties. If font is specified as a system keyword, it must be one of: caption, icon, menu, message-box, small-caption, status-bar. ...
...And 7 more matches
Inheritance and the prototype chain - JavaScript
bjects in JavaScript are instances of Object which sits on the top of a prototype chain. While this confusion is often considered to be one of JavaScript's weaknesses, the prototypal inheritance model itself is, in fact, more powerful than the classic model. It is, for example, fairly trivial to build a classic model on top of a prototypal model. Inheritance with the prototype chain Inheriting
properties JavaScript objects are dynamic "bags" of
properties (referred to as own
properties). JavaScript objects have a link to a prototype object. When trying to access a property of an object, the property will not only be sought on the object but on the prototype of the object, the prototype of the prototype, and so on until either a property with a matching name is found or the end of the prototype c...
...t should not be confused with the func.prototype property of functions, which instead specifies the [[Prototype]] to be assigned to all instances of objects created by the given function when used as a constructor. The Object.prototype property represents the Object prototype object. Here is what happens when trying to access a property: // Let's create an object o from function f with its own
properties a and b: let f = function () { this.a = 1; this.b = 2; } let o = new f(); // {a: 1, b: 2} // add
properties in f function's prototype f.prototype.b = 3; f.prototype.c = 4; // do not set the prototype f.prototype = {b:3,c:4}; this will break the prototype chain // o.[[Prototype]] has
properties b and c. // o.[[Prototype]].[[Prototype]] is Object.prototype. // Finally, o.[[Prototype]].[[Pro...
... p is an object that inherits from o p.a = 4; // creates a property 'a' on p console.log(p.m()); // 5 // when p.m is called, 'this' refers to p. // So when p inherits the function m of o, // 'this.a' means p.a, the property 'a' of p Using prototypes in JavaScript Let's look at what happens behind the scenes in a bit more detail. In JavaScript, as mentioned above, functions are able to have
properties. All functions have a special property named prototype. Please note that the code below is free-standing (it is safe to assume there is no other JavaScript on the webpage other than the below code). For the best learning experience, it is highly recommended that you open a console, navigate to the "console" tab, copy-and-paste in the below JavaScript code, and run it by pressing the Enter/Return ...
...And 7 more matches
Array - JavaScript
ular use, you might consider using typed arrays. Arrays cannot use strings as element indexes (as in an associative array) but must use integers. Setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection. The array's object
properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named
properties. Common operations Create an Array let fruits = ['Apple', 'Banana'] console.log(fruits.length) // 2 Access an Array item using the index position let first = fruits[0] // Apple let last = fruits[fruits.length - 1] // Banana Loop over an Array fruits.for...
...operty minus 1. Using an invalid index number returns undefined. ...
... For example, if you had an object with a property named 3d, it can only be referenced using bracket notation. ...
...And 7 more matches
Object.assign() - JavaScript
The Object.assign() method copies all enumerable own
properties from one or more source objects to a target object. It returns the target object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.assign(target, ...sources) Parameters target The target object -- what to apply the sources'
properties to, which is returned after it is modified. sources The source object(s) -- objects containing the
properties you want to apply. Return value The target object. ...
... project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.assign(target, ...sources) Parameters target The target object -- what to apply the sources'
properties to, which is returned after it is modified. sources The source object(s) -- objects containing the
properties you want to apply. Return value The target object. Description
Properties in the target object are overwritten by
properties in the sources if they have the same key. Later sources'
properties overwrite earlier ones. The Object.assign() method only copies enumerable and own
properties from a source object to a target object. It uses [[Get]] on the source and [[Set]] on the target, so it will invoke getters and setters. Therefore it assigns
properties, versus copying o...
...object are overwritten by
properties in the sources if they have the same key. Later sources'
properties overwrite earlier ones. The Object.assign() method only copies enumerable and own
properties from a source object to a target object. It uses [[Get]] on the source and [[Set]] on the target, so it will invoke getters and setters. Therefore it assigns
properties, versus copying or defining new
properties. This may make it unsuitable for merging new
properties into a prototype if the merge sources contain getters. For copying property definitions (including their enumerability) into prototypes, use Object.getOwnPropertyDescriptor() and Object.defineProperty() instead. Both String and Symbol
properties are copied. In case of an error, for example if a property is non-writable, a TypeError is rai...
...And 7 more matches
Object.freeze() - JavaScript
In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in. The source for this interactive example is stored in a GitHub repository. ...
...In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in. The source for this interactive example is stored in a GitHub repository. ...
...In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in. The source for this interactive example is stored in a GitHub repository. ...
...And 7 more matches
SVG documentation index - SVG: Scalable Vector Graphics
, SVG Event attributes always have their name starting with "on" followed by the name of the event for which they are intended. They specifies some script to run when the event of the given type is dispatched to the element on which the attributes are specified. 17 SVG Presentation Attributes Attribute, Beginner, Draft, Reference, SVG SVG presentation attributes are CSS
properties that can be used as attributes on SVG elements. 18 SVG Styling Attributes Attribute, Beginner, NeedsExample, Reference, SVG The SVG styling attributes are all the attributes that can be specified on any SVG element to apply CSS styling effects. 19 accent-height Deprecated, NeedsExample, SVG, SVG Attribute The accent-height attribute defines the distance f...
...ers, SVG, SVG Attribute The diffuseConstant attribute represents the kd value in the Phong lighting model. In SVG, this can be any non-negative number. 58 direction SVG, SVG Attribute The direction attribute specifies the inline-base direction of a <text> or <tspan> element. It defines the start and end points of a line of text as used by the text-anchor and inline-size
properties. It also may affect the direction in which characters are positioned if the unicode-bidi property's value is either embed or bidi-override. 59 display SVG, SVG Attribute The display attribute lets you control the rendering of graphical or container elements. 60 divisor Filters, SVG, SVG Attribute The divisor attribute specifies the value by which the resu...
...bute mainly used to bind a given <mask> element with the element the attribute belongs to. 135 maskContentUnits SVG, SVG Attribute The maskContentUnits attribute indicates which coordinate system to use for the contents of the <mask> element. 136 maskUnits SVG, SVG Attribute The maskUnits attribute indicates which coordinate system to use for the geometry
properties of the <mask> element. 137 mathematical Deprecated, SVG, SVG Attribute The mathematical attribute indicates the alignment coordinate for glyphs to achieve mathematical baseline alignment for horizontally oriented glyph layouts. 138 max SVG, SVG Attribute The max attribute specifies the maximum value of the active animation duration. 139 media ...
...And 7 more matches
JavaScript Daemons Management - Archive of obsolete content
.onstop = fInit; fInit.call(oOwner, this.INDEX, this.length, this.BACKW); } } /* Create the Daemon.blank() constructor and the global Daemon.context object */ Daemon.blank = function () {}; Daemon.context = Daemon.blank.prototype; /* Make love with the GC :-) */ Daemon.blank.prototype = /* Important! ...
...ototype; Daemon.context.constructor = Object; /* These
properties can be manually reconfigured after the creation of the daemon */ Daemon.prototype.owner = Daemon.context; Daemon.prototype.task = null; Daemon.prototype.rate = 100; Daemon.prototype.length = Infinity; Daemon.prototype.reversals = 0; Daemon.prototype.onstart = null; Daemon.prototype.onstop = null; /* These
properties should be read-only after the creation of the daemon */ Daemon.prototype.SESSION = -1; Daemon.prototype.INDEX = 0; Daemon.prototype.PAUSED = true; Daemon.prototype.BACKW = true; /* SYSTEM REQUIRED Daemon global object methods */ Daemon.forceCall = function (oDmn) { oDmn.INDEX += oDmn.BACKW ? -1 : 1; var bBreak = oDmn.task.call(oDmn.owner, oDmn.INDEX, oDmn.length, oDm...
...tion which will be synchronously invoked whenever the start event occurs. It will be assigned to the onstart property. It will be called with three arguments: index (the iterative index of each invocation), length (the number of total invocations assigned to the daemon - finite or Infinity), and backwards (a boolean expressing whether the process is going backwards or not). Daemon global object
properties Daemon.context An empty object used as the default this object when the thisObject is not specified during the construction of the daemon. If you want your callback function to be invoked with a null this object, you have to manually set the owner property to null. Daemon global object methods Daemon.forceCall(daemonInstance) Forces a callback to the daemonInstance.task function regardl...
...And 6 more matches
Custom XUL Elements with XBL - Archive of obsolete content
d by the binding. Taken from the XBL page. This somewhat cryptic explanation describes a very simple concept: with XBL you can create your own custom elements. XBL is heavily used in XUL, but in theory it could be applied to any XML language. XBL was submitted to the W3C for standardization, but for now it's used in XUL almost exclusively. With XBL you can define new elements and define their
properties, attributes, methods and event handlers. Many complex elements such as tabs, buttons and input controls are implemented using XBL and simpler XUL elements. As explained earlier, XUL is really just boxes, text and images. We'll look into XBL using a modified version of the Hello World extension. Download the Hello World XBL project, build it and test it for a while. You should see a new item in t...
..." />, then those attribute values are "inherited" to the content nodes that have this special attribute. The value attribute of the xul:label element would be "Pete". The oncommand attribute of the button has some code you've probably never seen before: document.getBindingParent(this). This code gets the DOM object that corresponds to the xshelloperson tag, allowing you access to its methods and
properties. In this case we're calling the remove method, which we will discuss later on. If you need to create a container element, or any other element that has child nodes, you can use the XBL children tag in your content to indicate the place where the child nodes will be inserted. The includes attribute gives you a little more flexibility with children, but it's rarely needed. One important thing to...
...s="value=name" /> And then, in order to get a reference to the node from the JS code in your binding, we use the getAnonymousElementByAttribute DOM method: let nameLabel = document.getAnonymousElementByAttribute( this, "anonid", "xulshoolhello-name-label"); Implementation The implementation section defines most of the scripting side of your element. Here you can define methods and
properties, as well as a constructor and a destructor for your element. JavaScript code is enclosed in CDATA sections to prevent JS and XML syntax conflicts.
Properties and Fields The field and property tags allow you to handle element variables and access them from outside of the element. A field holds a value that can be changed, except when the readonly attribute is set. It's very similar to a JS obje...
...And 6 more matches
Adding a new CSS property
stem is the part of the code in Gecko that is responsible for producing a computed value for every property for every element. See the Gecko Overview for more information about the style system. This document assumes that you have a specifcation for the property available. Issues about how to write such a specification (including things such as whether it is appropriate to use prefixes or when
properties should be inherited by default) are not covered here. If you need more details on any of the points mentioned here, a good place to find them is by looking at other changes in the version control history of the files mentioned. Getting started First, you'll want to add an appropriate test entry to property_database.js. See the documentation at the top of the file and the other entries for exa...
...f your new property to be added to many of the mochitests in layout/style/test, which can be run with the command "./mach mochitest -f plain layout/style/". Then, unless you're implementing a shorthand property, you need to decide which style struct the computed value of the property should go in. (Again, see the Gecko Overview for more information.) It should generally be grouped with related
properties. ...
...n layout/style/test, which can be run with the command "./mach mochitest -f plain layout/style/". Then, unless you're implementing a shorthand property, you need to decide which style struct the computed value of the property should go in. (Again, see the Gecko Overview for more information.) It should generally be grouped with related
properties. Remember that each style struct contains only
properties that inherit by default or only
properties that do not. ...
...And 6 more matches
Localization and Plurals
This page is to help explain how to localize these strings so that the correct plural form is shown to the user. For example, "1 page" vs "2 pages". If you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to Developing with PluralForm. You may also need to localize the initial strings for your code, so it would be good to read through at least the Usage section as well. Usage Here are a couple terms used in this page to help keep things clear: plural rule: For a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. ...
...language, there is a grammatical rule on how to change words, depending on the number qualifying the word. Different languages can have different rules. plural form: For a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". In this case, there are 2 forms, but other languages can have 1 or many more. If you're here for pluralRule in the chrome/global/intl.
properties file, you'll need to figure out what plural rule to choose for your localization. This plural rule is used to determine how many plural forms are needed for each word that needs to be localized, with plurals in mind. For all other
properties files that link to this page, you'll need to provide enough plural forms of the desired word, and separate them with semi-colons (;). If you don't know how ...
... List of Plural Rules This section contains a list of plural rules ordered by their plural rule number. ...
...And 6 more matches
Localizing with Koala
ist that appears when you click on the arrow pointing down situated next to the sidebar's [x] button). You should now see the results of the comparison in the "Koala file view" sidebar. Translating files Let's translate the searchbar-related strings mentioned in the beginning of this document. They can be found in two files, inside the browser/chrome/browser directory: searchbar.dtd, search.
properties. The difference between DTD and .
properties files in the moment when they are used by the application. DTD's files are read by the XML parser, which goes through the XUL files used in Mozilla to create the interface when it launches. The .
properties files are used in the JavaScript code while the application is already running. That's why the string "Add %s..." (where %s is replaced by the searc...
...It has to be generated every time the user switches between pages. On the other hand, "Manage Search Engines..." is generated only once, on start-up, and doesn't need to change. ...
... Note how Koala is smart enough to insert this entity before searchEndCap.label. This is helpful for keeping the localization files clean and tidy at all times. The string to translated is selected so that you can translate it without any further clicking. When you are done with translating the cmd_engineManager.label entity, save the file. Now let's create the other file. Double-click on search.
properties and click "OK" when Koala asks if you want to create this file. From the sidebar, add the cmd_addFoundEngine string to the newly-created search.
properties file in your locale file structure. Translate the cmd_addFoundEngine string. Notice that the .
properties files have a different syntax than the DTD files. They're just a simple key=value mapping. Save the file to save your work. Re-running t...
...And 6 more matches
JIT Optimization Strategies
replacing it with a constant reference to the object. When this optimization is successful, property access is eliminated entirely and replaced with an inline constant. The different success and failure conditions are documented below: GetProp_StaticName Attempts to optimize a property access on window which refers to a property on the global object. GetProp_TypedObject Optimizes accesses to
properties on TypedObjects. GetProp_DefiniteSlot Optimizes access to a well-known regular property on an object. For this optimization to succeed, the property needs to be well-defined on the object. For objects constructed by constructor functions, this means that the property needs to be defined in the constructor, before any complex logic occurs within the constructor. This is the best case for a regu...
...e best case for a regular "field" type property that is not turned into a constant. It compiles down to a single CPU-level load instruction. function SomeConstructor() { this.x = 10; // x is a definite slot property this.y = 10; // y is a definite slot property someComplicatedFunctionCall(); this.z = 20; // z is not a definite slot property. } In the above example, the
properties x and y can always be determined to exist on any instance of SomeConstructor at definite locations, allowing the engine to infer deterministically the position of x without a shape guard. This optimization can fail for a number of reasons. If the types observed at the property access are polymorphic (more than one type), this optimization cannot succeed. Furthermore, even if the object type is m...
...tion can fail for a number of reasons. If the types observed at the property access are polymorphic (more than one type), this optimization cannot succeed. Furthermore, even if the object type is monomorphic, the optimization will fail if the property being accessed is not a definite slot as described above. GetProp_Unboxed Similar to GetProp_DefiniteSlot. ...
...And 6 more matches
USBDevice - Web APIs
USBDevice.configurations Read only An array of device-specific interfaces for controlling a paired USB device. USBDevice.deviceClass Read only One of three
properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two
properties are USBDevice.deviceSubclass and USBDevice.deviceprotocol. ...
...e WebUSB API provides access to metadata about a paired USB device and methods for controlling it.
Properties USBDevice.configuration Read only A USBConfiguration object for the currently selected interface for a paired USB device. USBDevice.configurations Read only An array of device-specific interfaces for controlling a paired USB device. ...
...configuration Read only A USBConfiguration object for the currently selected interface for a paired USB device. USBDevice.configurations Read only An array of device-specific interfaces for controlling a paired USB device. USBDevice.deviceClass Read only One of three
properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two
properties are USBDevice.deviceSubclass and USBDevice.deviceprotocol. ...
...And 6 more matches
Box-shadow generator - CSS: Cascading Style Sheets
> <div class="block info"> <div class="input" data-topic="a" data-title='alpha:' data-action="alpha"></div> <div class="input" data-topic="hexa" data-title='' data-action="hexa"></div> </div> </div> </div> </div> <div class="wrap-right"> <div id="shadow_
properties" class="category"> <div class="title"> Shadow
properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> inset </div> <div class="ui-checkbox" data-topic='inset'></div> </div> <div class="slidergroup"> ...
... data-min="-100" data-max="100" data-step="1" data-value="50"> </div> <div class="ui-slider-btn-set" data-topic="spread" data-type="add"></div> <div class="ui-slider-input" data-topic="spread" data-unit="px"></div> </div> </div> </div> <div id="element_
properties" class="category"> <div class="title"> Class element
properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> border </div> <div class="ui-checkbox" data-topic='border-state' data-state="true"></div> </div> <div id="z-in...
...function() { shadow.copy(store); updateShadowCSS(id); setTimeout(function() { active.node.style.removeProperty("transition"); animate = false; }, 100); }, 200); } var updateActivePos = function updateActivePos(deltaX, deltaY) { if (active.shadowID === null) active.updatePos(deltaX, deltaY); else updateShadowPos(deltaX, deltaY); } /* * Shadow
properties */ var updateShadowCSS = function updateShadowCSS(id) { active.render[id] = active.shadows[id].computeCSS(); active.updateShadows(); } var toggleShadowInset = function toggleShadowInset(value) { if (active.shadowID === null) return; active.shadows[active.shadowID].toggleInset(value); updateShadowCSS(active.shadowID); } var updateShadowPos = function updateShadowP...
...And 6 more matches
border-block-start - CSS: Cascading Style Sheets
er-block-start CSS property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the individual logical block-start border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: border-block-start-color border-block-start-style border-block-start-width Syntax border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue; border-block-start can be used to set the values for one or more of border-block-start-width, border-block-start-style, and border-block-start-color. The physical border to which it maps depends on the elem...
...alues for one or more of border-block-start-width, border-block-start-style, and border-block-start-color. The physical border to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. Related
properties are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element. Values The border-block-start is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. Formal defi...
...And 6 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
ways to add color to your HTML elements to create just the look you want. This article is a primer introducing each of the ways CSS color can be used in HTML. Fortunately, adding color to your HTML is actually really easy to do, and you can add color to nearly anything. We're going to touch on most of what you'll need to know when using color, including a list of what you can color and what CSS
properties are involved, how you describe colors, and how to actually use colors both in stylesheets and in scripts. We'll also take a look at how to let the user pick a color. Then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. Things that can have color At the element leve...
...w to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. Things that can have color At the element level, everything in HTML can have color applied to it. 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. For each, we'll see a list of the CSS
properties that apply color to them. At a fundamental level, the color property defines the foreground color of an HTML element's content and the background-color property defines the element's background color. These can be used on just about any element. Text Whenever an element is rendered, these
properties are used to determine the color of the text, its background, and any decorations on the text. ...
... referred to as the text input cursor) within the element. This is only useful in elements that are editable, such as <input> and <textarea> or elements whose HTML contenteditable attribute is set. Boxes Every element is a box with some sort of content, and has a background and a border in addition to whatever contents the box may have. Borders See the section Borders for a list of the CSS
properties you can use to set the colors of a box's borders. background-color The background color to use in areas of the element that have no foreground content. column-rule-color The color to use when drawing the line separating columns of text. outline-color The color to use when drawing an outline around the outside of the element. This outline is different from the border in that it doesn't get s...
...And 6 more matches
JSON.stringify() - JavaScript
The JSON.stringify() method converts a JavaScript object or value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified
properties if a replacer array is specified. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax JSON.stringify(value[, replacer[, space]]) Parameters value The value to convert to a JSON string. ...
...ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax JSON.stringify(value[, replacer[, space]]) Parameters value The value to convert to a JSON string. replacer Optional A function that alters the behavior of the stringification process, or an array of String and Number that serve as an allowlist for selecting/filtering the
properties of the value object to be included in the JSON string. If this value is null or not provided, all
properties of the object are included in the resulting JSON string. space Optional A String or Number object that's used to insert white space into the output JSON string for readability purposes. If this is a Number, it indicates the number of space characters to use as white space; this number i...
...h the traditional conversion semantics. undefined, Functions, and Symbols are not valid JSON values. If any such values are encountered during conversion they are either omitted (when found in an object) or changed to null (when found in an array). JSON.stringify() can return undefined when passing in "pure" values like JSON.stringify(function(){}) or JSON.stringify(undefined). All Symbol-keyed
properties will be completely ignored, even when using the replacer function. The instances of Date implement the toJSON() function by returning a string (the same as date.toISOString()). Thus, they are treated as strings. The numbers Infinity and NaN, as well as the value null, are all considered null. All the other Object instances (including Map, Set, WeakMap, and WeakSet) will have only their enumera...
...And 6 more matches
Object - JavaScript
The Object class represents one of JavaScript's data types. It is used to store various keyed collections and more complex entities. Objects can be created using the Object() constructor or the object initializer / literal syntax. Description Nearly all objects in JavaScript are instances of Object; a typical object inherits
properties (including methods) from Object.prototype, although these
properties may be shadowed (a.k.a. overridden). ...
...This provides a very powerful although potentially dangerous mechanism to override or extend object behavior. The Object constructor creates an object wrapper for the given value. ...
...an empty object. Otherwise, it will return an object of a Type that corresponds to the given value. If the value is an object already, it will return the value. When called in a non-constructor context, Object behaves identically to new Object(). See also the object initializer / literal syntax. ...
...And 6 more matches
TypedArray - JavaScript
The source for this interactive example is stored in a GitHub repository. ...
... The source for this interactive example is stored in a GitHub repository. ...
...e-examples and send us a pull request. Description ECMAScript 2015 defines a TypedArray constructor that serves as the [[Prototype]] of all TypedArray constructors. This constructor is not directly exposed: there is no global %TypedArray% or TypedArray property. It is only directly accessible through Object.getPrototypeOf(Int8Array) and similar. All TypedArrays constructors inherit common
properties from the %TypedArray% constructor function. Additionally, all typed array prototypes (TypedArray.prototype) have %TypedArray%.prototype as their [[Prototype]]. The %TypedArray% constructor on its own is not particularly useful. Calling it or using it in a new expression will throw a TypeError, except when used during object creation in JS engines that support subclassing. There are at present...
...And 6 more matches
Object initializer - JavaScript
tax errors. // Shorthand property names (ES2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // Shorthand method names (ES2015) let o = { property(parameters) {} } // Computed property names (ES2015) let prop = 'foo' let o = { [prop]: 'hey', ['b' + 'ar']: 'there' } Description An object initializer is an expression that describes the initialization of an Object. Objects consist of
properties, which are used to describe an object. Values of object
properties can either contain primitive data types or other objects. Object literal notation vs JSON The object literal notation is not the same as the JavaScript Object Notation (JSON). Although they look similar, there are differences between them: JSON permits only property definition using "property": value syntax. The property nam...
...tion cannot be a shorthand. In JSON the values can only be strings, numbers, arrays, true, false, null, or another (JSON) object. A function value (see "Methods" above) can not be assigned to a value in JSON. Objects like Date will be a string after JSON.parse(). JSON.parse() will reject computed property names and an error will be thrown. Examples Creating objects An empty object with no
properties can be created like this: let object = {} However, the advantage of the literal or initializer notation is, that you are able to quickly create objects with
properties inside the curly braces. You simply notate a list of key: value pairs delimited by commas. The following code creates an object with three
properties and the keys are "foo", "age" and "baz". The values of these keys are a string...
...ou are able to quickly create objects with
properties inside the curly braces. You simply notate a list of key: value pairs delimited by commas. The following code creates an object with three
properties and the keys are "foo", "age" and "baz". The values of these keys are a string "bar", the number 42, and another object. let object = { foo: 'bar', age: 42, baz: {myProp: 12} } Accessing
properties Once you have created an object, you might want to read or change them. Object
properties can be accessed by using the dot notation or the bracket notation. (See property accessors for detailed information.) object.foo // "bar" object['age'] // 42 object.foo = 'baz' Property definitions We have already learned how to notate
properties using the initializer syntax. Oftentimes, there are vari...
...And 6 more matches
for...in - JavaScript
The for...in statement iterates over all enumerable
properties of an object that are keyed by strings (ignoring ones keyed by Symbols), including inherited enumerable
properties. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for (variable in object) statement variable A different property name is assigned to variable on each iteration. object Object whose non-Symbol enumerable
properties are iterated over. Description A for...in loop only iterates over enumerable, non-Symbol
properties. ...
...s a pull request. Syntax for (variable in object) statement variable A different property name is assigned to variable on each iteration. object Object whose non-Symbol enumerable
properties are iterated over. Description A for...in loop only iterates over enumerable, non-Symbol
properties. Objects created from built-in constructors like Array and Object have inherited non-enumerable
properties from Object.prototype and String.prototype, such as String's indexOf() method or Object's toString() method. The loop will iterate over all enumerable
properties of the object itself and those the object inherits from its prototype chain (
properties of nearer prototypes take precedence over those of prototypes further away from the object in its prototype chain). Deleted, added, or modified prop...
...e, such as String's indexOf() method or Object's toString() method. The loop will iterate over all enumerable
properties of the object itself and those the object inherits from its prototype chain (
properties of nearer prototypes take precedence over those of prototypes further away from the object in its prototype chain). Deleted, added, or modified
properties A for...in loop iterates over the
properties of an object in an arbitrary order (see the delete operator for more on why one cannot depend on the seeming orderliness of iteration, at least in a cross-browser setting). If a property is modified in one iteration and then visited at a later time, its value in the loop is its value at that later time. A property that is deleted before it has been visited will not be visited later.
Properties a...
...And 6 more matches
Dehydra Object Reference - Archive of obsolete content
Introduction Dehydra represents C++ types and variables as JavaScript objects. The objects are designed to distill that type system to the minimum such that it can be easy to match on. Often, the best way to become familiar with the Dehydra objects is to print out the objects: Dehydra example code an online tool for pretty-printing dehydra data Understanding
Properties Dehydra only sets
properties that are applicable. ...
... .attributes array of objects Attributes of the type or declaration. Each member of the array has the following
properties: { name: string, value: string or number, if applicable } See an example on enforcing final classes. ...
....loc. Dehydra only sets boolean flags when they are true. For example, a pointer type will have .isPointer == true, but a class type will not have an .isPointer property. Common
Properties Property Type Description .loc location object Source location of a type or declaration. .attributes array of objects Attributes of the type or declaration. ...
...And 5 more matches
Browser Feature Detection - Archive of obsolete content
An experimental approach to discovering degree of support for Standards. Among the methods of browser detection, many people recommend using the existence of specific
properties or methods in a browser's DOM to detect the browser type and whether it supports a given operation. This test takes that idea to the extreme and tests a large number of
properties and methods to determine the level of support a browser has for particular standards and reports a rating as the percentage of names the browser defines. This article has generally never been more than a way to show off Firefox Web compatibility, rather than something truly informative in a broader sense. Therefore, given that it's also badly out of date, it's been archived. You should not rely on any information here. Browser Sniff...
... 100% 100% 100% 75% / 91% 75% / 75% DOM Core 2 100% 100% 100% 70% / 94% 58% / 58% DOM 1 HTML 100% 100% 100% 100% / 100% 100% / 100% DOM CSS 1 100% 100% 100% 100% / 100% 96% / 96% DOM CSS 2 100% 98% 67% 71% / 83% 38% / 42% Test Results Cross Reference DOM Core Level 1 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 Document.createDocumentFragment() true true true Document.createTe...
...ion() 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 Document.createDocumentFragment() true true true Document.createTe...
...And 5 more matches
WAI-ARIA basics - Learn web development
- These define what an element is or does. Many of these are so-called landmark roles, which largely duplicate the semantic value of HTML5 structural elements e.g. role="navigation" (<nav>) or role="complementary" (<aside>), but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in UIs.
Properties -- These define
properties of elements, which can be used to give them extra meaning or semantics. As an example, aria-required="true" specifies that a form input needs to be filled in to be valid, whereas aria-labelledby="label" allows you to put an ID on an element, then reference it as being the label for anything else on the page, including multiple elements, which is not possible using <labe...
...put">. As an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to image alt text -- specify existing information on the page as an image's alt text, rather than having to repeat it inside the alt attribute. You can see an example of this at Text alternatives. States -- Special
properties that define the current conditions of elements, such as aria-disabled="true", which specifies to a screenreader that a form input is currently disabled. States differ from
properties in that
properties don't change throughout the lifecycle of an app, whereas states can change, generally programmatically via JavaScript. An important point about WAI-ARIA attributes is that they don't affect anyth...
...ser's accessibility APIs (where screenreaders get their information from). WAI-ARIA doesn't affect webpage structure, the DOM, etc., although the attributes can be useful for selecting elements by CSS. Note: You can find a useful list of all the ARIA roles and their uses, with links to futher information, in the WAI-ARIA spec -- see Definition of Roles. The spec also contains a list of all the
properties and states, with links to further information -- see Definitions of States and
Properties (all aria-* attributes). Where is WAI-ARIA supported? This is not an easy question to answer. It is difficult to find a conclusive resource that states what features of WAI-ARIA are supported, and where, because: There are a lot of features in the WAI-ARIA spec. There are many combinations of operatin...
...And 5 more matches
Debugging CSS - Learn web development
ent rendering between multiple browsers. You will also find that browsers have chosen to focus on different areas when creating their DevTools. For example in Firefox there are some excellent tools for working visually with CSS Layout, allowing you to inspect and edit Grid Layouts, Flexbox, and Shapes. However, all of the different browsers have similar fundamental tools, e.g. for inspecting the
properties and values applied to elements on your page, and making changes to them from the editor. In this lesson we will look at some useful features of the Firefox DevTools for working with CSS. In order to do so I'll be using an example file. Load this up in a new tab if you want to follow along, and open up your DevTools as described in the article linked above. The DOM versus view source Something ...
... the applied CSS Select an element on your page, either by right/ctrl-clicking on it and selecting Inspect, or selecting it from the HTML tree on the left of the DevTools display. Try selecting the element with the class of box1; this is the first element on the page with a bordered box drawn around it. If you look at the Rules view to the right of your HTML, you should be able to see the CSS
properties and values applied to that element. You will see the rules directly applied to class box1 and also the CSS that is being inherited by the box from its ancestors, in this case to <body>. This is useful if you are seeing some CSS being applied that you didn't expect. Perhaps it is being inherited from a parent element and you need to add a rule to overwrite it in the context of this element. Also ...
...see the rules directly applied to class box1 and also the CSS that is being inherited by the box from its ancestors, in this case to <body>. This is useful if you are seeing some CSS being applied that you didn't expect. Perhaps it is being inherited from a parent element and you need to add a rule to overwrite it in the context of this element. Also useful is the ability to expand out shorthand
properties. In our example the margin shorthand is used. Click on the little arrow to expand the view, showing the different longhand
properties and their values. You can toggle values in the Rules view on and off, when that panel is active -- if you hold your mouse over it checkboxes will appear. Uncheck a rule's checkbox, for example border-radius, and the CSS will stop applying. You can use this to do...
...And 5 more matches
Introduction to events - Learn web development
g about other such environments at this stage in your learning; we just wanted to make it clear that events can differ in different programming environments. Ways of using web events There are a number of ways to add event listener code to web pages so it runs when the associated event fires. In this section, we review the various mechanisms and discuss which ones you should use. Event handler
properties These are the
properties that exist to contain event handler code we have seen most frequently during the course. Returning to the above example: const btn = document.querySelector('button'); btn.onclick = function() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundColor = rndCol; } The onclick property is the event handler...
...andler property to be equal to a named function name (like we saw in Build your own function). The following works just the same: const btn = document.querySelector('button'); function bgChange() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundColor = rndCol; } btn.onclick = bgChange; There are many different event handler
properties available. Let's experiment. First, make a local copy of random-color-eventhandlerproperty.html, and open it in your browser. It's just a copy of the simple random color example we've played with already. Now try changing btn.onclick to the following different values in turn, and observing the results in the example: btn.onfocus and btn.onblur -- The color changes when the button is focused a...
...rally the JavaScript code you want to run when the event occurs. The above example invokes a function defined inside a <script> element on the same page, but you could also insert JavaScript directly inside the attribute, for example: <button onclick="alert('Hello, this is my old-fashioned event handler!');">Press me</button> You can find HTML attribute equivalents for many of the event handler
properties; however, you shouldn't use these -- they are considered bad practice. It might seem easy to use an event handler attribute if you are doing something really quick, but they quickly become unmanageable and inefficient. For a start, it is not a good idea to mix up your HTML and your JavaScript, as it becomes hard to parse -- keeping your JavaScript separate is best practice; if it is in a separat...
...And 5 more matches
JavaScript object basics - Learn web development
e First steps and Building blocks). Objective: To understand the basic theory behind object-oriented programming, how this relates to JavaScript ("most things are objects"), and how to start working with JavaScript objects. Object basics An object is a collection of related data and/or functionality (which usually consists of several variables and functions -- which are called
properties and methods when they are inside objects.) Let's work through an example to understand what they look like. To begin with, make a local copy of our oojs.html file. This contains very little -- a <script> element for us to write our source code into. We'll use this as a basis for exploring basic object syntax. While working with this example you should have your developer tools JavaScript console...
... case are separated by a colon. The syntax always follows this pattern: const objectName = { member1Name: member1Value, member2Name: member2Value, member3Name: member3Value }; The value of an object member can be pretty much anything -- in our person object we've got a string, a number, two arrays, and two functions. The first four items are data items, and are referred to as the object's
properties. The last two items are functions that allow the object to do something with that data, and are referred to as the object's methods. An object like this is referred to as an object literal -- we've literally written out the object contents as we've come to create it. This is in contrast to objects instantiated from classes, which we'll look at later on. It is very common to create an object usi...
...ct literal when you want to transfer a series of structured, related data items in some manner, for example sending a request to the server to be put into a database. Sending a single object is much more efficient than sending several items individually, and it is easier to work with than an array, when you want to identify individual items by name. Dot notation Above, you accessed the object's
properties and methods using dot notation. The object name (person) acts as the namespace -- it must be entered first to access anything encapsulated inside the object. Next you write a dot, then the item you want to access -- this can be the name of a simple property, an item of an array property, or a call to one of the object's methods, for example: person.age person.interests[1] person.bio() Sub-names...
...And 5 more matches
Eclipse CDT
y bother using Eclipse) you're going to have to set Eclipse's "Build" step to do a very slow, non-parallel, full rebuild. (See the "Code assistance" section above for why.) Nevertheless, if you understand the above warning and you still want to configure Eclipse's "Build" button to invoke a real build, then read on. ...
...Select the Behavior tab and remove the "all" from the "Build (Incremental build)" field. ...
... to just "${ProjDirPath}" (this is the top of the source tree). Select the Behavior tab and remove the "all" from the "Build (Incremental build)" field. Select "C/C++ Build > Build Variables", and add a variable "MOZCONFIG", and set it to the path of your .mozconfig file relative to the top source directory. Set any other environment variables you want to set for the build, then close the project
properties window. Now when you hit the Build button (the little hammer icon), you should see the source build in the Console tab at the bottom of the window. The benefit of building from inside Eclipse is that build errors will appear in the Problems tab at the bottom of the window, and from there you can double click on the build error and it will take you straight to the source file and line where the ...
...And 5 more matches
JavaScript-DOM Prototypes in Mozilla
rapper is exposed to JavaScript as the JavaScript representation of the DOM node. When XPConnect wraps a C++ object it will create a JSObject that is unique to this C++ object. In the case where the C++ object has class info (nsIClassInfo), the JSObject is a more or less empty JSObject which is not really that special. ...
...cript representation of the DOM node. When XPConnect wraps a C++ object it will create a JSObject that is unique to this C++ object. In the case where the C++ object has class info (nsIClassInfo), the JSObject is a more or less empty JSObject which is not really that special. ...
... are actually not
properties of the object itself, but rather
properties of the prototype of the JSObject for the wrapper (unless the C++ object's class info has the flag nsIXPCScriptable::DONT_SHARE_PROTOTYPE set, but lets assume that's not the case here). As an example of this let's look at an HTML image element in a document. var obj = document.images[0]; Here, obj will not really have any
properties (except for the standard JSObject
properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the DOM functionality of obj comes from obj's prototype (obj.__proto__) that XPConnect sets up when exposing the first image in document to JavaScript. ...
...And 5 more matches
Property cache
SpiderMonkey's property cache is an internal data structure used to speed up property accesses in the interpreter and to communicate between the interpreter and JIT. Warning: The details below are obsolete. Shape integers do not exist anymore. The property cache still exists, but it is simpler now. SpiderMonkey mainly uses type inference to determine which
properties are being accessed; in cases where type inference does not find the exact shape of the object being accessed, SpiderMonkey uses a PIC (polymorphic inline caches) to store the result of the lookup. The property cache is only used in the interpreter. The property cache was introduced in bug 365851. Basics In general, accessing a property of a native object entails: a property lookup; examining the Shape to see how the property ...
...L}PROP, and LENGTH; NAME; SETPROP, BINDNAME, and SETNAME; CALLPROP and CALLNAME; and {INC,DEC}NAME and NAME{INC,DEC}. ELEM opcodes do not use it. Nor do {INC,DEC}PROP or PROP{INC,DEC}. Nor do operations such as ADD that only need to look up a property (.toString) in unusual cases. Throughout this article, phrases such as "own property" should be taken to refer to the low-level representation of
properties in scopes and Shape chains. In the case of SHARED PERMANENT
properties, this differs from the notion of "own property" seen by scripts via Object.prototype.hasOwnProperty. Shape Native objects have a shape, a 24-bit unsigned integer such that: Basic layout guarantee -- If at time t0 the object x has shape s and at time t1 the object y has shape s, and no shape-regenerating GC occurred, th...
...bject.prototype.hasOwnProperty. Shape Native objects have a shape, a 24-bit unsigned integer such that: Basic layout guarantee -- If at time t0 the object x has shape s and at time t1 the object y has shape s, and no shape-regenerating GC occurred, then y at t1 has the same JSClass, JSObjectOps, prototype, and property specs as x had at t0. To be more precise regarding property specs, y's
properties have the same names, getters, setters, property attributes, and slot offsets, and they are in the same order, as x's
properties at t0. Furthermore, y at t1 has the same number of fixed slots that x had at t0, and either both have a slot array or neither does. (Informally: objects with the same shape have the same prototype, class, and layout.) Prototype chain shadowing guarantee -- If at t0...
...And 5 more matches
Address Book examples
This function will return the first match that it finds in the collection or null. let collection = ... let card = collection.getCardFromProperty("JobTitle", "software engineer", false); If you are searching for a card with a particular email address, you can use the cardForEmailAddress function that will match against multiple email addresses...
...ry).childCards; // ... use searchResult as required. } } Note: This method doesn't work with remote address books (e.g. LDAP). Hence the additional !ab.isRemote check How do I add/edit/delete contacts? Note: Not all address books can be written to. ...
...s book via its nsIAbDirectory interface: let newCard = addressbook.addCard(card); The addCard function returns a new nsIAbCard object that may have had nsIAbDirectory specific data added to it, e.g. database specific information, that is used on edits. Editing Contacts Once you have obtained a card from an nsIAbDirectory (see above), you can edit it in a two step process, firstly, change the
properties that you to edit: card.setProperty("FirstName", "Jane"); card.setProperty("LastName", "Doe"); Secondly, call modifyCard to save the card in the database. addressbook.modifyCard(card); Deleting Contacts Once you have obtained a card(s) from an nsIAbDirectory (see above) you can delete one or more simply by calling the deleteCards function: let cardsToDelete = Components.classes["@mozilla.o...
...And 5 more matches
Accessibility Inspector - Firefox Developer Tools
en you aren't specifically using it. When first implemented, the accessibility engine had to be explicitly turned on. Starting in Firefox 79, it is automatically enabled when you do one of the following: Choose Accessibility in the Tools > Web Developer menu. Select the Accessibility tab in the Developer Tools toolbox. Right-click in the main browser window, and choose Inspect Accessibility
Properties in the context menu. Right-click an item in the HTML pane of the Page Inspector, and choose Show Accessibility
Properties in the context menu. Once activated, the accessibility engine remains running until you close the Developer Tools toolbox. If you don't wish to allow the accessibility features to be automatically enabled, you can use the Configuration Editor (also known as about:config) t...
...ating the Accessibility Inspector do nothing. Features of the Accessibility panel The enabled accessibility panel looks like so: On the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. Items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. Each item has two
properties listed: Role -- the role this item has on the page (e.g., pushbutton, or footer). This can be either a default role provided by the browser, or a role given to it via a WAI-ARIA role attribute. Name -- the name this item has on the page. The name depends on the element; for example, the name of most text elements is simply their textContent, whereas form elements' names are the contents of th...
... by the browser, or a role given to it via a WAI-ARIA role attribute. Name -- the name this item has on the page. The name depends on the element; for example, the name of most text elements is simply their textContent, whereas form elements' names are the contents of their associated <label>. On the right-hand side, you can see further information about the currently selected item. The listed
properties are as follows: name -- the item's name, as described above. role -- the item's role, as described above. actions -- a list of actions that can be performed on the item, for example, a pushbutton would have "Press" listed, while a link would have "Jump" listed. value -- the value of the item. This can mean different things depending on the type of the item; for example, a form input (role: ...
...And 5 more matches
Debugger.Memory - Firefox Developer Tools
It can mark each new object with the JavaScript call stack at which it was allocated. It can log all object allocations, yielding a stream of JavaScript call stacks at which allocations have occurred. It can compute a census of items belonging to the debuggee, categorizing items in various ways, and yielding item counts. Ifdbg is a Debugger instance, then the methods and accessor
properties of dbg.memory control howdbg observes its debuggees' memory use. The dbg.memory object is an instance of Debugger.Memory; its inherited accesors and methods are described below. Allocation Site Tracking The JavaScript engine marks each new object with the call stack at which it was allocated, if: the object is allocated in the scope of a global object that is a debuggee of some Debugger i...
...imit on the log's size by setting dbg.memory.maxAllocationsLogLength. Censuses A census is a complete traversal of the graph of all reachable memory items belonging to a particular Debugger's debuggees. It produces a count of those items, broken down by various criteria. Ifdbg is a Debugger instance, you can call dbg.memory.takeCensus to conduct a census of its debuggees' possessions. Accessor
Properties of the Debugger.Memory.prototype Object Ifdbg is a Debugger instance, then <i>dbg</i>.memory is a Debugger.Memory instance, which inherits the following accessor
properties from its prototype: trackingAllocationSites A boolean value indicating whether this Debugger.Memory instance is capturing the JavaScript execution stack when each Object is allocated. This accessor property has both a g...
...d stored to. Its default value is 5000. allocationsLogOverflowed Returns true if there have been more than [maxAllocationsLogLength][#max-alloc-log] allocations since the last time [drainAllocationsLog][#drain-alloc-log] was called and some data has been lost. Returns false otherwise. Debugger.Memory Handler Functions Similar to Debugger's handler functions, Debugger.Memory inherits accessor
properties that store handler functions for SpiderMonkey to call when given events occur in debuggee code. Unlike Debugger's hooks, Debugger.Memory's handlers' return values are not significant, and are ignored. The handler functions receive the Debugger.Memory's owning Debugger instance as their this value. The owning Debugger's uncaughtExceptionHandler is still fired for errors thrown in Debugger.Memory ...
...And 5 more matches
Debugger.Script - Firefox Developer Tools
tions that code defines. The contents of a <script> element. A DOM event handler, whether embedded in HTML or attached to the element by other JavaScript code. Code appearing in a javascript: URL. The Debugger interface constructs Debugger.Script objects as scripts of debuggee code are uncovered by the debugger: via the onNewScript handler method; via Debugger.Frame's script
properties; via the functionScript method of Debugger.Object instances; and so on. For a given Debugger instance, SpiderMonkey constructs exactly one Debugger.Script instance for each underlying script object; debugger code can add its own
properties to a script object and expect to find them later, use == to decide whether two expressions refer to the same script, and so on. (If more than one Debugger ins...
...erlying script object; debugger code can add its own
properties to a script object and expect to find them later, use == to decide whether two expressions refer to the same script, and so on. (If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Script instance for a given script. This allows the code using each Debugger instance to place whatever
properties it likes on its Debugger.Script instances, without worrying about interfering with other debuggers.) A Debugger.Script instance is a strong reference to a JSScript object; it protects the script it refers to from being garbage collected. Note that SpiderMonkey may use the same Debugger.Script instances for equivalent functions or evaluated code--that is, scripts representing the same source cod...
...ndScripts method on Debugger instances. SpiderMonkey constructs exactly one Debugger.Script for each underlying WebAssembly module per Debugger instance. A Debugger.Script instance is a strong reference to the underlying WebAssembly module; it protects the module it refers to from being garbage collected. Please note at the time of this writing, support for WebAssembly is very preliminary. Many
properties and methods below throw. Convention For descriptions of
properties and methods below, if the behavior of the property or method differs between the instance referring to a JSScript or to a block of WebAssembly code, the text will be split into two sections, headed by "if the instance refers to a JSScript" and "if the instance refers to WebAssembly code", respectively. If the behavior does not d...
...And 5 more matches
Migrating from Firebug - Firefox Developer Tools
bug extensions like FirePHP allow to log server-side messages to the Firebug console. This functionality is already integrated into the DevTools using the ChromeLogger protocol and doesn't require any extensions to be installed. Command history The command history available through a button in Firebug's command line, is available by pressing ?/? within the DevTools command line. Inspect object
properties By clicking on an object logged within the console you can inspect the object's
properties and methods within the DOM panel. In the Firefox DevTools you can also inspect the objects. The difference is that they show the
properties and methods within a side panel inside the Web Console. Show network requests The Console panel in Firebug allows to log AJAX requests (aka XMLHttpRequests). This op...
...ode view in a similar way. Firebug has a Style side panel for this, the DevTools have a Rules side panel. In Firebug you add new rules by right-clicking and choosing Add Rule... from the context menu. The DevTools also have a context menu option for that named Add New Rule and additionally have a + button within the Rules panel's toolbar to create new rules. To edit element styles, i.e. the CSS
properties of the style attribute of an element, in Firebug you have to right-click into the Style side panel and choose Edit Element Style... from the context menu. The DevTools display an element {} rule for this purpose, which requires a single click into it to start editing the
properties. Auto-completion of CSS As in Firebug, the Rules view provides an auto-completion for the CSS property names and t...
...u toggle the CSS pseudo-classes :hover, :active and :focus for an element via the options menu of the Style side panel. In the DevTools there are two ways to do the same. The first one is to toggle them via the pseudo-class panel within the Rules side panel. The second one is to right-click and element within the node view and toggle the pseudo-classes via the context menu. ...
...And 5 more matches
Work with animations - Firefox Developer Tools
mation bars Each animation or transition is shown as a horizontal bar laid across the timeline. The bar is: blue if a transition was used to animate a property orange if a @keyframes animation was used green if the Web Animations API was used The bar contains a lightning bolt icon if the property was animated using the compositor thread (see more about the cost of animating different CSS
properties). The bar is shaped to reflect the easing effect used for the animation. In the example above you can see that the first bar is concave, representing ease-in, and the second is convex, representing ease-out. If the animation used CSS transitions, there is one bar for each property transitioned, and it is labeled with the name of the property being transitioned. If the animation used CSS @keyfra...
... left of each bar is a selector for the element that the animation applies to. If you hover over this selector, the element is highlighted in the page. Click the selector to select the element in the inspector. To the left of the selector is a "target" icon (). Clicking this icon locks the highlighter on the element. Animation details If you click one of the bars, you'll see details of all the
properties that were changed in the animation. For example, try clicking on the bar for img#icon's animation: This is telling us that two
properties were modified: filter and transform. Each dot represents an entry for that property in the set of keyframes used for the animation. Both
properties were initialized at 0ms and finalized at 750ms. filter was given a value at 250ms and transform at 500ms. If y...
...ter: '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. ...
...And 5 more matches
Applying styles and colors - Web APIs
e used only the default line and fill styles. Here we will explore the canvas options we have at our disposal to make our drawings a little more attractive. You will learn how to add different colors, line styles, gradients, patterns and shadows to your drawings. Colors Up until now we have only seen methods of the drawing context. If we want to apply colors to a shape, there are two important
properties we can use: fillStyle and strokeStyle. fillStyle = color Sets the style used when filling shapes. strokeStyle = color Sets the style for shapes' outlines. color is a string representing a CSS <color>, a gradient object, or a pattern object. We'll look at gradient and pattern objects later. By default, the stroke and fill color are set to black (CSS color value #000000). Note: When you s...
...the canvas. The value must be between 0.0 (fully transparent) to 1.0 (fully opaque). This value is 1.0 (fully opaque) by default. The globalAlpha property can be useful if you want to draw a lot of shapes on the canvas with similar transparency, but otherwise it's generally more useful to set the transparency on individual shapes when setting their colors. Because the strokeStyle and fillStyle
properties accept CSS rgba color values, we can use the following notation to assign a transparent color to them. // Assigning transparent colors to stroke and fill style ctx.strokeStyle = 'rgba(255, 0, 0, 0.5)'; ctx.fillStyle = 'rgba(255, 0, 0, 0.5)'; The rgba() function is similar to the rgb() function but it has one extra parameter. The last parameter sets the transparency value of this particular co...
... lineWidth = value Sets the width of lines drawn in the future. lineCap = type Sets the appearance of the ends of lines. lineJoin = type Sets the appearance of the "corners" where lines meet. miterLimit = value Establishes a limit on the miter when two lines join at a sharp angle, to let you control how thick the junction becomes. getLineDash() Returns th...
...And 5 more matches
HTMLFormElement - Web APIs
HTMLFormElement.elements Read only A HTMLFormControlsCollection holding all form controls belonging to this form element. HTMLFormElement.lengthRead only A long reflecting the number of controls in the form. HTMLFormElement.name A DOMString reflecting the value of the form's name HTML attribute, containing the name o...
... HTMLFormElement.elements Read only A HTMLFormControlsCollection holding all form controls belonging to this form element. HTMLFormElement.lengthRead only A long reflecting the number of controls in the form. HTMLFormElement.name A DOMString reflecting the value of the form's name HTML attribute, containing the name of the form. HTMLFormElement.method A DO...
...OMString reflecting the value of the form's action HTML attribute, containing the URI of a program that processes the information submitted by the form. HTMLFormElement.encoding or HTMLFormElement.enctype A DOMString reflecting the value of the form's enctype HTML attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set. The two
properties are synonyms. HTMLFormElement.acceptCharset A DOMString reflecting the value of the form's accept-charset HTML attribute, representing the character encoding that the server accepts. HTMLFormElement.autocomplete A DOMString reflecting the value of the form's autocomplete HTML attribute, indicating whether the controls in this form can have their values automatically populated by the browser. ...
...And 5 more matches
Node - Web APIs
Node.baseURIRead only Returns a DOMString representing the base URL of the document containing the Node. Node.baseURIObject Read only (Not available to web content.) The nsIURI object representing the base URI for the element. Node.childNodesRead only Returns a live NodeList containing all th...
... Node.baseURIRead only Returns a DOMString representing the base URL of the document containing the Node. Node.baseURIObject Read only (Not available to web content.) The nsIURI object representing the base URI for the element. Node.childNodesRead only Returns a live NodeList containing all the children of this node. NodeLi...
...x="151" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties In addition to the
properties below, Node inherits
properties from its parent, EventTarget. Node.baseURIRead only Returns a DOMString representing the base URL of the document containing the Node. Node.baseURIObject Read only (Not available to web content.) The nsIURI object representing the base URI for the element. Node.childNodesRead only Returns a live NodeList containing all the children of this node. NodeList being live means that if the ...
...And 5 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
The cross axis The cross axis runs perpendicular to the main axis, therefore if your flex-direction (main axis) is set to row or row-reverse the cross axis runs down the columns. If your main axis is column or column-reverse then the cross axis runs along the rows. Understanding which axis is which is important when we start to look at aligning and justifying flex items; flexbox features
properties that align and justify content along one axis or the other. Start and end lines Another vital area of understanding is how flexbox makes no assumption about the writing mode of the document. In the past, CSS was heavily weighted towards horizontal and left-to-right writing modes. Modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start...
... to you when dealing with other layout methods such as CSS Grid Layout which follow the same patterns. The flex container An area of a document laid out using flexbox is called a flex container. To create a flex container, we set the value of the area's container's display property to flex or inline-flex. As soon as we do this the direct children of that container become flex items. As with all
properties in CSS, some initial values are defined, so when creating a flex container all of the contained flex items will behave in the following way. Items display in a row (the flex-direction property's default is row). The items start from the start edge of the main axis. The items do not stretch on the main dimension, but can shrink. The items will stretch to fill the size of the cross axis. The...
...the initial value, and they will instead shrink to fit the container because they are using initial flexbox values that allows items to shrink. Using nowrap would cause an overflow if the items were not able to shrink, or could not shrink small enough to fit. Find out more about wrapping flex items in the guide Mastering Wrapping of Flex Items. The flex-flow shorthand You can combine the two
properties flex-direction and flex-wrap into the flex-flow shorthand. The first value specified is flex-direction and the second value is flex-wrap. In the live example below try changing the first value to one of the allowable values for flex-direction - row, row-reverse, column or column-reverse, and also change the second to wrap and nowrap.
Properties applied to flex items To have more control over...
...And 5 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
browsers mean that many of us are going to see the majority of users having Grid Layout support very quickly, there are also old or non-supporting browsers to contend with. In this guide we will walk through a variety of strategies for support. The supporting browsers Other than in Internet Explorer, CSS Grid Layout is unprefixed in Safari, Chrome, Opera, Firefox and Edge. Support for all the
properties and values detailed in these guides is interoperable across browsers. This means that if you write some Grid Layout code in Firefox, it should work in the same way in Chrome. This is no longer an experimental specification, and you are safe to use it in production. The Internet Explorer and Edge situation It should be remembered that the original implementation of CSS Grid Layout happened in In...
...his means that if you write some Grid Layout code in Firefox, it should work in the same way in Chrome. This is no longer an experimental specification, and you are safe to use it in production. The Internet Explorer and Edge situation It should be remembered that the original implementation of CSS Grid Layout happened in Internet Explorer 10. This early specification did not contain all of the
properties and values that the up-to-date specification has. There are also substantial differences between what shipped in IE10 and the current specification, even where the
properties and values appear the same. This early implementation is also the version of Grid Layout implemented in Edge up to version 15. The IE/Edge (<=15) version of the specification is prefixed with an -ms prefix and the propertie...
...he IE/Edge (<=15) version of the specification is prefixed with an -ms prefix and the
properties implemented in IE/Edge (<=15) are as follows: grid-template-columns as -ms-grid-columns grid-template-rows as -ms-grid-rows grid-row-start as -ms-grid-row grid-column-start as -ms-grid-column align-self as -ms-grid-row-align justify-self as -ms-grid-column-align The IE version has additional
properties not required in the new specification of -ms-grid-column-span and -ms-grid-row-span. This version does not include auto-placement capability, or grid template areas. Some simple grid layouts could be implemented for IE10, through to Edge 15, using the -ms
properties. As these
properties are vendor prefixed, they will not effect any browser supporting the up to date and unprefixed specification. ...
...And 5 more matches
background - CSS: Cascading Style Sheets
The background shorthand CSS property sets all background style
properties at once, such as color, image, origin and size, or repeat method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background shorthand CSS property sets all background style
properties at once, such as color, image, origin and size, or repeat method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ll background style
properties at once, such as color, image, origin and size, or repeat method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 5 more matches
border-image - CSS: Cascading Style Sheets
is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You should specify a separate border-style in case the border image fails to load. Indeed, this is required according to the specification, although not all browsers implement this requirement. ...
...o the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You should specify a separate border-style in case the border image fails to load. Indeed, this is required according to the specification, although not all browsers implement this requirement. ...
...ge-repeat. Accessibility concerns Assistive technology cannot parse border images. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
...And 5 more matches
border-inline-start - CSS: Cascading Style Sheets
-inline-start CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: border-inline-start-color border-inline-start-style border-inline-start-width Syntax border-inline-start: 1px; border-inline-start: 2px dotted; border-inline-start: medium dashed green; The physical border to which border-inline-start maps depends on the element's writing mode, directionality, and text orientation. It corre...
...-start: 1px; border-inline-start: 2px dotted; border-inline-start: medium dashed green; The physical border to which border-inline-start maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. Related
properties are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element. Values The border-inline-start is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. Formal defi...
...k-end, and border-inline-end, which define the other borders of the element. Values The border-inline-start is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. ...
...And 5 more matches
border-inline - CSS: Cascading Style Sheets
y for setting the individual logical inline border property values in a single place in the style sheet. border-inline: 1px; border-inline: 2px dotted; border-inline: medium dashed blue; The physical borders to which border-inline maps depends on the element's writing mode, directionality, and text orientation. ...
...nds on the element's writing mode, directionality, and text orientation. It corresponds to the border-top and border-bottom or border-right, and border-left
properties, depending on the values defined for writing-mode, direction, and text-orientation. The borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. ...
...s, depending on the values defined for writing-mode, direction, and text-orientation. The borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. ...
...And 5 more matches
grid-template - CSS: Cascading Style Sheets
The grid-template CSS property is a shorthand property for defining grid columns, rows, and areas. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e grid-template CSS property is a shorthand property for defining grid columns, rows, and areas. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <'grid-template-rows'> / <'grid-template-columns'> Sets grid-template-rows and grid-template-columns to the specified values, and sets grid-template-areas to none. [ <line-names>? <string>...
...And 5 more matches
grid - CSS: Cascading Style Sheets
The grid CSS property is a shorthand property that sets all of the explicit and implicit grid
properties in a single declaration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You can only specify the explicit or the implicit grid
properties in a single grid declaration. The sub-
properties you don't specify are set to their initial value, as normal for shorthands. Also, the gutter
properties are NOT reset by this shorthand. ...
...ute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You can only specify the explicit or the implicit grid
properties in a single grid declaration. The sub-
properties you don't specify are set to their initial value, as normal for shorthands. Also, the gutter
properties are NOT reset by this shorthand. ...
...ithub.com/mdn/interactive-examples and send us a pull request. Note: You can only specify the explicit or the implicit grid
properties in a single grid declaration. The sub-
properties you don't specify are set to their initial value, as normal for shorthands. Also, the gutter
properties are NOT reset by this shorthand. ...
...And 5 more matches
mask - CSS: Cascading Style Sheets
The mask CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points. As well as the
properties listed below, the mask shorthand also resets mask-border to its initial value. It is therefore recommended to use the mask shorthand rather than other shorthands or the individual
properties to override any mask settings earlier in the cascade. This will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...t specific points. As well as the
properties listed below, the mask shorthand also resets mask-border to its initial value. It is therefore recommended to use the mask shorthand rather than other shorthands or the individual
properties to override any mask settings earlier in the cascade. This will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...e mask shorthand also resets mask-border to its initial value. It is therefore recommended to use the mask shorthand rather than other shorthands or the individual
properties to override any mask settings earlier in the cascade. This will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...And 5 more matches
Strict mode - JavaScript
The normal code may duplicate property names, with the last one determining the property's value. But since only the last one does anything, the duplication is simply a...
...The normal code may duplicate property names, with the last one determining the property's value. ...
... (function() { 'use strict'; false.true = ''; // TypeError (14).sailing = 'home'; // TypeError 'with'.you = 'far away'; // TypeError })(); Simplifying variable uses Strict mode simplifies how variable names map to particular variable definitions i...
...And 5 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
ating options dialogs, confirmation dialogs, etc. This element takes a number of attributes, and can easily be made to display controls (buttons, etc) using widgets and layouts native to whatever platform it is running on. For example, Windows places the OK button on the left and the Cancel button on the right, while Mac OS X has the opposite layout. This is what Firefox itself uses for bookmark
properties and other dialogs. Buttons used in dialog windows A dialog element will display some number of buttons at its bottom. As shown in Table 1, there are four types of buttons that can be displayed, and you can set the names of the buttons you want to display as a comma-delimited list in the value of the buttons attribute. FIXME: Make the table cleaner Button name Description ...
...y buttons with icons that are standard for the platform. Possible values for the icon attribute are given in Table 2. Figure 8: A button with an image icon attribute value icon attribute value accept close cancel print help add open remove save refresh find go-forward clear go-back yes
properties no select-font apply select-color Table 2: Values for the icon attribute Toolbar buttons The toolbarbutton element is the element used to define toolbar buttons. This is typically placed inside a toolbar element, which defines a toolbar, but it can be used in other locations. These mostly act the same as button elements, but as shown in Listing 13, you can change...
...XUL document. Functions like Back, Forward, Reload can all be called using the goBack(), goForward(), and reload() methods. Using the stop() method stops loading the page currently in the process of being opened. Access restrictions With frames defined using HTML's frame and iframe elements, it is possible for a child frame to access its parent and ancestor frames by getting the parent and top
properties of window objects. For an application that can open any web page, this could give a script on a web page access to an XUL document's frame, creating a dangerous opening for personal information to leak out. In the interests of security, you can enforce access restrictions by declaring type="content" on a browser element. When you do this, any web page that gets opened will see itself as the topm...
...And 4 more matches
Appendix D: Loading Scripts - Archive of obsolete content
rom which the code being evaluated was extracted. This information is invaluable for debugging, and the flexibility with which it can be specified makes this method useful for extracting JavaScript from a number of file formats other than raw JavaScript scripts. Additionally, as Sandbox objects can be created with an arbitrary prototype object, the evaluated code can be given access to the global
properties of any existing scope. Security: Sandbox objects are initialized with a security principal object, or otherwise a window or URL from which to derive one. This means that evalInSandbox can be used to execute code with a specified privilege level rather than full chrome privileges. Beyond this, the scope of the Sandbox can be augmented or rarified to add or remove privileges as necessary. Under or...
...URL from which to derive one. This means that evalInSandbox can be used to execute code with a specified privilege level rather than full chrome privileges. Beyond this, the scope of the Sandbox can be augmented or rarified to add or remove privileges as necessary. Under ordinary circumstances, native objects passed out of Sandboxes are wrapped in XrayWrapper objects, which means that only native
properties of these objects are directly exposed to privileged code. This behavior can be reversed by setting the wantsXrays parameter to false when constructing the Sandbox. Disadvantages Performance: There are several significant performance disadvantages inherent in this method: There is currently no way to load code into sandboxes from a cache. This means that code must be compiled and execu...
.... Examples The following code will execute a simple script in a Sandbox with the privilege level of the current content page. The globals of the current content window will be available in the scripts global scope. In stack traces, the script will appear to have been loaded from the file "zz-9://plural/zed/alpha", line 42. // Use the current content window as the execution context. ...
...And 4 more matches
Binding Implementations - Archive of obsolete content
When the src attribute is specified, any children of the implementation element are ignored. Methods Methods are defined using the method element. The name given on the tag using the name attribute is the name that can be used to invoke the method on the element. ...
...ies those parameters and their names with parameter elements declared underneath the method element. The implementation of the method is contained inside a body element. The parameters specified are bound to their names in the method body. <method name="scrollToIndex"> <parameter name="index"/> <body> <![CDATA[ if (index < 0) return; ... ]]> </body> </method>
Properties Properties can also be defined on the bound element using property tags. There are two basic types of
properties. The first type of property is a raw value that is set directly on the element itself. The second type of property is one that defines functions that are invoked when the property is either retrieved or set. These functions are called getters and setters in XBL. For
properties with r...
...ing attachment and the resulting value is stored on the element. It can be assumed that the anonymous content of the binding has been fully constructed, although the bindingattached event will not have fired. Property initialization always takes place after content generation but before the firing of a binding attachment event, since the bindingattached handler needs to be able to assume that all
properties will be accessible on the binding.
Properties with getters and setters can define them using onget and onset attributes, or using the more verbose getter and setter elements. If both the attribute form and the element form are used to specify a getter or setter, then the element form is ignored. A getter contains script whose return value is handed back when the property is requested. A setter ...
...And 4 more matches
Backgrounds and borders - Learn web development
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 learn how to style the background and border of boxes. Styling backgrounds in CSS The CSS background property is a shorthand for a number of background longhand
properties that we will meet in this lesson. If you discover a complex background property in a stylesheet, it might seem a little hard to understand as so many values can be passed in at once. .box { background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 96%) center center / 400px 200px no-repeat, url(big-star.png) center no-repeat, rebeccapurple; } We'll return to how the s...
...assed in at once. .box { background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 96%) center center / 400px 200px no-repeat, url(big-star.png) center no-repeat, rebeccapurple; } We'll return to how the shorthand works later in the tutorial, but first let's have a look at the different things you can do with backgrounds in CSS, by looking at the individual background
properties. Background colors The background-color property defines the background color on any element in CSS. The property accepts any valid <color>. A background-color extends underneath the content and padding box of the element. In the example below, we have used various color values to add a background color to the box, a heading, and a <span> element. Play around with these, using any available <...
... property value, separating each one with a comma. When you do this you may end up with background images overlapping each other. The backgrounds will layer with the last listed background image at the bottom of the stack, and each previous image stacking on top of the one that follows it in the code. Note: Gradients can be happily mixed with regular background images. The other background-*
properties can also have comma-separated values in the same way as background-image: background-image: url(image1.png), url(image2.png), url(image3.png), url(image4.png); background-repeat: no-repeat, repeat-x, repeat; background-position: 10px 20px, top right; Each value of the different
properties will match up to the values in the same position in the other
properties. Above, for example, image1's bac...
...And 4 more matches
Cascade and inheritance - Learn web development
two rules which could potentially apply to the same element. The cascade, and the closely-related concept of specificity, are mechanisms that control which rule applies when there is such a conflict. Which rule is styling your element may not be the one you expect, so you need to understand how these mechanisms work. Also significant here is the concept of inheritance, which means that some CSS
properties by default inherit values set on the current element's parent element, and some don't. This can also cause some behavior that you might not expect. Let's start by taking a quick look at the key things we are dealing with, then we'll look at each in turn and see how they interact with each other and your CSS. This can seem like a set of tricky concepts to understand. As you get more practice writ...
...ter on. 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. For example, if you set a color and font-family on an element, every element inside it will also be styled with that color and font, unless you've applied different color and font values directly to them. Some
properties do not inherit -- for example if you set a width of 50% on an element, all of its descendants do not get a width of 50% of their parent's width. If this was the case, CSS would be very frustrating to use! Note: On MDN CSS property reference pages you can find a technical information box, usually at the bottom of the specifications section, which lists a number of data points about that property...
...ve then added a class of special to the second nested list and applied a different color to it. This then inherits down through its children. Things like widths (as mentioned above), margins, padding, and borders do not inherit. If a border were to be inherited by the children of our list, every single list and list item would gain a border -- probably not an effect we would ever want! Which
properties are inherited by default and which aren't is largely down to common sense. Controlling inheritance CSS provides four special universal property values for controlling inheritance. Every CSS property accepts these values. inherit Sets the property value applied to a selected element to be the same as that of its parent element. Effectively, this "turns on inheritance". initial Sets the pro...
...And 4 more matches
Handling different text directions - Learn web development
We create borders on the top, right, bottom, and left of a box, for example. These physical dimensions map very neatly to content that is viewed horizontally, and by default the web tends to support left-to-right languages (e.g. English or French) better than right-to-left languages (such as Arabic). ...
...o the fact that writing mode and direction of text can change, newer CSS layout methods do not refer to left and right, and top and bottom. Instead they will talk about start and end along with this idea of inline and block. Don't worry too much about that right now, but keep these ideas in mind as you start to look at layout; you will find it really helpful in your understanding of CSS. Logical
properties and values The reason to talk about writing modes and direction at this point in your learning however, is because of the fact we have already looked at a lot of
properties which are tied to the physical dimensions of the screen, and make most sense when in a horizontal writing mode. Let's take a look at our two boxes again -- one with a horizontal-tb writing mode and one with vertical-rl. I ha...
...s in the vertical writing mode, it still has a width, and this is causing the text to overflow. What we really want in this scenario, is to essentially swap height and width along with the writing mode. When we're in a vertical writing mode we want the box to expand in the block dimension just like it does in the horizontal mode. To make this easier, CSS has recently developed a set of mapped
properties. These essentially replace physical
properties -- things like width and height -- with logical, or flow relative versions. The property mapped to width when in a horizontal writing mode is called inline-size -- it refers to the size in the inline dimension. The property for height is named block-size and is the size in the block dimension. You can see how this works in the example below where we...
...And 4 more matches
Styling lists - Learn web development
A simple list example To begin with, let's look at a simple list example. ...
... A simple list example To begin with, let's look at a simple list example. Throughout this article, we'll look at unordered, ordered, and description lists -- all have styling features that are similar, and some that are particular to their type of list. ...
... Rules 5 and 6 apply to the description list -- we set the same line-height on the description list terms and descriptions as we did with the paragraphs and list items. Again, consistency is good! We also make the description terms have bold font, so they visually stand out easier. List-specific styles Now we've looked at general spacing techniques for lists, let's explore some list-specific
properties. There are three
properties you should know about to start with, which can be set on <ul> or <ol> elements: list-style-type: Sets the type of bullets to use for the list, for example, square or circle bullets for an unordered list, or numbers, letters or roman numerals for an ordered list. list-style-position: Sets whether the bullets appear inside the list items, or outside them before the s...
...And 4 more matches
Drawing graphics - Learn web development
first steps, building blocks, JavaScript objects), the basics of Client-side APIs Objective: To learn the basics of drawing on <canvas> elements using JavaScript. Graphics on the Web As we talked about in our HTML Multimedia and embedding module, the Web was originally just text, which was very boring, so images were introduced -- first via the <img> element and later via CSS
properties such as background-image, and SVG. This however was still not enough. While you could use CSS and JavaScript to animate (and otherwise manipulate) SVG vector images -- as they are represented by markup -- there was still no way to do the same for bitmap images, and the tools available were rather limited. The Web still had no way to effectively create animations, games, 3D scenes, and other requ...
... canvas, results in a document that's wider than the window. To get rid of the scrollbars, we need to remove the margin and also set overflow to hidden. Add the following into the <head> of your document: <style> body { margin: 0; overflow: hidden; } </style> The scrollbars should now be gone. Note: You should generally set the size of the image using HTML attributes or DOM
properties, as explained above. You could use CSS, but the trouble then is that the sizing is done after the canvas has rendered, and just like any other image (the rendered canvas is just an image), the image could become pixellated/distorted. Getting the canvas context and final setup We need to do one final thing before we can consider our canvas template finished. To draw onto the canvas we need to g...
... involve manipulating this object. Let's do one last thing before we move on. We'll color the canvas background black to give you a first taste of the canvas API. Add the following lines at the bottom of your JavaScript: ctx.fillStyle = 'rgb(0, 0, 0)'; ctx.fillRect(0, 0, width, height); Here we are setting a fill color using the canvas' fillStyle property (this takes color values just like CSS
properties do), then drawing a rectangle that covers the entire area of the canvas with thefillRect method (the first two parameters are the coordinates of the rectangle's top left hand corner; the last two are the width and height you want the rectangle drawn at -- we told you those width and height variables would be useful)! OK, our template is done and it's time to move on. 2D canvas basics As we sai...
...And 4 more matches
Chrome-only CSS reference
-moz-window-draggingThe -moz-window-dragging CSS property specifies whether a window is draggable or not. ...
... -moz-window-draggingThe -moz-window-dragging CSS property specifies whether a window is draggable or not. ...
...selected.:-moz-lwtheme-brighttextThe :-moz-lwtheme-brighttext pseudo-class matches in chrome documents when :-moz-lwtheme is true and a lightweight theme with a bright text color is selected.:-moz-lwtheme-darktextThe :-moz-lwtheme-darktext pseudo-class matches in chrome documents when :-moz-lwtheme is true and a lightweight theme with a dark text color is selected.::-moz-tree-cellActivated by the
properties attribute.::-moz-tree-cell-textActivated by the
properties attribute.::-moz-tree-cell-text(hover)The :-moz-tree-cell-text(hover) CSS pseudo-class will match an element if the mouse cursor is presently hovering over text in a tree cell.::-moz-tree-columnActivated by the
properties attribute.::-moz-tree-drop-feedbackActivated by the
properties attribute.::-moz-tree-imageActivated by the
properties ...
...And 4 more matches
Python binding for NSS
object (i.e. struct) become methods of that object. NSS/NSPR objects which are collections support the Python iteration protocol. In other words they can be iterated over, indexed by position, or used as slices. NSS/NSPR objects whose collection elements can be referenced by name support associative indexing. NSS/NSPR objects which have "get" and "set" API function calls are exposed as Python
properties. All NSS/NSPR Python objects can print their current value by evaluting the Python object in a string context or by using the Python str() function. Support threading. The Python Global Interpreter Lock (GIL) is released prior to calling NSS/NSPR C functions and reaquired after the NSS/NSPR C function returns. This allows other Python threads to execute during the time a NSS/NSPR function is pr...
...ocket.get_ssl_version_range SSLSocket.get_ssl_channel_info SSLSocket.get_negotiated_host SSLSocket.connection_info_format_lines SSLSocket.connection_info_format SSLSocket.connection_info_str SSLCipherSuiteInfo.format_lines SSLCipherSuiteInfo.format SSLChannelInfo.format_lines SSLChannelInfo.format The following class
properties were added: Certificate.ssl_trust_flags Certificate.email_trust_flags Certificate.signing_trust_flags SSLCipherSuiteInfo.cipher_suite SSLCipherSuiteInfo.cipher_suite_name SSLCipherSuiteInfo.auth_algorithm SSLCipherSuiteInfo.auth_algorithm_name SSLCipherSuiteInfo.kea_type SSLCipherSuiteInfo.kea_type_name SSLCipherSuiteInf...
...tem now converts almost all DER encoded data to a string when it's str method is invoked, formerly it was limited to only a few objects. ...
...And 4 more matches
Rhino scopes and contexts
nt to understand that a scope is independent of the Context that created it. You can create a scope using one Context and then evaluate a script using that scope and another Context (either by exiting the current context and entering another, or by executing on a different thread). You can even execute scripts on multiple threads simultaneously in the same scope. Rhino guarantees that accesses to
properties of JavaScript objects are atomic across threads, but doesn't make any more guarantees for scripts executing in the same scope at the same time. If two scripts use the same scope simultaneously, the scripts are responsible for coordinating any accesses to shared variables. A top-level scope is created by calling Context.initStandardObjects to create all the standard objects: ScriptableObject sco...
... In the diagram below, the order in which the six objects are traversed is indicated. Order of lookups in a two-deep scope chain with prototypes. For a more concrete example, let's consider the following script: var g = 7; function f(a) { var v = 8; x = v + a; } f(6); We have a top-level variable g, and the call to f will create a new top-level variable x. All top-level variables are
properties of the scope object. When we start executing f, the scope chain will start with the function's activation object and will end with the top-level scope (see diagram below). The activation object has two
properties, 'a' for the argument, and 'v' for the variable. The top-level scope has
properties for the variable g and the function f. An example scope chain for a simple script. When the statem...
...ave additional objects specific to the embedding. Then all we need to do is create a new object and call its setPrototypemethod to set the prototype to the shared object, and the parent of the new scope to null: Scriptable newScope = cx.newObject(sharedScope); newScope.setPrototype(sharedScope); newScope.setParentScope(null); The call to newObject simply creates a new JavaScript object with no
properties. It uses thesharedScope passed in to initialize the prototype with the standard Object.prototype value. We can now use newScope as a scope for calls to evaluate scripts. Let's call this scope the instance scope. Any top-level functions or variables defined in the script will end up as
properties of the instance scope. Uses of standard objects like Function, String, or RegExp will find the defini...
...And 4 more matches
Bytecode Descriptions
script on the scope chain. Implements: GetNewTarget. DynamicImport Stack: moduleId => promise Dynamic import of the module specified by the string value on the top of the stack. Implements: Import Calls. ImportMeta Stack: => import.meta Push the import.meta object. This must be used only in module code. Objects Creating objects NewInit Stack: => obj Create and push a new object with no
properties. Format: JOF_IC NewObject, NewObjectWithGroup Operands: (uint32_t baseobjIndex) Stack: => obj Create and push a new object of a predetermined shape. The new object has the shape of the template object script->getObject(baseobjIndex). Subsequent InitProp instructions must fill in all slots of the new object before it is used in any other way. For JSOp::NewObject, the new object has a group base...
...e used anywhere it might be executed more than once. There's a shell-only option, newGlobal({cloneSingletons: true}), that makes this instruction do a deep copy of the object. A few tests use it. Format: JOF_OBJECT ObjWithProto Stack: proto => obj Create and push a new ordinary object with the provided [[Prototype]]. This is used to create the .prototype object for derived classes. Defining
properties InitProp Operands: (uint32_t nameIndex) Stack: obj, val => obj Define a data property on an object. obj must be an object. Implements: CreateDataPropertyOrThrow as used in PropertyDefinitionEvaluation of regular and shorthand PropertyDefinitions. Format: JOF_ATOM, JOF_PROP, JOF_PROPINIT, JOF_IC InitHiddenProp Operands: (uint32_t nameIndex) Stack: obj, val => obj Like JSOp::InitProp, but defi...
...M, JOF_PROP, JOF_PROPINIT InitElemSetter, InitHiddenElemSetter Stack: obj, id, setter => obj Define an accesssor property on obj with property key id and the given setter. This is used to implement setters with computed property keys or numeric keys. JSOp::InitHiddenElemSetter is the same but defines a non-enumerable property, for setters in classes. Format: JOF_ELEM, JOF_PROPINIT Accessing
properties GetProp, CallProp Operands: (uint32_t nameIndex) Stack: obj => obj[name] Get the value of the property obj.name. This can call getters and proxy traps. JSOp::CallProp is exactly like JSOp::GetProp but hints to the VM that we're getting a method in order to call it. Implements: GetV, GetValue step 5. Format: JOF_ATOM, JOF_PROP, JOF_TYPESET, JOF_IC GetElem, CallElem Stack: obj, key => obj[key]...
...And 4 more matches
Shell global objects
r toggle JavaScript options. load(['foo.js' ...]) Load files named by string arguments. Filename is relative to the current working directory. loadRelativeToScript(['foo.js' ...]) Load files named by string arguments. Filename is relative to the calling script. evaluate(code[, options]) Evaluate code as though it were the contents of a file. ...
... Return any --module-load-path argument passed to the shell. Used by the module loader. parse(code) Parses a string, potentially throwing. syntaxParse(code) Check the syntax of a string, returning success value offThreadCompileScript(code[, options]) Compile code on a helper thread. To wait for the compilation to finish and run the code, call runOffThreadScript. ...
...g. clearLastWarning() Clear the last warning. elapsed() Execution time elapsed for the current thread. decompileFunction(func) Decompile a function. decompileThis() Decompile the currently executing script. thisFilename() Return the filename of the current script newGlobal([options]) Return a new global object in a new compartment. If options is given, it may have any of the following
properties: sameZoneAs the compartment will be in the same zone as the given object (defaults to a new zone) invisibleToDebugger the global will be invisible to the debugger (default false) principal if present, its value converted to a number must be an integer that fits in 32 bits; use that as the new compartment's principal. Shell principals are toys, meant only for testing; one shell princ...
...And 4 more matches
Places Developer Guide
/ The id of the folder the livemark will be placed in "My Livemark Title", // The title of the livemark siteURI, // The URI of the site. A nsIURI object. feedURI, // The URI of the actual feed. A nsIURI object. bookmarks.DEFAULT_INDEX); // The position of the livemark in its parent folder. ...
...f the first subfolder matching the given title. Int64 getIdForItemAt(aFolderId, aPosition) - Returns the id of the item at the given position (throws if there's no item there). Bool getFolderReadonly(aFolderId) Accessing Folder Contents Queries in Places are executed through the main history service. The example below shows how to enumerate a bookmark folder's contents, and how to access the
properties of the items themselves. var history = Cc["@mozilla.org/browser/nav-history-service;1"] .getService(Ci.nsINavHistoryService); var query = history.getNewQuery(); query.setFolders([myFolderId], 1); var result = history.executeQuery(query, history.getNewQueryOptions()); // The root property of a query result is an object representing the folder you specified above. var folderNode = result.root; //...
...lderId], 1); var result = history.executeQuery(query, history.getNewQueryOptions()); // The root property of a query result is an object representing the folder you specified above. var folderNode = result.root; // Open the folder, and iterate over its contents. folderNode.containerOpen = true; for (var i=0; i < folderNode.childCount; ++i) { var childNode = folderNode.getChild(i); // Some item
properties. var title = childNode.title; var id = childNode.itemId; var type = childNode.type; // Some type-specific actions. if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_URI) { var uri = childNode.uri; } else if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER) { childNode.QueryInterface(Ci.nsINavHistoryContainerResultNode); childNode.containerOpen = true; // now you can iterate...
...And 4 more matches
Avoiding leaks in JavaScript XPCOM components
om JavaScript) would just work the other way around. And in the simple case, they do. The wrapper owns a reference to the native object that it wraps, and the wrapper object is kept alive by the JavaScript garbage collector. This problem is only in versions of Mozilla prior to Mozilla 1.8. However, it's not quite that simple, because of the convention that DOM nodes can have arbitrary JavaScript
properties added to them by the programmer. These
properties have to be preserved across garbage collections, even if the wrapper is not reachable from any garbage collection root, since the JavaScript programmer could access the DOM node again the same way he did the first time, and would then expect the added
properties to still be there. We currently implement this by making the wrapper a root in the Jav...
...eachable from any garbage collection root, since the JavaScript programmer could access the DOM node again the same way he did the first time, and would then expect the added
properties to still be there. We currently implement this by making the wrapper a root in the JavaScript garbage collector once somebody sets a JavaScript property on a DOM node. (This is roughly equivalent to making all the
properties roots, but simpler.) Once this happens, it remains a root until the document stops being displayed. This means that neither the element nor any of the
properties nor any of the objects reachable from those
properties can be freed until the document is no longer displayed. You might think that it's unusual to set arbitrary
properties on DOM nodes. And in many cases it is. But in one important cas...
... until the document stops being displayed. This means that neither the element nor any of the
properties nor any of the objects reachable from those
properties can be freed until the document is no longer displayed. You might think that it's unusual to set arbitrary
properties on DOM nodes. And in many cases it is. But in one important case it's not: XBL. XBL fields are implemented as JavaScript
properties on the bound element's wrapper, so they have all the hazards of JavaScript
properties. (On wrapped objects other that DOM nodes, we allow JavaScript programmers to set
properties, but we don't do anything to protect them from garbage collection. This makes program behavior depend on when garbage collection happens, which means the API is nondeterministic, which is really bad. This situation may ...
...And 4 more matches
nsIAbCard/Thunderbird3
Note: This interface has been overhauled completely for Thunderbird 3. Documentation for the old nsIAbCard interface is currently at nsIAbCard. The nsIAbCard interface is used to represent and manipulate cards in the address book. In a big change from the original nsIAbCard,
properties are now stored in a hash table instead of as attributes on the interface, allowing it to be more flexible.
Properties currently supported on the card: Names: FirstName, LastName PhoneticFirstName, PhoneticLastName DisplayName, NickName SpouseName, FamilyName PrimaryEmail, SecondEmail Home Contact: HomeAddress, HomeAddress2, HomeCity, HomeState, HomeZipCode, HomeCountry HomePhone, HomePhoneType Work contact. Same as home, but with `Work' instead of `Home' Other Conta...
...ut with `Work' instead of `Home' Other Contact: FaxNumber, FaxNumberType PagerNumber, PagerNumberType CellularNumber, CellularNumberType JobTitle, Department, Company _AimScreenName Dates: AnniversaryYear, AnniversaryMonth, AnniversaryDay BirthYear, BirthMonth, BirthDay WebPage1 (work), WebPage2 (home) Custom1, Custom2, Custom3, Custom4 Notes Integral
properties: LastModifiedDate PopularityIndex PreferMailFormat (see nsIAbPreferMailFormat) Boolean
properties: AllowRemoteContent Inherits from: nsIAbItem Method overview nsIVariant getProperty(in AUTF8String name, in nsIVariant defaultValue); [noscript] AString getPropertyAsAString(in string name); [noscript] AUTF8String getPropertyAsAUTF8String(in...
... firstName AString Shorthand for getProperty and setProperty. lastName AString Shorthand for getProperty and setProperty. displayName AString Shorthand for getProperty and setProperty. primaryEmail ...
...And 4 more matches
Element - Web APIs
More specific classes inherit from Element. For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy. Languages outside the realm of the Web platform, like XUL through the XULElement interface, also implement Element. ...
...It implements the
properties of ParentNode, ChildNode, NonDocumentTypeChildNode, and Animatable. Element.attributes Read only Returns a NamedNodeMap object containing the assigned attributes of the corresponding HTML element. Element.classList Read only Returns a DOMTokenList conta...
... Element.attributes Read only Returns a NamedNodeMap object containing the assigned attributes of the corresponding HTML element. Element.classList Read only Returns a DOMTokenList containing the list of cla...
...And 4 more matches
HTMLImageElement - Web APIs
The HTMLImageElement interface represents an HTML <img> element, providing the
properties and methods used to manipulate image elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke...
...a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Image() The Image() constructor creates and returns a new HTMLImageElement object representing an HTML <img> element which is not attached to any DOM tree. It accepts optional width and height parameters. When called without parameters, new Image() is equivalent to calling document.createElement("img").
Properties Inherits
properties from its parent, HTMLElement. HTMLImageElement.alt A DOMString that reflects the alt HTML attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded. HTMLImageElement.complete Read only Returns a Boolean that is true if the browser has finished fetching the image, whether successful or not. That means this value is also t...
... in CSS pixels. HTMLImageElement.x Read only An integer indicating the horizontal offset of the left border edge of the image's CSS layout box relative to the origin of the <html> element's containing block. HTMLImageElement.y Read only The integer vertical offset of the top border edge of the image's CSS layout box relative to the origin of the <html> element's containing block. Obsolete
properties HTMLImageElement.align A DOMString indicating the alignment of the image with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". This is obsolete; you should instead use CSS (such as text-align, which works with images despite its name) to specify the alignment. HTMLImageElement.border A DOMString which defines the width of the border s...
...And 4 more matches
The HTML DOM API - Web APIs
, in which a node is a fundamental record representing a single object within the document (such as an element or text node). Nodes may be strictly organizational, providing a means for grouping other nodes together or for providing a point at which a hierarchy can be constructed; other nodes may represent visible components of a document. Each node is based on the Node interface, which provides
properties for getting information about the node as well as methods for creating, deleting, and organizing nodes within the DOM. Nodes don't have any concept of including the content that is actually displayed in the document. They're empty vessels. The fundamental notion of a node that can represent visual content is introduced by the Element interface. An Element object instance represents a single elem...
...ed to both elements and documents; these presently include only copy, cut, and paste actions. HTML element interfaces The Element interface has been further adapted to represent HTML elements specifically by introducing the HTMLElement interface, which all more specific HTML element classes inherit from. This expands the Element class to add HTML-specific general features to the element nodes.
Properties added by HTMLElement include for example hidden and innerText. HTMLElement also adds all the global event handlers. An HTML document is a DOM tree in which each of the nodes is an HTML element, represented by the HTMLElement interface. The HTMLElement class, in turn, implements Node, so every element is also a node (but not the other way around). This way, the structural features implemented by ...
...nterface is generic, however, providing only the functionality common to all HTML elements such as the element's ID, its coordinates, the HTML making up the element, information about scroll position, and so forth. ...
...And 4 more matches
::first-line (:first-line) - CSS: Cascading Style Sheets
the length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text. /* 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. Browsers also accept :first-line, introduced in CSS2. ...
...n many factors, including the width of the element, the width of the document, and the font size of the text. /* 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. Browsers also accept :first-line, introduced in CSS2. ...
...d the font size of the text. /* 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. Browsers also accept :first-line, introduced in CSS2. ...
...And 4 more matches
Border-image generator - CSS: Cascading Style Sheets
--> <div id="border-width-control" class="category"> <div class="title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="title"> border-image-outset </div> </div> <!-- other-settings --> <div id="aditional-
properties" class="category"> <div class="title"> aditional-
properties </div> <div class="property"> <div class="name"> repeat-x </div> <div class="ui-dropdown border-repeat" data-topic="image-repeat-X" data-selected="2"> <div data-value="0">repeat</div> <div data-value="0">stretch</div> ...
...t; width: 80px; } #controls .border-repeat .ui-dropdown-list { height: 6.2em; border-width: 1px; text-align: center; } /* border-image-slice */ #border-slice-control .ui-dropdown-list { height: 4.3em; } /* border-image-width */ #border-width-control .ui-dropdown-list { height: 6.2em; } /* border-image-outset */ #border-outset-control .ui-dropdown-list { height: 4.3em; } #aditional-
properties .property { width: 200px; } #aditional-
properties .ui-input-slider > input { width: 80px !important; } /* unit settings panel */ #unit-settings { padding: 10px; position: absolute; background: #FFF; font-size: 12px; border-radius: 3px; border: 1px solid #CCC; text-align: center; color: #555; position: absolute; z-index: 1000; box-shadow: 0 0 3px 0 #BABABA; transition: all 0.2...
...}; var load = function load() { browse.click(); }; browse.setAttribute('type', 'file'); browse.style.display = 'none'; browse.onchange = loadImage; return { load: load }; })(); var ImageControl = (function ImageControl() { var scale = 0.5; var imgSource = new Image(); var imgState = null; var selected = null; var topics = ['slice', 'width', 'outset']; var
properties = {};
properties['border1'] = { fill : false, slice_values : [27, 27, 27, 27], width_values : [20, 20, 20, 20], outset_values : [0, 0, 0, 0], slice_units : [0, 0, 0, 0], width_units : [0, 0, 0, 0], outset_units : [0, 0, 0, 0], repeat : [1, 1], size : [300, 200], preview_area : 400 };
properties['border2'] = { fill : false, slice_values : [3...
...And 4 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
t speeds. CSS was therefore modularised, and the various CSS Specifications are different modules that make up CSS today. These modules relate to each other, and are at different stages of development. The box alignment module For many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container. Flexbox provides access to
properties that allow the alignment of items on their cross axis and justification of items on the main axis. These
properties started life in the flexbox specification, but are now also part of the Box Alignment Specification. This specification details how alignment works in all layout -- not just flexbox. Box alignment deals with alignment and justification, and also distribution of space along an axis.
...n their cross axis and justification of items on the main axis. These
properties started life in the flexbox specification, but are now also part of the Box Alignment Specification. This specification details how alignment works in all layout -- not just flexbox. Box alignment deals with alignment and justification, and also distribution of space along an axis. The reason that the Box alignment
properties remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types. There is a note in the flexbox spec stating that in the future, once it is completed, the definitions in Box Alignment Level 3 will supersede those of flexbox: "Note: While the ali...
... detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types. There is a note in the flexbox spec stating that in the future, once it is completed, the definitions in Box Alignment Level 3 will supersede those of flexbox: "Note: While the alignment
properties are defined in CSS Box Alignment [CSS-ALIGN-3], Flexible Box Layout reproduces the definitions of the relevant ones here so as to not create a normative dependency that may slow down advancement of the spec. These
properties apply only to flex layout until CSS Box Alignment Level 3 is finished and defines their effect for other layout modes. Additionally, any new values defined in the Box Alignme...
...And 4 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
t space, and have a couple of options. We either display the space outside of the items -- therefore spacing them out with white space between or around them -- or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space. Space distributed outside the items To distribute the space between or around the items we use the alignment
properties in flexbox, and the justify-content property. You can read more about this property in Aligning Items in a flex container, which deals with aligning items on the main axis. In the below live example we display the items at their natural size and by using justify-content: space-between make equal amounts of space between the items. You can change how the space is distributed using the space-aroun...
...here supported, space-evenly. You could also use flex-start to place the space at the end of the items, flex-end to place it before them, or center to centre the navigation items. Space distributed within the items A different pattern for navigation would be to distribute the available space within the items themselves, rather than create space between them. In this case we would use the flex
properties to allow items to grow and shrink in proportion to one another as described in Controlling ratios of flex items along the main axis. If I wanted all of my navigation items to have equal width, then I might use flex: auto, which is the shorthand for flex: 1 1 auto -- all items grow and shrink from a flex-basis of auto. This would mean that the longer item would have more space. In the live examp...
...haviour of flexbox, and we are aligning the item on the right by giving it a left margin of auto. You can move the class from one item to another to change where the split happens. Also in this example we are using margins on the flex items to create a gap between items, and a negative margin on the container in order that the items still remain flush with the right and left edges. Until the gap
properties from the Box Alignment specification are implemented in flexbox, we have to use margins in this way if we want to create a gutter between items. Center item Before flexbox, developers would joke that the hardest problem in web design was vertical centering. This has now been made straightforward using the alignment
properties in flexbox, as the following live example shows. You can play with...
...And 4 more matches
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
In this guide, we look at how flow layout behaves when used with different document writing modes. This is not a comprehensive guide to the use of writing modes in CSS, the aim here is to document the areas where flow layout interacts with writing modes in possibly unanticipated ways. The external resources and see also sections of this document link to more writing modes resources. ...
... external resources and see also sections of this document link to more writing modes resources. The Writing Modes Specification The CSS Writing Modes Level 3 Specification defines the impact a change the document writing mode has on flow layout. In the writing modes introduction, the specification says, "A writing mode in CSS is determined by the writing-mode, direction, and text-orientation
properties. It is defined primarily in terms of its inline base direction and block flow direction." The specification defines the inline base direction as the direction in which content is ordered on a line. This defines the start and end of the inline direction. The start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line. The block flow dire...
...riting mode. The CSS writing-mode property controls the block flow direction. If you want to change your page, or part of your page, to vertical-lr then you can set writing-mode: vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. While certain languages will use a particular writing mode or text direction, we can also use these
properties for creative effect, such as running a heading vertically. The writing-mode property and block flow The writing-mode property accepts the values horizontal-tb, vertical-rl and vertical-lr. These values control the direction that blocks flow on the page. The initial value is horizontal-tb, which is a top to bottom block flow direction with a horizontal inline direction. Left to right languages...
...And 4 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with Grid. One-dimensional vs. two-dimensional layout A simple example can demonstrate the difference between one- and two-dimensional layouts. In this first example, I am using flexbox to lay out a set of boxes. I have five child items in my container, and I have given the flex
properties values so that they can grow and shrink from a flex-basis of 150 pixels. I have also set the flex-wrap property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px sol...
...s most exciting to many of us was that it gave us proper alignment control for the first time. It made it easy to center a box on the page. Flex items can stretch to the height of the flex container, meaning that equal height columns were possible. These were things we have wanted to do for a very long time, and have come up with all kinds of hacks to accomplish, at least visually. The alignment
properties from the flexbox specification have been added to a new specification called Box Alignment Level 3. This means that they can be used in other specifications, including Grid Layout. In the future, they may well apply to other layout methods as well. In a later guide in this series, I'll be taking a proper look at Box Alignment and how it works in Grid Layout. For now, here is a comparison between...
... <div class="wrapper"> <div class="box1">One</div> <div class="box2">Two</div> <div class="box3">Three</div> </div> .wrapper { display: flex; align-items: flex-end; min-height: 200px; } .box1 { align-self: stretch; } .box2 { align-self: flex-start; } Alignment in CSS Grids This second example uses a grid to create the same layout. This time we are using the box alignment
properties as they apply to a grid layout. So we align to start and end rather than flex-start and flex-end. In the case of a grid layout, we are aligning the items inside their grid area. In this case that is a single grid cell, but it could be an area made up of several grid cells. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } ...
...And 4 more matches
border-radius - CSS: Cascading Style Sheets
oject, please clone https://github.com/mdn/interactive-examples and send us a pull request. The radius applies to the whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property. The border-radius property does not apply to table elements when border-collapse is collapse. ...
...s no border; the exact position of the clipping is defined by the background-clip property. The border-radius property does not apply to table elements when border-collapse is collapse. Note: As with any shorthand property, individual sub-
properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing definitions. Instead, the individual longhand
properties have to be used. ...
...ipping is defined by the background-clip property. The border-radius property does not apply to table elements when border-collapse is collapse. Note: As with any shorthand property, individual sub-
properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing definitions. Instead, the individual longhand
properties have to be used. ...
...And 4 more matches
border-right - CSS: Cascading Style Sheets
It sets those that are not specified to their default values. This means that ... border-right-style: dotted; border-right: thick green; ... is actually the same as ... border-right-style: dotted; border-right: none thick green; ... ...
...It sets those that are not specified to their default values. This means that ... border-right-style: dotted; border-right: thick green; ... is actually the same as ... border-right-style: dotted; border-right: none thick green; ... ...
...It sets those that are not specified to their default values. This means that ... border-right-style: dotted; border-right: thick green; ... is actually the same as ... border-right-style: dotted; border-right: none thick green; ... ...
...And 4 more matches
border-top - CSS: Cascading Style Sheets
It sets those that are not specified to their default values. This means that ... border-top-style: dotted; border-top: thick green; ... is actually the same as ... border-top-style: dotted; border-top: none thick green; ... ...
...It sets those that are not specified to their default values. This means that ... border-top-style: dotted; border-top: thick green; ... is actually the same as ... border-top-style: dotted; border-top: none thick green; ... ...
...It sets those that are not specified to their default values. This means that ... border-top-style: dotted; border-top: thick green; ... is actually the same as ... border-top-style: dotted; border-top: none thick green; ... and the value of border-top-style given before border-top is ignored. ...
...And 4 more matches
flex - CSS: Cascading Style Sheets
The flex CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...perty sets how a flex item will grow or shrink to fit the space available in its flex container. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...st be one of: a <number>: then it is interpreted as <flex-shrink>. a valid value for width: then it is interpreted as <flex-basis>. Three-value syntax: the values must be in the following order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. Values initial The item is sized according to its width and height
properties. It shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container. This is equivalent to setting "flex: 0 1 auto". auto The item is sized according to its width and height
properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container. This is equivalent to setting "flex:...
...And 4 more matches
transition - CSS: Cascading Style Sheets
xample is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Transitions enable you to define the transition between two states of an element. Different states may be defined using pseudo-classes like :hover or :active or dynamically set using JavaScript. ...
...ibute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Transitions enable you to define the transition between two states of an element. Different states may be defined using pseudo-classes like :hover or :active or dynamically set using JavaScript. ...
... Each single-property transition describes the transition that should be applied to a single property...
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Increments the value of a numeric input by one or by the specified number of units. CSS Inputs, being replaced elements, have a few features not applicable to non form elements. There are CSS selectors that can specification target form controls based on their UI features, also known as UI pseudo-classes. The input element can also be targeted by type with attribute selectors. There are some
properties that are especially useful as well. UI pseudo-classes Captions super relevant to the <input> element: Pseudo-class Description :enabled Any currently enabled element that can be activated (selected, clicked on, typed into, etc.) or accept focus and also has a disabled state, in which it can't be activated or accept focus. :disabled Any currently disabled...
...password"] {} /* matches a form control whose valid values are limited to a range of values*/ input[min][max] {} /* matches a form control with with a pattern attribute */ input[pattern] {} ::placeholder By default, the appearance of placeholder text is a translucent or light gray. The ::placeholder pseudo-element is the input's placeholder text. It can be styled with a limited subset of CSS
properties. ::placeholder { color: blue; } Only the subset of CSS
properties that apply to the ::first-line pseudo-element can be used in a rule using ::placeholder in its selector. appearance The appearance property enables the displaying of (almost) any element as a platform-native style based on the operating system's theme as well as the removal of any platform-native styling with the none value. ...
...stom { caret-color: red; font: 16px "Helvetica", "Arial", "sans-serif" } Result object-position and object-fit In certain cases (typically involving non-textual inputs and specialized interfaces), the <input> element is a replaced element. When it is, the position and size of the element's size and positioning within its frame can be adjusted using the CSS object-position and object-fit
properties Styling For more information about adding color to elements in HTML, see: Applying color to HTML elements using CSS. Also see: Styling HTML forms, advanced styling for HTML forms, and the compatibility table of CSS
properties. Additional features Labels Labels are needed to associate assistive text with an <input>. The <label> element provides explanatory information about a form f...
...And 4 more matches
JavaScript data types and data structures - JavaScript
These can be used to build other data structures. Wherever possible, comparisons with other languages are drawn. Dynamic typing JavaScript is a loosely typed and dynamic language. ...
... number often represents only its value, JavaScript provides binary (bitwise) operators. Caution: Although bitwise operators can be used to represent several Boolean values within a single number using bit masking, this is usually considered a bad practice. JavaScript offers other means to represent a set of Booleans (like an array of Booleans, or an object with Boolean values assigned to named
properties). Bit masking also tends to make the code more difficult to read, understand, and maintain. It may be necessary to use such techniques in very constrained environments, like when trying to cope with the limitations of local storage, or in extreme cases (such as when each bit over the network counts). This technique should only be considered when it is the last measure that can be taken to optim...
... the appropriate abstraction. Symbol type A Symbol is a unique and immutable primitive value and may be used as the key of an Object property (see below). In some programming languages, Symbols are called "atoms". For more details see Symbol and the Symbol object wrapper in JavaScript. Objects In computer science, an object is a value in memory which is possibly referenced by an identifier.
Properties In JavaScript, objects can be seen as a collection of
properties. With the object literal syntax, a limited set of
properties are initialized; then
properties can be added and removed. Property values can be values of any type, including other objects, which enables building complex data structures.
Properties are identified using key values. A key value is either a String or a Symbol value. Th...
...And 4 more matches
core/heritage - Archive of obsolete content
much machinery exposed. Dog.prototype.type = 'dog'; Dog.prototype.bark = function bark() { return 'Ruff! Ruff!' }; // Subclassing a `Dog` function Pet(name, breed) { // Once again we do our little dance if (!(this instanceof Pet)) return new Pet(name, breed); Dog.call(this, name); this.breed = breed; } // To subclass, you need to make another special dance with special // 'prototype'
properties. Pet.prototype = Object.create(Dog.prototype); // If you want correct instanceof behavior you need to make a dance with // another special `constructor` property of the `prototype` object. Object.defineProperty(Pet.prototype, 'constructor', { value: Pet }); // Finally you can define some
properties. Pet.prototype.call = function(name) { return this.name === name ? this.bark() : ''; }; Since SD...
...xel.toString(); // => #CC3399@11:23 pixel instanceof Pixel // => true pixel instanceof Point // => true extend Module exports extend utility function, that is useful for creating objects that inherit from other objects, without associated classes. It's very similar to Object.create, only difference is that second argument is an object containing
properties to be defined, instead of property descriptor map. Also, keep in mind that returned object will be frozen. var { extend } = require('sdk/core/heritage'); var base = { a: 1 }; var derived = extend(base, { b: 2 }); derived.a // => 1 derived.b // => 2 base.isPrototypeOf(derived) // => true mix Module exports mix utility function that is usefu...
...d, instead of property descriptor map. Also, keep in mind that returned object will be frozen. ...
...And 3 more matches
util/object - Archive of obsolete content
Properties are merged with descriptors onto the source object. Any argument given with "falsy" values (null, undefined) in case of objects are skipped. ...
...
Properties are merged with descriptors onto the source object. Any argument given with "falsy" values (null, undefined) in case of objects are skipped. ...
...
Properties are merged with descriptors onto the source object. Any argument given with "falsy" values (null, undefined) in case of objects are skipped. ...
...And 3 more matches
Install Manifests - Archive of obsolete content
t of the Install Manifest is RDF/XML. The file must be called install.rdf and live at the top level of an add-on's XPI file. Layout The basic layout of an Install Manifest is like so: <?xml version="1.0" encoding="UTF-8"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <!--
properties --> </Description> </RDF> Some
properties are required, some are optional. Some have simple string values, some are complex resources. Required Property Reference Your Install Manifest must specify these
properties correctly otherwise your add-on may not install. id The ID of the extension, which must be one of the following: GUID (Firefox 1.0) A string formatted like so: extensionnam...
...2</em:version> Firefox 1.5 / XULRunner 1.8 - add-ons that do not use a valid version format will not be installed. The version format is different from, although backwards-compatible with, 1.0's. For add-ons hosted on addons.mozilla.org - Mozilla's update website may repackage your add-on and correct or reject malformed version strings. Optional Property Reference You may need to supply these
properties, depending on the capabilities of your add-on. aboutURL The chrome:// URL of the extension's about dialog box. This is only useful to extensions. If this property is specified, in the about:addons extensions list, the About... link in the extension's context menu will show this dialog, rather than the default. Note: As of Gecko 2.0, the dialog receives the Addon object representing your add-...
... this information for. Examples This declares a set of add-on metadata to be displayed when the application is running in the de-DE locale. <em:localized> <Description> <em:locale>de-DE</em:locale> <em:name>Tab Sidebar</em:name> <em:description>Zeigt in einer Sidebar Vorschaubilder der Inhalte aller offenen Tabs an.</em:description> </Description> </em:localized> The following
properties which are described elsewhere in this page can be included in the localized property: name description creator homepageURL developer translator contributor More documentation can be found at Localizing extension descriptions. optionsType The type of user-interface used for displaying the options. Accepted values are: 1 Opens optionsURL in a dialog box 2 Optio...
...And 3 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
e: There are still some scenarios where incompatibilities may arise, such as trying to cancel the function call under a certain set of conditions when other Add-ons have overridden the same function. Again, this is a problem with the "string-patch" method, too. How to handle this is inter-Add-on specific and not addressed in this article. Overriding/Extending/Amending existing objects (or object
properties) Again, you might be tempted to uneval(), string replace and eval() existing objects to override them (or at least some
properties). Of course, the issues given in the previous section about functions remain. Alternative: Just assign Most of the time, assigning
properties will just work. someExistingObject.someProperty = "abc"; // We already demonstrated with with functions in a previous exa...
...because the object is frozen or sealed, then creating a Proxy around the object might be a viable approach. ...
...because the object is frozen or sealed, then creating a Proxy around the object might be a viable approach. ...
...And 3 more matches
Menu - Archive of obsolete content
ure.import("menu"); Menus All menus in Jetpack are jetpack.Menu objects, including both built-in Firefox menus and menus that features create. To create a new menu, use one of the jetpack.Menu constructors below. Constructors jetpack.Menu() Creates an empty menu. jetpack.Menu(menuitems) Creates a menu with the given items. Parameters menuitems An array of menuitems. jetpack.Menu(
properties) Creates a menu with specific
properties. Parameters
properties An object defining any of the
properties below. The items property may be used to define an array of menuitems.
Properties Property Type Description beforeHide function A function invoked just before the menu is hidden. If the menu is a context menu, it is called...
...t before the item's menu is shown and when the items array of the item's menu is retrieved. It must return a non-function menuitem. If the item belongs to a context menu, the function is called as function(context) and otherwise function(). context is an object describing the context in which the menu was shown. string A simple menuitem with the given string label. object A menuitem with specific
properties. The object may define any of the
properties listed below.
Properties Property Type Description command function A function that will be called when the menuitem is clicked. If the menu property is present, command will instead be called when any of the item's descendants is clicked. In that case, the commands of descendants will be...
... A character that is used as the item's shortcut key while the menu is open. It should be one of the characters that appears in the item's label. On some platforms this character is underlined in the label. type string Currently only "separator" is supported. If this property is undefined, the item is a normal menuitem. Note that when type == "separator", any other
properties (such as label) may be specified. Fancy separators may behave differently on different platforms, however. xulId string The ID of the menuitem's backing XUL element, exposed for the benefit of advanced developers. Menu bar menus jetpack.menu When you need to expose functionality through a menu but no menu in particular, do The Right Thing by using jetpack.men...
...And 3 more matches
loadResources - Archive of obsolete content
This method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file. ...
...This method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file. ...
...This method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file. Be aware that the parameter specifies the file within the XPI and not on the file system, as the following example demonstrates. ...
...And 3 more matches
Modifying a XUL Interface - Archive of obsolete content
de() function and the copy is appended using appendChild(). Note that some elements, such as listbox and menulist provide some additional specialized modification functions which you should use instead when you can. These are described in the next section. Manipulating Basic Elements The main XUL elements such as buttons, checkboxes and radio buttons may be manipulated using a number of script
properties. ...
...and the copy is appended using appendChild(). Note that some elements, such as listbox and menulist provide some additional specialized modification functions which you should use instead when you can. These are described in the next section. Manipulating Basic Elements The main XUL elements such as buttons, checkboxes and radio buttons may be manipulated using a number of script
properties. ...
...dditional specialized modification functions which you should use instead when you can. These are described in the next section. Manipulating Basic Elements The main XUL elements such as buttons, checkboxes and radio buttons may be manipulated using a number of script
properties. The
properties available are listed in the element reference as those available are different for each element. Common
properties that you will manipulate include the label, value, checked and disabled
properties. They set or clear the corresponding attribute as necessary. Label and value
properties examples Here is a simple example which changes the label on a button: Example 3 : Source View <button label="Hello" oncommand="this.label = 'Goodbye';"/> When the button is pressed, the label is changed. This technique will wo...
...And 3 more matches
Property Files - Archive of obsolete content
An example is shown below: notFoundAlert=No files were found matching the criteria. ...
...iles are suitable when you have text in a XUL file. However, a script does not get parsed for entities. In addition, you may wish to display a message which is generated from a script, if, for example, you do not know the exact text to be displayed. For this purpose, property files can be used. A property file contains a set of strings. You will find property files alongside the DTD files with a .
properties extension.
Properties in the file are declared with the syntax name=value. An example is shown below: notFoundAlert=No files were found matching the criteria. deleteAlert=Click OK to have all your files deleted. resultMessage=%2$S files found in the %1$S directory. Here, the property file contains three
properties. These would be read by a script and displayed to the user. A property file can al...
...d in the %1$S directory. Here, the property file contains three
properties. These would be read by a script and displayed to the user. A property file can also include comments. A line that begins with a hash sign ('#') is treated as a comment: # This is a comment welcomeMessage=Hello, world! # This is another comment goodbyeMessage=Come back soon! Stringbundles You could write the code to read
properties yourself, however XUL provides the stringbundle element which does this for you. The element has a number of functions which can be used to get strings from the property file and get other locale information. This element reads in the contents of a property file and builds a list of
properties for you. You can then look up a particular property by name. <stringbundleset id="stringbundleset"> <str...
...And 3 more matches
Old Proxy API - Archive of obsolete content
JavaScript. The default object semantics are implemented in the JavaScript engine, often written in lower-level languages like C++. Proxies let the programmer define most of the behavior of an object in JavaScript. They are said to provide a meta-programming API. Terminology catch-all mechanism (or "intercession API") The technical term for this feature. handler The object that intercepts
properties. proxy The object whose
properties are being intercepted. proxy factory The object or method that creates intercessive proxies. traps The methods that provide property access. This is analogous to the concept of traps in operating systems. Proxies can be either be trapping or fixed. Proxy API Catch-alls can be defined only on distinct proxy objects, controlled by a handler object. There...
...e chain. Object.getOwnPropertyNames(proxy) getOwnPropertyNames: function() -> Strings Array Return an array of all own (non-inherited) property names of the emulated object. Object.getPropertyNames(proxy) getPropertyNames: function() -> Strings Array This function doesn't exist in ECMAScript 5. Like getOwnPropertyNames, but should also return non-overridden inherited
properties. Object.defineProperty(proxy,name,pd) defineProperty: function(name, propertyDescriptor) -> any Define a new property whose attributes are determined by the given propertyDescriptor. The return value of this method is ignored. delete proxy.name delete: function(name) -> boolean Delete the named property from the proxy. The boolean return value of this method should i...
...er or not the name property was successfully deleted. Object.freeze(proxy) Object.seal(proxy) Object.preventExtensions(proxy) fix: function() -> PropertyDescriptor map (indexed on property names) | undefined Should return an object that maps property names to property descriptors. After a call to fix(), the proxy becomes a regular (non-proxy) object with the
properties listed in the return value. The handler is no longer used. Moreover, the respective method (freeze(), seal(), or preventExtension()) is immediately called on the fixed object. Note: the fixed object has the same object identity as the proxy object. If fix() returns undefined, the call throws a TypeError exception. Derived traps Default implementation refers to the code that is ca...
...And 3 more matches
Implementing feature detection - Learn web development
ment('div'); if (testElem.style.flex !== undefined && testElem.style.flexFlow !== undefined) { conditional.setAttribute('href', 'flex-layout.css'); } else { conditional.setAttribute('href', 'float-layout.css'); } Here we are grabbing a reference to the second <link> element, and creating a <div> element as part of our test. In our conditional statement, we test that the flex and flex-flow
properties exist in the browser. Note how the JavaScript representations of those
properties that are stored inside the HTMLElement.style object use lower camel case, not hyphens, to separate the words. Note: If you have trouble getting this to work, you can compare it to our css-feature-detect-finished.html code (see also the live version). When you save everything and try out your example, you should ...
... css-feature-detect-finished.html code (see also the live version). When you save everything and try out your example, you should see the flexbox layout applied to the page if the browser supports modern flexbox, and the float layout if not. Note: Often such an approach is overkill for a minor feature detection problem -- you can often get away with using multiple vendor prefixes and fallback
properties, as described in CSS fallback behavior and Handling CSS prefixes. @supports In recent times, CSS has had its own native feature detection mechanism introduced -- the @supports at-rule. This works in a similar manner to media queries (see also Responsive design problems) -- except that instead of selectively applying CSS depending on a media feature like a resolution, screen width or aspect rat...
...-right: 0; } } This at-rule block applies the CSS rule within only if the current browser supports both the flex-flow: row and flex: 1 declarations. For each condition to work, you need to include a complete declaration (not just a property name) and NOT include the semi-colon on the end. @supports also has OR and NOT logic available -- the other block applies the float layout if the flexbox
properties are not available: @supports not (flex-flow: row) and (flex: 1) { /* rules in here */ } This may look a lot more convenient than the previous example -- we can do all of our feature detection in CSS, no JavaScript required, and we can handle all the logic in a single CSS file, cutting down on HTTP requests. the problem here is browser support -- @supports is not supported at all in IE, and ...
...And 3 more matches
Gecko info for Windows accessibility vendors
interested in only a few attributes per node. HRESULT get_attributesForNames( /* [in] */ unsigned short numAttribs, /* [in] */ BSTR __RPC_FAR *attribNames, /* [in] */ short __RPC_FAR *nameSpaceID, /* [out] */ BSTR __RPC_FAR *attribValues); The get_computedStyle method is used to find out the cumulative, computed results for all style rules applied to a node. ...
...node. HRESULT get_attributesForNames( /* [in] */ unsigned short numAttribs, /* [in] */ BSTR __RPC_FAR *attribNames, /* [in] */ short __RPC_FAR *nameSpaceID, /* [out] */ BSTR __RPC_FAR *attribValues); The get_computedStyle method is used to find out the cumulative, computed results for all style rules applied to a node. The return value numStyle
Properties specifies the number of style
properties for this node, and the last 2 parameters return 2 arrays corresponding to style property name and style property value. Another [in] parameter, useAlternativeMedia
Properties, indicates whether you want style information for the default media type (usually screen), or a set of alternative media types specified in nsISimpleDOMDocument::set_alternateViewMediaType(mediaTypeString) . See the W3C's web...
...tes whether you want style information for the default media type (usually screen), or a set of alternative media types specified in nsISimpleDOMDocument::set_alternateViewMediaType(mediaTypeString) . See the W3C's website for a list of official media type name. Unfortunately, at this time the argument useAlternateView is ignored. ...
...And 3 more matches
Displaying Places information using views
ollowing stylesheet is optional and only applies styles and icons to the built-in tree view: <?xml-stylesheet href="chrome://browser/skin/places/places.css" ?> For examples of instantiating a tree view from JavaScript rather than XUL, see Programmatic generation of the built-in tree view. Column binding The built-in tree view makes it easy to hook up specific columns of your tree to specific
properties of the result. It does so by recognizing certain magic values of the id attribute on your treecol elements. A property in the result is bound to a column via that column's id attribute. For example, by setting a column's id to "title", you tell the view to display the title of the nsINavHistoryResultNode of each row in that column. The following table shows the mappings between these magic colum...
...es of the id attribute on your treecol elements. A property in the result is bound to a column via that column's id attribute. For example, by setting a column's id to "title", you tell the view to display the title of the nsINavHistoryResultNode of each row in that column. ...
...vHistoryResultTreeViewer maps between row indices and the nsINavHistoryResultNode objects contained in the rows. nsINavHistoryResultObserver notifies observing clients about updates when the underlying data changes. It's not so useful for our purposes here. nsITreeView provides a high-level interface for trees in general. ...
...And 3 more matches
Downloads.jsm
try point to interact with the downloading capabilities of the platform, including starting new downloads, controlling ongoing downloads, and retrieving download-related configuration. To use it, you first need to import the code module into your JavaScript scope: Components.utils.import("resource://gre/modules/Downloads.jsm"); Method overview Promise<Download> createDownload(Object a
Properties); Promise<void> fetch(aSource, aTarget, [optional] Object aOptions); Promise<DownloadList> getList(aType); Promise<DownloadSummary> getSummary(aType); Constants Constant Description PUBLIC Work on downloads that were not started from a private browsing window. PRIVATE Work on downloads that were started from a private browsing...
...<DownloadList> getList(aType); Promise<DownloadSummary> getSummary(aType); Constants Constant Description PUBLIC Work on downloads that were not started from a private browsing window. PRIVATE Work on downloads that were started from a private browsing window. ALL Work on both Downloads.PRIVATE and Downloads.PUBLIC downloads.
Properties Attribute Type Description Error Read only Constructor Constructor for a DownloadError object. When you catch an exception during a download, you can use this to verify if ex instanceof Downloads.Error, before reading the exception
properties with the error details. Example (using Task.jsm): try { yield Downloads.fetch(sourceUri, targetFile); } catch (ex if ...
...g the exception
properties with the error details. Example (using Task.jsm): try { yield Downloads.fetch(sourceUri, targetFile); } catch (ex if ex instanceof Downloads.Error && ex.becauseTargetFailed) { console.log("Unable to write to the target file, ignoring the error."); } Methods createDownload() Creates a new Download object. Promise<Download> createDownload( Object a
Properties ); Parameters a
Properties Provides the initial
properties for the newly created download. This matches the serializable representation of a Download object. Some of the most common
properties in this object include: source: String containing the URI for the download source. Alternatively, may be an nsIURI, a DownloadSource object, or an object with the following
properties: url:...
...And 3 more matches
Localizing with Mozilla Translator
you will always do better if you can export a partial glossary and reimport it as needed. See the following example. Let's assume you have a Firefox product in MT with the directory layout present in language packs, as you probably would need for a initial localization. ...
...the following example. Let's assume you have a Firefox product in MT with the directory layout present in language packs, as you probably would need for a initial localization. The directory structure will look like this: (ab-CD JAR root) locale |-- branding | |-- brand.dtd | `-- brand.
properties |-- browser | |-- aboutDialog.dtd . . |-- browser-region | `-- region.
properties `-- ab-CD |-- alerts | `-- notificationNames.
properties |-- autoconfig | `-- autoconfig.
properties |-- cookie | |-- cookieAcceptDialog.dtd | `-- cookieAcceptDialog.
properties |-- global | |-- about.dtd | |-- appPicker.dtd . . but in the CVS and mozilla-central repositories the locale part looks like this: t...
... . ...
...And 3 more matches
Localization technical reviews
th <em:contributor> tags just after the MOZ_LANGPACK_CONTRIBUTORS section. Make sure that the the text content is wrapped with emptyLines. Leading comments are OK, but watch out for #filter emptyLines #define ... # comment #define ... #unfilter emptyLines In toolkit/defines.inc, the native name of the language is specified, which is used as description for the built language packs. region.
properties Though locales might like to specify changes from the beginning, the region.
properties files will be reverted to en-US. Changes will be discussed in productization bugs filed for each locale. Search plugins Similar to the region.
properties files, the list.txt file should be reverted to en-US and amended accordingly as the search plugin productization bugs are completed. For this initial revi...
...It is best to look into each of these files to see if the localizer's strings might be too long. This is something to look for, but can be difficult to diagnose immediately. For more info, see bug 435874. ...
...It is best to look into each of these files to see if the localizer's strings might be too long. This is something to look for, but can be difficult to diagnose immediately. For more info, see bug 435874. ...
...And 3 more matches
JSNewEnumerateOp
The type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey's default [[Enumerate]] internal method. Syntax typedef bool (* JSNewEnumerateOp)(JSContext *cx, JS::HandleObject obj, JS::AutoIdVector &
properties); // Added in SpiderMonkeySidebar 38 typedef bool (* JSNewEnumerateOp)(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op, JS::MutableHandleValue statep, JS::MutableHandleId idp); // Obsolete since JSAPI 37 Name Type Description cx JSContext * The context in which the enumeration is taking place. obj JS::HandleObject The object to be enumerated.
properties JS::AutoIdVector & Out parameter. Id array to populate with all property keys. enum_op ...
...aning depends on enum_op. See the Description below. Description From SpiderMonkey 38, JSNewEnumerateOp is the type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey's default [[Enumerate]] internal method. When an ordinary object is enumerated, that object and each object on its prototype chain is tested for an enumerate op, and those ops are called in order. ...
...he Description below. Description From SpiderMonkey 38, JSNewEnumerateOp is the type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey's default [[Enumerate]] internal method. When an ordinary object is enumerated, that object and each object on its prototype chain is tested for an enumerate op, and those ops are called in order. The
properties each op adds to the
properties vector are added to the set of values the for-in loop will iterate over. All of this is nonstandard. An object is "enumerated" when it's the target of a for-in loop or JS_Enumerate. All other property inspection, including Object.keys(obj), goes through [[OwnKeys]]. The callback's job is to populate
properties with all property keys that the for-in loop should visit. Before JSAPI 37, JSNewEnu...
...And 3 more matches
Starting WebLock
n special locations - an application plugin directory, for example, preference files and/or directories, or other application specific paths. For example, to expose the location of the "white list" file containing all of the URLs that are safe for WebLock, you can add its location to the nsDirectoryService, which clients can then query for this infomation. The Directory Service implements the nsI
Properties interface, which allows you to Get(), Set(), and Undefine() interface pointers. In the case of WebLock, these interface pointers will be nsIFile objects. [scriptable, uuid(78650582-4e93-4b60-8e85-26ebd3eb14ca)] interface nsI
Properties : nsISupports { /** * Gets a property with a given name. * * @return NS_ERROR_FAILURE if a property with that * name doesn't exist. * ...
... the directory containing the application executable is NS_XPCOM_CURRENT_PROCESS_DIR. Given this key, you can acquire the directory service, call Get(), and pass the key. In the example below, appDir will point to the directory that contains the executable. ...
..., and pass the key. In the example below, appDir will point to the directory that contains the executable. ...
...And 3 more matches
Components.utils.Sandbox
omponents.utils.Sandbox(principal); Null principal You can create a null principal using code like: Cc["@mozilla.org/nullprincipal;1"].createInstance(Ci.nsIPrincipal); From Firefox 37 onwards, you can also specify the null principal by simply passing null as the principal argument. options The constructor accepts an optional parameter. This parameter is an object with the following optional
properties: freshZone If true creates a new GC region separate from both the calling context's and the sandbox prototype's region. Addons creating sandboxes whose expected lifetime is tied to that of a content window object will want to use sameZoneAs instead. sameZoneAs A JavaScript object in whose garbage collection region the sandbox should be created in. This helps to improve memory usage by a...
... Boolean indicating whether the Components object is available or not in the sandbox. Default: true. If the sandbox interacts with untrusted content this should be set to false when possible to further reduce possible attack surface. wantExportHelpers A Boolean: if true, then createObjectIn(), evalInWindow(), and exportFunction() are available in the sandbox. Default: false. wantGlobal
Properties An array of strings. Each string is the name of an object that you want to make available as a global to code running in the sandbox. The exception is "-Promise": the Promise constructor is available by default for sandboxes, and you use this option to remove it from the sandbox. Note that "-Promise" is removed in Firefox 37. The following objects are supported: -Promise (remov...
... wantXrays A Boolean value indicating wheth...
...And 3 more matches
imgICache
CacheForChannel(relevantChannel) If there is no relevant document or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie. any images from windows in private browsing mode will not be present in the cache returned from a call with a null parameter). ...
...vantChannel) If there is no relevant document or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie. any images from windows in private browsing mode will not be present in the cache returned from a call with a null parameter). ...
...rview void clearCache(in boolean chrome); nsI
Properties findEntry
Properties(in nsIURI uri); void removeEntry(in nsIURI uri); Methods clearCache() Evict images from the cache. void clearCache( in boolean chrome ); Parameters chrome If true, evict only chrome images. If false, evict everything except chrome images. ...
...And 3 more matches
nsIHTMLEditor
nsIDOMElement aAnchorElement); boolean isAnonymousElement(in nsIDOMElement aElement); void makeOrChangeList(in AString aListType, in boolean entireList, in AString aBulletType); boolean nodeIsBlock(in nsIDOMNode node); void pasteNoFormatting(in long aSelectionType); void rebuildDocumentFromSource(in AString aSourceString); void removeAllDefault
Properties(); void removeAllInline
Properties(); void removeDefaultProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); void removeInlineProperty(in nsIAtom aProperty, in AString aAttribute); void removeInsertionListener(in nsIContentFilter inFilter); void removeList(in AString aListType); void replaceHeadContentsWithHTML(in AString a...
...ght color of the selection. AString getHighlightColorState( out boolean aMixed ); Parameters aMixed true if there is more than one font color. Return value Color string. "" is returned for none. getIndentState() Document me! void getIndentState( out boolean aCanIndent, out boolean aCanOutdent ); Parameters aCanIndent aCanOutdent getInlineProperty() Gets aggregate
properties of the current selection. All object in the current selection are scanned and their attributes are represented in a list of Property object. void getInlineProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll ); Parameters aProperty The property to get on the selection. aAttribute The attribute of the ...
...formatting. void pasteNoFormatting( in long aSelectionType ); Parameters aSelectionType rebuildDocumentFromSource() Rebuild the entire document from source HTML Needed to be able to edit HEAD and other outside-of-BODY content. void rebuildDocumentFromSource( in AString aSourceString ); Parameters aSourceString HTML source string of the entire new document. removeAllDefault
Properties() Unregisters all default style
properties with the editor. void removeAllDefault
Properties(); Parameters None. removeAllInline
Properties() Deletes all the inline
properties from all text in the current selection. void removeAllInline
Properties(); Parameters None. removeDefaultProperty() Unregisters a default style property with the editor. void removeDefaultProperty( in nsIAtom a...
...And 3 more matches
Using nsIDirectoryService
This implementation will allow you to Get(), Set(), Define(), and Undefine() nsIFile. Getting a location: Most developers need to find where a file or directory is located. With nsDirectoryService, there are two steps involved. First, you must know what the string key (or property) is that refers to this locations. Header files containing known keys are listed in the Known Locations section of this document. Bear in mind that this list is not static. ...
...l Get() passing the known string key. In the example below, prop is a string that references your requested file locations. ...
...1"] .getService(Components.interfaces.nsI
Properties) .get("ProfD", Components.interfaces.nsIFile); (The example is taken from the Code snippets section of this site.) Adding a location: There are currently two ways to add a file location to the directory service: directly and delayed. You can directly add a new nsIFile with any property string using the nsI
Properties interface: Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsI
Properties) .set("MyFileName", file); Now, if your cost is too high to set all of these
properties at once, you can register to be a callback that can provide an nsIFile. To do this, you must get the implementation again like above. When you have it...
...And 3 more matches
Debugger.Environment - Firefox Developer Tools
if the debugger encounters the same environment through two different routes (perhaps two functions have closed over the same environment), SpiderMonkey presents the same Debugger.Environment instance to the debugger each time. ...
...Environment instances refer to the same environment in the debuggee, and place its own
properties on a Debugger.Environment instance to store metadata about particular environments. (If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Environment instance for a given environment. This allows the code using each Debugger instance to place whatever
properties it likes on its own Debugger.Object instances, without worrying about interfering with other debuggers.) If a Debugger.Environment instance's referent is not a debuggee environment, then attempting to access its
properties (other than inspectable) or call any its methods throws an instance of Error. Debugger.Environment instances protect their referents from the garbage collector; as long as th...
...s not a debuggee environment, then attempting to access its
properties (other than inspectable) or call any its methods throws an instance of Error. Debugger.Environment instances protect their referents from the garbage collector; as long as the Debugger.Environment instance is live, the referent remains live. Garbage collection has no visible effect on Debugger.Environment instances. Accessor
Properties of the Debugger.Environment Prototype Object A Debugger.Environment instance inherits the following accessor
properties from its prototype: inspectable True if this environment is a debuggee environment, and can therefore be inspected. False otherwise. All other
properties and methods of Debugger.Environment instances throw if applied to a non-inspectable environment. type The type of th...
...And 3 more matches
Index - Firefox Developer Tools
Toolbox Debug, Firefox, JavaScript The Browser Toolbox enables you to debug add-ons and the browser's own JavaScript code rather than just web pages like the normal Toolbox. The Browser Toolbox's context is the whole browser rather than just single page on a single tab. 16 DOM Property Viewer DOM, Tools, Web Development The DOM Property Viewer lets you inspect the
properties of the DOM as an expandable tree structure, starting from the window object of the current page or the selected iframe. 17 Debugger-API Debugger, Intermediate, Intro, JavaScript, Tools Mozilla's JavaScript engine, SpiderMonkey, provides a debugging interface named Debugger which lets JavaScript code observe and manipulate the execution of other JavaScript code. Both Firefox's...
... find the lexical environment in which the execution is taking place, and so on. 21 Debugger.Memory The Debugger API can help tools observe the debuggee's memory use in various ways: 22 Debugger.Object A Debugger.Object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent. The referent's
properties do not appear directly as
properties of the Debugger.Object instance; the debugger can access them only through methods like Debugger.Object.prototype.getOwnPropertyDescriptor and Debugger.Object.prototype.defineProperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters. 23 Debugger.Script A Debugger.Script instance may refer to a s...
...locations Per Call Path Debugger, Tools, Tutorial This page shows how to use the Debugger API to show how many objects a web page allocates, sorted by the function call path that allocated them. 27 Debugger.Object A Debugger.Object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent. The referent's
properties do not appear directly as
properties of the Debugger.Object instance; the debugger can access them only through methods like Debugger.Object.prototype.getOwnPropertyDescriptor and Debugger.Object.prototype.defineProperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters. 28 Deprecated tools Deprecated, Tools Over the course of DevToo...
...And 3 more matches
Document - Web APIs
Depending on the document's type (e.g. HTML, XML, SVG, ...), a larger API is available: HTML documents, served with the "text/html" content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocument interface. Constructor Document() Creates a new Document object.
Properties This interface also inherits fro...
...nt interface describes the common
properties and methods for any kind of document. Depending on the document's type (e.g. HTML, XML, SVG, ...), a larger API is available: HTML documents, served with the "text/html" content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocument interface. Constructor Document() Creates a new Document object.
Properties This interface also inherits from the Node and EventTarget interfaces. Document.anchorsRead only Returns a list of all of the anchors in the document. Document.body Returns the <body> or <frameset> node of the current document. Document.characterSetRead only Returns the character set being used by the document. Document.compatMode Read only Indicates whether the document is rendere...
...which the document was last modified. Document.locationRead only Returns the URI of the current document. Document.readyStateRead only Returns loading status of the document. Document.referrerRead only Returns the URI of the page that linked to this page. Document.title Sets or gets the title of the current document. Document.URLRead only Returns the document location as a string.
Properties included from DocumentOrShadowRoot The Document interface includes the following
properties defined on the DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the Document interface. DocumentOrShadowRoot.activeElementRead only Returns the Element within the shadow tree that has focus. Document.fullscreenElement...
...And 3 more matches
Element.getBoundingClientRect() - Web APIs
-box has been set on it. Syntax domRect = element.getBoundingClientRect(); Value The returned value is a DOMRect object which is the union of the rectangles returned by getClientRects() for the element, i.e., the CSS border-boxes associated with the element. The result is the smallest rectangle which contains the entire element, with read-only left, top, right, bottom, x, y, width, and height
properties describing the overall border-box in pixels.
Properties other than width and height are relative to the top-left of the viewport. Empty border-boxes are completely ignored. If all the element's border-boxes are empty, then a rectangle is returned with a width and height of zero and where the top and left are the top-left of the border-box for the first CSS box (in content order) for the elemen...
...o account when computing the bounding rectangle. This means that the rectangle's boundary edges (top, right, bottom, left) change their values every time the scrolling position changes (because their values are relative to the viewport and not absolute). ...
...lling position to the top and left
properties (these can be obtained using window.scrollX and window.scrollY) to get a bounding rectangle which is independent from the current scrolling position. Cross-browser fallback Scripts requiring high cross-browser compatibility can use window.pageXOffset and window.pageYOffset instead of window.scrollX and window.scrollY. ...
...And 3 more matches
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. This interface corresponds to <a> element; not to be confused with <link>, which is represented by HTMLLinkElement) <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><t...
... Element.accessKey Is a DOMString representing a single character that switches input focus to the hyperlink. HTMLAnchorElement.download Is a DOMString indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed ...
... Element.accessKey Is a DOMString representing a single character that switches input focus to the hyperlink. HTMLAnchorElement.download Is a DOMString indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If ...
...And 3 more matches
HTMLElement - Web APIs
HTMLElement.accessKey Is a DOMString representing the access key assigned to the element. HTMLElement.accessKeyLabel Read only Returns a DOMString containing the element's assigned access key. HTM...
... HTMLElement.accessKey Is a DOMString representing the access key assigned to the element. HTMLElement.accessKeyLabel Read only Returns a DOMString containing the element's assigned access key. HTMLElement.contentEdita...
...er. HTMLElement.offsetParent Read only Returns a Element that is the element from which all offset calculations are currently computed. HTMLElement.offsetTop Read only Returns a double, the distance from this element's top border to its offsetParent's top border. HTMLElement.offsetWidth Read only Returns a double containing the width of an element, relative to the layout. HTMLElement.
properties Read only Returns a HTML
PropertiesCollection... HTMLElement.spellcheck Is a Boolean that controls spell-checking. It is present on all HTML elements, though it doesn't have an effect on all of them. HTMLElement.style Is a CSSStyleDeclaration, an object representing the declarations of an element's style attributes. HTMLOrForeignElement.tabIndex Is a long representing the position of the ...
...And 3 more matches
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-bas...
... HTMLIFrameElement.align Is a DOMString that specifies the alignment of the frame with respect to the surrounding context. HTMLIFrameElement.allow Is a list of origins the the frame is allowed to display content from. This attribute also accepts the values self and src which represent the origin in the iframe's src attribute. The default...
... HTMLIFrameElement.align Is a DOMString that specifies the alignment of the frame with respect to the surrounding context. HTMLIFrameElement.allow Is a list of origins the the frame is allowed to display content from. This attribute also accepts the values self and src which represent the origin in the iframe's src attribute. The default value is src. HTMLI...
...And 3 more matches
MediaTrackConstraints - Web APIs
retrieved by calling getConstraints(). For each constraint, you can typically specify an exact value you need, an ideal value you want, a range of acceptable values, and/or a value which you'd like to be as close to as possible. The specifics vary somewhat depending on the type of the constrainable property. To learn more about how constraints work, see Capabilities, constraints, and settings.
Properties Some combination--but not necessarily all--of the following
properties will exist on the object. This may be because a given browser doesn't support the property, or because it doesn't apply. For example, because RTP doesn't provide some of these values during negotiation of a WebRTC connection, a track associated with a RTCPeerConnection will not include certain values, such as facingMode or gr...
...ombination--but not necessarily all--of the following
properties will exist on the object. This may be because a given browser doesn't support the property, or because it doesn't apply. For example, because RTP doesn't provide some of these values during negotiation of a WebRTC connection, a track associated with a RTCPeerConnection will not include certain values, such as facingMode or groupId. ...
... channelCount A ConstrainLong specifying the channel count or range of channel counts which are acceptable and/or required. ...
...And 3 more matches
PerformanceNavigationTiming - Web APIs
For example, this interface can be used to determine how much time it takes to load or unload a document. ...
... PerformanceEntry.name Read only Returns the document's address. PerformanceEntry.startTime Read only Returns a DOMHighResTimeStamp with a value of "0". PerformanceEntry.durati...
... PerformanceEntry.name Read only Returns the document's address. PerformanceEntry.startTime Read only Returns a DOMHighResTimeStamp with a value of "0". PerformanceEntry.duration Read only Returns a timestamp that is the difference between ...
...And 3 more matches
Performance API - Web APIs
e has two methods. The now() method returns a DOMHighResTimeStamp whose value that depends on the navigation start and scope. If the scope is a window, the value is the time the browser context was created and if the scope is a worker, the value is the time the worker was created. The toJSON() method returns a serialization of the Performance object, for those attributes that can be serialized.
Properties The Performance interface has two
properties. The timing property returns a PerformanceTiming object containing latency-related performance information such as the start of navigation time, start and end times for redirects, start and end times for responses, etc. The navigation property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing...
...as the start of navigation time, start and end times for redirects, start and end times for responses, etc. The navigation property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the page was navigated to from history, the page was navigated to by following a link, etc. Interfaces Performance Provides methods and
properties containing timing-related performance information for the given page. PerformanceEntry Provides methods and
properties the encapsulate a single performance metric that is part of the performance timeline. PerformanceFrameTiming Provides methods and
properties containing frame timing data about the browser's event loop. PerformanceMark An abstract interface for performance entries with an en...
...a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. PerformanceMeasure An abstract interface for performance entries with an entry type of "measure". Entries of this type are created by calling performance.measure() to add a namedDOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. ...
...And 3 more matches
Using the Resource Timing API - Web APIs
The Resource Timing API provides a way to retrieve and analyze detailed network timing data regarding the loading of an application's resource(s). An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource such as an XMLHttpRequest, <SVG>, image, script, etc.). The interface's
properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, DNS lookup start and end times, response start and end times, etc. The interface also includes other
properties that provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. This document shows the use of Resource Timing interfaces. For more details about the i...
...he See also section. A live version of the examples is available on Github, as is the source code. Pull requests and bug reports are welcome. Resource loading phases An application can get timestamps for the various phases of resource loading such as redirection, DNS lookup, and TCP connection setup. Those phases and their property names are illustrated in Figure 1. Figure 1. ...
...on, DNS lookup, and TCP connection setup. Those phases and their property names are illustrated in Figure 1. Figure 1. Resource timing
properties An application developer can use the property values to calculate the length of time a phase takes and that information can help diagnose performance issues. Timing resource loading phases The following example illustrates using the resource timing
properties to calculate the amount of time the following phases take: redirection (redirectStart and redirectEnd ), DNS lookup (domainLookupStart and domainLookupEnd), TCP handshake (connectStart and connectEnd), and response (responseStart and responseEnd). This example also calculates the time from the start of the fetch and request start phases (fetchStart and requestStart, respectively), until the respo...
...And 3 more matches
::first-letter (:first-letter) - CSS: Cascading Style Sheets
low.) A combination of the ::before pseudo-element and the content property may inject some text at the beginning of the element. In that case, ::first-letter will match the first letter of this generated content. CSS3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. Browsers also accept :first-letter, introduced in CSS2. ...
...eudo-element and the content property may inject some text at the beginning of the element. In that case, ::first-letter will match the first letter of this generated content. CSS3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. Browsers also accept :first-letter, introduced in CSS2. ...
... of the element. In that case, ::first-letter will match the first letter of this generated content. CSS3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. Browsers also accept :first-letter, introduced in CSS2. ...
...And 3 more matches
Coordinate systems - CSS: Cascading Style Sheets
ttom-left corner, with positive y-coordinate values being above the origin. When drawing 3D graphics, or using a third dimension to layer objects from front to back, the z-coordinate is also used. This specifies the distance away from the viewer if positive and toward the viewer if negative. It's actually possible to change the definitions and orientations of these coordinate systems using CSS
properties such as transform. However, we'll only talk about the standard coordinate system for now. Standard CSSOM coordinate systems There are four standard coordinate systems used by the CSS object model, as described below. Offset Coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. For example, when a mouse event ...
...for now. Standard CSSOM coordinate systems There are four standard coordinate systems used by the CSS object model, as described below. Offset Coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. For example, when a mouse event occurs, the position of the mouse as specified in the event's offsetX and offsetY
properties are given relative to the top-left corner of the node to which the event has been delivered. The origin is inset by the distances specified by padding-left and padding-top. Client The "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. This is the entire viewing area in which the document is presented. Scrolling is n...
...e origin is inset by the distances specified by padding-left and padding-top. Client The "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. This is the entire viewing area in which the document is presented. Scrolling is not a factor. On a desktop computer, for example, the MouseEvent.clientX and MouseEvent.clientY
properties indicate the position of the mouse cursor at the moment the event occurred, relative to the top-left corner of the browser window. The top-left corner of the window is always (0, 0), regardless of the content of the document or any scrolling that may have been done. In other words, scrolling the document will change the client coordinates of a given position within the document. Page The "page"...
...And 3 more matches
Box alignment in grid layout - CSS: Cascading Style Sheets
justify-content. On the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. The first item overrides the align-items value set on the group by setting align-self to center. Grid axes As a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items. ...
...alignment
properties to help us achieve this. The inline axis is the axis that corresponds to the direction that words in a sentence would run in the writing mode used. Therefore, in a horizontal language such as English or Arabic the inline direction runs horizontally. Should you be in a vertical writing mode the inline axis will run vertically. To align things on the inline axis you use the
properties that start with justify-, justify-content, justify-items and justify-self. The block axis crosses the inline axis in the direction that blocks are displayed down the page -- for example paragraphs in English are displayed one below the other vertically. This, therefore is the block dimension. ...
...To align things on the inline axis you use the
properties that start with justify-, justify-content, justify-items and justify-self. The block axis crosses the inline axis in the direction that blocks are displayed down the page -- for example paragraphs in English are displayed one below the other vertically. This, therefore is the block dimension. To align things on the block axis you use the
properties that start with align-, align-content, align-items and align-self. Self alignment justify-self align-self place-self justify-items align-items place-items These
properties deal with aligning the item inside the grid area it is placed into. The
properties align-items and justify-items are applied to the grid container and set the align-self and justify-self
properties as a group. This...
...And 3 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
To center our box we use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. ...
... use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. We use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. You can take a look at the code of this example below. Change the size of the container or nested element and the nested element always remains centered.
Properties that control alignment The
properties we will look at in this guide are as follows. justify-content -- controls alignment of all items on the main axis. align-items -- controls alignment of all items on the cross axis. align-self -- controls alignment of an individual flex item on the cross axis. align-content -- described in the spec as for "packing flex lines"; controls space between fle...
...f all items on the main axis. align-items -- controls alignment of all items on the cross axis. align-self -- controls alignment of an individual flex item on the cross axis. align-content -- described in the spec as for "packing flex lines"; controls space between flex lines on the cross axis. We will also discover how auto margins can be used for alignment in flexbox. Note: The alignment
properties in Flexbox have been placed into their own specification -- CSS Box Alignment Level 3. It is expected that this spec will ultimately supersede the
properties as defined in Flexbox Level One. The Cross Axis The align-items and align-self
properties control alignment of our flex items on the cross axis, down the columns if flex-direction is row and along the row if flex-direction is column. We ...
...And 3 more matches
OpenType font features guide - CSS: Cascading Style Sheets
to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. These are all referred to as OpenType Features, and are made available to use on the web via specific
properties and a low-level control property -- font-feature-settings. This article provides you with all you need to know about using OpenType font features in CSS. Some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios. In addition to broad featu...
...nt forms of certain glyphs, which can impact meaning and readability. In cases such as these it's more than just a nicety, but rather an integral part of the content itself. The font features There are a number of different features to consider. They are grouped and explained here according to the main attributes and options covered in the W3C specifications. Note: The examples below show the
properties and some example combinations, along with the lower-level syntax equivalents. They may not match exactly due to browser implementation inconsistencies, but in many cases the first example will match the second. The typefaces shown are Playfair Display, Source Serif Pro, IBM Plex Serif, Dancing Script, and Kokoro (all available and free to use, most are on Google Fonts and other services). Kerni...
...f glyphs within a font. The example below shows a string of glyphs with only the OpenType set 'jis78' enabled. Uncheck the box below and you'll see more characters displayed. Note: these glyphs were copied out of a font sample and are not intended as prose. Font variant shorthand (font-variant) This is the shorthand syntax for defining all of the above. Setting a value of normal resets all
properties to their initial value. Setting a value of none sets font-variant-ligatures to none and all other
properties to their initial value. (Meaning that if kerning is on by default, it will still be on even with a value of none being supplied here.) Font feature settings font-feature-settings is the 'low level syntax' that allows explicit access to every named available OpenType feature. This gives...
...And 3 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
{ grid-column-start: 2; grid-column-end: 3; grid-row-start: 1; grid-row-end: 2; } .box4 { grid-column-start: 2; grid-column-end: 4; grid-row-start: 3; grid-row-end: 4; } The grid-column and grid-row shorthands We have quite a lot of code here to position each item. It should come as no surprise to know there is a shorthand. The grid-column-start and grid-column-end
properties can be combined into grid-column, grid-row-start and grid-row-end into grid-row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; backgro...
...Grid defaults to spanning one track. This means that our initial, long-hand, example would look like this: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns: repeat(3...
...he left-hand column line as inline-start is always the point from which text would be written in the current writing mode, inline-end is the final column line of our grid. When we specify our grid area using the grid-area property we first define both start lines block-start and inline-start, then both end lines block-end and inline-end. This seems unusual at first as we are used to the physical
properties of top, right, bottom and left but makes more sense if you start to think of websites as being multi-directional in writing mode. Counting backwards We can also count backwards from the block and inline end of the grid, for English that would be the right hand column line and final row line. These lines can be addressed as -1, and you can count back from there - so the penultimate line is -2. I...
...And 3 more matches
border-block-end - CSS: Cascading Style Sheets
border-block-end CSS property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: border-block-end-color border-block-end-style border-block-end-width Syntax border-block-end: 1px; border-block-end: 2px dotted; border-block-end: medium dashed blue; border-block-end can be used to set the values for one or more of border-block-end-width, border-block-end-style, and border-block-end-color. The physical ...
... the values for one or more of border-block-end-width, border-block-end-style, and border-block-end-color. The physical border to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. Related
properties are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element. Values The border-block-end is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. Formal defi...
...ne-start, and border-inline-end, which define the other borders of the element. Values The border-block-end is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. ...
...And 3 more matches
border-color - CSS: Cascading Style Sheets
s a pull request. Each side can be set individually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color. You can find more information about border colors in Borders in Applying color to HTML elements using CSS. ...
...er-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color. You can find more information about border colors in Borders in Applying color to HTML elements using CSS. ...
... the top and bottom, the second to the left and right. When three values are specified, the first color applies to the top, the second to the left and right, the third to the bottom. When four values are specified, the colors apply to the top, right, bottom, and left in that order (clockwise). Values <color> Defines the color of the border. ...
...And 3 more matches
env() - CSS: Cascading Style Sheets
The env() CSS function can be used to insert the value of a user agent-defined environment variable into your CSS, in a similar fashion to the var() function and custom
properties. The difference is that, as well as being user-agent defined rather than user-defined, environment variables are globally scoped to a document, whereas custom
properties are scoped to the element(s) on which they are declared. To tell the browser to use the whole available space on the screen, and so enabling us to use the env() variables, we need to add a new viewport meta value: <meta name="viewport" content="viewport-fit=cover" /> body { padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px); } In addition, unlike...
...in Media query rules). As the spec evolves, it may also be usable in other places such as selectors. Originally provided by the iOS browser to allow developers to place their content in a safe area of the viewport, the safe-area-inset-* values ...
...ort, which is safe to put content into without risking it being cut off by the shape of a non-rectangular display. For rectangular viewports, like your average laptop monitor, their value is equal to zero. For non-rectangular displays -- like a round watch face -- the four values set by the user agent form a rectangle such that all content inside the rectangle is visible. Note: Unlike other CSS
properties, user agent-defined property names are case-sensitive. Formal syntax env( <custom-ident> , <declaration-value>? ) Examples The below example makes use of the optional second parameter of env(), which allows you to provide a fallback value in case the environment variable is not available. <p> If the <code>env()</code> function is supported in your browser, this paragraph's text will have...
...And 3 more matches
DOM onevent handlers - Developer guides
Elements can be interactive (links, buttons, images, forms, and so forth) or non-interactive (such as the base <body> element). ...
... call the event handler directly. If the event handler doesn't access any data from the event object, you can leave out the event when calling onclick(). This continues until every handler has been called, unless one of the event handlers explicitly halts the processing of the event by calling stopPropagation() on the event object itself. Non-element objects Event handlers can also be set with
properties on non-element objects that generate events, like window, document, XMLHttpRequest, and others. 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. When the ...
...(The HTML specification names these: onblur, onerror, onfocus, onload, and onscroll.) Event handler's parameters, this binding, and the return value When the event handler is specified as an HTML attribute, the specified code is wrapped into a function with the following parameters: event -- for a...
...And 3 more matches
HTML documentation index - HTML: Hypertext Markup Language
g custom elements for more details). 21 itemid Attribute, Global attribute, HTML, HTML Microdata, Microdata, Reference, itemid The itemid global attribute provides microdata in the form of a unique, global identifier of an item. 22 itemprop Attribute, Global attribute, HTML, HTML Microdata, Microdata, Reference The itemprop global attribute is used to add
properties to an item. Every HTML element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. Each name-value pair is called a property, and a group of one or more
properties forms an item. Property values are either a string or a URL and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>...
.... Each name-value pair is called a property, and a group of one or more
properties forms an item. Property values are either a string or a URL and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. 23 itemref Attribute, Global attribute, HTML, HTML Microdata, Microdata, Reference
Properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. 24 itemscope Attribute, Global attribute, HTML, HTML Microdata, Microdata, Reference itemscope is a boolean global attribute that defines the scope of associated metadata. Specifying the itemscope attribute for an element creates a new item, w...
...scope of associated metadata. Specifying the itemscope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element. 25 itemtype Attribute, Global attribute, HTML, HTML Microdata, Microdata, Reference The global attribute itemtype specifies the URL of the vocabulary that will be used to define itemprop's (item
properties) in the data structure. 26 lang Global attributes, HTML, Reference 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. The attribute contains a single "language tag" in the format defined in Tags for Identifying Languages (BCP47)...
...And 3 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
e access can be chained together: obj.details.color; // orange obj['details']['size']; // 12 The following example creates an object prototype(Person) and an instance of that prototype(you). function Person(name, age) { this.name = name; this.age = age; } // Define an object var you = new Person('You', 24); // We are creating a new person named "You" aged 24. Once created, an object's
properties can again be accessed in one of two ways: // dot notation obj.name = 'Simon'; var name = obj.name; And... // bracket notation obj['name'] = 'Simon'; var name = obj['name']; // can use a variable to define a key var user = prompt('what is your key?') obj[user] = prompt('what is its value?') These are also semantically equivalent. The second method has the advantage that the name of the prope...
... key var user = prompt('what is your key?') obj[user] = prompt('what is its value?') These are also semantically equivalent. The second method has the advantage that the name of the property is provided as a string, which means it can be calculated at run-time. However, using this method prevents some JavaScript engine and minifier optimizations being applied. It can also be used to set and get
properties with names that are reserved words: obj.for = 'Simon'; // Syntax error, because 'for' is a reserved word obj['for'] = 'Simon'; // works fine Starting in ECMAScript 5, reserved words may be used as object property names "in the buff". This means that they don't need to be "clothed" in quotes when defining object literals. See the ES5 Spec. For more on objects and prototypes see Object.protot...
...ect prototype chains see Inheritance and the prototype chain. Starting in ECMAScript 2015, object keys can be defined by the variable using bracket notation upon being created. {[phoneType]: 12345} is possible instead of just var userPhone = {}; userPhone[phoneType] = 12345. Arrays Arrays in JavaScript are actually a special type of object. They work very much like regular objects (numerical
properties can naturally be accessed only using [] syntax) but they have one magic property called 'length'. This is always one more than the highest index in the array. One way of creating arrays is as follows: var a = new Array(); a[0] = 'dog'; a[1] = 'cat'; a[2] = 'hen'; a.length; // 3 A more convenient notation is to use an array literal: var a = ['dog', 'cat', 'hen']; a.length; // 3 Note that ar...
...And 3 more matches
Indexed collections - JavaScript
employee number zero, emp[1] employee number one, and so on. JavaScript does not have an explicit array data type. However, you can use the predefined Array object and its methods to work with arrays in your applications. The Array object has methods for manipulating arrays in various ways, such as joining, reversing, and sorting them. It has a property for determining the array length and other
properties for use with regular expressions. 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 w...
...ate arrays with single elements of an arbitrary data type, it is safer to use array literals. Alternatively, create an empty array first before adding the single element to it. In ES2015, you can use the Array.of static method to create arrays with single element. let wisenArray = Array.of(9.3) // wisenArray contains only one element 9.3 Referring to array elements Because elements are also
properties, you can access the using property accessors. Suppose you define the following array: let myArray = ['Wind', 'Rain', 'Fire'] You can refer to the first element of the array as myArray[0], the second element of the array as myArray[1], etc... The index of the elements begins with zero. Note: You can also use property accessors to access other
properties of the array, like with an object. let...
... The length property is special. It always returns the index of the last element plus one. (In the example below, 'Dusty' is indexed at 30, so cats.length returns 30 + 1). Remember, JavaScript Array indexes are 0-based: they start at 0, not 1. This means that the length property will be one more than the highest index stored in the array: let cats = ...
...And 3 more matches
Regular expressions - JavaScript
sible (including look-ahead, look-behind, and conditional expressions). Character classes Distinguish different types of characters. For example, distinguishing between letters and digits. Groups and ranges Indicate groups and ranges of expression characters. Quantifiers Indicate numbers of characters or expressions to match. Unicode property escapes Distinguish based on unicode character
properties, for example, upper- and lower-case letters, math symbols, and punctuation. If you want to look at all the special characters that can be used in regular expressions in a single table, see the following: Special characters in regular expressions. Characters / constructs Corresponding article \, ., \cX, \d, \D, \f, \n, \r, \s, \S, \t, \v, \w, \W, \0, \xhh, \uhhhh, \uhh...
...string. split() Uses a regular expression or a fixed string to break a string into an array of substrings. When you want to know whether a pattern is found in a string, use the test() or search() methods; for more information (but slower execution) use the exec() or match() methods. ...
...an array and update
properties of the associated regular expression object and also of the predefined regular expression object, RegExp. If the match fails, the exec() method returns null (which coerces to false). In the following example, the script uses the exec() method to find a match in a string. var myRe = /d(b+)d/g; var myArray = myRe.exec('cdbbdbsbz'); If you do not need to access the
properties of the regular expression, an alternative way of creating myArray is with this script: var myArray = /d(b+)d/g.exec('cdbbdbsbz'); // similar to "cdbbdbsbz".match(/d(b+)d/g); however, // "cdbbdbsbz".match(/d(b+)d/g) outputs Array [ "dbbd" ], while // /d(b+)d/g.exec('cdbbdbsbz') outputs Array [ 'dbbd', 'bb', index: 1, input: 'cdbbdbsbz' ]. (See different behaviors for further info ab...
...And 3 more matches
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
The Intl.NumberFormat.prototype.resolvedOptions() method returns a new object with
properties reflecting the locale and number formatting options computed during initialization of this NumberFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numberFormat.resolvedOptions() Return value A new object with
properties reflecting the locale and number formatting options computed during the initialization of the given NumberFormat object. Description The resulting object has the following
properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values were requ...
... notation The value provided for this property in the options argument, if present, or "standard filled in as a default. ...
...s argument, if present, or "standard filled in as a default. compactDisplay The value provided for this property in the options argument, or "short" filled in as a default. This property is only present if the notation is set to "compact". signDisplay The value provided for this property in the options argument, or "auto" filled in as a default. ...
...And 3 more matches
Object.getOwnPropertyNames() - JavaScript
The Object.getOwnPropertyNames() method returns an array of all
properties (including non-enumerable
properties except for those which use Symbol) found directly in a given object. Syntax Object.getOwnPropertyNames(obj) Parameters obj The object whose enumerable and non-enumerable
properties are to be returned. Return value An array of strings that corresponds to the
properties found directly in the given object. 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. The ordering of the enumerable
properties in the array is consistent with the ordering exposed by a for...in loop (or by Object.keys()) over the
properties of the object. The ordering of the no...
... In ES5, if the argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-object argument will be coerced to an object. ...
... In ES5, if the argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-object argument will be coerced to an object. ...
...And 3 more matches
Object.seal() - JavaScript
The Object.seal() method seals an object, preventing new
properties from being added to it and marking all existing
properties as non-configurable. Values of present
properties can still be changed as long as they are writable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.seal(obj) Parameters obj The object which should be sealed. Return value The object being sealed. Description By default, objects are extensible (new
properties can be added to them). Sealing an object prevents new
properties from being added and marks all existing
properties as non-configurable. This has the effect of making ...
...amples and send us a pull request. Syntax Object.seal(obj) Parameters obj The object which should be sealed. Return value The object being sealed. Description By default, objects are extensible (new
properties can be added to them). Sealing an object prevents new
properties from being added and marks all existing
properties as non-configurable. This has the effect of making the set of
properties on the object fixed and immutable. ...
...bj) Parameters obj The object which should be sealed. Return value The object being sealed. Description By default, objects are extensible (new
properties can be added to them). Sealing an object prevents new
properties from being added and marks all existing
properties as non-configurable. This has the effect of making the set of
properties on the object fixed and immutable. Making all
properties non-configurable also prevents them from being converted from data
properties to accessor
properties and vice versa, but it does not prevent the values of data
properties from being changed. ...
...And 3 more matches
Symbol - JavaScript
The data type symbol is a primitive data type. The Symbol() function returns a value of type symbol, has static
properties that expose several members of built-in objects, has static methods that expose the global symbol registry, and resembles a built-in object class, but is incomplete as a constructor because it does not support the syntax "new Symbol()". Every symbol value returned from Symbol() is unique. A symbol value may be used as an identifier for object
properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general. Some further explanation about purpose and usage can be found in the glossary entry for Symbol. Description To create a new primitive symbol,...
... Shared symbols in the global symbol registry The above syntax using the Symbol() function will not create a global symbol that is available in your whole codebase. To create symbols available across files and even across realms (each of which has its own global scope), use the methods Symbol.for() and Symbol.keyFor() to set and retrieve symbols from the global symbol registry. Finding symbol
properties on objects The method Object.getOwnPropertySymbols() returns an array of symbols and lets you find symbol
properties on a given object. Note that every object is initialized with no own symbol
properties, so that this array will be empty unless you've set symbol
properties on the object. Constructor Symbol() Creates a new Symbol object. It is incomplete as a constructor because it does not ...
...Used by for await...of. Symbol.hasInstance A method determining if a constructor object recognizes an object as its instance. Used by instanceof. ...
...And 3 more matches
delete operator - JavaScript
be returned. However, it is important to consider the following scenarios: If the property which you are trying to delete does not exist, delete will not have any effect and will return true. If a property with the same name exists on the object's prototype chain, then, after deletion, the object will use the property from the prototype chain (in other words, delete only has an effect on own
properties). Any property declared with var cannot be deleted from the global scope or from a function's scope. As such, delete cannot delete any functions in the global scope (whether this is part from a function definition or a function expression). Functions which are part of an object (apart from the global scope) can be deleted with delete. Any property declared with let or const cannot be ...
...e or from a function's scope. As such, delete cannot delete any functions in the global scope (whether this is part from a function definition or a function expression). Functions which are part of an object (apart from the global scope) can be deleted with delete. Any property declared with let or const cannot be deleted from the scope within which they were defined. Non-configurable
properties cannot be removed. This includes
properties of built-in objects like Math, Array, Object and
properties that are created as non-configurable with methods like Object.defineProperty(). The following snippet gives a simple example: var Employee = { age: 28, name: 'abc', designation: 'developer' } console.log(delete Employee.name); // returns true console.log(delete Employee.age); // ...
...ect.defineProperty(). ...
...And 3 more matches
Classes and Inheritance - Archive of obsolete content
Inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
...Inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
...ginal object. Every function has an explicit property, known as prototype. When a function is used in a constructor call, JavaScript makes the value of this property the prototype of the newly created object: let shape = Shape(2, 3); Object.getPrototypeOf(shape) == Shape.prototype; // => true All instances of a class have the same prototype. This makes the prototype the perfect place to define
properties that are shared between instances of the class. To illustrate this, let's add a member function to the class Shape: Shape.prototype.draw = function () { throw Error("not yet implemented"); } let shape = Shape(2, 3); Shape.draw(); // => Error: not yet implemented Inheritance and Constructors Suppose we want to create a new class, Circle, and inherit it from Shape. Since every Circle is als...
...And 2 more matches
context-menu - Archive of obsolete content
occurs when the menu is invoked on a page whose URL matches any of the patterns. These are the same match pattern strings that you use with the page-mod include property. Read more about patterns. PredicateContext(predicateFunction) predicateFunction is called when the menu is invoked, and the context occurs when the function returns a true value. The function is passed an object with
properties describing the menu invocaton context. array An array of any of the other types. This context occurs when all contexts in the array occur. Menu items also have a context property that can be used to add and remove declarative contexts after construction. For example: var context = require("sdk/context-menu").SelectorContext("img"); myMenuItem.context.add(context); myMenuItem.c...
... regexp or an array of match pattern strings or regexps. PredicateContext(predicateFunction) New in Firefox 29 Creates a context that occurs when predicateFunction returns a true value. See Specifying Contexts above. Parameters predicateFunction : function(context) A function which will be called with an object argument that provide information about the invocation context. context object
properties: Property Description documentType The MIME type of the document the menu was invoked in. E.g. text/html for HTML pages, application/xhtml+xml for XHTML, or image/jpeg if viewing an image directly. documentURL The URL of the document the menu was invoked in. targetName The name of the DOM element that the menu was invoked on, in lower-case. ...
... input text box or area if the menu was invoked in one, null otherwise. Item A labeled menu item that can perform an action when clicked. Methods destroy() Permanently removes the item from its parent menu and frees its resources. The item must not be used afterward. If you need to remove the item from its parent menu but use it afterward, call removeItem() on the parent menu instead.
Properties label The menu item's label. You can set this after creating the item to update its label later. image The item's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI. You can set this after creating the item to update its image later. To remove the item's image, set it to null. data An optional arbitrary value to associate with th...
...And 2 more matches
remote/parent - Archive of obsolete content
consistency and to make writing multiprocess compatible code easier, remoteRequire() will also create a new module loader and load modules in the main process. Parameters id : String The module to load. To use a relative path you must pass the module parameter. module : Object The module to resolve the relative module ID against. To resolve relative to the loading module, pass module here.
Properties processes A Processes object. frames A Frames object. Processes The Processes object lets you interact with the processes currently running. You can use it as a simple list of all running processes: const { processes } = require("sdk/remote/parent"); for (var p of processes) { console.log(p.isRemote); } Each element in this list is a Process. There will always be at least one process i...
...re started and stopped: const { processes } = require("sdk/remote/parent"); processes.on("attach", function(process) { console.log("new process is remote: " + process.isRemote); }); Methods forEvery(callback) Calls the callback for every existing process and any new processes created in the future. This is a shortcut for enumerating existing processes and then listening for attach events.
Properties port An event emitter that sends messages to and receives messages from all processes. Events attach Event emitted when a new process is started. The event handler is called with a Process representing the new process. detach Event emitted when a process disconnects from the application. It may have been closed normally or it may have crashed. The event handler is called with the Process t...
...hear as frames are created and destroyed. const { frames } = require("sdk/remote/parent"); frames.on("attach", function(frame) { console.log("frame is attached: " + frame.frameElement); }); Methods forEvery(callback) Calls the callback for every existing frame and any new frames created in the future. This is a shortcut for enumerating existing frames and then listening for attach events.
Properties port An event emitter that sends messages to and receives messages from all frames. Events attach Event emitted when a new frame is created. The event handler is called with a Frame representing the new frame. detach Event emitted when a frame is removed. For example, the user might have closed a content tab. The event handler is called with the Frame that detached. Process A Process pro...
...And 2 more matches
ui/frame - Archive of obsolete content
move. off(event, listener) This function is an alias for removeListener(). Parameters event : string The event the listener is listening for. Frame supports the following events: attach, detach, load, ready, and message. listener : function The listener to remove. destroy() Destroy the frame. After calling this function, the frame will no longer appear in the UI, and accessing any of its
properties or methods will throw an error.
Properties url URL for the content loaded into the frame. This is read-only. It's only accessible after the attach event has occurred for this frame. Events attach This event is emitted whenever a new frame instance is constructed and the browser has started to load its document: for example, when the user opens a new browser window, if that window has a tool...
...t: for example, when the user opens a new browser window, if that window has a toolbar containing this frame. Since the event is dispatched asynchronously, the document may already be loaded by the time the event is received. At this point, you should not try to send messages to scripts hosted in the frame, because the frame scripts may not have been loaded. Arguments event : This contains two
properties: source, which defines a postMessage() function which you can use to send messages back to this particular frame instance. But note that at this point you should not try to send messages to scripts hosted in the frame, because the frame scripts may not have been loaded. origin, which you can use as the targetOrigin argument to postMessage() if you want to communicate with this particular fram...
...ources may still be in the process of loading. It's the equivalent of the point where the frame's document.readyState becomes "interactive": var { Frame } = require("sdk/ui/frame"); var frame = new Frame({ url: "./frame.html" }); frame.on("ready", ping); function ping(e) { // message only this frame instance e.source.postMessage("pong", e.origin); } Arguments event : This contains two
properties: source, which defines a postMessage() function which you can use to send messages back to this particular frame instance. origin, which you can use as the targetOrigin argument to postMessage() if you want to communicate with this particular frame instance. load This event is emitted while a frame instance is completely loaded. It's the equivalent of the point where the frame's document.r...
...And 2 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
l-hbox'}, LABEL({'control': 'coord-x', 'value': 'X:'}), TEXTBOX({'id': 'coord-x', 'class': 'coord-box', 'placeholder' : '0'}), LABEL({'control': 'coord-y', 'value': 'Y:'}), TEXTBOX({'id': 'coord-y', 'class': 'coord-box', 'placeholder': '0'}) ... That way you build elements hierarchy with not much interaction with DOM, plus you can see tag
properties and it children in a nice, structured way, just like in overlay.xul. You can find working example here. It involves using of firebug.sdk xul.js with few modifications. Step 7: Manually handle global CSS Stylesheets Any Global CSS style sheets which you are using will need to be registered upon load and unregistered when your extension is unloaded. Any CSS files used in any of your own XUL files...
...ion unloadFromWindow(window) { var event = window.document.createEvent("Event"); event.initEvent("myAddonName-unload",false,false); window.dispatchEvent(event); } In each window you can then register on startup to listen for your custom "myAddonName-unload" event and just tear down and clean up when that event or a regular "unload" event comes in. Step 10: Bypass cache when loading
properties files The above will get you a working add-on that will install without a Firefox restart. It will even get you a working add-on that will update without a Firefox restart... usually. Some parts work only if you don't look too closely; localization is one of them. As mentioned in the previous section, you'll need to clear the chrome caches on add-on shutdown, namely for chrome images and propert...
... that will install without a Firefox restart. It will even get you a working add-on that will update without a Firefox restart... usually. Some parts work only if you don't look too closely; localization is one of them. As mentioned in the previous section, you'll need to clear the chrome caches on add-on shutdown, namely for chrome images and
properties files. Doing this will get an update's new
properties file to load, however sometimes this will instead produce an error on the next property access. It just doesn't seem that it can reliably clear the cache correctly, for whatever reason. String changes seem to be fine, however the addition or removal of strings can sometimes produce this error. It's not reliably reproducible, but it does happen. Yes, this is a pain in the ass. The suggestion that...
...And 2 more matches
The Essentials of an Extension - Archive of obsolete content
ags. The Chrome As mentioned earlier, the chrome is composed of 3 sections: content, locale and skin. The content is the most important section, holding user interface (XUL) and script (JS) files. The skin section has the files that define most of the look and feel of the UI (using CSS and images, just like web pages). Finally, the locale section holds all text used in the extension, in DTD and
properties files. This division allows other developers to create themes that replace skins, and translators to create localizations in different languages, all of this without having to change your extension or your code. This gives Firefox extensions a great deal of flexibility. Chrome files are accessed through the chrome protocol. This is what a chrome URI looks like: chrome://packagename/section/pa...
...hat allows us to obtain localized strings dynamically, by only providing a "key" that identifies the string. This is what we do on the second line. We call the getString method of the bundle element and get the localized message to be displayed. We then call the window.alert function with the message, just like we would do in an HTML document. Locale There are two types of locale files: DTD and
properties, and in this example we use them both. DTD is the most efficient way of showing text in XUL, so you should use it whenever possible. It is somewhat inflexible so it can't be used for dynamically generated text, hence the need for an alternate way of getting localized strings. Looking back at the menu code, you probably noticed some attributes such as this: label="&xulschoolhello.hello.label;"...
...There should only be one per document, which is the reason why we overlay the stringbundleset that is in browser.xul, hence the very generic id. We don't include the insertbefore or insertafter attributes because the ordering of string bundles doesn't make a difference. The element is completely i...
...And 2 more matches
Style System Overview - Archive of obsolete content
a group of declarations. A declaration is a property and a value. p { color: green; font-size: 12em; } selector { property: value; property: value; } CSS Style Rules What do style rules mean? Selector matches elements in the document. Rule applies to matched elements. "cascaded" value for property + element: if 0 rules matching the element have the property: some
properties inherit and some
properties use initial value. inherited: 'font-size', 'color', etc. "reset": 'border', 'background', etc. 1 matching rule: use value 2+ matching rules: cascade decides which wins: sort by origin (UA, user, author) & weight (!important), then specificity of selector, then order Example document source <doc> <ti...
...: 1em; } title { display: block; font-size: 3em; } para { display: block; } [class="emph"] { font-style: italic; } CSS style rule representation Each declaration block is represented by an nsCSSDeclaration An CSSStyleRuleImpl contains each selector associated with that declaration, and the declaration, and is the most important implementation of nsIStyleRule. The declarations (
properties & values) are stored in data structs (nsCSS*). The data format of the structs and selectors is mostly clear from the code and not worth going into (although the implementation of :not() is confusing). CSS style rule representation h1, h2 { color: green; text-align: right; text-indent: 0; } CSSStyleRuleImpl CSSStyleRuleImpl ? ? ? ?
...ara: D ? ? quote: A quote: A ? span: E class="emph" The rule tree and style data All of the style structs that can be obtained through a style context add up to around 900 bytes. This is big, and slow to fill in. The rule tree allows sharing. To allow for optimizations, each style struct contains only inherited
properties or only "reset"
properties. (Thus these structs can be called inherited structs or reset structs.) In the normal case, a style rule has a small number of declarations (hitting only a small number of structs). The rule tree and style data We optimize for the structs for which the rules have no declarations. In this case: inherited structs: same value as parent style context (optimization br...
...And 2 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
nt handlers. They must specifically pass the object on to the function called through an argument. A cross-browser event handling example follows (note that it means you can't define a global variable named event in your code): <div onclick="handleEvent(event);">Click me!</div> <script> function handleEvent(aEvent) { var myEvent = window.event ? window.event : aEvent; } </script> The
properties and functions that the event object exposes are also often named differently in Mozilla and Internet Explorer, as Table 4 shows. Table 4. Event
properties differences between Mozilla and Internet Explorer Internet Explorer Name Mozilla Name Description altKey altKey Boolean property that returns whether the alt key was pressed during the event. cancelBubbl...
... event. srcElement target The element to which the event was originally dispatched. toElement currentTarget For mouse events, this is the element to which the mouse moved. type type Returns the name of the event. Attach event handlers Mozilla supports two ways to attach events through JavaScript. The first, supported by all browsers, sets event
properties directly on objects. To set a click event handler, a function reference is passed to the object's onclick property: <div id="myDiv">Click me!</div> <script> function handleEvent(aEvent) { // if aEvent is null, means the Internet Explorer event model, // so get window.event. var myEvent = aEvent ? aEvent : window.event; } function onPageLoad(){ document.getElementById("myD...
...handleEvent(aEvent) { // if aEvent is null, it is the Internet Explorer event model, // so get window.event. var myEvent = aEvent ? aEvent : window.event; } function onPageLoad() { var element = document.getElementById("myDiv"); element.addEventListener("click", handleEvent, false); } </script> One advantage of addEventListener() and removeEventListener() over setting
properties is that you can have multiple event listeners for the same event, each calling another function. Thus, to remove an event listener requires all three parameters be the same as the ones you use when adding the listener. Mozilla does not support Internet Explorer's method of converting <script> tags into event handlers, which extends <script> with for and event attributes (see Table 5). It also do...
...And 2 more matches
Building Trees - Archive of obsolete content
The label attribute is used to set the label for a cell. The mode is used for progress meter columns. It may be set to either "normal" for a normal progress meter or "undetermined" for an undetermined progress meter. The value attribute is used to set the current progress value for norma...
...ri="?"> <treerow> <treecell label="?subject"/> <treecell label="?sender"/> <treecell label="?date"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> Features of the Tree Builder Besides the label of a cell, there are several other cell
properties you can set when using the tree builder. The supported
properties are: label, mode,
properties, src and value. The label attribute is used to set the label for a cell. The mode is used for progress meter columns. It may be set to either "normal" for a normal progress meter or "undetermined" for an undetermined progress meter. The value attribute is used to set the current progress value for normal progress meters. The value attribute may also be used for checkb...
...than all of them. Once the row height is changed, we can see the full photos. Note: If you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. These are used to track the current state of the disclosure triangles. Support for this was introduced in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4). Using Tree
Properties Since we need to use special CSS for trees, the
properties attribute on a cell becomes extremely useful. It can be used to define extra
properties for reference later in a stylesheet. For example, if the
properties attribute was set to the value "?creator", you could style the photos created by different people differently. Alternatively, you could also use static values (in addition to variable...
...And 2 more matches
Custom Tree Views - Archive of obsolete content
This example can be used for a tree with 10,000 rows. The contents of the cells in the first col...
... This example can be used for a tree with 10,000 rows. The contents of the cells in the first column will be set to the text 'Row X' where X is...
... This example can be used for a tree with 10,000 rows. The contents of the cells in the first column will be set to the text 'Row X' where X is the row number. The contents of the cells in the se...
...And 2 more matches
Element Positioning - Archive of obsolete content
w you to control the size of an element. The quick way is to simply add the width and height attributes on an element, much like you might do on an HTML img tag. An example is shown below: Example 1: Source View <button label="OK" width="100" height="40"/> However, it is not recommended that you do this. It is not very portable and may not fit in with some themes. A better way is to use style
properties, which work similarly to style sheets in HTML. The following CSS
properties can be used. width This specifies the width of the element. Note that the CSS global skin of the XUL application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property. hei...
...an be used. width This specifies the width of the element. Note that the CSS global skin of the XUL application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property. height This specifies the height of the element. By setting either of the two
properties, the element will be created with that width and height. If you specify only one size property, the other is calculated as needed. The size of these style
properties should be specified as a number followed by a unit. Flexible elements The sizes are fairly easy to calculate for non-flexible elements. They simply obey their specified widths and heights, and if the size wasn't specified, the elem...
...et this by using four attributes: minwidth; This specifies the minimum width that the element can be. minheight This specifies the minimum height that the element can be. maxwidth This specifies the maximum width that the element can be. maxheight This specifies the maximum height that the element can be. The values are always measured in pixels. You can also use the corresponding CSS
properties, min-width, min-height, max-width and max-height. These
properties are only useful for flexible elements. By setting a maximum height, for example, a stretchy button will only grow to a certain maximum height. You will still be able to resize the window beyond that point but the button will stop growing in size. The box the button is inside will also continue to grow, unless you set a maximum he...
...And 2 more matches
More Event Handlers - Archive of obsolete content
ent handler is passed an event object. In the attribute form of the event handler, the event object is an implied argument to the script code which can be referred to using the name 'event'. In the addEventListener form, the first argument passed to the listener function will be the event object. Other arguments can be passed to a listener function, if required. The event object has a number of
properties which can be examined during an event. For a full list, see the reference. We already saw the event's target property in the last section. It holds a reference to the element where the event occurred. A similar property currentTarget holds the element that is currently having its event listeners handled. In the example below, currentTarget is always the vbox, whereas target would be the specific ...
...he mouse so you should avoid performing lengthy tasks from this handler. mouseout Called when the mouse pointer is moved off of an element. You might then unhighlight the element or remove status text. There are also a set of drag related events, which occur when the user holds down a mouse button and drags the mouse around. Those events are described in Drag and Drop. Mouse Button Event
Properties When a mouse button event occurs, a number of additional
properties are available to determine which mouse buttons were pressed and the location of the mouse pointer. The event's button property can be used to determine which button was pressed, where possible values are 0 for the left button, 1 for the middle button and 2 for the right button. If you've configured your mouse differently, these v...
...een clicked quickly in sequence. This allows you to check for single, double or triple clicks. Of course, if you just want to check for double clicks, you can also use the dblclick event instead. The click event will be fired once for the first click, again for the second click, and again for the third click, but the dblclick event will only be fired once for a double click. ...
...And 2 more matches
notificationbox - Archive of obsolete content
Typically the element will be a browser, but any element may be used. The notification element is used for each notification, and will be created automatically for each item. Each notification will slide in and out as needed. This element is used, for example, to implement the yellow information bar in various Firefox windows. The notification box is a vertical box which may have children. The notifications appear at the top of the box. The notifications may be placed at the bottom by setting the dir attribute to reverse. ...
...he web content window for the tab you want to find the notification box for. Also it is possible to call function with the same name (they are different) of global object gBrowser: notifyBox = gBrowser.getNotificationBox() Examples <notificationbox flex="1"> <browser src="http://www.mozilla.org"/> </notificationbox> There is a more complex code available in the Code Snippets area. ...
...This property is read-only. allNotifications Type: nodeList NodeList of all notifications. This property is read-only. notificationsHidden Type: boolean Indicating whether the notification area should be hidden. Events AlertActive Type: Event Fired when...
...And 2 more matches
tabbrowser - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used for holding a set of read-only views of Web documents. It is similar to the browser element, except that multiple documents can be displayed, each in a separate tab. Note: Starting in Firefox 3 (XULRunner/Gecko 1.9), this is only used in the main Firefox window and cannot be used in other XUL windows by third-party applications or extensions. ...
... can be displayed, each in a separate tab. Note: Starting in Firefox 3 (XULRunner/Gecko 1.9), this is only used in the main Firefox window and cannot be used in other XUL windows by third-party applications or extensions. ...
...nt area in the tabbrowser. onbookmarkgroup Not in Firefox Type: script code This code executes when the user chooses the "Bookmark this Group of Tabs" command. onnewtab Not in Firefox Type: script code This script will be called when the new tab button is clicked. tabmodalPromptShowing Type: integer The number of tab modal prompts currently attached to the current tab.
Properties browsers Type: nodelist of browser elements Holds a list of the browser elements inside the tabbrowser. canGoBack Type: boolean This read-only property is true if there is a page to go back to in the session history and the Back button should be enabled. canGoForward Type: boolean This read-only property is true if there is a page to go forward to in the sessio...
...And 2 more matches
CSS - Archive of obsolete content
and layout orientation.-ms-content-zoom-chainingThe -ms-content-zoom-chaining CSS property is a Microsoft extension specifying the zoom 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 va...
... 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-snap-points CSS property is a Microsoft extension that specifies where zoom snap-points are located.-ms-content-zoom-snap-typeThe -ms-content-zoom-snap-type CSS property is a Microsoft extension that specifies how zooming is affected by defined snap-points.-ms-content-zoomingThe -ms-content-zooming CSS property is a Microsoft extension that specifi...
...If the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated.-ms-h...
...And 2 more matches
Reference - Archive of obsolete content
I also just read a document on proper inheritance using apply(). ...
...tance and ofcourse Function == Object return false ;) and the following statements also tells me that Function == Object although Math is only an instance of Object... which basicly says Function != Object alert(Function instanceof Object) //true alert(Object instanceof Function) //true alert(Math instanceof Object) //true alert(Math instanceof Function) //false note that the Methods and
properties for Object in this reference are also available for Function and vice versa ... Actual Question so my question is , what the heck is going on here ... IS Function same as Object. is Function an instance of Object or is Object an instace of Function ? note that the Methods and
properties for Object in this reference are also available for Function and vice versa ... --Aaike82 18:54, 18 August...
...oduced, and why you can infinitely do Function.constructor; //Function Function.constructor.constructor; //Function . . . Function.constructor.constructor.constructor.constructor.constructor . . . ; //Function Note that Math is not a constructor function, but merely a global object with methods and
properties useful to perform various mathematical operations. This is why Math instanceof Object evaluates to true, but Math instanceof Function does not. Compare this to the Date object. Like Math, Date is a global object that contains useful methods (Date.parse() and Date.UTC()). In addition to this, however, Date is also a constructor function: it constructs objects of the class Date, and thus is an inst...
...And 2 more matches
Windows Media in Netscape - Archive of obsolete content
s them in detail. GeckoActiveXObject vs. ActiveXObject Both GeckoActiveXObject and ActiveXObject work very similarly, with one key difference: Both take a Programmatic ID (ProgID) and use it to create a reference to the Windows Media Player. The ProgID of Windows Media Player is MediaPlayer.MediaPlayer.1. While the ProgID cannot be used to create a Windows Media Player object that exposes all its
properties and methods, it is useful for rapid detections. Here is a code snippet that shows this: var player; try { if (window.ActiveXObject) { player = new ActiveXObject("MediaPlayer.MediaPlayer.1"); } else if (window.GeckoActiveXObject) { player = new GeckoActiveXObject("MediaPlayer.MediaPlayer.1"); } else { // Plugin code using navigator.mimeTypes player = navigator.mimeTypes["appl...
...echanisms won't work owing to a bug in Netscape 7.1. Both ActiveXObject and GeckoActiveXObject can take WMPlayer.OCX.7 as an argument to create the control if Windows Media Player 7 or 9 are present. Unlike using the ProgID as an argument, using WMPlayer.OCX.7 as an argument to both these APIs creates a fully usable reference to the Windows Media Player 7 or 9 control, with all the methods and
properties exposed to JavaScript. Furthermore, you know for certain that you are working with the Windows Media 7 or 9 control -- there is no comparable instantiation for the Windows Media Player 6 control. For the sake of brevity, we've made the following code snippet shorter to illustrate the relevant points about the API: var player; try { if(window.ActiveXObject) { player = new ActiveXObject("WM...
...eries SDK. In Netscape 7.1, the codebase attribute of the object element cannot be used to initiate a digitally signed download of the Windows Media control, if it is not present on the machine. The section below on scripting the control covers more on how to detect if the Windows Media Player has not been successfully created. Scripting the Windows Media Player Control The number of methods and
properties that are exposed by the Windows Media Player, including the events that the player throws for handling by scripts in the web page containing the control, are covered in detail by the Windows Media Player SDK. This section covers relevant issues concerning the invocation of methods and
properties from within web pages that are embedding the Windows Media control. Detecting Successful Creation of t...
...And 2 more matches
Grids - Learn web development
ner"> <div>One</div> <div>Two</div> <div>Three</div> <div>Four</div> <div>Five</div> <div>Six</div> <div>Seven</div> </div> Note: The fr unit distributes available space, not all space. Therefore if one of your tracks has something large inside it there will be less free space to share out. Gaps between tracks To create gaps between tracks we use the
properties grid-column-gap for gaps between columns, grid-row-gap for gaps between rows, and grid-gap to set both at once. .container { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-gap: 20px; } These gaps can be any length unit or a percentage, but not an fr unit. Simple Grid Example with fr units body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 Aria...
... .container { display: grid; grid-template-columns: 2fr 1fr 1f...
... .container { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-gap: 20px; gap: 20px; } Repeating track listings You can repeat all, or a section of, your track listing using repeat notation. ...
...And 2 more matches
How CSS is structured - Learn web development
with CSS. The Cascade and inheritance section in the next module explains this in detail, including how to calculate specificity. For now, remember that specificity exists. Sometimes, CSS might not apply as you expected because something else in the stylesheet has more specificity. Recognizing that more than one rule could apply to an element, is the first step in fixing these kinds of issues.
Properties and values At its most basic level, CSS consists of two components:
Properties: These are human-readable identifiers that indicate which stylistic features you want to modify. For example, font-size, width, background-color. Values: Each property is assigned a value. This value indicates how to style the property. The example below highlights a single property and value. The property name ...
...declaration. CSS declarations are found within CSS Declaration Blocks. In the example below, highlighting identifies the CSS declaration block.. Finally, CSS declaration blocks are paired with selectors to produce CSS rulesets (or CSS rules). The example below contains two rules: one for the h1 selector and one for the p selector. The colored highlighting identifies the h1 rule. Setting CSS
properties to specific values is the primary way of defining layout and styling for a document. The CSS engine calculates which declarations apply to every single element of a page. Important: CSS
properties and values are case-sensitive. The property and value in each pair is separated by a colon. (:) Look up different values of
properties listed below. Write CSS rules that apply styling to different H...
... calculation isn't something that can be computed in advance and entered as a static value. Another example would be the various values for transform, such as rotate(). <div class="box"></div> .box { margin: 30px; width: 100px; height: 100px; background-color: rebeccapurple; transform: rotate(0.8turn) } The output from the above code looks like this: Look up different values of
properties listed below. Write CSS rules that apply styling to different HTML elements: transform background-image, in particular gradient values color, in particular rgb/rgba/hsl/hsla values @rules CSS @rules (pronounced "at-rules") provide instruction for what CSS should perform or how it should behave. Some @rules are simple with just a keyword and a value. For example, @import imports a styles...
...And 2 more matches
create fancy boxes - Learn web development
hallenging because of annoying constraints and crazy freedom in the use of CSS. Let's do some fancy boxes. Before we start getting into the practical side of it, make sure you are familiar with the CSS box model. It's also a good idea, but not a prerequisite, to be familiar with some CSS layout basics. On the technical side, Creating fancy boxes are all about mastering CSS border and background
properties and how to apply them to a given box. But beyond the technics its also all about unleashing your creativity. It will not be done in one day, and some web developers spend their whole life having fun with it. We are about to see many examples, but we will always work on the most simple piece of HTML possible, a simple element: <div class="fancy">Hi! I want to be fancy.</div> Ok, that's a very s...
... your creativity. It will not be done in one day, and some web developers spend their whole life having fun with it. We are about to see many examples, but we will always work on the most simple piece of HTML possible, a simple element: <div class="fancy">Hi! I want to be fancy.</div> Ok, that's a very small bit of HTML, what can we tweak on that element? All of the following: Its box model
properties: width, height, padding, border, etc. Its background
properties: background, background-color, background-image, background-position, background-size, etc. Its pseudo-element: ::before and ::after and some aside
properties like: box-shadow, transform, outline, etc. So we have a very large playground. Let the fun begin. Box model tweak The box model alone allows us to do some basic stuff, l...
... Making circles <div class="fancy">Hi! I want to be fancy.</div> This is something that is both very simple and very fun. ...
...And 2 more matches
Object-oriented JavaScript for beginners - Learn web development
place your previous function with the following: function Person(name) { this.name = name; this.greeting = function() { alert('Hi! I\'m ' + this.name + '.'); }; } The constructor function is JavaScript's version of a class. Notice that it has all the features you'd expect in a function, although it doesn't return anything or explicitly create an object -- it basically just defines
properties and methods. Notice also the this keyword being used here as well -- it is basically saying that whenever one of these object instances is created, the object's name property will be equal to the name value passed to the constructor call, and the greeting() method will use the name value passed to the constructor call too. Note: A constructor function name usually starts with a capital letter -...
...They do, however, have the same name property and greeting() method available. Note that they are using their own name value that was assigned to them when they were created; this is one reason why it is very important to use this, so...
...st + ' is ' + this.age + ' years old. He likes ' + this.interests[0] + ' and ' + this.interests[1] + '.'); }; this.greeting = function() { alert('Hi! I\'m ' + this.name.first + '.'); }; } Now add in the following line below it, to create an object instance from it: let person1 = new Person('Bob', 'Smith', 32, 'male', ['music', 'skiing']); You can now see that you can access the
properties and methods just like we did previously -- try these in your JS console: person1['age'] person1.interests[1] person1.bio() // etc. Note: If you are having trouble getting this to work, try comparing your code against our version -- see oojs-class-finished.html (also see it running live). Further exercises To start with, try adding a couple more object creation lines of your own, and try get...
...And 2 more matches
Mozilla’s UAAG evaluation report
Does not contradict current specifications for HTML and CSS rendering. 2.2 Provide text view. (P1) C Also known as view source. 2.3 Render conditional content. (P1) VG ALT for IMG: rendered when images turned off. See meta bug 41924 for open issues with the ALT attribute. TITLE for *any* element: rendered as tooltip LONGDESC for IMG element: in context menu -
properties content of OBJECT element: ? ALT for AREA element: ? ALT for INPUT element: ? ACRONYM element: supported ABBR element: supported ABBR attribute for TD/TH: not supported SUMMARY for TABLE: supported TITLE for FRAME: ? LONGDESC for FRAME: Not supported, see Bug 3658 NOFRAME for FRAME: Must use user style sheets to render this. A UI for this would be good. ...
...sider this to be a very difficult problem. 2.8 No repair text. (P3) P We have no repair strategy in 2.7 We have no way to configure that alt="" still needs to be repaired 2.9 Render conditional content automatically. (P3) G ALT for IMG: rendered when images turned off TITLE for *any* element: rendered as tooltip LONGDESC for IMG element: in context menu -
properties content of OBJECT element: ? ALT for AREA element: ? ALT for INPUT element: ? ACRONYM element: supported ABBR element: supported ABBR attribute for TD/TH: not supported SUMMARY for TABLE: supported TITLE for FRAME: ? LONGDESC for FRAME: Not supported, see Bug 3658 NOFRAME for FRAME: Must use user style sheets to render this. A UI for this would be good. ...
...): Available through DOM HTML: HEADERS attribute (TABLE): Available through DOM HTML: AXIS attribute (TABLE): Available through DOM HTML: TABINDEX attribute: yes, can be used to order sequential navigation HTML: ACCESSKEY attribute: Supported with ALT-{key}, menu key conflict favor the accesskey? HTML: ALT for IMG: yes HTML: LONGDESC for IMG: yes, available in context menu
properties HTML: ALT for AREA: ? HTML: ALT for INPUT: ? CSS: TEXT-INDENT: yes CSS: TEXT-ALIGN: yes CSS: WORD-SPACING: yes CSS: LETTER-SPACING: yes CSS: FONT-STRETCH: NI CSS: MARGIN: yes CSS: FLOAT: yes CSS: POSITION: yes CSS: !IMPORTANT: yes CSS: SYSTEM FONTS: yes CSS: SYSTEM COLORS: yes CSS: list types: yes CSS: OUTLINE: no CSS: :before, :afte...
...And 2 more matches
Eclipse CDT Manual Setup
cting an appropriate directory, click OK, then close the "Welcome" tab when the main Eclipse window opens. Before you proceed any further, check that your changes to Eclipse's memory limits have taken effect and are present in Eclipse/Help > About Eclipse > Installation Details > Configuration. To avoid confusion in this and the following sections, note that "workspace preferences" and "project
properties" are different things (we'll get to the details below). Whenever you create a new workspace for a Mozilla source tree, you should be sure to turn off the following two settings in the workspace preferences (Window > Preferences, or Eclipse > Preferences) before creating a project in that workspace: in "General > Workspace", disable "Build automatically" in "C/C++ > Indexer", disable "Automat...
...ree). Click on the little green button beside this message to open the "Progress" tab, and keep an eye on the "Refreshing workspace" item as you continue with the steps below. (If an "indexing" item starts after the "Refreshing the workspace" item has finished, click the little red box beside that item to cancel it, since we want to configure the project before the indexer runs.) Initial project
properties So that the indexer will run faster and give better results, and so that Eclipse doesn't give results for irrelevant files, you should add some resource filters to have Eclipse ignore certain non-source files and directories. Note, you must not make Eclipse ignore your (main) object directory. That object directory is needed to resolve include paths to the various headers that the build process ...
...that Eclipse doesn't give results for irrelevant files, you should add some resource filters to have Eclipse ignore certain non-source files and directories. Note, you must not make Eclipse ignore your (main) object directory. That object directory is needed to resolve include paths to the various headers that the build process generates/copies there. To create resource filters, open the project
properties (different to the workspace preferences!) by selecting
Properties from the context menu for the project (root item) in the Project Explorer tab on the left, or by selecting Project >
Properties from the menubar. Select "Resource > Resource Filters" on the left of the window that opens, then use the Add button to add the following filters: Add an "Exclude all" filter for folders with a Project ...
...And 2 more matches
Download
persisted across sessions. A new Download object can be created using the Downloads.createDownload() function. Method overview Promise start(); Promise launch(); Promise showContainingDirectory(); Promise cancel(); Promise removePartialData(); Promise whenSucceeded(); Promise finalize([optional] boolean aRemovePartialData);
Properties Attribute Type Description canceled Read only boolean Indicates that the download has been canceled. This property can become true, then it can be reset to false when a canceled download is restarted. This property becomes true as soon as the cancel() method is called, though the stopped property might remain false until the cancellation request has been ...
...d is in progress, using the MIME type provided by the server. currentBytes Read only number Number of bytes currently transferred. This value starts at zero, and may be updated regardless of the value of hasProgress. Note: You shouldn't rely on this property being equal to totalBytes to determine whether the download is completed. You should use the individual state
properties instead, since this value may not be updated after the last piece of data is transferred. error Read only DownloadError When the download fails, this is set to a DownloadError instance indicating the cause of the failure. If the download has been completed successfully or has been canceled, this property is null. This property is reset to null when a failed download is restart...
...get file will be opened or executed automatically. launcherPath string Local file path of the application to be used to launch the target file, or null if the file should be launched with the default application associated with the contentType property or the extension of the target file. onchange Function This can be set to a function that is called after other
properties change. Warning: This property cannot be used if the download is part of a DownloadList. progress Read only number Progress percent, from 0 to 100. Intermediate values are reported only if hasProgress is true. Note: You shouldn't rely on this property being equal to 100 to determine whether the download is completed. You should use the individual state...
...And 2 more matches
Localizing extension descriptions
f Mozilla add-ons, as well as for other metadata about your add-on. Because a new method for doing so was implemented in Gecko 1.9 (Firefox 3), there are two sets of instructions below. Localizing in Gecko 1.9 Gecko 1.9 includes a new, more robust method for localizing add-on descriptions and other metadata. All of the different descriptions now appear in the install.rdf file using em:localized
properties. ...
...ncludes a new, more robust method for localizing add-on descriptions and other metadata. All of the different descriptions now appear in the install.rdf file using em:localized
properties. Each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale. ...
...ES and vice versa). If there is more than one locale with the same number of matching parts, then use the most general one (e.g., en in preference to en-GB when searching for en-US). The current app locale will be searched for and then there will be a fallback search for en-US. ...
...And 2 more matches
Localizing without a specialized tool
With that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. ...
...le in your x-testing directory and translate the words inside the quotation marks. Be sure to only translate what is in the quotation marks. For the purposes of this tutorial, we will just convert all letters to uppercase, so that the change is visible in the UI. <!ENTITY cmd_engineManager.label "MANAGE SEARCH ENGINES..."> <!ENTITY searchEndCap.label "SEARCH"> Save the file. .
properties Files The property file "search.
properties" contains the string "Add %S". This string can easily be found in the browser UI by visiting a website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search box in the upper-right corner of your browser. At the second to bottom of the list of search engines that appears, you'll see, "Add %S...
... en-US source code (mozilla-1.9.2). You can do this by typing: cd ../../ where each ".." represents the prior sub directory before the main directory where you want to be. You can always check the path by typing pwd Once you are in the root working directory with both en-US source and the l10n base, copy the searchbar.dtd file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/search.
properties l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ Open that file and translate the strings that follow the "=". For instance, enter the proper translation for the line "Add %S" cmd_addFoundEngine=ADD "%S" With these two string examples translated, you can now test your work to see immediately where you have translated. Refer to the Building and Testing section of the Create a new localizatio...
...And 2 more matches
Mozilla Style System
The handling of those computed values is the responsibility of other parts of the code. Architecture The style system is split in half rather neatly. In one half (the backend) are the sources of specified style data, and in the other half (the frontend) is the code that turns the specified values into computed values. ...
...StyleSet object and many nsStyleContext objects, each of which holds the computed style for an element, pseudo-element, or text node. The style set provides the API managing the rule processors and for creating style contexts. The style contexts then provide the API for computed style data by allowing retrieval of a set of style structs, each of which contains the computed values of a set of CSS
properties. ...
...ent, or text node. The style set provides the API managing the rule processors and for creating style contexts. The style contexts then provide the API for computed style data by allowing retrieval of a set of style structs, each of which contains the computed values of a set of CSS
properties. Style structs The style structs are a set of structs, each of which holds computed values a group of
properties. ...
...And 2 more matches
Scripting Java
that matter). All the functionality covered in this chapter should thus be considered an extension. Accessing Java Packages and Classes Every piece of Java code is part of a class. Every Java class is part of a package. In JavaScript, however, scripts exist outside of any package hierarchy. How then, do we access classes in Java packages? Rhino defines a top-level variable named Packages. The
properties of the Packages variable are all the top-level Java packages, such as java and com. For example, we can access the value of the java package: js> Packages.java [JavaPackage java] As a handy shortcut, Rhino defines a top-level variable java that is equivalent to Packages.java. So the previous example could be even shorter: js> java [JavaPackage java] We can access Java classes simply by stepp...
...i) } exists parentFile mkdir toString wait [44 others] Note that not only the methods of the File class are listed, but also the methods inherited from the base class java.lang.Object (like wait). This makes it easier to work with objects in deeply nested inheritance hierarchies since you can see all the methods that are available for that object. Rhino provides another convenience by allowing
properties of JavaBeans to be accessed directly by their property names. A JavaBean property foo is defined by the methods getFoo and setFoo. Additionally, a boolean property of the same name can be defined by an isFoo method. For example, the following code actually calls the File object's getName and isDirectory methods. js> f.name test.txt js> f.directory false Calling Overloaded Methods The process ...
...g JavaScript argument types (number,number) is ambiguous; candidate methods are: class java.lang.String g(java.lang.String,int) class java.lang.String g(int,java.lang.String) See Java Method Overloading and LiveConnect 3 for a more precise definition of overloading semantics. Implementing Java Interfaces Now that we can access Java classes, create Java objects, and access fields, methods, and
properties of those objects, we have a great deal of power at our fingertips. However, there are a few instances where that is not enough: many APIs in Java work by providing interfaces that clients must implement. One example of this is the Thread class: its constructor takes a Runnable that contains a single method run that will be called when the new thread is started. To address this need, Rhino provid...
...And 2 more matches
JSPropertyOp
in SpiderMonkey 1.9.3 Name Type Description cx JSContext * The context in which the property access is taking place. Provides request. In JS_THREADSAFE builds, the JavaScript engine calls this callback only from within an active request on cx. The callback does not need to call JS_BeginRequest()). obj JS::HandleObject The object whose
properties are being accessed. id JS::HandleId The name or index of the property being accessed. This is either a string (Unicode property identifier) or an integer (element index). strict bool (JSStrictPropertyOp only) If strict is true, treating the assignment as strict mode code. vp JS::MutableHandleValue In/out parameter. Points to a JS::Value variable. The m...
... may veto the ongoing property operation by optionally reporting an error or raising an exception and then returning false. The operation then fails, and the error is propagated to the caller. Otherwise the callback must return true, and the property operation proceeds. Getters and setters When a JSAPI application creates a property on an object (for example, using JS_DefineProperty or JS_Define
Properties) it can specify getter and setter callbacks for the new property. Getters. The getter callback is called each time JavaScript code accesses the property's value using the syntax obj.prop or obj[propname]. It is also called when the property's value is accessed via JSAPI functions such as JS_GetProperty or (less obviously) JS_CallFunctionName. On entry, *vp contains the property's stored value or...
...th = x), is the value of *vp after the setter is called. This is typically the value of the left-hand side after assignment, as opposed to the value of the right-hand side, as required by ECMA 262-3 ?11.13. This ECMAScript incompatibility is observable when assigning to the length property of an Array, for example. This incompatibility will be fixed in SpiderMonkey 1.8; see bug 312354. Inherited
properties. Note that in JavaScript, an object can inherit
properties from its prototype. Getters (and sometimes setters; see JS_SetProperty for details) are called even when the property being accessed is found on a prototype and not on obj itself. In this case obj points to the object from which the property is being accessed, not the object on which the property was defined. JSClass hooks JSClass offer...
...And 2 more matches
JSAPI reference
type Added in SpiderMonkey 31 JS::IdentifyStandardConstructor Added in SpiderMonkey 38 Date JS_NewDateObject Added in SpiderMonkey 1.8.5 JS_NewDateObjectMsec Added in SpiderMonkey 1.8.5 JS_ObjectIsDate Added in SpiderMonkey 1.8.5 JS_ClearDateCaches Added in SpiderMonkey 17 JS_Now Intl API JS_SetDefaultLocale Added in SpiderMonkey 24 JS_ResetDefaultLocale Added in SpiderMonkey 24
Properties These functions correspond directly to the ways scripts access object
properties: JS_GetProperty JS_GetUCProperty JS_GetPropertyById Added in SpiderMonkey 1.8.1 JS_SetProperty JS_SetUCProperty JS_SetPropertyById Added in SpiderMonkey 1.8.1 JS_HasProperty JS_HasUCProperty JS_HasPropertyById Added in SpiderMonkey 1.8.1 JS_HasOwnProperty Added in JSAPI 45 JS_HasOwnPropertyById Added in...
..."Define" is a lower-level version of "set" that provides access to extra settings and does not call setters. Similarly, "lookup" is a lower-level version of "get" that offers extra options and does not call getters. struct JSPropertyDescriptor Added in SpiderMonkey 1.8 Property attributes JSPROP_ENUMERATE JSPROP_READONLY JSPROP_PERMANENT JSPROP_PROPOP_ACCESSORS...
...ANENT Added in SpiderMonkey 38 JSPROP_IGNORE_VALUE Added in SpiderMonkey 38 JS_AlreadyHasOwnElement Added in SpiderMonkey 1.8 JS_AlreadyHasOwnProperty Added in SpiderMonkey 1.8 JS_AlreadyHasOwnUCProperty Added in SpiderMonkey 1.8 JS_AlreadyHasOwnPropertyById Added in SpiderMonkey 1.8.1 JS_DefineProperty JS_DefineUCProperty JS_DefinePropertyById Added in SpiderMonkey 1.8.1 JS_Define
Properties JS_Enumerate JS_ForwardGetPropertyTo Added in SpiderMonkey 17 JS_ForwardGetElementTo Added in SpiderMonkey 17 JS_GetPropertyDescriptor Added in SpiderMonkey 31 JS_GetPropertyDescriptorById Added in SpiderMonkey 1.8.1 JS_GetOwnPropertyDescriptor Added in SpiderMonkey 31 JS_GetOwnPropertyDescriptorById Added in SpiderMonkey 31 JS_GetOwnUCPropertyDescriptor Added in SpiderMonkey 45 JS_SetAl...
...And 2 more matches
Language bindings
llowing bridging layers are currently available: Components objectThe Components object is the object through which XPConnect functionality is reflected into JavaScript. The Components object is actually a native instance of the nsIXPCComponents interface which is reflected into JavaScript as a top level object using XPConnect.Components.classesComponents.classes is a read-only object whose
properties are classes indexed by ContractID.Components.classesByIDComponents.classesByID is a read-only object whose
properties are classes indexed by CID.Components.ConstructorCreates a JavaScript function which can be used to create or construct new instances of XPCOM components.Components.ExceptionComponents.Exception is a JavaScript constructor to create nsIXPCException objects. These exception objects...
... objects. ...
...nsresult value) indicates the success or failure of an operation, returning true or false respectively.Components.lastResultComponents.managerComponents.manager is a convenience reflection of the global native component manager service. The scriptable methods on the nsIComponentManager interface can be called directly on this object.Components.resultsComponents.results is a read-only object whose
properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at Table Of Errors), with the value of each corresponding to that constant's value.Components.returnCodeComponents.stackComponents.stack is a read only property of type nsIStackFrame (IDL definition) that represents a snapshot of the current JavaScript callstack. This can be used for various diagnostic pu...
...And 2 more matches
WebIDL bindings
xt*, JSObject*); bool IsLong() const; int32_t GetAsLong() const; int32_t& SetAsLong() Owning unions used on the stack should be declared as a RootedUnion<UnionType>, for example, RootedUnion<OwningObjectOrLong>. Date WebIDL Date types are represented by a mozilla::dom::Date struct. C++ reflections of WebIDL declarations WebIDL declarations (maplike/setlike/iterable) are turned into a set of
properties and functions on the interface they are declared on. Each has a different set of helper functions it comes with. In addition, for iterable, there are requirements for C++ function implementation by the interface developer. Maplike Example Interface: interface StringToLongMap { maplike<DOMString, long>; }; The bindings for this interface will generate the storage structure for the map, as we...
...ngAlias=propName] This extended attribute can be specified on an attribute and indicates that another property with the specified name will also appear on the interface prototype object and will call the same underlying C++ implementation for the getter and setter. This is more efficient than using the same BinaryName for both attributes, because it shares the binding glue code between them. The
properties still have separate getter/setter functions in JavaScript, so from the point of view of web consumers it's as if you actually had two separate attribute declarations on your interface. For example: interface MyInterface { [BindingAlias=otherAttr] readonly attribute boolean attr; }; MyInterface.prototype.otherAttr and MyInterface.prototype.attr will both exist, have separate getter/setter fun...
...nerate extra code to handle possible exceptions. Possibly-throwing methods and attributes get an ErrorResult& argument. [Throws] applies to both methods and attributes; for attributes it means both the getter and the setter can throw. [GetterThrows] applies only to attributes. [SetterThrows] applies only to non-readonly attributes. For interfaces flagged with [JSImplementation], all methods and
properties are assumed to be able to throw and do not need to be flagged as throwing. [DependsOn] Used for a method or attribute to indicate what the return value depends on. Possible values are: Everything This value can't actually be specified explicitly; this is the default value you get when [DependsOn] is not specified. This means we don't know anything about the return value's dependencies and h...
...And 2 more matches
Debugger.Source - Firefox Developer Tools
serialized text of a block of WebAssembly code. The two cases are distinguished by the latter having its introductionType property always being "wasm" and the former having its introductionType property never being "wasm". Each Debugger instance has a separate collection of Debugger.Source instances representing the source code that has been presented to the system. A debugger may place its own
properties on Debugger.Source instances, to store metadata about particular pieces of source code. Debugger.Source for JavaScript For a Debugger.Source instance representing a piece of JavaScript source code, its
properties provide the source code itself as a string, and describe where it came from. Each Debugger.Script instance refers to the Debugger.Source instance holding the source code from which it ...
...sented to the JavaScript implementation more than once, with the same origin metadata, the JavaScript implementation may generate a fresh Debugger.Source instance to represent each presentation, or it may use a single Debugger.Source instance to represent them all. Debugger.Source for WebAssembly For a Debugger.Source instance representing the serialized text of a block of WebAssembly code, its
properties provide the serialized text as a string. Currently only entire modules evaluated via new WebAssembly.Module are represented. SpiderMonkey constructs exactly one Debugger.Source for each underlying WebAssembly module per Debugger instance. Please note at the time of this writing, support for WebAssembly is very preliminary. Many
properties below return placeholder values. Convention For descri...
...he serialized text as a string. Currently only entire modules evaluated via new WebAssembly.Module are represented. SpiderMonkey constructs exactly one Debugger.Source for each underlying WebAssembly module per Debugger instance. Please note at the time of this writing, support for WebAssembly is very preliminary. Many
properties below return placeholder values. Convention For descriptions of
properties and methods below, if the behavior of the property or method differs between the instance referring to JavaScript source or to a block of WebAssembly code, the text will be split into two sections, headed by "if the instance refers to JavaScript source" and "if the instance refers to WebAssembly code", respectively. If the behavior does not differ, no such emphasized headings will appear. Access...
...And 2 more matches
Examine and edit CSS - Firefox Developer Tools
n CSS and rules view features. You can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of Firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the Configuration Editor to enable this feature); change the display based on print media rules. A warning icon appears next to unsupported CSS
properties or rules that have invalid values. This can help you understand why certain styles are not being applied. In the following example, a spelling error, "background-colour" instead of "background-color" has made the rule invalid: Rule display It displays each rule as in a stylesheet, with a list of selectors followed by a list of property:value; declarations. Highlight matched elements: nex...
..." under the developer tool settings panel. (Note that this setting is independent of the "Browser styles" checkbox in the Computed view.) User-agent styles are displayed against a different background, and the link to the filename and line number contains the prefix (user agent): element {} rule The element {} rule at the top of the rules list isn't actually a CSS rule. It represents the CSS
properties assigned to the element via its style attribute. This also gets the target icon: , giving you a convenient way to highlight the currently selected element in the page. Filtering rules There's a box at the top of the Rules view labeled "Filter Styles": As you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlig...
...ove it again. Strict search By default, the search box highlights all declarations which contain any part of the string. For example, searching for "color" will highlight declarations containing border-bottom-color and background-color as well as just color.: If you enclose the search query in backticks, like this: `color`, the search is restricted to exact matches: Expanding shorthand
properties Shorthand
properties can be expanded to display their related longhand
properties by clicking the arrow besides them. 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-numb...
...And 2 more matches
CSS Typed Object Model API - Web APIs
authors (for example, numeric values are reflected with actual JS numbers, and have unit-aware mathematical operations defined for them). It is also generally faster, as values can be directly manipulated and then cheaply translated back into underlying values without having to both build and parse strings of CSS. CSS Typed OM both allows for the performant manipulation of values assigned to CSS
properties while enabling maintainable code that is both more understand and easier to write. Interfaces CSSStyleValue The CSSStyleValue interface of the the CSS Typed Object Model API is the base class of all CSS values accessible through the Typed OM API. An instance of this class may be used anywhere a string is expected. CSSStyleValue.parse(property, cssText) The parse() method of the CSSStyle...
...o the StylePropertyMap with the given property and value. StylePropertyMap.delete() Method that removes the CSS declaration with the given property from the StylePropertyMap. StylePropertyMap.clear() Method that removes all declarations in the StylePropertyMap. CSSUnparsedValue The CSSUnparsedValue interface of the CSS Typed Object Model API represents property values that reference custom
properties. It consists of a list of string fragments and variable references. CSSUnparsedValue.CSSUnparsedValue() constructor Creates a new CSSUnparsedValue object which represents property values that reference custom
properties. CSSUnparsedValue.entries() Method returning an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (t...
... CSSUnparsedValue.forEach() Method executing a provided function once for each element of the CSSUnparsedValue. ...
...And 2 more matches
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignm...
... Element.accessKey Is a DOMString containing a single character that switches input focus to the control. HTMLAreaElement.alt Is a DOMString that reflects the alt HTML attribute, containing alternative text for the element. HTMLAreaElement.coords Is a DOMString that reflects the coords H...
... Element.accessKey Is a DOMString containing a single character that switches input focus to the control. HTMLAreaElement.alt Is a DOMString that reflects the alt HTML attribute, containing alternative text for the element. HTMLAreaElement.coords Is a DOMString that reflects the coords HTML attribute, contai...
...And 2 more matches
HTMLBodyElement - Web APIs
The HTMLBodyElement interface provides special
properties (beyond those inherited from the regular HTMLElement interface) for manipulating <body> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121...
... HTMLBodyElement.aLink Is a DOMString that represents the color of active hyperlinks. HTMLBodyElement.background Is a DOMString that represents the description of the location of the background image resource. Note that this is not an URI, though some older version of some browsers do expect it. HTMLBodyElem...
... HTMLBodyElement.aLink Is a DOMString that represents the color of active hyperlinks. HTMLBodyElement.background Is a DOMString that represents the description of the location of the background image resource. Note that this is not an URI, though some older version of some browsers do expect it. HTMLBodyElement.bgColor Is a D...
...And 2 more matches
HTMLLinkElement - Web APIs
The HTMLLinkElement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by HTMLAnchorElement). This object inherits all of the
properties and methods of the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56"...
... HTMLLinkElement.as Is a DOMString representing the type of content being loaded by the HTML link. HTMLLinkElement.crossOrigin Is a DOMString that corresponds to the CORS setting for this link element. See CORS settings attributes for details. HTMLLinkElement.disabled Is a Boolean which represents whether the link is dis...
... HTMLLinkElement.as Is a DOMString representing the type of content being loaded by the HTML link. HTMLLinkElement.crossOrigin Is a DOMString that corresponds to the CORS setting for this link element. See CORS settings attributes for details. HTMLLinkElement.disabled Is a Boolean which represents whether the link is disabled; currently only...
...And 2 more matches
HTMLScriptElement - Web APIs
JavaScript files should be served with the application/javascript MIME type, but browsers are lenient and block them only if the script is served with an image type (image/*), video type (video/*), audio type (audio/*), or text/csv. If the script is blocked, its element receives an error event; otherwise, it receives a load event. ...
... HTMLScriptElement.type Is a DOMString representing the MIME type of the script. It reflects the type attribute. HTMLScriptElement.src Is a DOMString representing the URL of an external script. It reflects the src attribute. HTMLScriptElement.event Is a DOMString; an obsolete way of registering event handlers on elements in an HTML doc...
... HTMLScriptElement.type Is a DOMString representing the MIME type of the script. It reflects the type attribute. HTMLScriptElement.src Is a DOMString representing the URL of an external script. It reflects the src attribute. HTMLScriptElement.event Is a DOMString; an obsolete way of registering event handlers on elements in an HTML document. HTMLScriptEl...
...And 2 more matches
HTMLTableCellElement - Web APIs
The HTMLTableCellElement 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 table cells, either header or data cells, in an HTML document. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospa...
... HTMLTableCellElement.abbr A DOMString which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell.. This alternate label can be used in other contexts, such as when describing the headers that apply to a data cell. This is used to offer a shorter term for use by screen readers in particular, and is a ...
... HTMLTableCellElement.abbr A DOMString which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell.. This alternate label can be used in other contexts, such as when describing the headers that apply to a data cell. This is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibilit...
...And 2 more matches
MediaTrackSettings - Web APIs
The MediaTrackSettings dictionary is used to return the current values configured for each of a MediaStreamTrack's settings. These values will adhere as closely as possible to any constraints previously described using a MediaTrackConstraints object and set using applyConstraints(), and will adhere to the default constraints for any
properties whose constraints haven't been changed, or whose customized constraints couldn't be matched. To learn more about how constraints and settings work, see Capabilities, constraints, and settings.
Properties Some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. For example, because RTP doesn't provide some of these values during negotiation of a WebRTC connect...
...The device ID is a origin-unique string identifying the source of the track; this is usually a GUID. ...
... devices for the speaker and microphone built into a phone would share the same group ID, since they're part of the same physical device. The microphone on a headset would have a different ID, though. This value is specific to the source of the track's data and is not usable for setting constraints; it can, however, be used for initially selecting media when calling MediaDevices.getUserMedia().
Properties of audio tracks autoGainControl A Boolean which indicates the current value of the autoGainControl property, which is true if automatic gain control is enabled and is false otherwise. channelCount A long integer value indicating the current value of the channelCount property, specifying the number of audio channels present on the track (therefore indicating how many audio samples exist in e...
...And 2 more matches
Using Performance Timeline - Web APIs
]); } // Use getEntriesByName() to get all "mark" entries named "Begin" p = performance.getEntriesByName("Begin", "mark"); for (var i=0; i < p.length; i++) { log ("Begin and Mark [" + i + "]"); print_perf_entry(p[i]); } } PerformanceEntry interface The PerformanceEntry interface encapsulates a single performance entry i.e. a single performance metric. ...
...mance.getEntriesByName("Begin", "mark"); for (var i=0; i < p.length; i++) { log ("Begin and Mark [" + i + "]"); print_perf_entry(p[i]); } } PerformanceEntry interface The PerformanceEntry interface encapsulates a single performance entry i.e. a single performance metric. This interface has four
properties and a JSON serializer (toJSON(). The following example shows the use of these
properties. ...
...i < p.length; i++) { log ("Begin and Mark [" + i + "]"); print_perf_entry(p[i]); } } PerformanceEntry interface The PerformanceEntry interface encapsulates a single performance entry i.e. a single performance metric. This interface has four
properties and a JSON serializer (toJSON(). The following example shows the use of these
properties. ...
...And 2 more matches
SVGMeshElement - Web APIs
The SVGMeshElement interface provides access to the
properties of <mesh> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/SVGMeshElement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGMeshElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGeometryElement, and implements the methods of SVGURIReference. ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGeometryElement, and implements the methods of SVGURIReference. ...
...And 2 more matches
SVGPolygonElement - Web APIs
The SVGPolygonElement interface provides access to the
properties of <polygon> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25"...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGGeometryElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGGeometryElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGPolygonElement' in that specificatio...
...And 2 more matches
SVGPolylineElement - Web APIs
The SVGPolylineElement interface provides access to the
properties of <polyline> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,2...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGGeometryElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGGeometryElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGPolylineElement' in that specificati...
...And 2 more matches
Web audio spatialization basics - Web APIs
om (defined by the edges of the browser viewport), and in this demo, we can move and rotate it with the provided controls. When we move the boombox, the sound it produces changes accordingly, panning as it moves to the left or right of the room, or becoming quieter as it is moved away from the user or is rotated so the speakers are facing away from them, etc. This is done by setting the different
properties of the PannerNode object instance in relation to that movement, to emulate spacialization. Note: The experience is much better if you use headphones, or have some kind of surround sound system to plug your computer into. Creating an audio listener So let's begin! The BaseAudioContext (the interface the AudioContext is extended from) has a listener property that returns an AudioListener objec...
...e room using positionZ. Here we are setting the listener to be in the middle of the viewport and slightly in front of our boombox. We can also set the direction the listener is facing. The default values for these work well: listener.forwardX.value = 0; listener.forwardY.value = 0; listener.forwardZ.value = -1; listener.upX.value = 0; listener.upY.value = 1; listener.upZ.value = 0; The forward
properties represent the 3D coordinate position of the listener's forward direction (e.g. the direction they are facing in), while the up
properties represent the 3D coordinate position of the top of the listener's head. These two together can nicely set the direction. Creating a panner node Let's create our PannerNode. This has a whole bunch of
properties associated with it. Let's take a look at each of ...
...thm that's used to position the audio in 3D space. We can set this to: equalpower -- The default and the general way panning is figured out HRTF -- This stands for 'Head-related transfer function' and looks to take into account the human head when figuring out where the sound is. Pretty clever stuff. Let's use the HRTF model! const pannerModel = 'HRTF'; The coneInnerAngle and coneOuterAngle
properties specify where the volume emanates from. By default, both are 360 degrees. Our boombox speakers will have smaller cones, which we can define. The inner cone is where gain (volume) is always emulated at a maximum and the outer cone is where the gain starts to drop away. The gain is reduced by the value of the coneOuterGain value. Let's create constants that store the values we'll use for these para...
...And 2 more matches
-webkit-text-stroke - CSS: Cascading Style Sheets
The -webkit-text-stroke CSS property specifies the width and color of strokes for text characters. This is a shorthand property for the longhand
properties -webkit-text-stroke-width and -webkit-text-stroke-color. ...
...ext characters. This is a shorthand property for the longhand
properties -webkit-text-stroke-width and -webkit-text-stroke-color. /* Width and color values */ -webkit-text-stroke: 4px navy; text-stroke: 4px navy; /* Global values */ -webkit-text-stroke: inherit; -webkit-text-stroke: initial; -webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; Constituent
properties This property is a shorthand for the following CSS
properties: -webkit-stroke-color -webkit-stroke-width Syntax Values <length> The width of the stroke. <color> The color of the stroke. ...
...rit; -webkit-text-stroke: initial; -webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; Constituent
properties This property is a shorthand for the following CSS
properties: -webkit-stroke-color -webkit-stroke-width Syntax Values <length> The width of the stroke. <color> The color of the stroke. ...
...And 2 more matches
Handling content breaks in multicol - CSS: Cascading Style Sheets
In this guide we see how Fragmentation works in multicol. Fragmentation basics The CSS Fragmentation specification details how content breaks between the fragmentation containers, or fragmentainers. In multicol, the fragmentainer is the column box. A column box can contain other markup and there are many places where a break would not be ideal. ...
...ragmentation containers, or fragmentainers. In multicol, the fragmentainer is the column box. A column box can contain other markup and there are many places where a break would not be ideal. For example, we would generally prefer that the figcaption of an image not be separated into a new column away from the image it refers to and ending a column with a heading looks strange. The fragmentation
properties give us ways to exercise some control over this. There are various places we might want to control our breaks: Breaks inside boxes, for example inside a figure element. Breaks before and after boxes, which would include our heading example above. Breaks between lines. Breaks inside boxes To control breaks inside boxes use the break-inside property. This property takes values of: auto ...
... Breaks between lines. Breaks inside boxes To control breaks inside boxes use the break-inside property. This property takes values of: auto avoid avoid-page avoid-column avoid-region In the example below, we have applied break-inside to the figure element to prevent the caption from becoming separated from the image. Breaks before and after boxes The break-before and break-after
properties are used to control breaks before and after elements. They take the following values when in a multicol context: auto avoid avoid-column column In this next example, we are forcing a column break before an h2 element. Breaks between lines The orphans and widows
properties are also useful. The orphans property controls the number of lines left on their own at the end of a fragment. The...
...And 2 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
In this guide we will be exploring the three
properties that are applied to flex items, which enable us to control the size and flexibility of the items along the main axis -- flex-grow, flex-shrink, and flex-basis. Fully understanding how these
properties work with growing and shrinking items is the real key to mastering flexbox. A first look Our three
properties control the following aspects of a flex item's flexibility: flex-grow: How much of the positive free space does this item get? flex-shrink: How much negative free space can be removed from this item? flex-basis: What is the size of the item before growing and shrinking happens? The
properties are usually expressed as the shorthand flex property. The following code would set the flex-grow property to 2, flex-shrink to 1 and flex-b...
...his item? flex-basis: What is the size of the item before growing and shrinking happens? The
properties are usually expressed as the shorthand flex property. The following code would set the flex-grow property to 2, flex-shrink to 1 and flex-basis to auto. .item { flex: 2 1 auto; } If you have read the article Basic Concepts of Flexbox, then you will have already had an introduction to the
properties. Here we will explore them in depth in order that you can fully understand what the browser is doing when you use them. Important concepts when working on the main axis There are a few concepts worth digging into before looking at how the flex
properties work to control ratios along the main axis. These relate to the natural size of flex items before any growing or shrinking takes place, and to...
...hat container was too narrow. If your browser does not yet support these keywords both paragraphs will be rendered as normal paragraphs in block flow; the below screenshots show the expected rendering. Remember this behaviour and what effects min-content and max-content have as we explore flex-grow and flex-shrink later in this article. Positive and negative free space To talk about these
properties we need to understand the concept of positive and negative free space. When a flex container has positive free space, it has more space than is required to display the flex items inside the container. For example, if I have a 500 pixel-wide container, flex-direction is row, and I have three flex items each 100 pixels wide, then I have 200 pixels of positive free space, which could be distributed ...
...And 2 more matches
CSS Fonts - CSS: Cascading Style Sheets
CSS Fonts is a module of CSS that defines font-related
properties and how font resources are loaded. It lets you define the style of a font, such as its family, size and weight, line height, and the glyph variants to use when multiple are available for a single character. Basic example The following example shows a simple use of basic font
properties to style a paragraph of text. p { width: 600px; margin: 0 auto; font-family: "Helvetica Neue", "Arial", sans-serif; font-style: italic; font-weight: 100; font-variant-ligatures: normal; font-size: 2rem; letter-spacing: 1px; } <p>Three hundred years ago<br> I thought I might get some sleep<br> I stretched myself out onna antique bed<br> An' my spirit did a midnite creep</p> The result is as follows: Variable fonts examples ...
...cing: 1px; } <p>Three hundred years ago<br> I thought I might get some sleep<br> I stretched myself out onna antique bed<br> An' my spirit did a midnite creep</p> The result is as follows: Variable fonts examples You can find a number of variable fonts examples at v-fonts.com and axis-praxis.org; see also our Variable fonts guide for more information and usage information. ...
...to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. These are all referred to as OpenType Features, and are made available to use on the web via specific
properties and a low-level control property -- font-feature-settings. This article provides you with all you need to know about using OpenType font features in CSS. Variable fonts guide Variable fonts are an evolution of the OpenType font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight...
...And 2 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
ual behavior based on their differences (features and constraints). While the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the CSS Grid Layout method has been widely adopted. This guide presents demonstrations of how box alignment in grid layout works. You will see many similarities in how these
properties and values work in flexbox. Due to grid being two-dimensional and flexbox one-dimensional there are some small differences that you should watch out for. So we will start by looking at the two axes that we deal with when aligning things in a grid. The two axes of a grid layout When working with grid layout you have two axes available to align things against - the block axis and the inline axis.
...two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. The inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. We are able to align the content inside grid areas, and the grid tracks themselves on these two axes. Aligning items on the Block Axis The align-self and align-items
properties control alignment on the block axis. When we use these
properties, we are changing the alignment of the item within the grid area you have placed it. In the following example, I have four grid areas within my grid. I can use the align-items property on the grid container, to align the items using one of the following values: auto normal start end center stretch baseline first baseline ...
...: end; } .item4 { grid-area: d; justify-self: center; } <div class="wrapper"> <div class="item1">Item 1</div> <div class="item2">Item 2</div> <div class="item3">Item 3</div> <div class="item4">Item 4</div> </div> As with align-self and align-items, you can apply justify-items to the grid container, to set the justify-self value for all items. The justify-self and justify-items
properties are not implemented in flexbox. This is due to the one-dimensional nature of flexbox, and that there may be multiple items along the axis, making it impossible to justify a single item. To align items along the main, inline axis in flexbox you use the justify-content property. Shorthand
properties The place-items property is shorthand for align-items and justify-items. The place-self propert...
...And 2 more matches
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
Firefox initially implemented an early version of the Scroll Snap Specification, called Scroll Snap Points. In Firefox 68 the new version of the specification will be shipped and these old
properties removed. In this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your web site or app. What should I do if I used the old Firefox implementation? If you have only used the old Firefox implementation of the specification, with the
properties that are detailed in Scroll Snap Points, you should update your code to use the new specification. This will ensure your scroll snapping works in all browsers which implement the specification, including Firefox. If you do not do this your scroll snapping will...
...
properties that are detailed in Scroll Snap Points, you should update your code to use the new specification. This will ensure your scroll snapping works in all browsers which implement the specification, including Firefox. If you do not do this your scroll snapping will no longer work in Firefox 68 and up. ...
...sers of old Firefox (or -webkit prefixed Safari), then you can continue to use the old specification as outlined in the example below. In this initial example we have used the old specification alongside the current specification in order to make scroll snapping work in all browsers which support some form of scroll snapping. The example adds the scroll-snap-points-y and scroll-snap-destination
properties, which are deprecated, to make scroll snapping work in Firefox. We also added the scroll-snap-type property twice, once with the y axis value needed for browsers that support the new spec, and once for Firefox pre-68, which supports the property but without the y value. Do I need to use both specs? Scroll snapping is one of those nice parts of CSS in which the fallback is that you don't get t...
...And 2 more matches
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. These extensions are prefixed with -moz-. Mozilla-only
properties and pseudo-classes (avoid using on websites) Note: These
properties and pseudo-classes will only work in Mozilla applications such as Firefox, and are not on a standards track. Some of them apply only to XUL elements. ...
...lasses will only work in Mozilla applications such as Firefox, and are not on a standards track. Some of them apply only to XUL elements. ...
...Once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. A -moz-animation [Prefixed version still accepted] -moz-animation-delay [Prefixed vers...
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
Applications based on WebKit or Blink, such as Safari and Chrome, support a number of special WebKit extensions to CSS. These extensions are generally prefixed with -webkit-. Most -webkit- prefixed
properties also work with an -apple- prefix. A few are prefixed with -epub-. WebKit-only
properties Note: Avoid using on websites. These
properties will only work in WebKit applications. A -webkit-animation-trigger -webkit-app-region -webkit-appearance* -webkit-aspect-ratio B -webkit-backdrop-filter -webkit-background-composite -webkit-border-after** -webkit-border-after-color** -webkit-border-after-style** -webkit-border-after-width** -webkit-border-before** -webkit-border-before-color** -webkit-border-before-style** -webkit-border-before-width** -webkit-border-end** -webkit-...
...e-color -webkit-text-stroke-width -webkit-text-stroke -webkit-text-zoom -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z U -webkit-user-drag -webkit-user-modify * A few are on the standards, unprefixed track ** New syntax has been standardized. Property links to the new synax. Old prefixed syntax is still supported in some browsers. WebKit-prefixed
properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y Formerly proprietary
properties that are now standard Note: To maximize the compatibility of your CSS, you should use the unprefixed standard
properties instead of the prefixed ones listed below. A ...
...Many of these are supported with no prefix as well: see Formerly propri...
...And 2 more matches
border-block - CSS: Cascading Style Sheets
shed blue; border-block can be used to set the values for one or more of border-block-width, border-block-style, and border-block-color setting both the start and end in the block dimension at once. The physical borders to which it maps depends on the element's writing mode, directionality, and text orientation. ...
...h it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top and border-bottom or border-right, and border-left
properties depending on the values defined for writing-mode, direction, and text-orientation. The borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end. Constituent
properties This property is a shorthand for the following CSS
properties: border-block-color border-block-style border-block-width Syntax Values The border-block is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See c...
...operties: border-block-color border-block-style border-block-width Syntax Values The border-block is specified with one or more of the following, in any order: <'border-width'> The width of the border. See border-width. <'border-style'> The line style of the border. See border-style. <'color'> The color of the border. See color. ...
...And 2 more matches
border-bottom - CSS: Cascading Style Sheets
ottom shorthand CSS property sets an element's bottom border. It sets the values of border-bottom-width, border-bottom-style and border-bottom-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand
properties, border-bottom always sets the values of all of the
properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-bottom-style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-style: dotted; border-bottom: none thick green; ... and the value of border-bottom-style given b...
...efault values. This means that ... border-bottom-style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-style: dotted; border-bottom: none thick green; ... and the value of border-bottom-style given before border-bottom is ignored. Since the default value of border-bottom-style is none, not specifying the border-style part results in no border. Constituent
properties This property is a shorthand for the following CSS
properties: border-bottom-color border-bottom-style border-bottom-width Syntax border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; The three values of the shorthand property can be specified in any order, and one or two of them may be omitted. Values <br-width> See border-bottom-width. <br-style> Se...
...e border-bottom-width Syntax border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; The three values of the shorthand property can be specified in any order, and one or two of them may be omitted. Values <br-width> See border-bottom-width. <br-style> See border-bottom-style. <color> See border-bottom-color. ...
...And 2 more matches
border-left - CSS: Cascading Style Sheets
The border-left shorthand CSS property set an element's left border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand
properties, border-left always sets the values of all of the
properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-left-style: dotted; border-left: thick green; ... is actually the same as ... border-left-style: dotted; border-left: none thick green; ... and the value of border-left-style given before border-left is ignored. Since the default value of border-left-style is none, not spec...
...ied to their default values. This means that ... border-left-style: dotted; border-left: thick green; ... is actually the same as ... border-left-style: dotted; border-left: none thick green; ... and the value of border-left-style given before border-left is ignored. Since the default value of border-left-style is none, not specifying the border-style part results in no border. Constituent
properties This property is a shorthand for the following CSS
properties: border-left-color border-left-style border-left-width Syntax border-left: 1px; border-left: 2px dotted; border-left: medium dashed green; The three values of the shorthand property can be specified in any order, and one or two of them may be omitted. Values <br-width> See border-left-width. <br-style> See border-left...
...der-left-style border-left-width Syntax border-left: 1px; border-left: 2px dotted; border-left: medium dashed green; The three values of the shorthand property can be specified in any order, and one or two of them may be omitted. Values <br-width> See border-left-width. <br-style> See border-left-style. <color> See border-left-color. ...
...And 2 more matches
border-width - CSS: Cascading Style Sheets
The border-width shorthand CSS property sets the width of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-width shorthand CSS property sets the width of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... thick A thick border Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern thin <= medium <= thick, and the values are constant within a single document. ...
...And 2 more matches
columns - CSS: Cascading Style Sheets
The columns CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e number of columns to use when drawing an element's contents, as well as those columns' widths. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: column-count column-width Syntax /* Column width */ columns: 18em; /* Column count */ columns: auto; columns: 2; /* Both column width and count */ columns: 2 auto; columns: auto 12em; columns: auto auto; /* Global values */ columns: inherit; columns: initial; columns: unset; The columns property may be specified as one or two of the values listed below, in any order. Values <'colu...
...th may be wider or narrower to fit the available space. See column-width. <'column-count'> The ideal number of columns into which the element's content should be flowed, defined as an <integer> or the keyword auto. If neither this value nor the column's width are auto, it merely indicates the maximum allowable number of columns. See column-count. ...
...And 2 more matches
font-variant - CSS: Cascading Style Sheets
font variants for a font. You can also set the CSS Level 2 (Revision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...evision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... none Sets the value of the font-variant-ligatures to none and the values of the other longhand property as normal, their initial value. ...
...And 2 more matches
list-style - CSS: Cascading Style Sheets
The list-style CSS shorthand property allows you set all the list style
properties at once. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This property is applied to list items, i.e., elements with display: list-item; . By default this includes <li> elements. Because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
...amples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This property is applied to list items, i.e., elements with display: list-item; . By default this includes <li> elements. Because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
...-examples and send us a pull request. Note: This property is applied to list items, i.e., elements with display: list-item; . By default this includes <li> elements. Because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
...And 2 more matches
mask-border - CSS: Cascading Style Sheets
The mask-border CSS shorthand property lets you create a mask along the edge of an element's border. Constituent
properties This property is a shorthand for the following CSS
properties: mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width Syntax /* source | slice */ mask-border: url('border-mask.png') 25; /* source | slice | repeat */ mask-border: url('border-mask.png') 25 space; /* source | slice | width */ mask-border: url('border-mask.png') 25 / 35px; /* source | slice | width | outset | repeat | mode */ mask-border: url('border-mask.png') 25 / 35px / 12px space alpha; Values <'mask-border-source'> The source image. See mask-border-source. <'mask-border-slice'> The dimensions for slicing the source image ...
... be specified. See mask-border-outset. <'mask-border-repeat'> Defines how the edge regions of the source image are adjusted to fit the dimensions of the border mask. Up to two values may be specified. See mask-border-repeat. <'mask-border-mode'> Defines whether the source image is treated as a luminance mask or alpha mask. See mask-border-mode. ...
...ha mask. See mask-border-mode. ...
...And 2 more matches
offset - CSS: Cascading Style Sheets
The offset CSS shorthand property sets all the
properties required for animating an element along a defined path. Note: Early versions of the spec called this property motion. ...
... The offset CSS shorthand property sets all the
properties required for animating an element along a defined path. Note: Early versions of the spec called this property motion. ...
... The offset CSS shorthand property sets all the
properties required for animating an element along a defined path. Note: Early versions of the spec called this property motion. ...
...And 2 more matches
place-items - CSS: Cascading Style Sheets
The CSS place-items shorthand property allows you to align items along both the block and inline directions at once (i.e. the align-items and justify-items
properties) in a relevant layout system such as Grid or Flexbox. If the second value is not set, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...n-items and justify-items
properties) in a relevant layout system such as Grid or Flexbox. If the second value is not set, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...em such as Grid or Flexbox. If the second value is not set, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 2 more matches
place-self - CSS: Cascading Style Sheets
The place-self CSS shorthand property allows you to align an individual item in both the block and inline directions at once (i.e. the align-self and justify-self
properties) in a relevant layout system such as Grid or Flexbox. If the second value is not present, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...self and justify-self
properties) in a relevant layout system such as Grid or Flexbox. If the second value is not present, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...uch as Grid or Flexbox. If the second value is not present, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 2 more matches
Adding captions and subtitles to HTML5 video - Developer guides
ge they want the subtitles displayed in, or to turn them off entirely. We have added the button, but before we make it do anything, we need to build the menu that goes with it. 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. ...
...; padding:2px 5px; border-radius:2px; } Styling the displayed subtitles One of the less well known about and supported features of WebVTT is the ability to style the individual subtitles (something called text cues) via CSS Extensions. The ::cue pseudo-element is the key to targetting individual text track cues for styling, as it matches any defined cue. ...
... features of WebVTT is the ability to style the individual subtitles (something called text cues) via CSS Extensions. The ::cue pseudo-element is the key to targetting individual text track cues for styling, as it matches any defined cue. ...
...And 2 more matches
Microdata - HTML: Hypertext Markup Language
t and process microdata from a web page and use it to provide a richer browsing experience for users. Search engines benefit greatly from direct access to this structured data because it allows search engines to understand the information on web pages and provide more relevant results to users. Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its
properties. Microdata is an attempt to provide a simpler way of annotating HTML elements with machine-readable tags than the similar approaches of using RDFa and classic microformats. At a high level, microdata consists of a group of name-value pairs. The groups are called items, and each name-value pair is a property. Items and
properties are represented by regular elements. To create an item, the item...
...scope attribute is used. To add a property to an item, the itemprop attribute is used on one of the item's descendants. Vocabularies Google and other major search engines support the Schema.org vocabulary for structured data. This vocabulary defines a standard set of type names and property names, for example, Schema.org Music Event indicates a concert performance, with startDate and location
properties to specify the concert's key details. In this case, Schema.org Music Event would be the URL used by itemtype and startDate and location would be itemprop's that Schema.org Music Event defines. Note: More about itemtype attributes can be found at http://schema.org/Thing Microdata vocabularies provide the semantics or meaning of an Item. Web developers can design a custom vocabulary or use voca...
...d encyclopedic articles. This extension was made to solve transliteration problems between the Cyrillic and Latin alphabets. Due to the implementation of additional marking parameters of Schema's vocabulary, the indexation of information in Russian-language web-pages became considerably more successful. Global attributes itemid - The unique, global identifier of an item. itemprop - Used to add
properties to an item. Every HTML element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref -
Properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. Itemref provides a list of element ids (not itemids) with additional
properties elsewhere in the document. itemscope - Itemscope (us...
...And 2 more matches
Numbers and dates - JavaScript
tter "X" (0x or 0X). If the digits after 0x are outside the range (0123456789ABCDEF), the following SyntaxError is thrown: "Identifier starts immediately after numeric literal". ...
...Identifier starts immediately after numeric literal". 0xFFFFFFFFFFFFFFFFF // 295147905179352830000 0x123456789ABCDEF // 81985529216486900 0XA // 10 Exponentiation 1E3 // 1000 2e6 // 2000000 0.1e2 // 10 Number object The built-in Number object has
properties for numerical constants, such as maximum value, not-a-number, and infinity. You cannot change the values of these
properties and you use them as follows: var biggestNum = Number.MAX_VALUE; var smallestNum = Number.MIN_VALUE; var infiniteNum = Number.POSITIVE_INFINITY; var negInfiniteNum = Number.NEGATIVE_INFINITY; var notANum = Number.NaN; You always refer to a property of the predefined Number object as shown above, and not as a property of a Number object you create yourself. The following table summarizes the Nu...
...hem as follows: var biggestNum = Number.MAX_VALUE; var smallestNum = Number.MIN_VALUE; var infiniteNum = Number.POSITIVE_INFINITY; var negInfiniteNum = Number.NEGATIVE_INFINITY; var notANum = Number.NaN; You always refer to a property of the predefined Number object as shown above, and not as a property of a Number object you create yourself. The following table summarizes the Number object's
properties.
Properties of Number Property Description Number.MAX_VALUE The largest representable number (+-1.7976931348623157e+308) Number.MIN_VALUE The smallest representable number (+-5e-324) Number.NaN Special "not a number" value Number.NEGATIVE_INFINITY Special negative infinite value; returned on overflow Number.POSITIVE_INFINI...
...And 2 more matches
Classes - JavaScript
s the global object. In strict mode, autobinding will not happen; the value of this remains as passed. ...
...In strict mode, autobinding will not happen; the value of this remains as passed. ...
...Support in browsers is limited, but the feature can be used through a build step with system...
...And 2 more matches
Object.getOwnPropertyDescriptors() - JavaScript
The Object.getOwnPropertyDescriptors() method returns all own property descriptors of a given object. Syntax Object.getOwnPropertyDescriptors(obj) Parameters obj The object for which to get all own property descriptors. Return value An object containing all own property descriptors of an object. Might be an empty object, if there are no
properties. Description This method permits examination of the precise description of all own
properties of an object. A property in JavaScript consists of either a string-valued name or a Symbol and a property descriptor. Further information about property descriptor types and their attributes can be found in Object.defineProperty(). A property descriptor is a record with some of the following attributes: value The value associated with the prope...
...s no getter (accessor descriptors only). set A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. ...
...escriptors only). configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. enumerable true if and only if this property shows up during enumeration of the
properties on the corresponding object. ...
...And 2 more matches
Object.prototype.hasOwnProperty() - JavaScript
One'); // returns true o.propTwo = undefined; o.hasOwnProperty('propTwo'); // returns true Examples Using hasOwnProperty to test for a property's existence The following example determines whether the o object contains a property named prop: o = new Object(); o.hasOwnProperty('prop'); // returns false o.prop = 'exists'; o.hasOwnProperty('prop'); // returns true Direct vs. ...
...('propTwo'); // returns true Examples Using hasOwnProperty to test for a property's existence The following example determines whether the o object contains a property named prop: o = new Object(); o.hasOwnProperty('prop'); // returns false o.prop = 'exists'; o.hasOwnProperty('prop'); // returns true Direct vs. ...
...// returns true Examples Using hasOwnProperty to test for a property's existence The following example determines whether the o object contains a property named prop: o = new Object(); o.hasOwnProperty('prop'); // returns false o.prop = 'exists'; o.hasOwnProperty('prop'); // returns true Direct vs. ...
...And 2 more matches
eval() - JavaScript
. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax eval(string) Parameters string A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and
properties of existing objects. Return value The completion value of evaluating the given code. If the completion value is empty, undefined is returned. Description eval() is a function property of the global object. The argument of the eval() function is a string. If the string represents an expression, eval() evaluates the expression. If the argument represents one or more JavaScript statements, eva...
...iciently because the function arguments names can be minified too as seen in the minified code below. console.log(Function('"use strict";return(function(a){return a(5)})')()(function(a){ return"Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" ")[a%7||0]})); There are also additional safer (and faster!) alternatives to eval() or Function() for common use-cases. Accessing member
properties You should not use eval() to convert property names into
properties. Consider the following example where the property of the object to be accessed is not known until the code is executed. This can be done with eval(): var obj = { a: 20, b: 30 }; var propName = getPropName(); // returns "a" or "b" eval( 'var result = obj.' + propName ); However, eval() is not necessary here. In fact, its us...
...a" or "b" eval( 'var result = obj.' + propName ); However, eval() is not necessary here. In fact, its use here is discouraged. Instead, use the property accessors, which are much faster and safer: var obj = { a: 20, b: 30 }; var propName = getPropName(); // returns "a" or "b" var result = obj[ propName ]; // obj[ "a" ] is the same as obj.a You can even use this method to access descendant
properties. ...
...And 2 more matches
for...of - JavaScript
d in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for (variable of iterable) { statement } variable On each iteration a value of a different property is assigned to variable. variable may be declared with const, let, or var. iterable Object whose iterable
properties are iterated. Examples Iterating over an Array const iterable = [10, 20, 30]; for (const value of iterable) { console.log(value); } // 10 // 20 // 30 You can use let instead of const too, if you reassign the variable inside the block. const iterable = [10, 20, 30]; for (let value of iterable) { value += 1; console.log(value); } // 11 // 21 // 31 Iterating over a String const ite...
...this.i++, done: false }; } return { value: undefined, done: true }; } }; } }; for (const value of iterable) { console.log(value); } // 0 // 1 // 2 Difference between for...of and for...in Both for...in and for...of statements iterate over something. The main difference between them is in what they iterate over. The for...in statement iterates over the enumerable
properties of an object, in an arbitrary order. The for...of statement iterates over values that the iterable object defines to be iterated over. The following example shows the difference between a for...of loop and a for...in loop when used with an Array. Object.prototype.objCustom = function() {}; Array.prototype.arrCustom = function() {}; const iterable = [3, 5, 7]; iterable.foo = 'hello'; for (con...
..., "foo" } } for (const i of iterable) { console.log(i); // logs 3, 5, 7 } Let us look into the above code step by step. Object.prototype.objCustom = function() {}; Array.prototype.arrCustom = function() {}; const iterable = [3, 5, 7]; iterable.foo = 'hello'; Every object will inherit the objCustom property and every object that is an Array will inherit the arrCustom property since these
properties have been added to Object.prototype and Array.prototype, respectively. The object iterable inherits the
properties objCustom and arrCustom because of inheritance and the prototype chain. for (const i in iterable) { console.log(i); // logs 0, 1, 2, "foo", "arrCustom", "objCustom" } This loop logs only enumerable
properties of the iterable object, in arbitrary order. It doesn't log array elemen...
...And 2 more matches
Animation performance and frame rate - Web Performance
Animation on the web can be done via SVG, JavaScript, including <canvas> and WebGL, CSS animation, <video>, animated gifs and even animated PNGs and other image types. The performance cost of animating a CSS property can vary from one property to another, and animating expensive CSS
properties can result in jank as the browser struggles to hit a smooth frame rate. For animated media, such as video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue. Code based animations, be it CSS, SVG, <canvas>, webGL or other JavaScript animations, can cause performance issues even if the bandwidth footprint is small. These animations can consume CPU and/or cause jank. While performance is sensitive to...
...r, the performance cost of modifying a CSS property can vary from one property to another. It's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. For a rate of 60 frames per second, the browser has 16.7 milliseconds to execute scripts, recalculate styles and layout if needed, and repaint the area being updated. Slow scripts and animating expensive CSS
properties can result in jank as the browser struggles to hit a smooth frame rate. The rendering waterfall The process a browser uses to paint changes to a page when an element is animating CSS
properties can be described as a waterfall consisting of the following steps: Recalculate Style: when a property for an element changes, the browser must recalculate computed styles. Layout: next, the browser...
... changing. Rather, the page is being repainted, repeatedly, based on JavaScript canvas API functions. When a canvas is animating a drawing, the canvas animation can be described as a waterfall consisting of the following steps: These sequenced need to fit into a single frame, since the screen isn't updated until it is complete. CSS property cost In the context of the rendering waterfall, some
properties are more expensive than others: Property type Cost Examples
Properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size
Properties that don't affect geometry or position, but are not rendered in their own layer, do n...
...And 2 more matches
patternUnits - SVG: Scalable Vector Graphics
The patternUnits attribute indicates which coordinate system to use for the geometry
properties of the <pattern> element. ...
... The patternUnits attribute indicates which coordinate system to use for the geometry
properties of the <pattern> element. ...
... Only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- All geometry
properties are relative to the current user space --> <pattern id="p1" x="12.5" y="12.5" width="25" height="25" patternUnits="userSpaceOnUse"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- All geometry
properties are relative to the target bounding box --> <pattern id="p2" x=".125" y=".125" width=".25" height=".25" patternUnits="objectBoundingBox"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- Left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> <!-- Right square with bounding box tiles --> <rect x="110" y="10" widt...
...And 2 more matches
Content type - SVG: Scalable Vector Graphics
ber of data types. This article lists these types along with their syntax and descriptions of what they're used for. Angle <angle> Angles are specified in one of two ways. When used in the value of a property in a stylesheet, an <angle> is defined as follows: angle ::= number (~"deg" | ~"grad" | ~"rad")? where deg indicates degrees, grad indicates grads and rad indicates radians. For
properties defined in CSS2, an angle unit identifier must be provided. For angle values in SVG-specific
properties and their corresponding presentation attributes, the angle unit identifier is optional. If not provided, the angle value is assumed to be in degrees. In presentation attributes for all
properties, whether defined in SVG1.1 or in CSS2, the angle identifier, if specified, must be in lower case. ...
...gth in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for <length>. Within the SVG DOM, a <coordinate> is represented as an SVGLength or an SVGAnimatedLength. Frequency <frequency> Frequency values are used with aural
properties. As defined in CSS2, a frequency value is a <number> immediately followed by a frequency unit identifier. The frequency unit identifiers are: Hz: Hertz kHz: kilo Hertz Frequency values may not be negative. FuncIRI <FuncIRI> Functional notation for a reference. The syntax for this reference is the same as the css uri. ICCColor <icccolor> An <icccolor> is an ICC color spe...
... 1.1 (2nd Edition): IRI references. Length <length> A length is a distance measurement, given as a number along with a unit. Lengths are specified in one of two ways. When used in a stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")? See the CSS2 specification for the meanings of the unit identifiers. ...
...And 2 more matches
panel - Archive of obsolete content
ton. If this is supplied the panel will be shown attached to the button. See the section on attaching panels to buttons. a widget object. If this is supplied the panel will be shown attached to the widget. an object which specifies where in the window the panel should be shown. The rest of this section describes this object. The position object has one or more of the following
properties: top, right, bottom and left. Their values are expressed in pixels. Any other
properties will be ignored. The default alignment along each axis is centered: so to display a panel centred along the vertical or horizontal axis, just omit that axis: // Show the panel centered horizontally and // aligned to the bottom of the content area require("sdk/panel").Panel({ position: { bottom...
...d // aligned to the bottom of the content area require("sdk/panel").Panel({ position: { bottom: 0 } }).show(); // Show the panel centered vertically and // aligned to the left of the content area require("sdk/panel").Panel({ position: { left: 0 } }).show(); // Centered panel, default behavior require("sdk/panel").Panel({}).show(); As with the CSS top, bottom, left, and right
properties, setting both top and bottom or both left and right will implicitly set the panel's height or width relative to the content window: // Show the panel centered horizontally, with: // - the top edge 40px from the top // of the content window // - the bottom edge 100px from the bottom // of the content window require("sdk/panel").Panel({ position: { top: 40, bottom: 100 } }).show()...
...izontally, with: // - the top edge 40px from the top // of the content window // - the bottom edge 100px from the bottom // of the content window require("sdk/panel").Panel({ position: { top: 40, bottom: 100 } }).show(); If you set both top and bottom, but also set the panel's height explicitly using the height property, then the panel will ignore bottom, just as CSS does for its
properties with the same name: // Show the panel centered horizontally, with: // - the top edge 40px from the top // of the content window // - a height of 400px require("sdk/panel").Panel({ position: { top: 40, bottom: 100, }, height: 400 }).show(); // This is equivalent to: require("panel").Panel({ position { top: 40 }, height: 400 }).show(); The same principle is appl...
... Registers an event listener with the panel. Parameters type : string The type of event to listen for. listener : function The listener function that handles the event. removeListener(type, listener) Unregisters an event listener from the panel. Parameters type : string The type of event for which listener was registered. listener : function The listener function that was registered.
Properties port EventEmitter object that allows you to: send events to the content script using the port.emit function receive events from the content script using the port.on function See the guide to communicating using port for details. isShowing Tells if the panel is currently shown or not. This property is read-only. height The height of the panel in pixels. width The width of the panel ...
request - Archive of obsolete content
nt in regards to the Twitter API calls and need to be updated Make simple network requests. For more advanced usage, check out the net/xhr module, based on the browser's XMLHttpRequest object. Globals Constructors Request(options) This constructor creates a request object that can be used to make network requests. The constructor takes a single parameter options which is used to set several
properties on the resulting Request. Parameters options : object Optional options: Name Type url string,url This is the url to which the request will be made. Can either be a String or an instance of the SDK's URL. onComplete function This function will be called when the request has received a response (or in terms of XHR, when readyState...
...ete" event. Registered event listeners are passed a Response object. Each Request object is designed to be used once. Attempts to reuse them will throw an error. Since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to. With the exception of response, all of a Request object's
properties correspond with the options in the constructor. Each can be set by simply performing an assignment. However, keep in mind that the same validation rules that apply to options in the constructor will apply during assignment. Thus, each can throw if given an invalid value. The example below shows how to use Request to get the most recent tweet from the @mozhacks account: var Request = require("sd...
...ter.com/1.1/application/rate_limit_status.json", onComplete: function (response) { if (response.json.remaining_hits) { latestTweetRequest.get(); } else { console.log("You have been rate limited!"); } } }).get(); Methods get() Make a GET request. head() Make a HEAD request. post() Make a POST request. put() Make a PUT request. delete() Make a DELETE request.
Properties url headers content contentType response Events complete The Request object emits this event when the request has completed and a response has been received. Arguments Response : Listener functions are passed the response to the request as a Response object. Response The Response object contains the response to a network request issued using a Request object. It is returned by the get...
...st has completed and a response has been received. Arguments Response : Listener functions are passed the response to the request as a Response object. Response The Response object contains the response to a network request issued using a Request object. It is returned by the get(), head(), post(), put() or delete() method of a Request object. All members of a Response object are read-only.
Properties url The URL of the response content. text The content of the response as plain text. json The content of the response as a JavaScript object. The value will be null if the document cannot be processed by JSON.parse. status The HTTP response status code (e.g. 200). statusText The HTTP response status line (e.g. OK). headers The HTTP response headers represented as key/value pairs. To ...
preferences/service - Archive of obsolete content
Example: var name = "extensions.checkCompatibility.nightly"; require("sdk/preferences/service").reset(name); getLocalized(name, defaultValue) Gets the localized value for an application preference name. Parameters name : string defaultValue : string Preference value. Returns string : Localized preference value, returns a default value if no preference is set. ...
...ility.nightly"; require("sdk/preferences/service").reset(name); getLocalized(name, defaultValue) Gets the localized value for an application preference name. Parameters name : string defaultValue : string Preference value. Returns string : Localized preference value, returns a default value if no preference is set. Some preferences refer to a
properties file. So that prefs.get returns the
properties file URL whereas prefs.getLocalized returns the value defined in the
properties file. Example: var prefs = require("sdk/preferences/service"); var name = "general.useragent.locale"; prefs.get(name); // is equal to "chrome://global/locale/intl.
properties" prefs.getLocalized(name) // is equal to "en-US" setLocalized(name, value) Sets the localized application preference name to value. Paramete...
...ile. Example: var prefs = require("sdk/preferences/service"); var name = "general.useragent.locale"; prefs.get(name); // is equal to "chrome://global/locale/intl.
properties" prefs.getLocalized(name) // is equal to "en-US" setLocalized(name, value) Sets the localized application preference name to value. Parameters name : string Preference name. ...
.../intl.
properties" prefs.getLocalized(name) // is equal to "en-US" setLocalized(name, value) Sets the localized application preference name to value. Parameters name : string Preference name. ...
Miscellaneous - Archive of obsolete content
Disabling JavaScript programmatically // Disable JS in the currently active tab from the context of browser.xul gBrowser.docShell.allowJavascript = false; If this isn't your browser, you should save the value and restore it when finished. If you wish to block selected scripts based on their URI, implement nsIContentPolicy. ...
...ell.allowJavascript = false; If this isn't your browser, you should save the value and restore it when finished. If you wish to block selected scripts based on their URI, implement nsIContentPolicy. Using string bundles from JavaScript Assuming the extension has myext.
properties with name/value pairs such as: invalid.url=The speficied URL, %S, is invalid. That was attempt number %S. ...
...operties with name/value pairs such as: invalid.url=The speficied URL, %S, is invalid. That was attempt number %S. ...
...turn this._bundle.GetStringFromName(msg); } }; alert(common.getLocalizedMessage("invalid.url")) Another similar alternative (using both GetStringFromName and formatStringFromName), is: var fcBundle = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService) .createBundle("chrome://myext/locale/myext.
properties"); function getStr(msg, args){ //get localised message if (args){ args = Array.prototype.slice.call(arguments, 1); return fcBundle.formatStringFromName(msg,args,args.length); } else { return fcBundle.GetStringFromName(msg); } } /* Usage */ alert(getStr("invalid.url", "http://bad/url/", "3")); //for message with parameters alert(getStr("invalid.url")); //for message without par...
Jetpack Processes - Archive of obsolete content
e given message name. createHandle() Similar to nsIJetpack.createHandle(), this function creates a new handle and returns it. createSandbox() This creates a new JavaScript sandbox and returns its global scope. This global scope does not contain privileged APIs, or any non-standard JavaScript objects for that matter, though new globals can be endowed by simply attaching them to the global scope as
properties. evalInSandbox(aSandbox, aScript) Evaluates the given script contents in the given sandbox's global scope. At minimum, JavaScript 1.8.1 is used. Individual lines of the form //@line 1 "foo.js" can be used to specify filename and line number information for debugging purposes. gc() Synchronously performs garbage collection. Handles Messages that communicate between the browser and jetpack process...
...d to specify filename and line number information for debugging purposes. gc() Synchronously performs garbage collection. Handles Messages that communicate between the browser and jetpack process may contain only serializable (JSON) data and handles. A handle can be used to provide context for messages. Either the browser or the jetpack implementation may create one. A handle keeps any arbitrary
properties attached to it alive, but those
properties are not transmitted across the process boundary. These arbitrary
properties are the primary means through which context can be provided for messages; for instance, if the handle is meant to represent a network request, an XMLHttpRequest instance can be attached to the handle on the chrome process. Because a handle's existence crosses process boundaries a...
...nreachable in both processes and a memory leak is created. To prevent such memory leaks, a process can either invalidate a handle, immediately preventing it from being passed as a message argument, or it can unroot the handle, allowing it to be passed as a message argument until all references to it are removed, at which point it is garbage collected. Handles have the following native methods and
properties: invalidate() Invalidates the handle. Either process may invalidate a handle when it is no longer useful. createHandle() Creates a child handle which becomes invalid when its parent does. This is useful for associating handles to the lifetime of a particular window, context menu, or other element, and helping ensure that they do not leak. parent The parent handle of the object, if any. Read-only...
...ges core:process-error(context) When the jetpack process crashes, this message is sent to the parent. If a crash report minidump is available, the context.dumpID property will list the minidump ID of the crash report that was collected. core:exception(error) When an exception occurs in a Jetpack script and is not caught, this message is sent to the parent. The error object contains the following
properties: fileName, lineNumber, and message. History See bug 556846 and bug 578821 for details. Sample Code For example code, check out the unit tests. See also nsIJetpackService nsIJetpack ...
findbar - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] In Gecko 1.9, the findbar widget moved into toolkit, so it's available to any XUL application, as well as extensions. For example, the standard findbar in Firefox 3.5 looks like this on the Mac: You may attach a findbar to a particular browser element by either setting the findbar's browserid attribute to the ID of the browser element before the findbar element is bound, or by setting the findbar's browser property to the browser element itself. ...
...e this on the Mac: You may attach a findbar to a particular browser element by either setting the findbar's browserid attribute to the ID of the browser element before the findbar element is bound, or by setting the findbar's browser property to the browser element itself. Attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey
Properties browser, findMode Methods close, onFindAgainCommand, open, startFind, toggleHighlight Example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="FindToolbar" browserid="content"/> Attributes browserid Type: string The ID of the browser element to which the findbar is attached. This attribute is only used when the findbar is con...
... Type: string The access key for the "Find Next" toolbar button in the findbar. findpreviousaccesskey Type: string The access key for the "Find Previous" toolbar button in the findbar. highlightaccesskey Type: string The access key for the "Highlight" toolbar button in the findbar. matchcaseaccesskey Type: string The access key for the "Match case" checkbox in the findbar. ...
...ess key for the "Find Next" toolbar button in the findbar. findpreviousaccesskey Type: string The access key for the "Find Previous" toolbar button in the findbar. highlightaccesskey Type: string The access key for the "Highlight" toolbar button in the findbar. matchcaseaccesskey Type: string The access key for the "Match case" checkbox in the findbar. ...
Manipulating Lists - Archive of obsolete content
ULSelectControlElement interface so any XUL elements which implement this interface have these methods. This includes the menulist, radiogroup and tabs elements. For example, to add a new item to a menulist, you can use the same syntax as for a listbox. The right kind of element will be appended in each situation. ...
...ontrolElement interface provides two additonal
properties, selectedIndex and selectedItem. The former returns the index of the selected item while the latter returns the selected element. For instance the selectedItem of a menulist will be the menuitem that is selected. If no item is selected, selectedIndex will return -1, while selectedItem will return null. Getting the selected item These two
properties are commonly inspected during a select event, as in the following example: Example 2 : Source View <listbox id="thelist" onselect="alert(this.selectedItem.label);"> <listitem label="Short"/> <listitem label="Medium"/> <listitem label="Tall"/> </listbox> The select event is fired for a listbox when an item in the list is selected. The select handler here displays an alert containing the ...
...ore convenient to use functions of the tabbox element instead. It also has a selectedIndex function which will return the index of the selected tab. However, to get the selected item, use the tabbox's selectedTab property instead. Or, use the selectedPanel property to get the selected panel, that is, return the content associated with the tab. Changing the selection All of the selection related
properties described above may also be assigned a new value to change the selection. In the next example, the selectedIndex property of a radiogroup element is changed based on the value entered in a textbox. This code isn't foolproof though; for example it doesn't check if the value entered is out of range. You will want to make sure that you add this kind of error checking. Example 3 : Source View <scri...
...diogroup> Listboxes also support multiple selection and the functions of the nsIDOMXULMultiSelectControlElement interface. This interface provides a number of functions specifically for handling multiple selection. For example the selectedItems property holds a list of the items that are selected, while the selectedCount property holds the number of items selected. Typically, you will use these
properties to iterate over the list and perform some operation for each item. Be careful when iterating over the selected items; if you modify the items in the list while iterating, the list will change and the selection
properties may return different values. This is one reason why it is useful to manipulate the list by the item rather than by index. Deleting selected items The following example shows a ...
Tree View Details - Archive of obsolete content
e which containers are open and which are closed. Note that the tree will call neither isContainerEmpty nor isContainerOpen for rows that are not containers as indicated by the return value of the isContainer method. A container may be rendered differently than a non-container. For instance, a container may have a folder icon beside it. A style sheet may be used to style items based on various
properties such as whether a row is open. This is described in a later section. A non-empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. Empty containers will not have a twisty, but will still be treated like a container. When the user clicks the twisty to open a row, the tree will call the view's toggleOpenState method. The view shoul...
... << PreviousNext >> ...
... << PreviousNext >> ...
... << PreviousNext >> ...
arrowscrollbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A box which provides scroll arrows along its edges for scrolling through the contents of the box. The user only needs to hover the mouse over the arrows to scroll the box. This element is typically used for large popup menus. Hovering the mouse over one of the (active) arrows triggers a scroll event. More information is available in the XUL Tutorial. ...
...croll arrows along its edges for scrolling through the contents of the box. The user only needs to hover the mouse over the arrows to scroll the box. This element is typically used for large popup menus. Hovering the mouse over one of the (active) arrows triggers a scroll event. More information is available in the XUL Tutorial. ...
...lean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. Currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. ...
... enables smooth scrolling for the corresponding arrowscrollbox, false disables it. Currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. ...
browser - Archive of obsolete content
It is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page. Are you here looking for information about the Firefox web browser, or because you'd like to download the latest version of Firefox? Get Firefox Most of the
properties and methods of the browser will rarely be used and can only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document. ...
... A XUL <browser> element represents a frame which is expected to contain a view of a Web document. It is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page. Are you here looking for information about the Firefox web browser, or because you'd like to download the latest version of Firefox? Get Firefox Most of the
properties and methods of the browser will rarely be used and can only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document. Attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedLinkHandler, homepage, showcaret, src, type
Properties accessibleType, canGoBack, ...
...allowed to access the chrome above it. This is the preferred value for any browser element in an application, which will use multiple browsers of equal privileges, and is unselected at the moment. chrome (default behaviour): A browser, intended to be used for loading privileged content using a chrome:// URI. Don't use for content from web, as this may cause serious security problems!
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. canGoBack Type: boolean This read-only property is true if there is a page to go back to in the session history and the Back button should be enabled. canGoForward Type: boolean This read-only property is true if there is a page to go forward ...
...od. docShell Type: nsIDocShell This read-only property contains the nsIDocShell object for the document. documentCharsetInfo Obsolete since Gecko 12.0 Type: nsIDocumentCharsetInfo This read-only property contains the nsIDocumentCharsetInfo object for the document which is used to handle which character set should be used to display the document. The
properties of the nsIDocumentCharsetInfo object were merged into the docshell in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9). homePage Type: string home page URL This property holds the value of the user's home page setting. markupDocumentViewer Type: nsIMarkupDocumentViewer This read-only property contains the nsIMarkupDocumentViewer which is...
button - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A button that can be pressed by the user. Event handlers can be used to trap mouse, keyboard and other events. It is typically rendered as a grey outset rectangle. You can specify the label of the button using the label attribute or by placing content inside the button. More information is available in the XUL tutorial. ...
...se, keyboard and other events. It is typically rendered as a grey outset rectangle. You can specify the label of the button using the label attribute or by placing content inside the button. More information is available in the XUL tutorial. Attributes accesskey, autocheck, checkState, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type
Properties accessKey, accessibleType, autoCheck, checkState, checked, command, crop, dir, disabled, dlgType, group, image, label, open, orient, tabIndex, type Examples <button label="Press Me" oncommand="alert('You pressed me!');"/> Attributes accesskey Type: character This should be set to a character that is used as a shortcut key. This should be one of the characters that appea...
... are unchecked. icon Mozilla 1.8 Type: string This attribute should be used to set the usage for common buttons. Some platforms display these buttons with a small icon indicating their usage. This should be used in place of the image attribute. Possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back,
properties, select-font, select-color, network. If you are using a button that matches one of these common usages, use the icon attribute to indicate this. See the appearance of the different icons on some available platforms. image Type: URI The URI of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the dir ...
...n the main part of the button is pressed. panel Similar to the menu type, this opens a popup. Place a panel element inside the button. panel elements are popups that support any type of content. radio The button acts like a radio button. Only one button in the group can be on a once. repeat This button will fire its command event repeatedly while the mouse button is held down.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. autoCheck Type: boolean Gets and sets the value of the autoCheck attribute. checkState Type: integer, values 0, 1, or 2 Gets and sets the valu...
datepicker - Archive of obsolete content
Three types are available, which can be specified using the type attribute. normal - a datepicker with three fields for entering the year, month and date. grid - a datepicker with a calendar grid for selecting a date. popup - a normal datepicker with three fields, but with an additional dropdown button to display a popup grid. There are several ways to set the selected day. In XUL, the value attribute may be set to a value of the form YYYY-MM-DD to initialize the datepicker to a certain date. If not specified, the datepicker defaults to the current day. ...
...e value attribute may be set to a value of the form YYYY-MM-DD to initialize the datepicker to a certain date. If not specified, the datepicker defaults to the current day. To change the selected date, the value property may be used to set a new value in the form YYYY-MM-DD. The dateValue property may be used to retrieve and set the date using a Date object. In addition, the date, month and year
properties may be used to retrieve and modify each component of the date separately. !!Attention: there is also a datepicker in TB-calendar with differing definitions for members (value is a Date there) The change event is fired whenever the date is changed. However, as described in Mozilla bug #799219, a change event handler may encounter erratic behavior when the date is changed using the keyboard inste...
...id this, you can use the workaround described here, i.e., use window.setTimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. A monthchange event is fired for the grid and popup datepickers whenever a new month is navigated to or displayed. Attributes disabled, firstdayofweek, readonly, type, tabindex, value
Properties date, dateLeadingZero, dateValue, disabled, month, monthLeadingZero, open, readOnly, tabIndex, value, year, yearLeadingZero Examples <datepicker type="grid" value="2007-03-26"/> Attributes disabled Type: boolean Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the elem...
...ed. grid A datepicker that displays a calendar grid where one month is shown at a time. popup A datepicker with three entry fields but an additional dropdown button, which, when pressed, will display a popup calendar grid. value Type: string The initial value of the datepicker in the form YYYY-MM-DD.
Properties date Type: integer The currently selected date of the month from 1 to 31. Set this property to change the selected date. dateLeadingZero Type: boolean A read only value indicating whether a leading zero should be displayed before the date when it is less than 10. dateValue Type: Date The date that is currently entered or sel...
deck - Archive of obsolete content
The first item is at index 0. ...
...The first item is at index 0. ...
...You may select an item by assigning its index to this property. By assigning -1 to this property, all items will be deselected. Returns -1 if no items are selected Do not hide panels; the deck element only understands visible panels. selectedPanel Type: element Holds a ...
...x to this property. By assigning -1 to this property, all items will be deselected. Returns -1 if no items are selected Do not hide panels; the deck element only understands visible panels. selectedPanel Type: element Holds a reference to the currently selected panel within a deck element. Assigning a value to this property will modify the selected panel. ...
image - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Summary An element that displays an image, much like the HTML img element. The src attribute can be used to specify the URL of the image. More information is available in the XUL tutorial. Note: Prior to Gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. The new behavior aligns more with the HTML <img> element and shrinks both the width and height down proportionally. ...
...ify the URL of the image. More information is available in the XUL tutorial. Note: Prior to Gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. The new behavior aligns more with the HTML <img> element and shrinks both the width and height down proportionally. Attributes onerror, onload, src, validate
Properties accessibleType, src Style classes alert-icon, error-icon, message-icon, question-icon Examples <image src='Firefoxlogo.png' width='135' height='130'/> Attributes onerror Type: script code This event is sent to an image element when an error occurs loading the image. image.onload Type: script code This event handler will be called on the image element when the image ...
...cates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling: always The image is always checked to see whether it should be reloaded. never The image will be loaded from the cache if possible. ...
...e entirely for default handling: always The image is always checked to see whether it should be reloaded. never The image will be loaded from the cache if possible.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. src Type: URL Gets and sets the value of the src attribute. ...
listcell - Archive of obsolete content
An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed. ...
...An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed. ...
... by the dir and orient attributes. label Type: string The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. type Type: string This attribute is reserved for use by anonymous children of listitem; do not use. ...
...out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. type Type: string This attribute is reserved for use by anonymous children of listitem; do not use.
Properties disabled Type: boolean Gets and sets the value of the disabled attribute. ...
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. Both the container and child attributes may use variables. More information is available in the XUL tutorial. ...
... << 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. Both the container and child attributes may use variables. More information is available in the XUL tutorial. ...
... container Type: ? A variable reference to a node that is expected to be a container. If the variable is the same as the uri attribute on the content element, the resource must be a container element in order to match. Inherite...
... child Type: ? A variable reference to a node that is expected to be a child of the element that is referred to by the container element. container Type: ? A variable reference to a node that is expected to be a container. If the variable is the same as the uri attribute on the content element, the resource must be a container element in order to match. ...
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. To look native (at least on Windows), the menubar element needs to be placed inside a toolbox element. More information is available in the XUL tutorial. ...
...elated ] 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. To look native (at least on Windows), the menubar element needs to be placed inside a toolbox element. More information is available in the XUL tutorial. ...
... </menu> </menubar> Attributes grippyhidden SeaMonkey only Type: boolean When set to true, the grippy will be hidden. When set to false, the default, the grippy will be shown. statusbar Type: id If you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them. ...
...he id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. statusbar Type: id of statusbar element Gets and sets the value of the statusbar attribute. ...
menuitem - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A single choice in a menupopup element. It acts much like a button but it is rendered on a menu. More information is available in the XUL tutorial. ...
...amples | Attributes |
Properties | Methods | Related ] A single choice in a menupopup element. It acts much like a button but it is rendered on a menu. More information is available in the XUL tutorial. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. accessKey Type: character Gets and sets the value of the accesskey attribute. command Type: element id Gets and sets the value of the command attribute. control Type: menu element Returns the enclosing menu that the item is inside, if any, o...
... menuitem and menuseparator elements in Firefox 3. tabIndex Type: integer Gets and sets the value of the tabindex attribute. value Type: string Gets and sets the value of the value attribute. For textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the Textbox.value and Menulist.value syntax. ...
menupopup - Archive of obsolete content
When a menupopup is open, it floats above the window and may extend outside the window border. There are several ways in which a menupopup may be used: It may be placed inside a menu, menulist, toolbarbutton, or a button with the type attribute set to "menu" to create a popup that will open when the menu or button is pressed. It may be attached to any element using the popup attribute. When the element is clicked with the left mouse button, the menupopup will be displayed. It may be attached to any element using the context attribute. ...
...tached to any element using the context attribute. When a context menu is opened, the menupopup will be displayed. A context menu may be opened by right-clicking the element, or by pressing the menu key on the keyboard. More information is available in the XUL tutorial and Popup Guide. Attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top
Properties accessibleType, anchorNode, popupBoxObject, position, state, triggerNode Methods hidePopup, moveTo, openPopup, openPopupAtScreen, setConsumeRollupEvent, showPopup, sizeTo Examples The following example shows how a menupopup may be attached to a menulist. <menulist> <menupopup> <menuitem label="Mozilla" value="http://mozilla.org"/> <menuitem label="Slashdot" value="http://slash...
...gle word string are shortcuts for the values above. Valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. For more details, including examples, please see popup positioning top Type: integer Overrides the vertical position of the popup specified by the showPopup method.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. anchorNode Type: nsIDOMElement This read-only property holds the DOM node that was specified as the anchor when opening the popup. popupBoxObject Type: nsIPopupBoxObject This read-only property holds the nsIPopupBoxObject that implements the popup...
...esponds to the popupanchor attribute on the element. The align argument corresponds to the popupalign attribute on the element. The anchor and align arguments are ignored if either x or y are not -1. To have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxObject.screenX and boxObject.screenY
properties of the element, and use those as the x and y arguments offset by the desired values. The popupType should be one of the strings popup, context, or tooltip. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. sizeTo( width, height ) Return type: no return value Changes the current size of the popup to the ne...
progressmeter - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A meter which can be used to display the progress of a lengthy operation. It is drawn as a bar that is filled as the operation completes. In addition, an indeterminate progressmeter may be created by setting the mode attribute to undetermined. This is used when the length of time to complete an operation is not known beforehand. More information is available in the XUL tutorial. ...
...e used to display the progress of a lengthy operation. It is drawn as a bar that is filled as the operation completes. In addition, an indeterminate progressmeter may be created by setting the mode attribute to undetermined. This is used when the length of time to complete an operation is not known beforehand. More information is available in the XUL tutorial. ...
... max Type: integer Gets and sets the value of the max attribute. mode Type: string Gets and sets the value of the mode attribute. value Type: string Gets and sets the value of the value attribute. For textbox and user editable menul...
... Type: integer Gets and sets the value of the max attribute. mode Type: string Gets and sets the value of the mode attribute. value Type: string Gets and sets the value of the value attribute. For textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the Textbox.value and Menulist.value syntax. ...
<statusbarpanel> - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox 4 note The status bar has been removed. Refer to the add-on bar. An individual element of a statusbar. This is a special type of button which is drawn differently. Unlike normal buttons, a statusbarpanel can only have a label or an image but not both. This element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
.... Refer to the add-on bar. An individual element of a statusbar. This is a special type of button which is drawn differently. Unlike normal buttons, a statusbarpanel can only have a label or an image but not both. This element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
...the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes. label Type: string The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. ...
...lement. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem.
Properties image Type: image URL Gets and sets the value of the image attribute. label Type: string Gets and sets the value of the label attribute. ...
timepicker - Archive of obsolete content
It contains three fields to enter the hour, minute and second. Arrow buttons next to the fields allow the values to be adjusted with the mouse. A fourth textbox appears for 12 hour clocks which allows selection of AM or PM. To specify the initial, use the value attribute set to a value of either the form HH:MM:SS or HH:MM. The value may be retrieved and changed using the value property or the dateValue property. The former specifies the time as a string of the form HH:MM:SS whereas the latter specifies the time as a Date object. ...
...our clocks which allows selection of AM or PM. To specify the initial, use the value attribute set to a value of either the form HH:MM:SS or HH:MM. The value may be retrieved and changed using the value property or the dateValue property. The former specifies the time as a string of the form HH:MM:SS whereas the latter specifies the time as a Date object. In addition, the hour, minute and second
properties may be used to retrieve and modify each component of the time separately. The change event is fired whenever the time is changed. However, as described in Mozilla bug #799219, a change event handler may encounter erratic behavior when the time is changed using the keyboard instead of the mouse. To avoid this, you can use the workaround described here, i.e., use window.setTimeout(actual-event-han...
...ndler may encounter erratic behavior when the time is changed using the keyboard instead of the mouse. To avoid this, you can use the workaround described here, i.e., use window.setTimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. Attributes disabled, hideseconds, increment, readonly, tabindex, value
Properties amIndicator, dateValue, disabled, hideSeconds, hour, hourLeadingZero, increment, is24HourClock, isPM, minute, minuteLeadingZero, pmIndicator, readOnly, second, secondLeadingZero, tabIndex, value Examples <timepicker value="12:05"/> Attributes disabled Type: boolean Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled...
...uld be used in combination with setting hideseconds to true. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. value Type: string The initial value of the timepicker in either the form HH:MM:SS or HH:MM.
Properties amIndicator Type: string The string value displayed for hours between midnight and noon, defaulting to AM. This value is determined from the user's locale. dateValue Type: Date The date that is currently entered or selected in the datepicker as a Date object. disabled Type: boolean Gets and sets the value of the disabled att...
tooltip - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used for the tooltip popups. For text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. More information is available in the XUL tutorial. ...
...tes |
Properties | Methods | Related ] This element is used for the tooltip popups. For text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. More information is available in the XUL tutorial. ...
...the second word) can be one of topleft, topright, bottomleft or bottomright. Positions specified as a single word string are shortcuts for the values above. Valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. For more details, including examples, please see popup positioning
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. label Type: string Gets and sets the value of the label attribute. popupBoxObject Type: nsIPopupBoxObject This read-only property holds the nsIPopupBoxObject that implements the popup. You wouldn't normally need to use this proper...
...esponds to the popupanchor attribute on the element. The align argument corresponds to the popupalign attribute on the element. The anchor and align arguments are ignored if either x or y are not -1. To have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxObject.screenX and boxObject.screenY
properties of the element, and use those as the x and y arguments offset by the desired values. The popupType should be one of the strings popup, context, or tooltip. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. sizeTo( width, height ) Return type: no return value Changes the current size of the popup to the new...
treecell - Archive of obsolete content
This element should be placed inside a treerow. You can set the text for the cell using the label attribute. More information is available in the XUL tutorial. Attributes editable, label, mode,
properties, ref, src, value Attributes editable Type: boolean Allows the contents of individual cells in the column to be changed, especially useful when <treecol type="checkbox">. Also useful for disabling editing of individual treecells. When the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell. ...
...ion of the menuitem. mode Type: one of the values below For columns that are progress meters, this determines the type of progress meter to use. none No progress meter is displayed. The cell text is displayed instead. normal The cell uses its value attribute to determine the amount of the bar that is filled in. undetermined The progressmeter is indeterminate.
properties Type: space-separated list of property names Sets the
properties of the element, which can be used to style the element. For more information, see Styling a Tree. ref Type: URI For template-generated elements, this attribute is used to specify the root RDF node where content generation begins. This will correspond to the value of an about attribute on an RDF container. This attribute s...
...n 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. ...
...ializable 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. ...
wizardpage - Archive of obsolete content
label Type: string The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. ...
... label Type: string The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. ...
...create wizards that do not have a linear sequence. If one of the pages has a next attribute, all of the pages should have one, except that last page. pageid Type: id This attribute should be set to a string that identifies the page's identifer in the wizard. This is used with the next attribute. The wizard always starts with the wizardpage that appears first in the wizard child list.
Properties next Type: string wizardpage id Set to the pageid of the next page after this one. When set, the page with this pageID is displayed when the Next button is pressed. This can be used to create wizards that do not have a linear sequence. If one of the pages has a next attribute, all of the pages should have one, except that last page. pageid Type: string wizardpage id This attribute s...
... sequence. If one of the pages has a next attribute, all of the pages should have one, except that last page. pageid Type: string wizardpage id This attribute should be set to a string that identifies the page's identifer in the wizard. This is used with the next attribute. The wizard always starts with the wizardpage that appears first in the wizard child list. ...
XULRunner tips - Archive of obsolete content
nsions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pref("extensions.dss.switchPending", false); pref("extensions.ignoreMTimeChanges", false); pref("extensions.logging.enabled", false); pref("general.skins.selectedSkin", "classic/1.0"); // NB these point at AMO pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.
properties"); pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.
properties"); pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.
properties"); If your application is based on Gecko 2.0, you need to register a component through the new component registration because the extension manager uses FUEL, namely Application.restart(), to restart...
...ou open the JS Shell and other tools provided by the extension. Branding Branding is a chrome package containing product-specific information (e.g. the product name, vendor, and logo). Some XULRunner components (in particular, the Extension Manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/locale/brand.
properties. ...
...rome package containing product-specific information (e.g. the product name, vendor, and logo). Some XULRunner components (in particular, the Extension Manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/locale/brand.
properties. In order to satisfy these dependencies, you can save Firefox's brand.dtd/brand.
properties to chrome/locale/branding folder, modify them appropriately, and register a locale provider for branding by adding the following line to your chrome manifest: locale branding en-US chrome/locale/branding/ The location you put the branding files in doesn't matter, as long as you register it appropriately in the manifest. In addition, a branding content package must be registered to include the ...
...Without these settings Password Manager will not store login details. pref("signon.rememberSignons", true); pref("signon.expireMasterPassword", false); pref("signon.SignonFileName", "signons.txt"); Y...
Browser Detection and Cross Browser Support - Archive of obsolete content
any web authors continued to use the vendor/version approach to distinguishing web browsers in their client side scripts. Since the user agent string was exposed as a property of the navigator object (e.g. navigator.userAgent), many web authors used the same logic in their client side scripts as they had used earlier in their server side browser detection. In addition to navigator.userAgent other
properties such as appName and appVersion were available in the navigator object which could be used in browser vendor/version detection strategies. The classic example of this vendor/version client side detection strategy can be found in the Ultimate Browser Sniffer. This script and variants of it can be found today on many web sites where it is a common source of detection problems. Netscape Navigator 4...
...increased since the introduction of Netscape 6 in November 2000. The best approach to take advantage of these IE compatibility features in Gecko is to use object based feature detection. This will automatically use any such features in Gecko if they are available in the version of Gecko being used. See the DOM Client Object Cross-Reference for more details on which Internet Explorer's objects and
properties are supported by which version of Gecko. A number of Internet Explorer features are not supported by Gecko. These include the window.event object, behaviors, filters, transitions, and ActiveX. How (and when) to use the navigator object when detecting Gecko Unless you specifically need to detect if Gecko is being used, do not use these methods. These methods should only be used in circumstances...
...navigator object when detecting Gecko Unless you specifically need to detect if Gecko is being used, do not use these methods. These methods should only be used in circumstances which can not be handled by using object feature detection such as when specific versions of Gecko must be excluded for security reasons. Note: For client side detection, we recommend using the navigator object and it's
properties. All of the information reported in the navigator is also available in the user agent string which can be used in server side situations. Product navigator.product is specific to Gecko browsers and will always return 'Gecko'. The is a quick and simple means of determining that a browser is based upon Gecko. CVS Branch Tag Beginning in Gecko 0.9.0 (Netscape 6.1 in Gecko 0.9.2), navigator.userA...
... elm.style.left = x; elm.style.top = y; } else { // Gecko/Internet Explorer 4+ // W3C DOM Style states that elm.style.left is a string // containing the length followed by the unit. e.g. 10px // Gecko will allow you to omit the unit only in Quirks // mode. // Gecko REQUIRES the unit when operating in Standards ...
New in JavaScript 1.8.5 - Archive of obsolete content
The following is a changelog for JavaScript 1.8.5. This version was included in Firefox 4. New features in JavaScript 1.8.5 New functions Function Description Object.create() Creates a new object with the specified prototype object and
properties. bug 492840 Object.defineProperty() Adds the named property described by a given descriptor to an object. Object.define
Properties() Adds the named
properties described by the given descriptors to an object. Object.getOwnPropertyDescriptor() Returns a property descriptor for a named pr...
...bug 518663 Object.preventExtensions() Prevents any extensions of an object. ...
... Object.getOwnPropertyDescriptor() Returns a property descriptor for a named property on an object. bug 505587 Object.keys() Returns an array of all enumerable
properties on an object. bug 307791 Object.getOwnPropertyNames() Returns an array of all enumerable and non-enumerable
properties on an object. bug 518663 Object.preventExtensions() Prevents any extensions of an object. bug 492849 Object.isExtensible() Determines if extending of an object is allowed. bug 492849 Object.seal() Prevents other code from deleting
properties of an object. bug 492845 ...
...bug 492844 Object.isFrozen() Determines if an object was frozen. bug 492844 Array.isArray() Checks if a variable is an array. ...
What is CSS? - Learn web development
ing to style. In this case we are styling level one headings (<h1>). We then have a set of curly braces { }. Inside those will be one or more declarations, which take the form of property and value pairs. Each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. Before the colon, we have the property, and after the colon, the value. CSS
properties have different allowable values, depending on which property is being specified. In our example, we have the color property, which can take various color values. We also have the font-size property. This property can take various size units as a value. A CSS stylesheet will contain many such rules, written one after the other. h1 { color: red; font-size: 5em; } p { color: black; } ...
.... We also have the font-size property. This property can take various size units as a value. A CSS stylesheet will contain many such rules, written one after the other. h1 { color: red; font-size: 5em; } p { color: black; } You will find that you quickly learn some values, whereas others you will need to look up. The individual property pages on MDN give you a quick way to look up
properties and their values when you forget, or want to know what else you can use as a value. Note: You can find links to all the CSS property pages (along with other CSS features) listed on the MDN CSS reference. Alternatively, you should get used to searching for "mdn css-feature-name" in your favourite search engine whenever you need to find out more information about a CSS feature. For example, try s...
...! CSS Modules As there are so many things that you could style using CSS, the language is broken down into modules. You'll see reference to these modules as you explore MDN and many of the documentation pages are organized around a particular module. For example, you could take a look at the MDN reference to the Backgrounds and Borders module to find out what its purpose is, and what different
properties and other features it contains. You will also find links to the CSS Specification that defines the technology (see below). At this stage you don't need to worry too much about how CSS is structured, however it can make it easier to find information if, for example, you are aware that a certain property is likely to be found among other similar things and are therefore probably in the same specif...
...t how CSS is structured, however it can make it easier to find information if, for example, you are aware that a certain property is likely to be found among other similar things and are therefore probably in the same specification. For a specific example, let's go back to the Backgrounds and Borders module -- you might think that it makes logical sense for the background-color and border-color
properties to be defined in this module. And you'd be right. CSS Specifications All web standards technologies (HTML, CSS, JavaScript, etc.) are defined in giant documents called specifications (or simply "specs"), which are published by standards organizations (such as the W3C, WHATWG, ECMA, or Khronos) and define precisely how those technologies are supposed to behave. CSS is no different -- it is deve...
CSS FAQ - Learn web development
other rules */ .stockSymbol { font-weight: normal; } <!-- most text is in bold, except "GE", which is red and not bold --> <div id="stockTicker"> NYS: <span class="stockSymbol">GE</span> +1.0 ... </div> To avoid this kind of error, try to define rules only once for a certain selector, and group all rules belonging to that selector. Use of a shorthand property Using shorthand
properties for defining style rules is good because it uses a very compact syntax. Using shorthand with only some attributes is possible and correct, but it must be remembered that undeclared attributes are automatically reset to their default values. This means that a previous rule for a single attribute could be implicitly overridden. #stockTicker { font-size: 12px; font-family: Verdana; font-weight: bol...
...div { color: black; } #orange { color: orange; } .green { color: green; } <div id="orange" class="green" style="color: red;">This is red</div> The rules are more complicated when the selector has multiple parts. More detailed information about how selector specificity is calculated can be found in the CSS 2.1 Specification chapter 6.4.3. ...
...#orange { color: orange; } .green { color: green; } <div id="orange" class="green" style="color: red;">This is red</div> The rules are more complicated when the selector has multiple parts. More detailed information about how selector specificity is calculated can be found in the CSS 2.1 Specification chapter 6.4.3. What do the -moz-*, -ms-*, -webkit-*, -o-* and -khtml-*
properties do? These
properties, called prefixed
properties, are extensions to the CSS standard. They allow use of experimental and non-standard features in browsers without polluting the regular namespace, preventing future incompatibilities to arise when the standard is extended. The use of such
properties on production websites is not recommended -- they have already created a huge web compatibility mess. For example, many ...
...se prefixes in your work, you are advised to write your code in a way that uses the prefixed versions first, but then includes a non-prefixed standard version afterwards so it can automatically override the prefixed versions where supported. For example: -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); Note: For more information on dealing with prefixed
properties, see Handling common HTML and CSS problems -- Handling CSS prefixes from our Cross-browser testing module. Note: See the Mozilla CSS Extensions page for more information on the Mozilla-prefixed CSS
properties. How does z-index relate to positioning? The z-index property specifies the stack order of elements. An element with a higher z-index/stack order is always rendered in front of an ele...
Client-side form validation - Learn web development
ing forms using JavaScript You must use JavaScript if you want to take control over the look and feel of native error messages or to deal with legacy browsers that do not support HTML's built-in form validation. In this section we will look at the different ways to do this. ...
... validationMessage: Returns a localized message describing the validation constraints that the control doesn't satisfy (if any). If the control is not a candidate for constraint validation (willValidate is false) or the element's value satisfies its constraints (is valid), this will return an empty string. validity: Returns a ValidityState object that contains ...
...le on the above elements. validationMessage: Returns a localized message describing the validation constraints that the control doesn't satisfy (if any). If the control is not a candidate for constraint validation (willValidate is false) or the element's value satisfies its constraints (is valid), this will return an empty string. validity: Returns a ValidityState object that contains several
properties describing the validity state of the element. You can find full details of all the available
properties in the ValidityState reference page; below is listed a few of the more common ones: patternMismatch: Returns true if the value does not match the specified pattern, and false if it does match. If true, the element matches the :invalid CSS pseudo-class. tooLong: Returns true if the valu...
...ata. If it has then we remove any error message being shown. If the data is not valid, we run showError() to show the appropriate error. Every time we try to submit the form, we again check to see if the data is valid. If so, we let the form submit. If not, we run showError() to show the appropriate error, and stop the form submitting with preventDefault(). The showError() function uses various
properties of the input's validity object to determine what the error is, and then displays an error message as appropriate. Here is the live result: Note: You can find this example live on GitHub as detailed-custom-validation.html (see also the source code.) The constraint validation API gives you a powerful tool to handle form validation, letting you have enormous control over the user interface a...
Introduction to web APIs - Learn web development
tion on a lot more 3rd party APIs at the Programmable Web API directory. How do APIs work? Different JavaScript APIs work in slightly different ways, but generally, they have common features and similar themes to how they work. They are based on objects Your code interacts with APIs using one or more JavaScript objects, which serve as containers for the data the API uses (contained in object
properties), and the functionality the API makes available (contained in object methods). Note: If you are not already familiar with how objects work, you should go back and work through our JavaScript objects module before continuing. Let's return to the example of the Web Audio API -- this is a fairly complex API, which consists of a number of objects. The most obvious ones are: AudioContext, which...
... how objects work, you should go back and work through our JavaScript objects module before continuing. Let's return to the example of the Web Audio API -- this is a fairly complex API, which consists of a number of objects. The most obvious ones are: AudioContext, which represents an audio graph that can be used to manipulate audio playing inside the browser, and has a number of methods and
properties available to manipulate that audio. MediaElementAudioSourceNode, which represents an <audio> element containing sound you want to play and manipulate inside the audio context. AudioDestinationNode, which represents the destination of the audio, i.e. the device on your computer that will actually output it -- usually your speakers or headphones. So how do these objects interact? If you look at...
...ings, although in this case, it's a graphical context rather than an audio context. Its context object is created by getting a reference to the <canvas> element you want to draw on, and then calling its HTMLCanvasElement.getContext() method: const canvas = document.querySelector('canvas'); const ctx = canvas.getContext('2d'); Anything that we want to do to the canvas is then achieved by calling
properties and methods of the context object (which is an instance of CanvasRenderingContext2D), for example: Ball.prototype.draw = function() { ctx.beginPath(); ctx.fillStyle = this.color; ctx.arc(this.x, this.y, this.size, 0, 2 * Math.PI); ctx.fill(); }; Note: You can see this code in action in our bouncing balls demo (see it running live also). They use events to handle changes in state We ...
... We already discussed events earlier on in the course in our Introduction to events article, which looks in detail at what client-side web events are and how they are used in your code. If you are not already familiar with how client-side web API events work, you should go and read this article first before continuing. Some web APIs contain no events, but most contain at least a few. The handler
properties that allow us to run functions when events fire are generally listed in our reference material in separate "Event handlers" sections. We already saw a number of event handlers in use in our Web Audio API example above. To provide another example, instances of the XMLHttpRequest object (each one represents an HTTP request to the server to retrieve a new resource of some kind) has a number of eve...
Object building practice - Learn web development
the <canvas> element, then calls the getContext() method on it to give us a context on which we can start to draw. The resulting constant (ctx) is the object that directly represents the drawing area of the canvas and allows us to draw 2D shapes on it. Next, we set constants called width and height, and the width and height of the canvas element (represented by the canvas.width and canvas.height
properties) to equal the width and height of the browser viewport (the area that the webpage appears on -- this can be gotten from the Window.innerWidth and Window.innerHeight
properties). Note that we are chaining multiple assignments together, to get the variables all set quicker -- this is perfectly OK. The last bit of the initial script looks as follows: function random(min, max) { const num = Math...
...und the screen. Since these balls will all behave in the same way, it makes sense to represent them with an object. Let's start by adding the following constructor to the bottom of our code. function Ball(x, y, velX, velY, color, size) { this.x = x; this.y = y; this.velX = velX; this.velY = velY; this.color = color; this.size = size; } Here we include some parameters that define the
properties each ball needs in order to function in our program: x and y coordinates -- the horizontal and vertical coordinates where the ball starts on the screen. This can range between 0 (top left hand corner) to the width and height of the browser viewport (bottom right hand corner). horizontal and vertical velocity (velX and velY) -- each ball is given a horizontal and vertical velocity; in real ter...
...t (bottom right hand corner). horizontal and vertical velocity (velX and velY) -- each ball is given a horizontal and vertical velocity; in real terms these values are regularly added to the x/y coordinate values when we animate the balls, to move them by this much on each frame. color -- each ball gets a color. size -- each ball gets a size -- this is its radius, in pixels. This handles the
properties, but what about the methods? We want to get our balls to actually do something in our program. Drawing the ball First add the following draw() method to the Ball()'s prototype: Ball.prototype.draw = function() { ctx.beginPath(); ctx.fillStyle = this.color; ctx.arc(this.x, this.y, this.size, 0, 2 * Math.PI); ctx.fill(); } Using this function, we can tell the ball to draw itself onto th...
...our pen to draw something on it: First, we use beginPath() to state that we want to draw a shape on the paper. Next, we use fillStyle to define what color we want the shape to be -- we set it to our ball's color property. Next, we use the arc() method to trace an arc shape on the paper. Its parameters are: The x and y position of the arc's center -- we are specifying the ball's x and y
properties. The radius of the arc -- in this case, the ball's size property. The last two parameters specify the start and end number of degrees around the circle that the arc is drawn between. Here we specify 0 degrees, and 2 * PI, which is the equivalent of 360 degrees in radians (annoyingly, you have to specify this in radians). That gives us a complete circle. If you had specified only 1 * PI, you...
TypeScript support in Svelte - Learn web development
ollowing: import type { TodoType } from '../types/todo.type' export let todo: TodoType The first warning we get is TypeScript telling us to define the type of the update() function's updatedTodo variable. This can be a little tricky because updatedTodo contains only the attributes of the todo that have been updated. That means it's not a complete todo -- it only has a subset of a todo's
properties. For these kinds of cases, TypeScript provides several utility types to make it easier to apply these common transformations. What we need right now is the Partial<T> utility, which allows us to represent all subsets of a given type. The partial utility returns a new type based on the type T, where every property of T is optional. We'll use it in the update() function -- update yours like s...
..., where every property of T is optional. We'll use it in the update() function -- update yours like so: function update(updatedTodo: Partial<TodoType>) { todo = { ...todo, ...updatedTodo } // applies modifications to todo dispatch('update', todo) // emit update event } With this we are telling TypeScript that the updatedTodo variable will hold a subset of the TodoType
properties. Now svelte-check tells us that we have to define the type of our action function parameters: ./07-next-steps/src/components/Todo.svelte:45:24 Warn: Parameter 'node' implicitly has an 'any' type, but a better type may be inferred from usage. (ts) const focusOnInit = (node) => node && typeof node.focus === 'function' && node.focus() ./07-next-steps/src/components/Todo.svelte:47:28 Warn...
...: export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue } The | operator lets us declare variables that could store values of two or more types. A JsonValue could be a string, a number, a boolean, and so on. In this case we are also making use of recursive types, to specify that a JsonValue can have an array of JsonValue, and also an object with
properties of type JsonValue. We will import our JsonValue type and use it accordingly. Update your localStore.ts file like this: // localStore.ts import { writable } from 'svelte/store' import type { JsonValue } from './types/json.type' export const localStore = (key: string, initial: JsonValue) => { // receives the key of the local storage and an initial value const toString = (valu...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Handling common HTML and CSS problems - Learn web development
YPE, and you are using tags for their correct purpose. A good strategy is to validate your code regularly. One service that can do this is the W3C Markup Validation Service, which allows you to point to your code, and returns a list of errors: CSS has a similar story -- you need to check that your property names are spelled correctly, property values are spelled correctly and are valid for the
properties they are used on, you are not missing any curly braces, and so on. The W3C has a CSS Validator available too, for this purpose. Linters Another good option to choose is a so-called Linter application, which not only points out errors, but can also flag up warnings about bad practices in your CSS, and other points besides. Linters can generally be customized to be stricter or more relaxed in the...
...be used in production websites -- they are subject to change or removal without warning, and cause cross browser issues. This is particularly a problem when developers decide to only use say, the -webkit- version of a property -- meaning that the site won't work in other browsers. This actually happens so much that other browsers have started to implement -webkit- prefixed versions of various CSS
properties, so they will work with such code. Usage of prefixes by browser vendors has declined recently precisely because of these types of problems, but there are still some that need attention. If you insist on using prefixed features, make sure you use the right ones. You can look up what browsers require prefixes on MDN reference pages, and sites like caniuse.com. If you are unsure, you can also find ...
...This is useful for finding out what versions of the property are implemented in that browser. At the time of writing, both Firefox and Chrome implemented -webkit- prefixed and non-prefixed versions of transform! Once you've found out which prefixes you need to support, you should write them all out in your CSS, for example: -ms-tr...
...E 10 and old versions of iOS/desktop Safari respectively support incompatible old versions of the flexbox spec. This results in some interesting browser prefix juggling if you want to try to use flexbox across all these browsers (see Advanced Cross-Browser Flexbox to get an idea). Layout features aren't as easy to provide graceful fallbacks for as simple colors, shadows, or gradients. If layout
properties are ignored, your entire design will likely fall to pieces. Because of this, you need to use feature detection to detect whether visiting browsers support those layout features, and selectively apply different layouts depending on the result (we will cover feature detection in detail in a later article). For example, you could apply a flexbox layout to modern browsers, then instead apply a float...
Accessibility/LiveRegionDevGuide
/AT-SPI point of view as part of the Orca Live Region Support project. However, many of the concepts were also used during the development of FireVox, an AT using IAccessible2. Sometimes the very best guide for some developers is the code itself. Please refer to the liveregions and Gecko Python modules in Orca for a real world example. For more information about Live Regions, please read the ARIA
properties spec or the live region report to learn about ARIA Live Region markup and the Live Region API Support document for the latest Firefox API with regards to Live Regions. As always, we're open to questions and suggestions for changes in community forums. Priority Queue The heart of any live region support module is the priority queue. It is responsible for queuing messages derived from live regi...
...on API Support document for the latest Firefox API with regards to Live Regions. As always, we're open to questions and suggestions for changes in community forums. Priority Queue The heart of any live region support module is the priority queue. It is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness
properties. In addition to the standard priority queue methods, additional methods will need to be implemented that purge the queue based on one of the priority criterion. The "purge by timestamp" method will be used to remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the ARIA live politeness specification. The later method will be explained in detail bel...
...o a list, trigger both an object changed and a text changed event. Both events should not be acted upon or double announcements would result. Instead, all text changed events should be examined for the presence of an embed character. If one is present, the text changed event should be discarded because an object changed event will follow. Filtering User Actions This paragraph describes object
properties and event naming schemes that are used to help an AT determine if an event is an actual live region event or is the result of user action. Filtering for Performance The most significant difference between AT-SPI and IAccessible2 is that AT-SPI is an inter-process communication service while IAccessible2 runs in process. As a result, care must be taken in an AT-SPI based application to minimize...
...LECTABLE is not a live region. An event containing an object that has the attribute "container-live" is a live region. However, many web sites do not have proper ARIA markup so this cannot be used by itself. An event containing an object that has an attribute "tag:xul*" is not a live region. An event that has an object that is not a descendant of the document frame is not a live region. Live
Properties This table describe the object attributes associated with a live region event. The following are guidelines on how to implement each container-live This property determines the interruption policy or politeness level for the event and can have values of "off", "polite", "assertive" and "rude". This property, along with an event's time stamp, determine the priority of a message within the pr...
mozbrowsercontextmenu
ilities between implementations and the behavior may change in the future. The mozbrowsercontextmenu event is fired when the user tried to access a context menu over a browser <iframe>. This event can be used to control what will appear in the menu. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: clientX The X value of the coordinate that was clicked inside the browser <iframe>'s viewport. clientY The Y value of the coordinate that was clicked inside the browser <iframe>'s viewport. systemTargets An array containing one or more MenuSystem objects (see The MenuSystem object, below), containing details of the standard menu(s) that will be shown. For example, if the user clicked on ...
...A Menu object (see The Menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the DOM element clicked on, which contains the menu's id. contextmenuItemSelected An anonymous function that fires when a menu item is selected. The MenuSystem object An object defining a standard context menu that will be displayed. Its
properties are as follows: documentURI A DOMString representing the URL of the document the menu is associated with. uri A DOMString. In the case of an image or video context menu, this is the src of the image or video clicked on to get the context menu. In the case of an link context menu, it is the link's href. text A DOMString representing the text of the link clicked on, in the case of a link co...
... context menu. method A DOMString representing the method of a form, in the case of a form context menu. name A DOMString representing the name of a form, in the case of a form context menu. The Menu object An object representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the DOM element clicked on, which contains the menu's id. Its
properties are as follows: type A DOMString representing the type of context menu displayed. It can be menu (a full menu) or menuitem (a single menu item.) label A DOMString equal to the label attribute of the DOM node the context menu is accessed on. icon The menu item's icon, if the context menu being accessed is a menu item. id The menu item's id, if the context menu being accessed is a menu it...
JavaScript Tips
an XUL overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names. var UniqueName = { _privateMember: 3, publicMember: "A string", init: function() { this.doSomething(this.anotherMember); }, doSomething: function(aParam) { alert(aParam); } }; XPConnect Don't use object methods and
properties more than you have to. It is often faster to store the result in a temporary variable. Don't call methods that you don't have to. For instance, windowManager.getEnumerator(aType).hasMoreElements() may be replaced with windowManager.getMostRecentWindow(aType) != null for a single window. Don't query interfaces unless you need to access methods and
properties of that interface. You do not have to...
...ists, call hasAttribute instead. Prefer to loop through childNodes rather than using first/lastChild with next/previousSibling. But prefer hasChildNodes() to childNodes.length > 0. Similarly prefer document.getElementsByTagName(aTag).item(0) != null to document.getElementsByTagName(aTag).length > 0. Prefer to use localName rather than tagName. XUL elements have many of the attributes mapped to
properties. ...
...childNodes rather than using first/lastChild with next/previousSibling. But prefer hasChildNodes() to childNodes.length > 0. Similarly prefer document.getElementsByTagName(aTag).item(0) != null to document.getElementsByTagName(aTag).length > 0. Prefer to use localName rather than tagName. XUL elements have many of the attributes mapped to
properties. This was done for a reason, so use them! The
properties are: align allowEvents contextMenu datasources dir flex height id left maxHeight maxWidth minHeight minWidth observes orient pack persist ref statusText top tooltip tooltipText width XUL also maps the ordinal attribute but this defaults to "1" if it is not present. XUL also maps the class attribute, but unfortunately...
...atusText top tooltip tooltipText width XUL also maps the ordinal attribute but this defaults to "1" if it is not present. XUL also maps the class attribute, but unfortunately class is a reserved identifier, so the property is named className. (The property could have been implemented as ["class"'] but that just looks silly.) XUL also maps the hidden and collapsed attributes to
properties, but note that these are boolean
properties whereas the above list are all string
properties. XUL also maps other useful
properties and methods using XBL bindings; these vary from element to element. For best performance give ids to all important elements. However in addition to locating elements by tag name XUL also allows you to locate an element by attribute, starting at any element in the d...
Addon
An Addon represents an add-on that is either installed or can be installed. Instances can be created using the many getAddon methods on the AddonManager object. The interface can represent many different kinds of add-ons and as such, some of the methods and
properties are considered "required" and others "optional," which means that the optional methods or property may not exist on Addon instances for some types of add-ons. API consumers should take care to verify the existence of these methods or
properties before relying on them. Overview of required methods void isCompatibleWith(in string appVersion, in string platformVersion) void findUpdates(in UpdateListener listener, in integer reason, in string appVersion, in string platformVersion) Overview of optional methods ...
... blocklistState Read only integer The current blocklist state of this add-on; see nsIBlocklistService for possible values. creator Read only AddonAuthor The crea...
... Read only boolean True or false depending on whether the add-on is a third party add-on installation or not. id Read only string The ID of the add-on. No other installed add-on will have the same ID. isActive Read only boolean True if the add-on is currently functional. For some add-ons this will change immediately based on the appDisabled and userDisabled
properties; for others it will only change after an application restart. isCompatible Read only boolean True or false depending on whether the add-on is compatible with the current application version and platform version. isPlatformCompatible Read only boolean True or false depending on whether the add-on is compatible with the current operating system. name Read on...
...ating or cannot be updated at all. scope Read only integer Indicates what scope the add-on is installed in, per profile, user, system, or application. type Read only string The type of the add-on. userDisabled boolean True if the user wants this add-on to be disabled. version Read only string The version of the add-on. Optional
properties Attribute Type Description aboutURL Read only string The URL of the about dialog to display for this add-on. This is passed to window.openDialog() when presenting the about dialog. If you don't provide an aboutURL, a generic about dialog is displayed. The dialog receives the Addon object representing your add-on as a parameter. applyBackgroundUpdates in...
CustomizableUI.jsm
ntainer) Fired when a widget's DOM node is not overflowing its container, a toolbar, anymore. onWindowOpened(aWindow) Fired when a new customizable (ie browser) window is opened. onWindowClosed(aWindow) Fired when a customizable (ie browser) window is closed. ...
...s regarding customization. Parameters aListener the listener object to add removeListener() Remove a listener added with addListener. Parameters aListener the listener object to remove registerArea() Register a customizable area with CustomizableUI. Parameters aAreaId The name of the area to register. Can only contain alphanumeric characters, dashes (-) and underscores (_). a
Properties The
properties of the area. The following
properties are recognized: Property Description type The type of area. Either TYPE_TOOLBAR (default) or TYPE_MENU_PANEL. anchor For a menu panel or overflowable toolbar, the anchoring node for the panel. legacy Set to true if you want CustomizableUI to automatically migrate the currentset a...
...s have finished (that is, there has been 1 endBatchUpdate call for each beginBatchUpdate call). If any of the endBatchUpdate calls pass aForceDirty=true, we will flush to the prefs file. Parameters aForceDirty force CustomizableUI to flush to the prefs file when all batch updates have finished. createWidget() Create a widget. To create a widget, you should pass an object with its desired
properties. For a list of supported
properties, see API-provided widgets. Parameters a
Properties the specification for the widget Return value A wrapper around the created widget. Note: if your extension is compatible with versions of Firefox below 29, i.e. before CustomizableUI was introduced, then you have to make sure that in case of running on newer browsers, XUL overlay does not contain descri...
... whose place we need to check Return value "toolbar" if the node is in a toolbar, "panel" if it is in the menu panel, "palette" if it is in the (visible!) customization palette, undefined otherwise. isBuiltinToolbar() Check if a toolbar is builtin or not. Parameters aToolbarId the ID of the toolbar you want to check Return value true if the toolbar is builtin, false otherwise.
Properties For readability, the
properties are split according to purpose: Dynamic getters Attribute Type Description areas Array Always returns an up to date Array of all the area IDs that are currently registered with CustomizableUI. inDefaultState bool Whether we're in a default state. Note that non-removable non-default widgets and non-existing widget...
PopupNotifications.jsm
isplaying popup notification panels. Note: This code module is imported by Firefox chrome windows, so you don't have to do it yourself in most extensions. Method overview void locationChange(); Notification getNotification(id, browser); void remove(notification); Notification show(browser, id, message, anchorID, mainAction, secondaryActions, options);
Properties Attribute Type Description isPanelOpen Boolean Returns true if the notification panel is currently visible, false if it is not. Methods locationChange() The consumer can call this method to let the popup notification module know that the current browser's location has changed. This lets the notification service update the active notifications as appropriate...
...ject uses the notification-popup-box element). mainAction A JavaScript object literal containing fields that define the button to draw in the notification panel. See Notification actions below for details. secondaryActions An array of notification action objects; these are used to populate the drop-down menu on the notification panel's button. options A JavaScript object containing optional
properties for the notification. See Notification options below for details. Return value Returns the Notification object corresponding to the added notification. Notification actions Notification action objects describe the user interface for actions associated with the notification. The main action is used to describe the button presented in the notification panel, while secondary actions are display...
...ject corresponding to the added notification. Notification actions Notification action objects describe the user interface for actions associated with the notification. The main action is used to describe the button presented in the notification panel, while secondary actions are displayed in the drop-down menu associated with the button. ...
... timeout A timestamp (milliseconds since the epoch) indicating the earliest time after which the notification can be automatically dismissed. ...
WebRequest.jsm
The WebRequest API is modeled on Chrome's webRequest extension API, which makes it easier to write cross-browser add-on code. There are some differences between this API and Chrome's, though: see Chrome incompatibilities for the details. Usage To import WebRequest, use code like: let {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {}); The WebRequest object has the following
properties, each of which corresponds to a specific stage in executing a web request: onBeforeRequest onBeforeSendHeaders onSendHeaders onHeadersReceived onResponseStarted onCompleted Each of these objects defines two functions: addListener(callback, filter, opt_extraInfoSpec) removeListener(callback) Adding listeners Use addListener to add a listener to a particular event. It takes one man...
...mples of using addListener(). To remove a listener for an event, call removeListener on the event in question, passing it the listener to remove. Filtering The filter argument is the second argument to addListener(). If you don't pass filter, then the listener is invoked for every web request the browser makes that triggers that particular event. filter is an object that may contain up to two
properties: urls and types. Name Type Description urls MatchPattern Only invoke the listener for URLs that match one of the patterns. types Array of Strings. An array of resource types. Only invoke the listener for resource types that match one of the types given. To specify match patterns, first import the "MatchPattern.jsm" module, then construct a ...
... HTTP headers. See some examples of canceling, redirecting, and modifying request headers. Events The events exported by WebRequest.jsm are triggered at the various stages of making a request. This section describes the stage corresponding to each event. It also documents two data structures that vary from one event to another: the opt_extraInfoSpec argument to addListener() the
properties of the argument passed to the listener. onBeforeRequest This event is triggered when a request is about to be made, and before headers are available. This is a good place to listen if you want to cancel the request. opt_extraInfoSpec values Name Description "blocking" Make the browser wait until the listener returns. Use this if you want to cancel the request. See...
...nd of resource being fetched. It's used in two places: filtering requests by type, and as the type property of the argument passed to the listener. The following types are supported: "main_frame" "sub_frame" "stylesheet" "script" "image" "object" "xmlhttprequest" HTTP headers HTTPs headers are represented as objects with two
properties, name and value: Name Type Description name String Header name, for example "Content-Type" value String Header value, for example "image/png" Chrome incompatibilities Although this API is modeled on Chrome's webRequest extension API, there are some differences. We're working on addressing them, though. filtering by windowId and tabId is...
Localization content best practices
established format for localization comments: it's important to follow the format as closely as possible, since there are a number of automated tools that parse these comments for easier access and use by localizers. DTD files <!-- LOCALIZATION NOTE (entity name): {{privacy}} will be replaced at run-time by an active link. the string 'privacy-link' will be used as text for this link. -->
Properties files # LOCALIZATION NOTE(privacy-text): {{privacy}} will be replaced at run-time by an # active link. the string 'privacy-link' will be used as text for this link. privacy-text = By proceeding you accept the {{privacy}}. privacy-link = Privacy Terms File-wide comments should use the same format, they should be at the top of the file (after the license header) and just drop the (entity name/ke...
...'t hardcode characters Typically white spaces, commas, or other separators (":", "|"). If you need a trailing white space in a string, use the Unicode character \u0020 (that's usually a bad sign, you're concatenating it to another string). At some point, someone will accidentally trim that whitespace. Remove unused strings If you're removing features, don't leave around unused strings in the .
properties file. Tooltips If a string is used as a tooltip, it should not end in a period (in English). Tooltips are never written in imperative mood but infinitive mood instead. Hence the proper absence of periods to indicate this isn't just a matter of consistency for en-US, as it is also vital info for localizers. Menu and control labels The labels on controls and menu titles, menu option strings, an...
...shortcuts When translating Firefox strings from /devtools/ folder, you may see some keys like this: inspector.searchHTML.key=CmdOrCtrl+F The first part of the string `CmdOrCtrl` should not be translated. You may only translate the letter to better match your locale. This key shortcut definition matches the Electron key shortcut definition. Create localizable UI CSS issues Some CSS text/font
properties may cause problems with text legibility when applied to certain language texts. Avoid using Italic for CJKT. This acronym stands for: Chinese (Simplified and Traditional), Japanese, Korean, and Taiwanese. The text-transform property is not reliable for some locales; for example, text-transform: uppercase won't work properly with languages such as Irish/Gaelic. For example, App Size in English...
... W3C has a good guide on the length ratios a developer should be prepared for. Test localizability As a developer, you should always test your patches not just for code errors, but also for localizability issues in case they involve string or UI changes. Gecko and mozilla-central First, make sure that there are no hard-coded strings, and all strings are available in localization files (.dtd, .
properties). One possible way to test a patch for localizability issues is to alter the en-US localization files, adding extraneous characters to the original strings: this can help to identify both hard-coded strings and "flexibility issues" in the UI. Changing existing strings Updating Entity Names If you are changing a string such that its meaning has changed, you must update the entity or property na...
Using the viewport meta tag to control layout on mobile browsers
to the special value device-width, which is the width of the screen in CSS pixels at a scale of 100%. (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. The maximum-scale, minimum-scale, and user-scalable
properties control how users are allowed to zoom the page in or out. Usage of user-scalable=no can cause accessibility issues to users with visual impairments such as low vision. A pixel is not a pixel In recent years, screen resolutions have risen to the size that individual pixels are hard to distinguish with the human eye. For example, recent smartphones generally have a 5-inch screens with resoluti...
... high dpi screens, pages with initial-scale=1 will effectively be zoomed by browsers. Their text will be smooth and crisp, but their bitmap images will probably not take advantage of the full screen resolution. To get sharper images on these screens, web developers may want to design images - or whole layouts - at a higher scale than their final size and then scale them down using CSS or viewport
properties. This is consistent with the CSS 2.1 specification, which says: If the pixel density of the output device is very different from that of a typical computer display, the user agent should rescale pixel values. It is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel. It is recommended that the reference pixel be the visual angle ...
... viewport width. For example, if your layout needs at least 500 pixels of width then you can use the following markup. When the screen is more than 500 pixels wide, the browser will expand the viewport (rather than zoom in) to fit the screen: <meta name="viewport" content="width=500, initial-scale=1"> Other attributes that are available are minimum-scale, maximum-scale, and user-scalable. These
properties affect the initial scale and width, as well as limiting changes in zoom level. Not all mobile browsers handle orientation changes in the same way. For example, Mobile Safari often just zooms the page when changing from portrait to landscape, instead of laying out the page as it would if originally loaded in landscape. If web developers want their scale settings to remain consistent when switchin...
...ment CSS Device AdaptationThe definition of '<meta name="viewport">' in that specification. Working Draft Non-normatively describes the Viewport META element There is clearly demand for the viewport meta tag, since it is supported by most popular mobile browsers and used by thousands of web sites. It would be good to have a true standard for web pages to control viewport
properties. As the standardization process proceeds, we at Mozilla will work to keep up to date with any changes. ...
Mozilla Style System Documentation
c style changes are also tricky because the style contexts don't have pointers to their frames, but instead, we have the reverse and is probably the biggest flaw in the design of this part of the system. Getting style data from a style context To get style data from a style context, use the GetStyleData method to fill in a pointer to a style struct. Each of the style structs contains a group of
properties. The structs are listed in, nsStyleStruct.hand the many of the values are in nsStyleConsts.h. Each of the structs includes either only features that are inherited by default or single
properties that are set to the initial value by default (see CSS26.1.1), which is essential for the ruletree. The fundamental way to get a style struct from a style context looks like this: const nsStyleDisplay *d...
...format [element type: rule node]: [doc: B] ,------------' | `-----------. [title: C] [para: F] [para: D] | | [quote: A] [quote: A] | [span: E] The reason the rule tree shares style data naturally is that most style rules specify
properties in very few structs. As stated above, each style struct contains only features that are inherited by default or those that are set to their initial value ("reset") by default. This leads to (or perhaps three, depending on how you count) two types of sharing. For those structs where all the values are inherited by default, a style context can often (when none of the rules matched by the style cont...
...ts. As stated above, each style struct contains only features that are inherited by default or those that are set to their initial value ("reset") by default. This leads to (or perhaps three, depending on how you count) two types of sharing. For those structs where all the values are inherited by default, a style context can often (when none of the rules matched by the style context specifies any
properties in the struct, or when explicit inherit is used) use the same struct as its parent style context. For the structs where all the
properties are reset by default, if no explicit inherit values or em or similar units are used, the style struct can be cached on the rule node rather than the style context and shared between all style contexts pointing to that rule node. Furthermore, if the rule specif...
...er rule node every time they are needed. The code that does this sharing work is mostly in nsStyleContext::GetStyleData, nsRuleNode::GetStyleData, and nsRuleNode::WalkRuleTree. When nsRuleNode::WalkRuleTree computes a struct, it walks the rules, starting with the style context's rule node, towards the root of the rule tree. It uses the appropriate declaration struct and has each rule fill in any
properties specified by that rule that are not filled in already. The walking stops when all of the
properties are filled in or when the root of the rule tree is reached. Then the style struct is computed from the declaration and stored at the appropriate location in the rule tree or on the style context. Problems: Dynamic style changes often destroy too much data. CSS Stylesheet backend CSS Stylesheet L...
JSAPI Cookbook
ror types, such as SyntaxError or TypeError, use JS_ReportErrorNumber instead. JavaScript also supports throwing any value at all, not just Error objects. Use JS_SetPendingException to throw an arbitrary JS::Value from C/C++. // JavaScript throw exc; /* JSAPI */ JS_SetPendingException(cx, exc); return false; When JS_ReportError creates a new Error object, it sets the fileName and lineNumber
properties to the line of JavaScript code currently at the top of the stack. This is usually the line of code that called your native function, so it's usually what you want. JSAPI code can override this by creating the Error object directly and passing additional arguments to the constructor: // JavaScript throw new Error(message, filename, lineno); /* JSAPI */ bool ThrowError(JSContext *cx, JSObject *g...
...ending. * It will be automatically restored when we return, unless we call savedState.drop(). */ JS::AutoSaveExceptionState savedState(cx); if (!JS_CallFunctionName(cx, global, "cleanup", 0, NULL, &r)) { /* The new error replaces the previous one, so discard the saved exception state. */ savedState.drop(); return false; } return success; Object
properties Getting a property // JavaScript var x = y.myprop; The JSAPI function that does this is JS_GetProperty. It requires a JSObject * argument. Since JavaScript values are usually stored in JS::Value variables, a cast or conversion is usually needed. In cases where it is certain that y is an object (that is, not a boolean, number, string, null, or undefined), this is fairly straightforward. Use J...
... You can use this function to create a constant property, one that can't be overwritten or deleted. Specify writable: false to make the property read-only and configurable: false to prevent it from being deleted or redefined. The flag enumerable: true causes this property to be seen by for-in loops. // JavaScript Object.defineProperty(obj, "prop", {value: 123, ...
...hese settings, simply omit the property attribute bits you don't want. /* JSAPI */ if (!JS_DefineProperty(cx, obj, "prop", INT_TO_JSVAL(123), JS_PropertyStub, JS_StrictPropertyStub, JSPROP_READONLY | JSPROP_ENUMERATE | JSPROP_PERMANENT)) { return false; } Defining a property with a getter and setter Object.defineProperty() can be used to define
properties in terms of two accessor functions. // JavaScript Object.defineProperty(obj, "prop", {get: GetPropFunc, set: SetPropFunc, enumerable: true}); In the JSAPI version, GetPropFunc and SetPropFunc are C/C++ functions of type JSNative. /* JSAPI */ if (!JS_DefineProperty(cx, obj, "prop", JS::UndefinedValue(), ...
JS::CompileOptions
t handler content attribute or an event handler IDL attribute, this returns the name of that attribute, a string. Otherwise, this returns NULL. JSScript *introductionScript() const Returns a pointer to JSScript which introduces the file. bool copy(JSContext *cx, const ReadOnlyCompileOptions &rhs) Copy compile options from rhs. Returns false if it failed to duplicate owning
properties. bool setFile(JSContext *cx, const char *f) Duplicate null-terminated string f for filename(). Returns false if it failed to duplicate. bool setFileAndLine(JSContext *cx, const char *f, unsigned l) Duplicate null-terminated string f for filename() and set lineno property. Returns false if it failed to duplicate. bool setSourceMapURL(JSContext *cx, const char16_t *...
... l) OwningCompileOptions &setIntroductionType(const char *t) bool setIntroductionInfo(JSContext *cx, const char *introducerFn, const char *intro, unsigned line, JSScript *script, uint32_t offset) Duplicate null-terminated string introducerFn for introducerFilename and set introductionType, introductionLineno, introductionScriptRoot, introductionOffset, and hasIntroductionInfo
properties. Returns false if it failed to duplicate. Methods of JS::CompileOptions Method Description JSObject *element() const Same as JS::OwningCompileOptions. JSString *elementAttributeName() const JSScript *introductionScript() const CompileOptions &setFile(const char *f) Sets each property and returns the instance itself. CompileOpt...
... versionSet bool true if version is set. utf8 bool true if the character set of the source code is UTF-8. lineno unsigned Line number of the first line of the source code (1-origin). column unsigned Colum...
... versionSet bool true if version is set. utf8 bool true if the character set of the source code is UTF-8. lineno unsigned Line number of the first line of the source code (1-origin). column unsigned Column number of th...
JS_DefineFunctions
Name Type Description cx JSContext * The context in which to define functions. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. ...
... JSContext. obj JS::Handle<JSObject*> The object on which functions are to be defined. fs const JSFunctionSpec * A NULL-terminated array of function specifications. Each element of the array defines an individual function. behavior PropertyDefinitionBehavior See below. Added in SpiderMonkey 38 enum PropertyDefinitionBehavior { DefineAll
Properties, OnlyDefineLate
Properties, DontDefineLate
Properties }; Name Description DefineAll
Properties Define all
properties regardless of their flags. OnlyDefineLate
Properties Define only
properties which have a JSPROP_DEFINE_LATE flag. DontDefineLate
Properties Define only
properties which have no JSPROP_DEFINE_LATE flag. Description JS_Defi...
... fs is a pointer to the first element of an array of JSFunctionSpec records. This array is usually defined as a static global, with each record initialized using JS_FS or JS_FN. ...
...ement defines a single function: its name, the native C/C++ implementation, the number of JavaScript arguments the function expects, and any property attributes. The last element of the array must contain 0 values. (The macro JS_FS_END can be used for the last element.) JS_DefineFunctions creates one function for each non-zero element in the array. PropertyDefinitionBehavior is used to select if
properties with JSPROP_DEFINE_LATE flag should be defined on the object. Normal JSAPI consumers probably always want DefineAll
Properties here. On success, JS_DefineFunctions returns true. On error or exception, it stops defining functions and returns false. See Also MXR ID Search for JS_DefineFunctions JS_CallFunctionName JS_DefineObject JS_Define
Properties JS_NewFunction bug 959787 - make fs type...
Property attributes
getter is a JavaScript Function, not a C/C++ function. See JS_DefineProperty for details. MXR ID Search for JSPROP_GETTER JSPROP_SETTER The property's setter is a JavaScript Function, not a C/C++ function. See JS_DefineProperty for details. MXR ID Search for JSPROP_SETTER JSPROP_SHARED The property is shared. This is usually the right thing for
properties that have getters or setters. This has three effects: The JavaScript engine does not set aside any memory for the property's value. The value is determined entirely by the getter. (The property has no stored value.) Assignment via the prototype chain is affected. Assigning to obj.x, where obj inherits a non-shared property from its prototype, creates a new own data property on obj...
...pects of inheriting the property via the prototype chain are affected. Do not depend on this. See bug 575997. MXR ID Search for JSPROP_SHARED JSPROP_INDEX The property's id is represented internally as an integer, not a string. Obsolete since JSAPI 39 This flag has an additional special meaning when used with JS_DefineProperty, JS_FS, and other APIs that define
properties: it means that the name parameter is actually an integer unsafely cast to a pointer type, not a string. MXR ID Search for JSPROP_INDEX JSPROP_DEFINE_LATE Don't define property when initially creating the constructor. Some objects like Function/Object have self-hosted functions that can only be defined after the initialization is already finished. Added in SpiderMonkey 38...
...NFIGURABLE If set, will allow redefining a non-configurable property, but only on a non-DOM global. This is a temporary hack that will need to go away in bug 1105518. Added in SpiderMonkey 38 MXR ID Search for JSPROP_REDEFINE_NONCONFIGURABLE JSPROP_RESOLVING Resolve hooks and enumerate hooks must pass this flag when calling JS_Define* APIs to reify lazily-defined
properties. JSPROP_RESOLVING is used only with property-defining APIs. It tells the engine to skip the resolve hook when performing the lookup at the beginning of property definition. This keeps the resolve hook from accidentally triggering itself: unchecked recursion. For enumerate hooks, triggering the resolve hook would be merely silly, not fatal, except in some cases involving non-configurable...
... JSPROP_RESOLVING is used only with property-defining APIs. It tells the engine to skip the resolve hook when performing the lookup at the beginning of property definition. This keeps the resolve hook from accidentally triggering itself: unchecked recursion. For enumerate hooks, triggering the resolve hook would be merely silly, not fatal, except in some cases involving non-configurable
properties. Added in SpiderMonkey 45 MXR ID Search for JSPROP_RESOLVING JSPROP_IGNORE_ENUMERATE Ignore the value in JSPROP_ENUMERATE. This flag only valid when defining over an existing property. Added in SpiderMonkey 38 MXR ID Search for JSPROP_IGNORE_ENUMERATE JSPROP_IGNORE_READONLY Ignore the value in JSPROP_READONLY. This flag only valid when defi...
Parser API
o available since Firefox 7; it can be imported into the global object via: Components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object via: Components.utils.import("resource://gre/modules/reflect.jsm", obj) Built-in objects Whether in SpiderMonkey shell or Firefox (after importing), the global singleton object Reflect currently contains just the parse method.
Properties of the Reflect object The Reflect object currently consists of a single method. Reflect.parse(src[, options]) Coerces src to a string and parses the result as a JavaScript program. By default, the parsing returns a Program object (see below) representing the parsed abstract syntax tree (AST). Additional options may be provided via the options object, which can include any of the following pro...
...under Builder Objects. target String Default: script A type of the parsing target, can be either script or module. If parsing fails due to a syntax error, an instance of SyntaxError is thrown. The syntax error object thrown by Reflect.parse() has the same message property as the syntax error that would be thrown by eval(src). The lineNumber and fileName
properties of the syntax error object indicate the source location of the syntax error. Node objects By default, Reflect.parse() produces Node objects, which are plain JavaScript objects (i.e., their prototype derives from the standard Object prototype). All node types implement the following interface: interface Node { type: string; loc: SourceLocation | null; } The type field is a string repr...
...nd side of an assignment may be any expression in general, an expression can also be a pattern. interface ThisExpression <: Expression { type: "ThisExpression"; } A this expression. interface ArrayExpression <: Expression { type: "ArrayExpression"; elements: [ Expression | null ]; } An array expression. interface ObjectExpression <: Expression { type: "ObjectExpression";
properties: [ Property ]; } An object expression. interface Property <: Node { type: "Property"; key: Literal | Identifier; value: Expression; kind: "init" | "get" | "set"; } A literal property in an object expression can have either a string or number as its value. Ordinary property initializers have a kind value "init"; getters and setters have the kind values "get" and "set", respectiv...
...destructuring pattern. Since the left-hand side of an assignment can in general be any expression, in an assignment context, a pattern can be any expression. In binding positions (such as function parameters, variable declarations, and catch headers), patterns can only be identifiers in the base case, not arbitrary expressions. interface ObjectPattern <: Pattern { type: "ObjectPattern";
properties: [ { key: Literal | Identifier, value: Pattern } ]; } An object-destructuring pattern. A literal property in an object pattern can have either a string or number as its value. interface ArrayPattern <: Pattern { type: "ArrayPattern"; elements: [ Pattern | null ]; } An array-destructuring pattern. Clauses interface SwitchCase <: Node { type: "SwitchCase"; test: Expression | ...
Split object
er than Mozilla that embed SpiderMonkey should avoid using split objects. The window object Split objects were introduced to resolve a problem posed by the window object. Three interrelated requirements on the window object seemed to conflict. The window object is the global object for scripts in Web pages. Firefox has to maintain this for Web compatibility. For performance, access to global
properties must be fast. There is a glaring difference in the lifetime of the window object as seen from two different angles. Suppose a script in page A, in tab TA, has a reference to the window object of page B in another tab TB. The window object for tab TB must persist as the user navigates from page to page in that tab. To the script in page A, the window must appear to be a single object that ...
...n by calling it, it is indirectly accessing tab TB's window. The Function object carries a reference to the window, via the scope chain. To further complicate matters, A and B are in the same security domain, so security checks between them automatically succeed. This makes the problem resistant to a wrapper-based approach.) Older versions of Firefox accomplished this by blowing away all window
properties every time a user navigated to another page, then reusing the window. Each page, even on Back, had to load from scratch. This was slow. Circa Firefox 1.5, the decision was made to cache layout information and JavaScript state across navigation. A new approach for window was needed. Security privileges are granted to JS code on the basis of the scope chain of the executing code. SpiderMonk...
...ects. ...And yet, there is special code in jsobj.h with a comment about fixing some kind of interaction between with an split objects. Write that down, it'll be on the test.) Split objects were the solution. The inner window object is different for each page a browser window visits. It serves as the "globals" object and provides the JSPrincipals for scripts on that page. Access to inner window
properties is fast. The outer window object is the object returned by window.open. It represents the window or tab itself and survives as the user navigates in that window or tab. The window object's JSClass.resolve hook ensures that
properties of the inner object are visible via the outer object, if the running code has the right principals to access them. This privilege check may be slow. See wikimo:Gecko...
.... Inner and outer objects are in certain other respects the same object: If Object.hasOwnProperty is called on an inner object, and the named property is found on an outer object, that's considered close enough and hasOwnProperty returns true. Note that none of the rules listed here affects ordinary property accesses. SpiderMonkey's split object support, by itself, does not cause inner object
properties to appear on the outer object or vice versa. Split objects that need this behavior must implement it in custom JSClass hooks. In the case of window, each half has custom hooks. ...
XForms Accessibility
as stripped out as it was believed the focus model was dependent on the content which used it. So, yes we don't care about navindex in XForms. If you use xhtml1.x use tabindex. If you use Xhtml2 use nextfocus. Therefore since Mozilla XForms works in XHTML (1.x) or XUL documents only then we use tabindex instead. Note, we support -moz-user-focus style neither for XHTML or XUL. ...
...n the content which used it. So, yes we don't care about navindex in XForms. If you use xhtml1.x use tabindex. If you use Xhtml2 use nextfocus. Therefore since Mozilla XForms works in XHTML (1.x) or XUL documents only then we use tabindex instead. Note, we support -moz-user-focus style neither for XHTML or XUL. AT API Accessible
properties This section describes common rules how accessibility
properties are formed for forms control elements. ...
...ccessible
properties This section describes common rules how accessibility
properties are formed for forms control elements. name It is formed from value of child XForms label element if the element doesn't have labelledby attribute. description It is formed from value of child XForms hint element if the element doesn't have describedby attribute. state It is formed as well from model item
properties (MIPs) of instance node that XForms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. Instance node states are mapped to accessibility state constants declared in nsIAccessibleStates interface like it shown below: relevant - STATE_UNAVAILABLE readonly - STATE_READONLY required - STATE_REQUIRED invalid - STATE_INVALID out of range - STATE_INVALID ...
... listbox checkboxes group select1 Allows the user to choose a single value from a list of pre-defined values (see the spec, the docs). It can have the following representations: combobox listbox radio group Additional Elements These elements may be used as child elements to the form controls described above. Some of these elements are not accessible itself but they makes accessibility
properties for XForms elements that hold them. label Specifies the label for the xforms control (see the spec, the docs). Every form control other than the output element must contain a label element. The value of label element is used as name of accessible object. help Specifies contextual help for the containing form control (see the spec, the docs). The help element has ROLE_ALERT role. hint Simila...
Components.classes
Note that Components.classes reflects only those component classes that have been previously installed and registered with the component manager using ContractIDs. ...
... Note that Components.classes reflects only those component classes that have been previously installed and registered with the component manager using ContractIDs. ...
... Note that Components.classes reflects only those component classes that have been previously installed and registered with the component manager using ContractIDs. ...
...er machine. If the given element in the Components.classes object is not registered on the machine then trying to access it will generate a JavaScript warning in strict mode and the value returned will be the JavaScript value undefined. You should use the in operator to test for the element before trying to access it: if (!("@some/bogus/class;1" in Components.classes)) // do something... The
properties of the Components.classes object can be enumerated using a for...in loop. Usage In order to retrieve the object for a given ContractID, you can query the Components.classes array as follows: var clazz0 = Components.classes["@mozilla.org/messenger;1"]; clazz0 is the class object for the ContractID @mozilla.org/messenger;1, which is not usually used by itself, but whose createInstance and getS...
nsDirectoryService
rence Summary The XPCOM Directory Service. This service returns the locations of "well known" directories in an OS-independent manner. For instance, it can give you the path of the system's temporary directory, desktop directory, current working directory, and so on. Class ID f00152d0-b40b-11d3-8c9c-000064657374 ContractID @mozilla.org/file/directory_service;1 Supported Interfaces nsI
Properties nsIDirectoryService Remarks This component is a singleton and should therefore be accessed via the XPCOM Service Manager. Example Code #include "nsXPCOM.h" #include "nsCOMPtr.h" #include "nsDirectoryServiceDefs.h" #include "nsIServiceManager.h" #include "nsI
Properties.h" /** * Get the location of the system's "temp" directory. */ nsresult GetTempDir(nsIFile **aResult) { nsresul...
... #include "nsXPCOM.h" #include "nsCOMPtr.h" #include "nsDirectoryServiceDefs.h" #include "nsIServiceManager.h" #include "nsI
Properties.h" /** * Get the location of the system's "temp" directory. ...
...location of the system's "temp" directory. ...
... NS_GET_IID(nsI
Properties), getter_AddRefs(directory)); if (NS_FAILED(rv)) return rv; rv = directory->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), aResult); return rv; } Note that NS_OS_TEMP_DIR is defined in nsDirectoryServiceDefs.h along with a number of other Directory Service keys. ...
nsIStringBundle
Inherits from: nsISupports Last changed in Gecko 1.7 This interface is used by XUL:stringbundle to retrieve strings. It is recommended that you use the methods of XUL:stringbundle to access these functions unless necessary. Alternatively, a string bundle can be created within a javascript context with nsIStringBundleService. ...
...formatStringFromID() Returns a formatted string with the given ID from the string bundle, where each occurrence of %S (uppercase) is replaced by each successive element in the supplied array. You may also use other formatting codes. You can only pass Unicode strings in. The ID should refer to a string in the bundle that uses %S, and the number of strings you pass MUST be the same here and in the
properties file (That is you can't omit %1 and use only %2). Do NOT try to use any other types. This uses nsTextFormatter::smprintf. wstring formatStringFromID( in long aID, [array, size_is(length)] in wstring params, in unsigned long length ); Parameters aID The ID of the string to retrieve. params Parameters to pass in to the string. length The length of the parameter list. Return value...
...ngFromName() Returns a formatted string with the given key name from the string bundle, where each occurrence of %S (uppercase) is replaced by each successive element in the supplied array. You may also use other formatting codes, but can only pass Unicode strings in. The name should refer to a string in the bundle that uses %S, and the number of strings you pass MUST be the same here and in the
properties file (That is you can't omit %1 and use only %2). Do NOT try to use any other types. This uses nsTextFormatter::smprintf to do the dirty work. wstring formatStringFromName( in wstring aName, [array, size_is(length)] in wstring params, in unsigned long length ); Parameters aName The name of the string to retrieve. params Parameters to pass in to the string. length The length of th...
... nsISimpleEnumerator getSimpleEnumeration(); Parameters None. Return value Returns a nsISimpleEnumerator of all nsIPropertyElement entries in the string bundle. GetStringFromID() Retrieves a string from the bundle by its ID. wstring GetStringFromID( in long aID ); Parameters aID The ID of the string to retrieve. String ID's are assigned by the order in which they are stored in the
properties file. Return value Returns the requested string. GetStringFromName() Retrieves a string from the bundle by its name. wstring GetStringFromName( in wstring aName ); Parameters aName The name of the string to retrieve. String name are designated in the
properties file. Return value Returns the requested string. See also XUL:stringbundle XUL Tutorial:Property Files nsIStringBu...
nsIStringBundleService
This string bundle has functions available on it. On the return value object on you can call functions like GetStringFromName and formatStringFromName see nsIStringBundle. createExtensibleBundle() nsIStringBundle createExtensible...
... nsIStringBundle createExtensibleBundle(in string aRegistryKey); void flushBundles(); wstring formatStatusMessage(in nsresult aStatus, in wstring aStatusArg); Methods createBundle() nsIStringBundle createBundle( in string aURLSpec ); Parameters aURLSpec The URL of the
properties file to load. This is typically a locale URL, e.g. chrome://global/locale/global.
properties Return value A string bundle corresponding to the
properties file. This string bundle has functions available on it. On the return value object on you can call functions like GetStringFromName and formatStringFromName see nsIStringBundle. createExtensibleBundle() nsIStringBundle createExtensibleBundle( in string aRegistryKey ); Parameters aRegistryKey The name of the category u...
... flushBundles() Flushes the string bundle cache - useful when the locale changes or when we need to get some extra memory back. ...
...on it. On the return value object on you can call functions like GetStringFromName and formatStringFromName see nsIStringBundle. createExtensibleBundle() nsIStringBundle createExtensibleBundle( in string aRegistryKey ); Parameters aRegistryKey The name of the category under which the
properties file(s) have been registered. Return value An extensible bundle corresponding to the
properties file(s). flushBundles() Flushes the string bundle cache - useful when the locale changes or when we need to get some extra memory back. (Automatically called for the memory-pressure and chrome-flush-caches global observer topics.) void flushBundles(); Parameters None. formatStatusMessage() Formats a message string from a status code and status arguments. Typically used to format a message...
DevTools API - Firefox Developer Tools
ool with the given ID has finished its initialization and is ready to be used. The panel is the object returned by the ToolDefinition.build() method. {toolId}-destroy(toolbox, panel) A tool with the given ID is about to be destroyed. The panel is the object returned by the ToolDefinition.build() method. Toolbox A Toolbox is a frame for the ToolPanels that is debugging a specific target.
Properties target Target. The Target this toolbox is debugging. hostType Toolbox.HostType. The type of the host this Toolbox is docked to. The value is one of the Toolbox.HostType constants. zoomValue The current zoom level of the Toolbox. Constants The Toolbox constructor contains following constant
properties. Toolbox.HostType.BOTTOM Host type for the default toolbox host at...
... The Toolbox the tool is being built for. Return value: A ToolPanel for the tool. onKey(panel, toolbox) Optional. A method that is called when the keyboard shortcut for the tool is activated while the tool is the active tool. Parameters: panel {ToolPanel} - The ToolPanel for the tool. toolbox {Toolbox} - The toolbox for the shortcut was triggered for. Return value: Undefined.
Properties The ToolDefinition object can contain following
properties. Most of them are optional and can be used to customize the presense of the tool in the Browser and the Toolbox. id String, required. An unique identifier for the tool. It must be a valid id for an HTML Element. url String, required. An URL of the panel document. label String, optional. The tool's name. If undefined t...
...w tab has been added {tabId}-ready Tab is loaded and can be used {tabId}-selected Tab has been selected and is visible {tabId}-unselected Tab has been unselected and is not visible show The sidebar has been opened. hide The sidebar has been closed. Examples Register a tool gDevTools.registerTool({ // FIXME: missing key related
properties. ...
... hide The sidebar has been closed. Examples Register a tool gDevTools.registerTool({ // FIXME: missing key related
properties. ...
Web Console remoting - Firefox Developer Tools
"sourceName": "http://localhost/~mihai/mozilla/test.js", "lineText": "", "lineNumber": 6, "columnNumber": 0, "category": "content javascript", "timeStamp": 1347294508210, "error": false, "warning": false, "exception": true, "strict": false, "private": false, } } The packet is similar to nsIScriptError - for simplicity. We only removed several unneeded
properties and changed how flags work. The private flag tells if the error comes from a private window/tab (added in Firefox 24). Starting with Firefox 24 the errorMessage and lineText
properties can be long string actor grips if the string is very long. Console API messages The window.console API calls send internal messages throughout Gecko which allow us to do whatever we want for each call. The Web ...
...soleObj20" }, " 960 739 3.141592653589793 %a", "zuzu", { "type": "null" }, { "type": "undefined" } ] } } Similar to how we send the page errors, here we send the actual console event received from the nsIObserverService. We change the arguments array - we create ObjectActor instances for each object passed as an argument - and, lastly, we remove some unneeded
properties (like window IDs). In the case of long strings we use the LongStringActor. The Web Console can then inspect the arguments. The private flag tells if the console API call comes from a private window/tab (added in Firefox 24). We have small variations for the object, depending on the console API call method - just like there are small differences in the console event object received from the obse...
... "exceptionMessage": null, "helperResult": null } exception holds the JSON-ification of the exception thrown during evaluation. exceptionMessage holds the exception.toString() result. result has the result ObjectActor instance. helperResult is anything that might come from a JSTerm helper result, JSON stuff (not content objects!). In Firefox 23: we renamed the error and errorMessage
properties to exception and exceptionMessage respectively, to avoid conflict with the default
properties used when protocol errors occur. Autocomplete and more The autocomplete request packet: { "to": "conn0.console9", "type": "autocomplete", "text": "d", "cursor": 1 } The response packet: { "from": "conn0.console9", "matches": [ "decodeURI", "decodeURIComponent", "defaultStat...
...ons to the evaluateJS request packet. Firefox 24: new private flags for the console actor notifications, bug 874061. Also added the lastPrivateContextExited notification for the global console actor. Firefox 24: new isXHR flag for the networkEvent notification, bug 859046. Firefox 24: removed the message property from the pageError packet notification, bug 877773. The lineText and errorMessage
properties can be long string actors now. Firefox 25: added the url option to the evaluateJS request packet. Firefox 25: added the getPreferences and sendHTTPRequest request packets to the console actor, bug 886067 and bug 731311. Conclusions As of this writing, this document is a dense summary of the work we did in bug 768096 and subsequent changes. We try to keep this document up-to-date. We hope thi...
Attr - Web APIs
Properties name Read only The attribute's name. namespaceURI Read only A DOMString representing the namespace URI of the attribute, or null if there is no namespace. localName Read only A DOMString representing the local part of the qu...
...
Properties name Read only The attribute's name. ...
...nchor="middle" alignment-baseline="middle">Attr</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Warning: Starting in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4), a number of deprecated
properties and methods output warning messages to the console. You should revise your code accordingly. See Deprecated
properties and methods for a complete list.
Properties name Read only The attribute's name. namespaceURI Read only A DOMString representing the namespace URI of the attribute, or null if there is no namespace. localName Read only A DOMString representing the local part of the qualified name of the attribute. prefix Read only A DOMString representing the namespace prefix of the attribute, or null if no prefix is specified. ownerElement ...
...ribute was explicitly specified in the source code or by a script, and false if its value came from the default one defined in the document's DTD. value The attribute's value. Note: DOM Level 3 defined namespaceURI, localName and prefix on the Node interface. In DOM4 they were moved to Attr. This change is implemented in Chrome since version 46.0 and Firefox since version 48.0. Deprecated
properties and methods The following
properties have been deprecated. Where available, the appropriate replacement is noted. attributes This property now always returns NULL. childNodes Obsolete since Gecko 14 This property now always returns an empty NodeList. firstChild Obsolete since Gecko 14 This property now always returns NULL. isId Read only Indicates whether the attribute is an "ID attri...
AudioListener - Web APIs
The AudioListener interface represents the position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. It is important to note that there is only one listener per context and that it isn't an AudioNode.
Properties The position, forward, and up value are set and retrieved using different syntaxes. Retrieval is done by accessing, for example, AudioListener.positionX, while setting the same property is done with AudioListener.positionX.value. This is why these values are not marked read only, which is how they appear in the specification's IDL. AudioListener.positionX Represents the horizontal position of the listener in a right-...
...ientation and position in Firefox, Internet Explorer and Safari. Deprecated features AudioListener.dopplerFactor A double value representing the amount of pitch shift to use when rendering a doppler effect. AudioListener.speedOfSound Is a double value representing the speed of sound, in meters per second. In a previous version of the specification, the dopplerFactor and speedOfSound
properties and the setPosition() method could be used to control the doppler effect applied to AudioBufferSourceNodes connected downstream -- these would be pitched up and down according to the relative speed of the PannerNode and the AudioListener. These features had a number of problems: Only AudioBufferSourceNodes were pitched up or down, not other source nodes. The behavior to adopt when an AudioBuf...
...ad a number of problems: Only AudioBufferSourceNodes were pitched up or down, not other source nodes. The behavior to adopt when an AudioBufferSourceNode was connected to multiple PannerNodes was unclear. Because the velocity of the panner and the listener were not AudioParams, the pitch modification could not be smoothly applied, resulting in audio glitches. Because of these issues, these
properties and methods have been removed. The setOrientation() and setPosition() methods have been replaced by setting their property value equivilents. For example setPosition(x, y, z) can be achieved by setting positionX.value, positionY.value, and positionZ.value respectively. Example In the following example, you can see an example of how the createPanner() method, AudioListener and PannerNode wo...
...D "Room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! Note how we have used some feature detection to either give the browser the newer property values (like AudioListener.forwardX) for setting position, etc. if it supports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new
properties. // set up listener and panner position information var WIDTH = window.innerWidth; var HEIGHT = window.innerHeight; var xPos = Math.floor(WIDTH/2); var yPos = Math.floor(HEIGHT/2); var zPos = 295; // define other variables var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); var panner = audioCtx.createPanner(); panner.panningModel = 'HRTF';...
BluetoothRemoteGATTCharacteristic - Web APIs
The BluetoothRemoteGattCharacteristic interface of the Web Bluetooth API represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service. ...
... BluetoothRemoteGattCharacteristic interface of the Web Bluetooth API represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service. ...
... BluetoothRemoteGATTCharacteristic.uuidRead only Returns a DOMString containing the UUID of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the Heart Rate Measurement characteristic. BluetoothRemoteGATTCharacteristic.
propertiesRead only Returns t...
...isticEventHandlers;
Properties BluetoothRemoteGATTCharacteristic.serviceRead only Returns the BluetoothGATTService this characteristic belongs to. BluetoothRemoteGATTCharacteristic.uuidRead only Returns a DOMString containing the UUID of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the Heart Rate Measurement characteristic. BluetoothRemoteGATTCharacteristic.
propertiesRead only Returns the
properties of this characteristic. BluetoothRemoteGATTCharacteristic.valueRead only The currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication. Methods BluetoothRemoteGATTCharacteristic.getDescriptor() Returns a Promise that resolves to the first BluetoothGATTDescriptor...
CSSStyleDeclaration - Web APIs
A CSSStyleDeclaration object can be exposed using three different APIs: Via HTMLElement.style, which deals with the inline styles of a single element (e.g., <div style="...">). Via the CSSStyleSheet API. For example, document.styleSheets[0].cssRules[0].style returns a CSSStyleDeclaration object on the first CSS rule in the document's first stylesheet. Via Window.getComputedStyle(), which exposes the CSSStyleDeclaration object as a read-only interface. ...
...les[0].style returns a CSSStyleDeclaration object on the first CSS rule in the document's first stylesheet. Via Window.getComputedStyle(), which exposes the CSSStyleDeclaration object as a read-only interface. Attributes CSSStyleDeclaration.cssText Textual representation of the declaration block. Setting this attribute changes the style. CSSStyleDeclaration.lengthRead only The number of
properties. See the item() method below. CSSStyleDeclaration.parentRuleRead only The containing CSSRule. CSS
Properties CSSStyleDeclaration.cssFloat Special alias for the float CSS property. CSSStyleDeclaration named
properties Dashed and camel-cased attributes for all supported CSS
properties. Methods CSSStyleDeclaration.getPropertyPriority() Returns the optional priority, "important". CS...
... implementations. CSSStyleDeclaration.removeProperty() Removes a property from the CSS declaration block. CSSStyleDeclaration.setProperty() Modifies an existing CSS property or creates a new CSS property in the declaration block. CSSStyleDeclaration.getPropertyCSSValue() Only supported via getComputedStyle in Firefox. Returns the property value as a CSSPrimitiveValue or null for shorthand
properties. Example var styleObj = document.styleSheets[0].cssRules[0].style; console.log(styleObj.cssText); for (var i = styleObj.length; i--;) { var nameString = styleObj[i]; styleObj.removeProperty(nameString); } console.log(styleObj.cssText); Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'CSSStyleDeclaration' in that specific...
... Document Object Model (DOM) Level 2 Style SpecificationThe definition of 'CSSStyleDeclaration' in that specification. Obsolete Initial definition ...
CSSValueList - Web APIs
So, an empty list means that the property has the value none. The items in the CSSValueList are accessible via an integral index, starting from 0. ...
...So, an empty list means that the property has the value none. The items in the CSSValueList are accessible via an integral index, starting from 0. ...
... CSSValueList.lengthRead only An unsigned long representing the number of CSSValues in the list. Methods CSSValueList.item() This method is used to retrieve a CSSValue by ordinal index. The order in this collection represents the order of the values in the CSS style property. If index is greater than or equal to the number of values in the...
... CSSValueList.lengthRead only An unsigned long representing the number of CSSValues in the list. Methods CSSValueList.item() This method is used to retrieve a CSSValue by ordinal index. The order in this collection represents the order of the values in the CSS style property. If index is greater than or equal to the number of values in the list, this returns n...
Using dynamic styling information - Web APIs
l> <head> <title>Modifying a stylesheet rule with CSSOM</title> <style type="text/css"> body { background-color: red; } </style> <script type="text/javascript"> var stylesheet = document.styleSheets[0]; stylesheet.cssRules[0].style.backgroundColor="blue"; </script> </head> <body> The stylesheet declaration for the body's background color is modified via JavaScript. </body> </html> The list of
properties available in the DOM from the style property is given on the DOM CSS
Properties List page. To modify styles to a document using CSS syntax, one can insert rules or insert <style> tags whose innerHTML property is set to the desired CSS. Modify an element's style The element style property (see also the section "DOM Style Object" below) can also be used to get and set the styles on an element. H...
...hapter for more information on how to use this method. DOM Style Object The style object represents an individual style statement. 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. It represents the in-line styles on a particular element. ...
... style object represents an individual style statement. 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. It represents the in-line styles on a particular element. ...
... of the style may or may not be given. Using the setAttribute method Note that you can also change style of an element by getting a reference to it and then use its setAttribute method to specify the CSS property and its value. var el = document.getElementById('some-element'); el.setAttribute('style', 'background-color:darkblue;'); Be aware, however, that setAttribute removes all other style
properties that may already have been defined in the element's style object. If the some-element element above had an in-line style attribute of say style="font-size: 18px", that value would be removed by the use of setAttribute. ...
Console.table() - Web APIs
. If data is an object, then its values will be the property names. Note that (in Firefox) console.table is limited to displaying 1000 rows (first row is the labeled index). Note: This feature is available in Web Workers. Collections of primitive types The data argument may be an array or an object. ...
...types The data argument may be an array or an object. ...
...sole.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; } var john = new Person("John", "Smith"); var jane = new Person("Jane", "Doe"); var emily = new Person("Emily", "J...
... // an array of objects function Person(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } var john = new Person("John", "Smith"); var jane = new Person("Jane", "Doe"); var emily = new Person("Emily", "Jones"); console.table([john, jane, emily]); Note that if the array contains objects, then the columns are labeled with the property name. // an object whose
properties are objects var family = {}; family.mother = new Person("Jane", "Smith"); family.father = new Person("John", "Smith"); family.daughter = new Person("Emily", "Smith"); console.table(family); Restricting the columns displayed By default, console.table() lists all elements in each row. You can use the optional columns parameter to select a subset of columns to display: // an array of objects...
DocumentType - Web APIs
DocumentType.entities Read only A NamedNodeMap of entities declared in the DTD. Every node in this map implements the Entity interface. DocumentType.internalSubset Read only A DOMString of the internal subset, or null if there is none. Eg "<!ELEMENT foo (bar)>". DocumentType.name Read only A DOMStri...
... DocumentType.entities Read only A NamedNodeMap of entities declared in the DTD. Every node in this map implements the Entity interface. DocumentType.internalSubset Read only A DOMString of the internal subset, or null if there is none. Eg "<!ELEMENT foo (bar)>". DocumentType.name Read only A DOMString, eg "html" for <!D...
... methods from its parent, Node, and implements the ChildNode interface. ChildNode.remove() Removes the object from its parent children list. Specifications Specification Status Comment DOMThe definition of 'DocumentType' in that specification. Living Standard Added implemention of the ChildNode interface. Removed the internalSubset, entities, and notation
properties. ...
... Document Object Model (DOM) Level 1 SpecificationThe definition of 'DocumentType' in that specification. ...
Introduction to the DOM - Web APIs
be accessed by various browsers with different DOMs. 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. alert(paragraphs[0].nodeName); All of the
properties, methods, and events available for manipulating and creating web pages are organized into objects (for example, the document object that represents the document itself, the table object that implements the special HTMLTableElement DOM interface for accessing HTML tables, and so forth). This documentation provides an object-by-object reference to the DOM. The modern DOM is built using multiple AP...
...ce: border attribute if(tableAttrs[i].nodeName.toLowerCase() == "border") table.border = "1"; } // HTMLTableElement interface: summary attribute table.summary = "note: increased border"; Core Interfaces in the DOM This section lists some of the most commonly-used interfaces in the DOM. The idea is not to describe what these APIs do here but to give you an idea of the sorts of methods and
properties you will see very often as you use the DOM. These common APIs are used in the longer examples in the DOM Examples chapter at the end of this book. The document and window objects are the objects whose interfaces you generally use most often in DOM programming. In simple terms, the window object represents something like the browser, and the document object is the root of the document itself. Ele...
...s chapter at the end of this book. The document and window objects are the objects whose interfaces you generally use most often in DOM programming. In simple terms, the window object represents something like the browser, and the document object is the root of the document itself. Element inherits from the generic Node interface, and together these two interfaces provide many of the methods and
properties you use on individual elements. These elements may also have specific interfaces for dealing with the kind of data those elements hold, as in the table object example in the previous section. The following is a brief list of common APIs in web and XML page scripting using the DOM. document.getElementById(id) document.getElementsByTagName(name) document.createElement(name) parentNode.append...
...The following screenshot gives you some idea of how interfaces can be grouped together for testing. Figure 0.1 Sample DOM Test Page In this example, the drop-down menus dynamically update such DOM--accessible aspects of the web page as its background c...
EffectTiming - Web APIs
Properties delay Optional The number of milliseconds to delay the start of the animation. Defaults to 0. ...
...
Properties delay Optional The number of milliseconds to delay the start of the animation. Defaults to 0. ...
...
Properties delay Optional The number of milliseconds to delay the start of the animation. Defaults to 0. ...
...by Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() to describe timing
properties for animation effects. These
properties are all optional, although without setting a duration the animation will not play. Simply put, these
properties describe how the user agent should go about making the transition from keyframe to keyframe, and how to behave when the animation begins and ends.
Properties delay Optional The number of milliseconds to delay the start of the animation. Defaults to 0. direction Optional Whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse). Defaults to "normal". duration Optional The number of milliseconds each ite...
ElementCSSInlineStyle.style - Web APIs
The style property has the same (and highest) priority in the CSS cascade as an inline style declaration set via the style attribute. ...
... The style property is used to get as well as set the inline style of an element. When getting, it returns a CSSStyleDeclaration object that contains a list of all styles
properties for that element with values assigned for the attributes that are defined in the element's inline style attribute. See the CSS
Properties Reference for a list of the CSS
properties accessible via style. The style property has the same (and highest) priority in the CSS cascade as an inline style declaration set via the style attribute. Setting styles Styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a CSSStyleDeclaration object which is also read-only. Instead, styles can be set by assigning ...
...ighest) priority in the CSS cascade as an inline style declaration set via the style attribute. Setting styles Styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a CSSStyleDeclaration object which is also read-only. Instead, styles can be set by assigning values to the
properties of style. For adding specific styles to an element without altering other style values, it is preferred to use the individual
properties of style (as in elt.style.color = '...') as using elt.style.cssText = '...' or elt.setAttribute('style', '...') sets the complete inline style for the element by overriding the existing inline styles. Note that the property names are in camel-case and not kebab-...
...untouched elt.style.color = "blue"; Getting style information The style property is not useful for completely learning about the styles applied on the element, since it represents only the CSS declarations set in the element's inline style attribute, not those that come from style rules elsewhere, such as style rules in the <head> section, or external style sheets. To get the values of all CSS
properties for an element you should use Window.getComputedStyle() instead. 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.getElem...
FileSystemFileEntry - Web APIs
Methods file() Creates a new File object which can be used to read the file. Obsolete methods createWriter() Creates a new FileWriter object which allows writing to the file represented by the file system entry. ...
... Methods file() Creates a new File object which can be used to read the file. ...
... Methods file() Creates a new File object which can be used to read the file. Obsolete methods createWriter() Creates a new FileWriter object which allows writing to the file represented by the file system entry. ...
... Methods file() Creates a new File object which can be used to read the file. Obsolete methods createWriter() Creates a new FileWriter object which allows writing to the file represented by the file system entry. ...
Fullscreen API - Web APIs
h many requiring vendor prefixes and/or not implementing the latest specification. See the Browser compatibility section below for details on support for this API. You may wish to consider using a library such as Fscreen for vendor agnostic access to the Fullscreen API. Interfaces The Fullscreen API has no interfaces of its own. Instead, it augments several other interfaces to add the methods,
properties, and event handlers needed to provide full-screen functionality. These are listed in the following sections. Methods The Fullscreen API adds methods to the Document and Element interfaces to allow turning off and on full-screen mode. Methods on the Document interface Document.exitFullscreen() Requests that the user agent switch from full-screen mode back to windowed mode. Returns a Promise...
...e full-screen mode has been completely 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. Returns a Promise which is resolved once full-screen mode has been activated.
Properties The Document interface provides
properties that can be used to determine if full-screen mode is supported and available, and if full-screen mode is currently active, which element is using the screen. DocumentOrShadowRoot.fullscreenElement The fullscreenElement property tells you the Element that's currently being displayed in full-screen mode on the DOM (or shadow DOM). If this is null, the...
... being allowed, or full-screen mode not being supported). Event handlers The Fullscreen API defines two events which can be used to detect when full-screen mode is turned on and off, as well as when errors occur during the process of changing between full-screen and windowed modes. Event handlers for these events are available on the Document and Element interfaces. Note: These event handler
properties are not available as HTML content attributes. In other words, you cannot specify event handlers for fullscreenchange and fullscreenerror in the HTML content. They must be added by JavaScript code. Event handlers on documents Document.onfullscreenchange An event handler for the fullscreenchange event that's sent to a Document when that document is placed into full-screen mode, or when that d...
... 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. Element.onfullscreenerror An event handler for the fullscreenerror event when sent to an element which has encountered an error while transitioning into or out of full-screen mode. Obsolete
properties Document.fullscreen A Boolean value which is true if the document has an element currently being displayed in full-screen mode; otherwise, this returns false. Note: Use the fullscreenElement property on the Document or ShadowRoot instead; if it's not null, then it's an Element currently being displayed in full-screen mode. Events The Fullscreen API defines two events which can be used...
HTMLEmbedElement - Web APIs
This topic describes the HTMLEmbedElement interface as defined in the standard. It does not address earlier, non-standardized version of the interface. ...
... HTMLEmbedElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "center", and "justify". HTMLEmbedElement.height Is a DOMString reflecting the height HTML attribute, containing the displayed height of ...
... HTMLEmbedElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "center", and "justify". HTMLEmbedElement.height Is a DOMString reflecting the height HTML attribute, containing the displayed height of the resource. HTMLEm...
...ce. HTMLEmbedElement.width Is a DOMString that reflects the width HTML attribute, containing the displayed width of the resource. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLEmbedElement' in that specification. Living Standard Adds two obsolete
properties, name and align, to help with compatibility with old Web sites. HTML5The definition of 'HTMLEmbedElement' in that specification. Recommendation Initial definition. ...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-base...
... HTMLFieldSetElement.disabled A Boolean reflecting the disabled HTML attribute, indicating whether the user can interact with the control. HTMLFieldSetElement.elementsRead only The elements belonging to this field set. The type of this property depends on the version of the spec that is implemented by the browser. HTMLFieldSetElement.formR...
... HTMLFieldSetElement.disabled A Boolean reflecting the disabled HTML attribute, indicating whether the user can interact with the control. HTMLFieldSetElement.elementsRead only The elements belonging to this field set. The type of this property depends on the version of the spec that is implemented by the browser. HTMLFieldSetElement.formRead only An HTMLFor...
...ate. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLFieldSetElement' in that specification. Living Standard HTML 5.1The definition of 'HTMLFieldSetElement' in that specification. Recommendation HTML5The definition of 'HTMLFieldSetElement' in that specification. Recommendation The following
properties have been added: disabled, elements, name, type, valdiationMessage, validity, and willValidate. The following methods have been added: checkValidity(), setCustomValidity(). Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLFieldSetElement' in that specification. Obsolete No change Document Object Model (DOM) Level 1 SpecificationThe definitio...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyli...
... HTMLHRElement.align Is a DOMString, an enumerated attribute indicating alignment of the rule with respect to the surrounding context. HTMLHRElement.color Is a DOMString representing the name of the color of the rule. HTMLHRElement.noshade Is a Boolean that sets the rule to have no shading. HTMLHRElement.size Is a DOMString re...
... HTMLHRElement.align Is a DOMString, an enumerated attribute indicating alignment of the rule with respect to the surrounding context. HTMLHRElement.color Is a DOMString representing the name of the color of the rule. HTMLHRElement.noshade Is a Boolean that sets the rule to have no shading. HTMLHRElement.size Is a DOMString representing the height...
...arent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHRElement' in that specification. Living Standard The color property has been added, as an obsolete property, to increase compatibility with the existing web. HTML5The definition of 'HTMLHRElement' in that specification. Recommendation Following
properties are now obsolete: align, noshade, size, and width. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLHRElement' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification. Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLHRElement' in that specification. Obsolete Initial definitio...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event...
... HTMLLIElement.type Is a DOMString representing the type of the bullets, "disc", "square" or "circle". As the standard way of defining the list type is via the CSS list-style-type property, use the CSSOM methods to set it via a script. HTMLLIElement.value Is a long indicating the ordinal position of the list element inside a given <ol>. It...
... HTMLLIElement.type Is a DOMString representing the type of the bullets, "disc", "square" or "circle". As the standard way of defining the list type is via the CSS list-style-type property, use the CSSOM methods to set it via a script. HTMLLIElement.value Is a long indicating the ordinal position of the list element inside a given <ol>. It reflects the value a...
...s via the CSS list-style-type property, use the CSSOM methods to set it via a script. HTMLLIElement.value Is a long indicating the ordinal position of the list element inside a given <ol>. It reflects the value attribute of the HTML <li> element, and can be smaller than 0. If the <li> element is not a child of an <ol> element, the property has no meaning. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLLIElement' in that specification. Living Standard HTML5The definition of 'HTMLLIElement' in that specification. Recommendation The following property is now obsolete: type. Document Object Model (DOM) Level 2 HTML Specificat...
HTMLMediaElement - Web APIs
The HTMLVideoElement and HTMLAudioElement elements both inherit this interface. ...
... HTMLMediaElement.audioTracks A AudioTrackList that lists the AudioTrack objects contained in the element. HTMLMediaElement.autoplay A Boolean that reflects the autoplay HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so ...
... HTMLMediaElement.audioTracks A AudioTrackList that lists the AudioTrack objects contained in the element. HTMLMediaElement.autoplay A Boolean that reflects the autoplay HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption. Note: Automatical...
...ly seeks to the given time. HTMLMediaElement.load() Resets the media to the beginning and selects the best available source from the sources provided using the src attribute or the <source> element. HTMLMediaElement.mozCaptureStream() [enter description] HTMLMediaElement.mozCaptureStreamUntilEnded() [enter description] HTMLMediaElement.mozGetMetadata() Returns Object, which contains
properties that represent metadata from the playing media resource as {key: value} pairs. A separate copy of the data is returned each time the method is called. This method must be called after the loadedmetadata event fires. HTMLMediaElement.pause() Pauses the media playback. HTMLMediaElement.play() Begins playback of the media. HTMLMediaElement.seekToNextFrame() Seeks to the next frame in the m...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text...
... Living Standard No change from latest snapshot, Unknown HTML 5.2The definition o...
... Living Standard No change from latest snapshot, Unknown HTML 5.2The definition of 'HTMLMenuElement' in that spec...
... Living Standard No change from latest snapshot, Unknown HTML 5.2The definition of 'HTMLMenuElement' in that specification. Recommendat...
HTMLMenuItemElement - Web APIs
The HTMLMenuItemElement interface provides special
properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating <menuitem> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarg...
... Recommendation Snapshot of the HTML Living Standard. Initial definition. ...
... Recommendation Snapshot of the HTML Living Standard. Initial definition. ...
... Recommendation Snapshot of the HTML Living Standard. Initial definition. ...
HTMLObjectElement - Web APIs
The HTMLObjectElement interface provides special
properties and methods (beyond those on the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4...
... HTMLObjectElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". HTMLObjectElement.archive Is a DOMString that reflects the archive HTML attribute, containing a list of archi...
... HTMLObjectElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". HTMLObjectElement.archive Is a DOMString that reflects the archive HTML attribute, containing a list of archives for resources for...
... Status Comment HTML Living StandardThe definition of 'HTMLObjectElement' in that specification. Living Standard HTML5The definition of 'HTMLObjectElement' in that specification. Recommendation The W3C specification is a latest of a previous version of HTML Living Standard Technically, the property tabindex is now defined on HTMLElement. The following
properties are now obsolete: align, archive, border, code, codeBase, codeType, declare, hspace, standby, and vspace. The following
properties have been added: typeMustMatch, contentWindow, willValidate, validity, and validationMessage. The following methods have been added: checkValidity() and setCustomValidity(). Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTML...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E5...
... HTMLParamElement.name Is a DOMString representing the name of the parameter. It reflects the name attribute. HTMLParamElement.value Is a DOMString representing the value associated to the parameter. It reflects the value attribute. HTMLParamElement.type Is a DOMString containing the type of the parameter when valueType has the "ref" val...
... HTMLParamElement.name Is a DOMString representing the name of the parameter. It reflects the name attribute. HTMLParamElement.value Is a DOMString representing the value associated to the parameter. It reflects the value attribute. HTMLParamElement.type Is a DOMString containing the type of the parameter when valueType has the "ref" value. It reflects the t...
...e values: "data", "ref", or "object". Methods No specific methods, inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLParamElement' in that specification. Living Standard HTML5The definition of 'HTMLParamElement' in that specification. Recommendation The following
properties are now obsolete: type, and valueType. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLParamElement' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification. Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLParamElement' in that specification. Obsolete Initial definition. ...
HTMLPreElement - Web APIs
The HTMLPreElement interface exposes specific
properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>). <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="m...
... HTMLPreElement.width Is a long value reflecting the obsolete width attribute, containing a fixed-size length for the <pre> element. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLPreElement' in t...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLPreElement' in that specification. ...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLPreElement' in that specification. ...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-base...
... HTMLProgressElement.max Is a double value reflecting the content attribute of the same name, limited to numbers greater than zero. Its default value is 1.0. HTMLProgressElement.positionRead only Returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indetermin...
... HTMLProgressElement.max Is a double value reflecting the content attribute of the same name, limited to numbers greater than zero. Its default value is 1.0. HTMLProgressElement.positionRead only Returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it ...
... value (max); if the progress bar is an indeterminate progress bar, it returns -1. HTMLProgressElement.value Is a double value that reflects the current value; if the progress bar is an indeterminate progress bar, it returns 0. HTMLProgressElement.labelsRead only Returns NodeList containing the list of <label> elements that are labels for this element. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLProgressElement' in that specification. Living Standard HTML 5.1The definition of 'HTMLProgressElement' in that specification. Recommendation HTML5The definition of 'HTMLProgressElement' in that specification. Recommend...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="midd...
... HTMLQuoteElement.cite Is a DOMString reflecting the cite HTML attribute, containing a URL for the source of the quotation. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLQuoteElement' in that speci...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLQuoteElement' in that specification. Living S...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLQuoteElement' in that specification. ...
HTMLSelectElement - Web APIs
The HTMLSelectElement interface represents a <select> HTML Element. These elements also share all of the
properties and methods of other HTML elements via the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline p...
... HTMLSelectElement.autofocus A Boolean reflecting the autofocus HTML attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specifi...
... HTMLSelectElement.autofocus A Boolean reflecting the autofocus HTML attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified. HTMLSelectElement.disabled A Bool...
...ment' in that specification. Living Standard Since the latest snapshot, HTML5, it adds the autocomplete property and the reportValidity() method. HTML5The definition of 'HTMLSelectElement' in that specification. Recommendation Is a snapshot of HTML Living Standard. It adds the autofocus, form, required, labels, selectedOptions, willValidate, validity and validationMessage
properties. The tabindex property and the blur() and focus() methods have been moved to HTMLElement. The methods item(), namedItem(), checkValidity() and setCustomValidity(). Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLSelectElement' in that specification. Obsolete options now returns an HTMLOptionsCollection. length now returns an unsigned long. ...
HTMLSpanElement - Web APIs
The HTMLSpanElement interface represents a <span> element and derives from the HTMLElement interface, but without implementing any additional
properties or methods. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 12...
... Methods This interface has no methods, but inherits methods from: HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLSpanElement' in that specification. Living Standard HTML 5.2The definition of 'HTMLSpanElement' in that spe...
... Methods This interface has no methods, but inherits methods from: HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLSpanElement' in that specification. Living Standard HTML 5.2The definition of 'HTMLSpanElement' in that specification. Recommendation ...
... y="65" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLSpanElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties, but inherits
properties from: HTMLElement. Methods This interface has no methods, but inherits methods from: HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLSpanElement' in that specification. Living Standard HTML 5.2The definition of 'HTMLSpanElement' in that specification. Recommendation HTML 5.1The defi...
HTMLStyleElement - Web APIs
The HTMLStyleElement interface represents a <style> element. It inherits
properties and methods from its parent, HTMLElement, and from LinkStyle. This interface doesn't allow to manipulate the CSS it contains (in most case). To manipulate CSS, see Using dynamic styling information for an overview of the objects used to manipulate specified CSS
properties using the DOM. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke...
... HTMLStyleElement.media Is a DOMString representing the intended destination medium for style information. HTMLStyleElement.type Is a DOMString representing the type of style being applied by this statement. HTMLStyleElement.disabled Is a Boolean value representing whether or not the stylesheet is disabled (true) ...
... HTMLStyleElement.media Is a DOMString representing the intended destination medium for style information. HTMLStyleElement.type Is a DOMString representing the type of style being applied by this statement. HTMLStyleElement.disabled Is a Boolean value representing whether or not the stylesheet is disabled (true) or not (false). Link...
...an value representing whether or not the stylesheet is disabled (true) or not (false). LinkStyle.sheet Read only Returns the StyleSheet object associated with the given element, or null if there is none HTMLStyleElement.scoped Is a Boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). Methods No specific method; inherits
properties from its parent, HTMLElement, and LinkStyle. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLStyleElement' in that specification. Living Standard HTML 5.1The definition of 'HTMLStyleElement' in that specification. Recommendation HTML5The definition of 'HTMLStyleElement' in that specification. Rec...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></...
... HTMLTableCaptionElement.align Is a DOMString which represents an enumerated attribute indicating alignment of the caption with respect to the table. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTM...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTableCaptionElement'...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTableCaptionElement' in that specification. Living Standard No change from HTML5. ...
HTMLTableElement - Web APIs
The HTMLTableElement interface provides special
properties and methods (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an HTML document. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" ali...
... HTMLTableElement.caption Is a HTMLTableCaptionElement representing the first <caption> that is a child of the element, or null if none is found. When set, if the object doesn't represent a <caption>, a DOMException with the HierarchyRequestError name is thrown. If a correct object is given, it is inserted in the tree as the first child of thi...
... HTMLTableElement.caption Is a HTMLTableCaptionElement representing the first <caption> that is a child of the element, or null if none is found. When set, if the object doesn't represent a <caption>, a DOMException with the HierarchyRequestError name is thrown. If a correct object is given, it is inserted in the tree as the first child of this element and the fir...
... a <thead> appear first, in tree order, and those members of a <tbody> last, also in tree order. The HTMLCollection is live and is automatically updated when the HTMLTableElement changes. HTMLTableElement.tBodiesRead only Returns a live HTMLCollection containing all the <tbody> of the element. The HTMLCollection is live and is automatically updated when the HTMLTableElement changes. Obsolete
Properties Warning: The following
properties are obsolete. You should avoid using them. HTMLTableElement.align Is a DOMString containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center". HTMLTableElement.bgColor Is a DOMString containing the ba...
HTMLTableRowElement - Web APIs
The HTMLTableRowElement interface provides special
properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an HTML table. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="...
... HTMLTableRowElement.align Is a DOMString containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center". HTMLTableRowElement.bgColor Is a DOMString containing the background color of the cel...
... HTMLTableRowElement.align Is a DOMString containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center". HTMLTableRowElement.bgColor Is a DOMString containing the background color of the cells. It reflects the o...
...lement' in that specification. Living Standard HTML5The definition of 'HTMLTableRowElement' in that specification. Recommendation The parameter of insertCell is now optional and default to -1. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLTableRowElement' in that specification. Obsolete The cells, rowIndex, and selectionRowIndex
properties are now read-only. The methods insertCell and deleteCell can raise exceptions. Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLTableRowElement' in that specification. Obsolete Initial definition. ...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">...
... HTMLUListElement.type Is a DOMString value reflecting the type and defining the kind of marker to be used to display. The values are browser dependent and have never been standardized. HTMLUListElement.compact Is a Boolean indicating that spacing between list items should be reduced. This property reflects the compact attribute only, it...
... HTMLUListElement.type Is a DOMString value reflecting the type and defining the kind of marker to be used to display. The values are browser dependent and have never been standardized. HTMLUListElement.compact Is a Boolean indicating that spacing between list items should be reduced. This property reflects the compact attribute only, it doesn't consider the...
... that behavior in modern pages. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLUListElement' in that specification. Living Standard HTML5The definition of 'HTMLUListElement' in that specification. Recommendation The compact and type
properties have been obsoleted. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLUListElement' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification. Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLUListElement' in that specification. Obsolete Initial definition. ...
HTMLUnknownElement - Web APIs
The HTMLUnknownElement interface represents an invalid HTML element and derives from the HTMLElement interface, but without implementing any additional
properties or methods. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="...
... Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLUnknownElement' in that specification. Living Standard No change from HTML5. HTML5The definition of 'HTMLUnknownElemen...
... Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLUnknownElement' in that specification. Living Standard No change from HTML5. HTML5The definition of 'HTMLUnknownElement' in that specification. Recommendation...
...oke-width="2px" /><text x="401" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLUnknownElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties No specific property; inherits
properties from its parent, HTMLElement. Methods No specific method; inherits
properties from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLUnknownElement' in that specification. Living Standard No change from HTML5. HTML5The definition of 'HTMLUnknownElement' in that specification. Recommendation Initial definition. ...
HTMLVideoElement - Web APIs
The list of supported media formats varies from one browser to the other. You should either provide your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered. ...
... HTMLVideoElement.height Is a DOMString that reflects the height HTML attribute, which specifies the height of the display area, in CSS pixels. HTMLVideoElement.poster Is a DOMString that reflects the poster HTML attribute, which specifies an image to show while no video data is available. HTMLVideoElement...
... HTMLVideoElement.height Is a DOMString that reflects the height HTML attribute, which specifies the height of the display area, in CSS pixels. HTMLVideoElement.poster Is a DOMString that reflects the poster HTML attribute, which specifies an image to show while no video data is available. HTMLVideoElement.videoHeight Read onl...
...ht of the resource in CSS pixels, or 0 if no media is available yet. HTMLVideoElement.videoWidth Read only Returns an unsigned integer value indicating the intrinsic width of the resource in CSS pixels, or 0 if no media is available yet. HTMLVideoElement.width Is a DOMString that reflects the width HTML attribute, which specifies the width of the display area, in CSS pixels. Gecko-specific
properties HTMLVideoElement.mozParsedFrames Read only Returns an unsigned long with the count of video frames that have been parsed from the media resource. HTMLVideoElement.mozDecodedFrames Read only Returns an unsigned long with the count of parsed video frames that have been decoded into images. HTMLVideoElement.mozPresentedFrames Read only Returns an unsigned long with the count of decoded...
PerformanceFrameTiming - Web APIs
PerformanceEntry.name Returns the document's address. PerformanceEntry.startTime Returns the timestamp when the frame was started. PerformanceEntry.duration R...
... PerformanceEntry.name Returns the document's address. PerformanceEntry.startTime Returns the timestamp when the frame was started. PerformanceEntry.duration Returns a timestamp indicating the ...
... PerformanceEntry.name Returns the document's address. PerformanceEntry.startTime Returns the timestamp when the frame was started. PerformanceEntry.duration Returns a timestamp indicating the difference between the startTimes of two successive frame...
... PerformanceEntry.name Returns the document's address. ...
PerformanceMark - Web APIs
PerformanceEntry.name Returns the name given to the mark when it was created via a call to performance.mark(). PerformanceEntry.startTime Returns the DOMHighResTimeStamp when performance.mark() was calle...
... PerformanceEntry.name Returns the name given to the mark when it was created via a call to performance.mark(). PerformanceEntry.startTime Returns the DOMHighResTimeStamp when performance.mark() was called. PerformanceEntry.duration Ret...
... PerformanceEntry.name Returns the name given to the mark when it was created via a call to performance.mark(). PerformanceEntry.startTime Returns the DOMHighResTimeStamp when performance.mark() was called. PerformanceEntry.duration Returns "0". (A mark has no duration.) Methods This inter...
...th="2px" /><text x="276" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceMark</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties but it extends the following PerformanceEntry
properties by qualifying/constraining the
properties as follows: PerformanceEntry.entryType Returns "mark". PerformanceEntry.name Returns the name given to the mark when it was created via a call to performance.mark(). PerformanceEntry.startTime Returns the DOMHighResTimeStamp when performance.mark() was called. PerformanceEntry.duration Returns "0". (A mark has no duration.) Methods This interface has no methods. Example See the exa...
PerformanceMeasure - Web APIs
PerformanceEntry.name Returns the name given to the measure when it was created via a call to performance.measure(). PerformanceEntry.startTime Returns a timestamp given to the measure when performan...
... PerformanceEntry.name Returns the name given to the measure when it was created via a call to performance.measure(). PerformanceEntry.startTime Returns a timestamp given to the measure when performance.measure() was called. Performa...
... PerformanceEntry.name Returns the name given to the measure when it was created via a call to performance.measure(). PerformanceEntry.startTime Returns a timestamp given to the measure when performance.measure() was called. PerformanceEntry.duration Returns a DOMHighResTimeStamp that is ...
...2px" /><text x="291" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceMeasure</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties but it extends the following PerformanceEntry
properties by qualifying/constrainting the
properties as follows: PerformanceEntry.entryType Returns "measure". PerformanceEntry.name Returns the name given to the measure when it was created via a call to performance.measure(). PerformanceEntry.startTime Returns a timestamp given to the measure when performance.measure() was called. PerformanceEntry.duration Returns a DOMHighResTimeStamp that is the duration of the measure (typically, the...
PerformancePaintTiming - Web APIs
PerformanceEntry.name Returns either "first-paint" or "first-contentful-paint". PerformanceEntry.startTime Returns the timestamp when the paint ocurred. Perfor...
... PerformanceEntry.name Returns either "first-paint" or "first-contentful-paint". PerformanceEntry.startTime Returns the timestamp when the paint ocurred. PerformanceEntry.duration Returns 0. ...
... PerformanceEntry.name Returns either "first-paint" or "first-contentful-paint". PerformanceEntry.startTime Returns the timestamp when the paint ocurred. PerformanceEntry.duration Returns 0. Methods This interface has no methods. Example functio...
... PerformanceEntry.name Returns either "first-paint" or "first-contentful-paint". ...
Pointer events - Web APIs
ice-specific handling is desired, pointer events defines a pointerType property to inspect the device type which produced the event. The events needed to handle generic pointer input are analogous to mouse events (mousedown/pointerdown, mousemove/pointermove, etc.). Consequently, pointer event types are intentionally similar to mouse event types. Additionally, a pointer event contains the usual
properties present in mouse events (client coordinates, target element, button states, etc.) in addition to new
properties for other forms of input: pressure, contact geometry, tilt, etc. In fact, the PointerEvent interface inherits all of the MouseEvent
properties, thus facilitating the migration of content from mouse events to pointer events. Terminology active buttons state The condition when a poin...
...ace is the PointerEvent interface which has a constructor plus several event types and associated global event handlers. The standard also includes some extensions to the Element and Navigator interfaces. The following sub-sections contain short descriptions of each interface and property. PointerEvent interface The PointerEvent interface extends the MouseEvent interface and has the following
properties. (All of the following
properties are Read only .) pointerId A unique identifier for the pointer causing the event. width The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer. height the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer. pressure the normalized pressure of the pointer input in the range of 0 to ...
...l.onpointermove = move_handler; el.onpointerup = up_handler; el.onpointercancel = cancel_handler; el.onpointerout = out_handler; el.onpointerleave = leave_handler; el.gotpointercapture = gotcapture_handler; el.lostpointercapture = lostcapture_handler; } </script> <body onload="init();"> <div id="target"> Touch me ... </div> </body> </html> Event
properties This example illustrates accessing all of a touch event's
properties. <html> <script> var id = -1; function process_id(event) { // Process this event based on the event's identifier } function process_mouse(event) { // Process the mouse pointer event } function process_pen(event) { // Process the pen pointer event } function process_touch(eve...
...cted the screen when there were no other active pens contacting the screen. Determining button states Some pointer devices, such as mouse and pen, support multiple buttons and the button presses can be chorded i.e. depressing an additional button while another button on the pointer device is already depressed. To determine the state of button presses, pointer events uses the button and buttons
properties of the MouseEvent interface (that PointerEvent inherits from). The following table provides the values of button and buttons for the various device button states. Device Button State button buttons Neither buttons nor touch/pen contact changed since last event -1 -- Mouse move with no buttons pressed, Pen moved while hovering with no buttons pressed ...
RTCRemoteOutboundRtpStreamStats - Web APIs
localId A DOMString which is used to find the local RTCInboundRtpStreamStats object which shares the same Synchronization Source (SSRC). ...
... localId A DOMString which is used to find the local RTCInboundRtpStreamStats object which shares the same Synchronization Source (SSRC). ...
... localId A DOMString which is used to find the local RTCInboundRtpStreamStats object which shares the same Synchronization Source (SSRC). ...
... localId A DOMString which is used to find the local RTCInboundRtpStreamStats object which shares the same Synchronization Source (SSRC). ...
RTCRtpStreamStats - Web APIs
RTCRtpStreamStats is the base class for all RTP-related statistics reports. It's based on RTCStats and adds the following additional fields. ...
... RTCRtpStreamStats is the base class for all RTP-related statistics reports. It's based on RTCStats and adds the following additional fields. ...
...hich interface the method is called on. RTCRtpStreamStats is the base class for all RTP-related statistics reports. It's based on RTCStats and adds the following additional fields. Note: This interface was called RTCRTPStreamStats until a specification update in the spring of 2017. Check the Browser compatibility table to know if and when the name change was implemented in specific browsers.
Properties The RTCRtpStreamStats dictionary is based on RTCStats, and inherits its
properties. In addition, some or all of the following
properties are available. Standard fields included for all media types codecId A DOMString which uniquely identifies the object which was inspected to produce the RTCCodecStats object associated with this RTP stream. kind A DOMString whose value is "audio" if the a...
...lue of MediaStreamTrack.id. transportId A DOMString uniquely identifying the object which was inspected to produce the RTCTransportStats object associated with this RTP stream. Obsolete fields mediaType Renamed to kind in the specification in February 2018. See Browser compatibility in RTCRtpStreamStats.kind to determine when browsers made the transition. Local-only measurements These
properties are computed locally, and are only available to the device receiving the media stream. Their primary purpose is to examine the error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is. firCount A count of the total number of Full Intra Request (FIR) packets received by the sender. This statistic is only available t...
SVGCursorElement - Web APIs
The SVGCursorElement interface provides access to the
properties of <cursor> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" s...
... SVGCursorElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <cursor> element. SVGCursorElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given <cursor> element. Methods This interface doesn't implement a...
... SVGCursorElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <cursor> element. SVGCursorElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given <cursor> element. Methods This interface doesn't implement any specific methods, but inherits methods...
...#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="401" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGCursorElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent, SVGElement, and implements
properties from SVGURIReference. SVGCursorElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <cursor> element. SVGCursorElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given <cursor> element. Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGElement. Specifications ...
SVGDefsElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits
properties from its parent, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGDefsElement' in that specific...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGDefsElement' in that specification. Candidate Recommendation Replaced the inherit...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGDefsElement' in that specification. Candidate Recommendation Replaced the inheritance from SVGElementSVGTe...
...aco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGDefsElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface doesn't implement any specific
properties, but inherits
properties from its parent, SVGGraphicsElement. Methods This interface doesn't implement any specific methods, but inherits
properties from its parent, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGDefsElement' in that specification. Candidate Recommendation Replaced the inheritance from SVGElementSVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable, and SVGTransformable by SVGGraphicsElement Scalable Vec...
SVGFEFloodElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement, and implements methods from SVGFilterPrimitiveStandardAttributes. Specifications ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement, and implements methods from SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filte...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement, and implements methods from SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effects Module Level 1T...
... x="396" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEFloodElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface doesn't implement any specific
properties, but inherits
properties from its parent interface, SVGElement, and implements
properties from SVGFilterPrimitiveStandardAttributes. Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement, and implements methods from SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFloodElement' in that specification. Wo...
SVGFEMergeElement - Web APIs
Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Spec...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effec...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effects Module Level 1The defi...
... x="396" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEMergeElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface not provide any specific
properties, but inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEMergeElement' in that specification. Working Draft ...
SVGFontElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGExternalResourcesRequired and SVGStylable. Specifications Specification Status Comment Sca...
... Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGExternalResourcesRequired and SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (S...
... Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGExternalResourcesRequired and SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The defini...
...ke="#D4DDE4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFontElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties but inherits
properties from its parent, SVGElement and implements
properties from SVGExternalResourcesRequired and SVGStylable. Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGExternalResourcesRequired and SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontElement' in that specification. Rec...
SVGForeignObjectElement - Web APIs
The SVGForeignObjectElement interface provides access to the
properties of <foreignObject> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121...
... SVGForeignObjectElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeignObjectElement.y Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeig...
... SVGForeignObjectElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeignObjectElement.y Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeignObjectElement.width Read only An SVGAn...
...e="#D4DDE4" stroke-width="2px" /><text x="146" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGForeignObjectElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent, SVGGraphicsElement and implements
properties from SVGURIReference. SVGForeignObjectElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeignObjectElement.y Read only An SVGAnimatedLength corresponding to the x attribute of the given <foreignObject> element. SVGForeignObjectElement.width Read only An SVGAnimatedLength corresponding to the width attribute of the given...
SVGMissingGlyphElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGMissingGlyphElement' in that s...
... Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGMissingGlyphElement' in that specification. Recomme...
...E4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGMissingGlyphElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties but inherits
properties from its parent, SVGElement and implements
properties from SVGStylable. Methods This interface has no methods but inherits methods from its parent, SVGElement and implements methods from SVGStylable. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGMissingGlyphElement' in that specification. Recommendation Initial definition ...
SVGSymbolElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement, and implements methods from SVGFitToViewBox. Specifications Specification ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement, and implements methods from SVGFitToViewBox. Specifications Specification Status Comment Scalable Vector Graphics (SVG) ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement, and implements methods from SVGFitToViewBox. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGSy...
..." y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGSymbolElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface doesn't implement any specific
properties, but inherits
properties from its parent interface, SVGGraphicsElement, and implements
properties from SVGFitToViewBox. Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement, and implements methods from SVGFitToViewBox. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGSymbolElement' in that specification. Candidate Recommendation Change...
SVGTRefElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGTextPositioningElement and implements
properties from SVGURIReference. Specifications Specification Status Comment Scalable Vector Graphics (SV...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definit...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGTRefElement' ...
...roke-width="2px" /><text x="71" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGTRefElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface has no
properties but inherits
properties from its parent, SVGTextPositioningElement and implements
properties from SVGURIReference. Methods This interface has no methods but inherits methods from its parent, SVGTextPositioningElement and implements
properties from SVGURIReference. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGTRefElement' in that specification. Recommendation Initial definition ...
SVGUseElement - Web APIs
SVGUseElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given element. SVGUseElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given element. SVGUseElement.width Read only An SVGAnimatedLengt...
... SVGUseElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given element. SVGUseElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given element. SVGUseElement.width Read only An SVGAnimatedLength corresponding to the width attribute of...
...e="#D4DDE4" stroke-width="2px" /><text x="196" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGUseElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGGraphicsElement and implements
properties from SVGURIReference. SVGUseElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given element. SVGUseElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given element. SVGUseElement.width Read only An SVGAnimatedLength corresponding to the width attribute of the given element. SVGUseElement.height Read only An SVGAnimatedLeng...
...returns null. Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement and implements methods from SVGURIReference. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGUseElement' in that specification. Candidate Recommendation Redefined the
properties instanceRoot and animatedInstanceRoot. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGUseElement' in that specification. Recommendation Initial definition ...
StylePropertyMapReadOnly.get() - Web APIs
The get() method of the StylePropertyMapReadOnly interface returns a CSSStyleValue object for the first value of the specified property. Syntax var declarationBlock = StylePropertyMapReadOnly.get(property) Parameters property The name of the property to retrieve the value of. Return value A CSSStyleValue object. Examples Let's get just a few
properties and values. Let's start by creating a link inside a paragraph in our HTML, and adding a definition list which we will populate with JavaScript: <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> We add a bit of CSS, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } We use the Element's computedStyleMap() to return a StylePr...
...definition list which we will populate with JavaScript: <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> We add a bit of CSS, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } We use the Element's computedStyleMap() to return a StylePropertyMapReadOnly object. ...
...eate an array of
properties of interest and use the StylePropertyMapReadOnly's get() method to get only those values. ...
...element const myElement = document.querySelector('a'); // get the <dl> we'll be populating const stylesList = document.querySelector('#regurgitation'); // Retrieve all computed styles with computedStyleMap() const styleMap = myElement.computedStyleMap(); // array of
properties we're interested in const ofInterest = ['font-weight', 'border-left-color', 'color', '--colour']; // iterate thru our
properties of interest for ( let i = 0; i < ofInterest.length; i++ ) { //
properties const cssProperty = document.createElement('dt'); cssProperty.appendChild(document.createTextNode(ofInterest[i])); stylesList.appendChild(cssProperty); // values const cssValue = document.createElement('dd'); cssValue.appendChild(document.createTextNode( styleMap.get(ofInterest[i]))); stylesList.appendChil...
WebRTC connectivity - Web APIs
answer to the caller. The caller receives the answer. The caller calls RTCPeerConnection.setRemoteDescription() to set the answer as the remote description for its end of the call. It now knows the configuration of both peers. Media begins to flow as configured. Pending and current descriptions Taking one step deeper into the process, we find that localDescription and remoteDescription, the
properties which return these two descriptions, aren't as simple as they look. Because during renegotiation, an offer might be rejected because it proposes an incompatible format, it's necessary that each endpoint have the ability to propose a new format but not actually switch to it until it's accepted by the other peer. For that reason, WebRTC uses pending and current descriptions. The current descriptio...
...rejected because it proposes an incompatible format, it's necessary that each endpoint have the ability to propose a new format but not actually switch to it until it's accepted by the other peer. For that reason, WebRTC uses pending and current descriptions. The current description (which is returned by the RTCPeerConnection.currentLocalDescription and RTCPeerConnection.currentRemoteDescription
properties) represents the description currently in actual use by the connection. This is the most recent connection that both sides have fully agreed to use. The pending description (returned by RTCPeerConnection.pendingLocalDescription and RTCPeerConnection.pendingRemoteDescription) indicates a description which is currently under consideration following a call to setLocalDescription() or setRemoteDescr...
...'t a pending description. The pendingLocalDescription contains not just the offer or answer under consideration, but any local ICE candidates which have already been gathered since the offer or answer was created. Similarly, pendingRemoteDescription includes any remote ICE candidates which have been provided by calls to RTCPeerConnection.addIceCandidate(). See the individual articles on these
properties and methods for more specifics, and Codecs used by WebRTC for information about codecs supported by WebRTC and which are compatible with which browsers. The codecs guide also offers guidance to help you choose the best codecs for your needs. ICE candidates As well as exchanging information about the media (discussed above in Offer/Answer and SDP), peers must exchange information about the netwo...
...s to an ongoing session. Aborting the call would be an excessive reaction in that situation. Instead, you can initiate an ICE rollback. A rollback restores the SDP offer (and the connection configuration by extension) to the configuration it had the last time the connection's signalingState was stable. To programmatically initiate a rollback, send a description whose type is rollback. Any other
properties in the description object are ignored. In addition, the ICE agent will automatically initiate a rollback when a peer that had previously created an offer receives an offer from the remote peer. In other words, if the local peer is in the state have-local-offer, indicating that the local peer had previously sent an offer, calling setRemoteDescription() with a received offer triggers rollback so t...
Using the Web Animations API - Web APIs
imation effects. It is one of the most performant ways to animate on the Web, letting the browser make its own internal optimizations without hacks, coercion, or Window.requestAnimationFrame(). With the Web Animations API, we can move interactive animations from stylesheets to JavaScript, separating presentation from behavior. We no longer need to rely on DOM-heavy techniques such as writing CSS
properties and scoping classes onto elements to control playback direction. And unlike pure, declarative CSS, JavaScript also lets us dynamically set values from
properties to durations. For building custom animation libraries and creating interactive animations, the Web Animations API might be the perfect tool for the job. Let's see what it can do! Browser Support The basic Web Animations API features di...
... Currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence). If your keyframe list has only one entry, Element.animate() may throw a NotSupportedError exception in some browsers until they are updated. So to recap, the keys are equally spaced by default unless you specify an offset on a key. Handy, no? Representing timing
properties We'll also need to create an object of timing
properties (an AnimationEffectTiming
Properties object) corresponding to the values in Alice's animation: var aliceTiming = { duration: 3000, iterations: Infinity } You'll notice a few differences here from how equivalent values are represented in CSS: For one, the duration is in milliseconds as opposed to seconds -- 3000 not 3s. Like WindowT...
...ime to bring them both together with the Element.animate() method: document.getElementById("alice").animate( aliceTumbling, aliceTiming ) And boom: the animation starts playing (see the finished version on Codepen). The animate() method can be called on any DOM element that could be animated with CSS. And it can be written in several ways. ...
...We can divide her duration in half to get the midpoint for her animation's timeline, setting her to be normal height. Now we can reverse and play her animation in either direction to make her grow smaller or larger! And we can do th...
window.postMessage() - Web APIs
The ownership of these objects is given to the destination side and they are no longer usable on the sending side. The dispatched event otherWindow can listen for dispatched messages by executing the following JavaScript: window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { if (event.origin !== "http://example.org:8080") return; // ... } The
properties of the dispatched message are: data The object passed from the other window. origin The origin of the window that sent the message at the time postMessage was called. This string is the concatenation of the protocol and "://", the host name if one exists, and ":" followed by a port number if a port is present and differs from the default port for the given protocol. Examples of typical orig...
... establish two-way communication between two windows with different origins. Security concerns If you do not expect to receive messages from other sites, do not add any event listeners for message events. This is a completely foolproof way to avoid security problems. If you do expect to receive messages from other sites, always verify the sender's identity using the origin and possibly source
properties. Any window (including, for example, http://evil.example.com) can send a message to any other window, and you have no guarantees that an unknown sender will not send malicious messages. Having verified identity, however, you still should always verify the syntax of the received message. Otherwise, a security hole in the site you trusted to send only trusted messages could then open a cross-site s...
... event.origin); } window.addEventListener("message", receiveMessage, false); Notes Any window may access this method on any other window, at any time, regardless of the location of the document in the window, to send it a message. Consequently, any event listener used to receive messages must first check the identity of the sender of the message, using the origin and possibly source
properties. This cannot be overstated: Failure to check the origin and possibly source
properties enables cross-site scripting attacks. As with any asynchronously-dispatched script (timeouts, user-generated events), it is not possible for the caller of postMessage to detect when an event handler listening for events sent by postMessage throws an exception. postMessage() schedules the MessageEvent to be di...
... The value of the origin property when the sending window contains a javascript: or data: URL is the origin of the script that loaded the URL. Using window.postMessage in extensions window.postMessage is available to JavaScript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (The other
properties have their expected values.) It is not possible for content or web context scripts to specify a targetOrigin to communicate directly with an extension (either the background script or a content script). Web or content scripts can use window.postMessage with a targetOrigin of "*" to broadcast to every listener, but this is discouraged, since an extension cannot be certain the origin of such messa...
WorkerGlobalScope - Web APIs
in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. This interface is usually specialized by each worker type: DedicatedWorkerGlobalScope for dedicated workers, SharedWorkerGlobalScope for shared workers, and ServiceWorkerGlobalScope for ServiceWorker. The self property returns the specialized scope for each context.
Properties This interface inherits
properties from the EventTarget interface and WindowOrWorkerGlobalScope and WindowEventHandlers mixins. Standard
properties WorkerGlobalScope.navigator Read only Returns the WorkerNavigator associated with the worker. It is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers. WorkerGlobalScope.self Read only R...
...eturns a reference to the WorkerGlobalScope itself. Most of the time it is a specific scope like DedicatedWorkerGlobalScope, SharedWorkerGlobalScope or ServiceWorkerGlobalScope. WorkerGlobalScope.location Read only Returns the WorkerLocation associated with the worker. It is a specific location object, mostly a subset of the Location for browsing scopes, but adapted to workers. Non-standard
properties WorkerGlobalScope.performance Read only Returns the Performance associated with the worker. It is a regular performance object, except that only a subset of its property and methods are available to workers. WorkerGlobalScope.console Read only Returns the Console associated with the worker.
Properties implemented from elsewhere WindowOrWorkerGlobalScope.caches Read only Returns...
...losing this particular scope. In newer browser versions, close() is available on DedicatedWorkerGlobalScope and SharedWorkerGlobalScope instead. This change was made to stop close() being available on service workers, as it isn't supposed to be used there and always throws an exception when called (see bug 1336043). Example You won't access WorkerGlobalScope directly in your code; however, its
properties and methods are inherited by more specific global scopes such as DedicatedWorkerGlobalScope and SharedWorkerGlobalScope. For example, you could import another script into the worker and print out the contents of the worker scope's navigator object using the following two lines: importScripts('foo.js'); console.log(navigator); Since the global scope of the worker script is effectively the globa...
...from WorkerGlobalScope, you can run lines such as those above without specifying a parent object. Specifications Specification Status Comment HTML Living StandardThe definition of 'WorkerGlobalScope' in that specification. Living Standard ...
Accessibility documentation index - Accessibility
t consists of the IDs of the HTML elements you want to concatenate into a single accessible name. 12 How to file ARIA-related bugs ARIA, Bugzilla The state of ARIA technology has always depended on the community. If you notice an implementation issue, please take a little time and let the developers know. ...
...depended on the community. If you notice an implementation issue, please take a little time and let the developers know. 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. Authors must assign an ARIA role and the appropriate states and
properties to an element during its life-cycle, unless the element already has appropriate ARIA semantics (via use of an appropriate HTML element). Addition of ARIA semantics only exposes extra information to a browser's accessibility API, and does not affect a page's DOM. 14 ARIA Technique Te...
... the maximum value allowed for a range widget such as a slider, spinbutton or progressbar. 27 Using the aria-valuemin attribute ARIA, Accessibility, NeedsContent The aria-valuemin attribute is used to define the minimum value allowed for a range widget such as a slider, spinbutton or progressbar. If the aria-valuenow has a known maximum and minimum, the author SHOULD provide
properties for aria-valuemax and aria-valuemin.The value of aria-valuemin MUST be less than or equal to the value of aria-valuemax. 28 Using the aria-valuenow attribute ARIA, Accessibility, NeedsContent The aria-valuenow attribute is used to define the current value for a range widget such as a slider, spinbutton or progressbar. If the current value is not known, the author should not s...
...l default of reading in document source order. The property serves to define element relationships utilizing ARIA relationship attributes and the aria-flowto property. 41 WAI-ARIA Roles ARIA, ARIA Roles, Accessibility, Reference, Roles This page lists reference pages covering all the WAI-ARIA roles discussed on MDN. For a full list of roles, see Using ARIA: Roles, States, and
Properties 42 ARIA: Comment role ARIA, ARIA Role, Comment, Reference, annotations The comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment. 43 ARIA: Complementary role ARIA, ARIA Role, Reference, role-complementary The complementary landmark role is used to designate a supporting section that relates to ...
-moz-outline-radius - CSS: Cascading Style Sheets
and property can be used to give an element's outline rounded corners. /* One value */ -moz-outline-radius: 25px; /* Two values */ -moz-outline-radius: 25px 1em; /* Three values */ -moz-outline-radius: 25px 1em 12%; /* Four values */ -moz-outline-radius: 25px 1em 12% 4mm; /* Global values */ -moz-outline-radius: inherit; -moz-outline-radius: initial; -moz-outline-radius: unset; Constituent
properties This property is a shorthand for the following CSS
properties: -moz-outline-radius-bottomleft -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright Syntax Values Elliptical outlines and <percentage> values follow the syntax described in border-radius. One, two, three or four <outline-radius> values, represents one of: <length> See <length> for po...
...set, the first one applies to the top-Left corner, the second one to the top-right and bottom-left corners and the third one to the bottom-right corner. If four values are set, the first one applies to the top-left corner, the second one to the top-right corner, the third one to the bottom-right corner and the fourth one to the bottom-left corner. ...
... corner, the second one to the top-right corner, the third one to the bottom-right corner and the fourth one to the bottom-left corner. ...
...he
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 border boxComputed valueas each of the
properties of the shorthand:-moz-outline-radius-topleft: as specified-moz-outline-radius-topright: as specified-moz-outline-radius-bottomright: as specified-moz-outline-radius-bottomleft: as specifiedAnimation typeas each of the
properties of the shorthand:-moz-outline-radius-topleft: a length, percentage or calc();-moz-outline-radius-topright: a length, percentage or calc();-moz-outline-radius-bottomright:...
-webkit-border-before - CSS: Cascading Style Sheets
It relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. This property is on the standard track as border-block-start. ...
...t, and -webkit-border-end, which define the other borders of the element. This property is on the standard track as border-block-start. ...
...r more of the following, in any order: <'border-width'> See border-width <'border-style'> See border-style <'color'> See color Formal definition Initial valueas each 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 ...
...If it isn't, it will be the rgb() corresponding one. ...
:visited - CSS: Cascading Style Sheets
er, or :active) that has at least equal specificity. To style links appropriately, put the :visited rule after the :link rule but before the :hover and :active rules, as defined by the LVHA-order: :link -- :visited -- :hover -- :active. Styling restrictions For privacy reasons, browsers strictly limit which styles you can apply using this pseudo-class, and how they can be used: Allowable CSS
properties are color, background-color, border-color, border-bottom-color, border-left-color, border-right-color, border-top-color, column-rule-color, outline-color, text-decoration-color, and text-emphasis-color. Allowable SVG attributes are fill and stroke. The alpha component of the allowed styles will be ignored. The alpha component of the element's non-:visited state will be used instead, except when...
... is 0, in which case the style set in :visited will be ignored entirely. Although these styles can be change the appearance of colors to the end user, the window.getComputedStyle method will lie and always return the value of the non-:visited color. Note: For more information on these limitations and the reasons behind them, see Privacy and the :visited selector. Syntax :visited Examples
Properties that would otherwise have no color or be transparent cannot be modified with :visited. Of the
properties that can be set with this pseudo-class, your browser probably has a default value for color and column-rule-color only. Thus, if you want to modify the other
properties, you'll need to give them a base value outside the :visited selector. HTML <a href="#test-visited-link">Have you visited th...
...is pseudo-class, your browser probably has a default value for color and column-rule-color only. Thus, if you want to modify the other
properties, you'll need to give them a base value outside the :visited selector. HTML <a href="#test-visited-link">Have you visited this link yet?</a><br> <a href="">You've already visited this link.</a> CSS a { /* Specify non-transparent defaults to certain
properties, allowing them to be styled with the :visited state */ background-color: white; border: 1px solid white; } a:visited { background-color: yellow; border-color: hotpink; color: hotpink; } Result Specifications Specification Status Comment HTML Living StandardThe definition of ':visited' in that specification. Living Standard Selectors...
...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 Full support 8Opera Full support 15Safari F...
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
Every box is composed of four parts (or areas), defined by their respective edges: the content edge, padding edge, border edge, and margin edge. The content area, bounded by the content edge, contains the "real" content of the element, such as text, an image, or a video player. ...
... a video player. Its dimensions are the content width (or content-box width) and the content height (or content-box height). It often has a background color or background image. If the box-sizing property is set to content-box (default) and if the element is a block element, the content area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height
properties. The padding area, bounded by the padding edge, extends the content area to include the element's padding. Its dimensions are the padding-box width and the padding-box height. The thickness of the padding is determined by the padding-top, padding-right, padding-bottom, padding-left, and shorthand padding
properties. The border area, bounded by the border edge, extends the padding area to inclu...
...The thickness of the padding is determined by the padding-top, padding-right, padding-bottom, padding-left, and shorthand padding
properties. The border area, bounded by the border edge, extends the padding area to include the element's borders. Its dimensions are the border-box width and the border-box height. The thickness of the borders are determined by the border-width and shorthand border
properties. If the box-sizing property is set to border-box, the border area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height
properties. When there is a background (background-color or background-image) set on a box, it extends to the outer edge of the border (i.e. extends underneath the border in z-ordering). This default behavior can be altered wit...
... behavior can be altered with the background-clip css property. The margin area, bounded by the margin edge, extends the border area to include an empty area used to separate the element from its neighbors. Its dimensions are the margin-box width and the margin-box height. The size of the margin area is determined by the margin-top, margin-right, margin-bottom, margin-left, and shorthand margin
properties. When margin collapsing occurs, the margin area is not clearly defined since margins are shared between boxes. 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 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. ...
... 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. ...
... 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. ...
... 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. Reference
Properties Properties controlling the flow of content in a box overflow overflow-x overflow-y
Properties controlling the size of a box height width max-height max-width min-height min-width
Properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim
Properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top Other
properties visibility Guides Introduction to the CSS box model Explains one of the fundamental concept of CSS: the box model. This model defines how...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
ains how the specification works with some common use case examples. 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 happens in the same way that content is fragmented into pages when we work with CSS Paged Media, for example by creating a print stylesheet. The
properties defined by the specification are: column-width column-count columns column-rule-color column-rule-style column-rule-width column-rule column-span column-fill column-gap By adding column-count or column-width to an element, that element becomes a multi-column container, or multicol container for short. The columns are anonymous boxes and described as column boxes in the specification...
...column-rule-style column-rule-width column-rule column-span column-fill column-gap By adding column-count or column-width to an element, that element becomes a multi-column container, or multicol container for short. The columns are anonymous boxes and described as column boxes in the specification. Defining columns To create a multicol container you must use at least one of the column-*
properties, these being column-count and column-width. The column-count property The column-count property specifies the number of columns that you would like the content to be displayed as. The browser will then assign the correct amount of space to each column box to create the requested number of columns. In the below example we use the column-count property to create three columns on the .container e...
... box will only shrink to be smaller than the declared column width in the case of a single column with less available width than the value of column-width. In the below example we use the column-width property with a value of 200px. We get as many 200 pixel columns as will fit the container, with the extra space shared equally. Using column-count and column-width together If you specify both
properties on a multicol container then column-count will act as a maximum number of columns. Therefore the behaviour as described for column-width will happen, until the number of columns in column-count is reached. After this point no more columns will be drawn, and the extra space is distributed evenly between the existing columns, even if there is enough room for more columns of the specified column-wid...
...en column-count will act as a maximum number of columns. Therefore the behaviour as described for column-width will happen, until the number of columns in column-count is reached. After this point no more columns will be drawn, and the extra space is distributed evenly between the existing columns, even if there is enough room for more columns of the specified column-width size. When using both
properties together you may get fewer columns than specified in the value for column-count. In this next example we use column-width of 200px and column-count of 2. Even if there is space for more than two columns, we get two. If there is not enough space for two columns of 200px, however, we get one. The columns shorthand You can use the columnsshorthand to set column-count and column-width. If you se...
Using multi-column layouts - CSS: Cascading Style Sheets
h line they were on. Therefore, to make maximum use of a large screen, authors should have limited-width columns of text placed side by side, just as newspapers do. Unfortunately this is impossible to do with CSS and HTML without forcing column breaks at fixed positions, or severely restricting the markup allowed in the text, or using heroic scripting. This limitation is solved by adding new CSS
properties to extend the traditional block layout mode. Using columns Column count and width Two CSS
properties control whether and how many columns will appear: column-count and column-width. The column-count property sets the number of columns to a particular number. E.g., Example 1 HTML <div id="col"> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor in...
...rum </div> CSS #wid { column-width: 100px; } Result The exact details are described in the CSS3 specification. In a multi-column block, content is automatically flowed from one column into the next as needed. All HTML, CSS and DOM functionality is supported within columns, as are editing and printing. The columns shorthand Most of the time, a Web designer will use one of the two CSS
properties: column-count or column-width. As values for these
properties do not overlap, it is often convenient to use the shorthand columns. E.g. The CSS declaration column-width: 12em can be replaced by columns: 12em. Example 3 HTML <div id="col_short"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim v...
... the heights of the content in each column are approximately equal. Firefox does this. However, in some situations it is also useful to set the maximum height of the columns explicitly, and then lay out content starting at the first column and creating as many columns as necessary, possibly overflowing to the right. Therefore, if the height is constrained, by setting the CSS height or max-height
properties on a multi-column block, each column is allowed to grow to that height and no further before adding new column. This mode is also much more efficient for layout. Column Gaps There is a gap between columns. The recommended default is 1em. This size can be changed by applying the column-gap property to the multi-column block: Example 6 HTML <div id="column_gap"> Lorem ipsum dolor sit amet, ...
...ation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> CSS #column_gap { column-count: 5; column-gap: 2em; } Result Graceful Degradation The column
properties will just be ignored by non-columns-supporting browsers. Therefore it's relatively easy to create a layout that will display in a single column in those browsers and use multiple columns in supporting browsers. Conclusion CSS3 columns are a layout primitive that will help Web developers make the best use of screen real estate. Imaginative developers may find many uses for them, especially with ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
and then the grid on this element will be overlaid in the browser window. As you learn and then work with the CSS Grid Layout this tool will give you a better idea of what is happening with your grids visually. If we want to start making this more grid-like we need to add column tracks. Grid Tracks We define rows and columns on our grid with the grid-template-columns and grid-template-rows
properties. These define grid tracks. A grid track is the space between any two lines on the grid. In the below image you can see a track highlighted - this is the first row track in our grid. I can add to our earlier example by adding the grid-template-columns property, then defining the size of the column tracks. I have now created a grid with three 200-pixel-wide column tracks. The child items will b...
...ace something outside of the defined grid--or due to the amount of content, more grid tracks are needed--then the grid creates rows and columns in the implicit grid. These tracks will be auto-sized by default, resulting in their size being based on the content that is inside them. You can also define a set size for tracks created in the implicit grid with the grid-auto-rows and grid-auto-columns
properties. In the below example we use grid-auto-rows to ensure that tracks created in the implicit grid are 200 pixels tall. <div class="wrapper"> <div>One</div> <div>Two</div> <div>Three</div> <div>Four</div> <div>Five</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 200px; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f...
...ing items against lines We will be exploring line based placement in full detail in a later article. The following example demonstrates doing this in a simple way. When placing an item, we target the line - rather than the track. In the following example I am placing the first two items on our three column track grid, using the grid-column-start, grid-column-end, grid-row-start and grid-row-end
properties. Working from left to right, the first item is placed against column line 1, and spans to column line 4, which in our case is the far-right line on the grid. It begins at row line 1 and ends at row line 3, therefore spanning two row tracks. The second item starts on grid column line 1, and spans one track. This is the default so I do not need to specify the end line. It also spans two row tracks...
...have highlighted the first cell of the grid. Grid areas Items can span one or more cells both by row or by column, and this creates a grid area. Grid areas must be rectangular - it isn't possible to create an L-shaped area for example. The highlighted grid area spans two row and two column tracks. Gutters Gutters or alleys between grid cells can be created using the column-gap and row-gap
properties, or the shorthand gap. In the below example, I am creating a 10-pixel gap between columns and a 1em gap between rows. .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 10px; row-gap: 1em; } Note: When grid first shipped in browsers the column-gap, row-gap and gap were prefixed with the grid- prefix as grid-column-gap, grid-row-gap and grid-gap respectively. ...
Grid template areas - CSS: Cascading Style Sheets
.media .text { grid-area: content; padding: 10px; } <div class="media flipped"> <div class="image"></div> <div class="text">This is a media object example. We can use grid-template-areas to switch around the image and text part of the media object. </div> </div> Grid definition shorthands Having looked at various ways of placing items on our grids and many of the
properties used to define grid, this is a good time to take a look at a couple of shorthands that are available for defining the grid and many things about it all in one line of CSS. These can quickly become difficult to read for other developers, or even your future self. However they are part of the specification and it is likely you will come across them in examples or in use by other developers, even i...
...hings about it all in one line of CSS. These can quickly become difficult to read for other developers, or even your future self. However they are part of the specification and it is likely you will come across them in examples or in use by other developers, even if you choose not to use them. Before using any shorthand it is worth remembering that shorthands not only enable the setting of many
properties in one go, they also act to reset things to their initial values that you do not, or cannot set in the shorthand. Therefore if you use a shorthand, be aware that it may reset things you have applied elsewhere. The two shorthands for the grid container are the Explicit Grid Shorthand grid-template and the Grid Definition Shorthand grid. grid-template The grid-template property sets the followin...
...n one go, they also act to reset things to their initial values that you do not, or cannot set in the shorthand. Therefore if you use a shorthand, be aware that it may reset things you have applied elsewhere. The two shorthands for the grid container are the Explicit Grid Shorthand grid-template and the Grid Definition Shorthand grid. grid-template The grid-template property sets the following
properties: grid-template-rows grid-template-columns grid-template-areas The property is referred to as the Explicit Grid Shorthand because it is setting those things that you control when you define an explicit grid, and not those which impact any implicit row or column tracks that might be created. The following code creates a layout using grid-template that is the same as the layout created earli...
..., auto) / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ; } The first value is our grid-template-areas value but we also declare the size of the row at the end of each row. This is what the minmax(100px, auto) is doing. Then after grid-template-areas we have a forward slash, after that is an explicit track listing of column tracks. grid The grid shorthand goes a step further and also sets
properties used by the implicit grid. So you will be setting: grid-template-rows grid-template-columns grid-template-areas grid-auto-rows grid-auto-columns grid-auto-flow The property also resets the grid-gap property to 0, however you cannot specify the gaps in this shorthand. You can use this syntax in the exact same way as the grid-template shorthand, just be aware than when doing so you will ...
CSS reference - CSS: Cascading Style Sheets
The syntax for each specified value depends on the data type defined for each specified property. ...
...The syntax for each specified value depends on the data type defined for each specified property. ...
... pseudo-classes, pseudo-elements, data types, and at-rules. You can also browse key CSS concepts and a list of selectors organized by type. Also included is a brief DOM-CSS / CSSOM reference. Basic rule syntax Style rule syntax style-rule ::= selectors-list {
properties-list } ... where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list]
properties-list ::= [property : value] [;
properties-list] See the index of selectors, pseudo-classes, and pseudo-elements below. The syntax for each specified value depends on the data type defined for each specified property. Style rule examples strong { color: red; } div.menu-bar li:hover > ul { display: block; } For a beginner-level introduction to the syntax of selectors, see our guide o...
...tiple columns are considered to be a member of all of those columns. Pseudo Pseudo classes : Specifies a special state of the selected element(s). Pseudo elements :: Represents entities that are not included in HTML. See also: Selectors in the Selectors Level 4 specification. ...
animation - CSS: Cascading Style Sheets
NIMATION.forEach(function (node, index) { node.addEventListener('animationstart', function () { toggleButton(BUTTON[index], 'pause'); }); node.addEventListener('animationend', function () { toggleButton(BUTTON[index], 'restart'); }); }); BUTTON.forEach(function (btn, index) { btn.addEventListener('click', function () { playPause(index); }); }); }) A description of which
properties are animatable is available; it's worth noting that this description is also valid for CSS transitions. Constituent
properties This property is a shorthand for the following CSS
properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function Syntax The animation property i...
...o, one, or two <time> values The order of values within each animation definition is important: the first value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay. The order within each animation definition is also important for distinguishing animation-name values from other keywords. When parsed, keywords that are valid for
properties other than animation-name, and whose values were not found earlier in the shorthand, must be accepted for those
properties rather than for animation-name. Furthermore, when serialized, default values of other
properties must be output in at least the cases necessary to distinguish an animation-name that could be a value of another property, and may be output in additional cases. Values <singl...
...sed a preference for no animated experiences. Designing Safer Web Animation For Motion Sensitivity . ...
...nderstanding 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 Formal syntax <single-animation>#where <single-animation> = <time> | <timing-function> | <...
border-style - CSS: Cascading Style Sheets
The border-style shorthand CSS property sets the line style for all four sides of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rder-style shorthand CSS property sets the line style for all four sides of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...et. When applied to a table cell with border-collapse set to collapsed, this value behaves like groove. outset Displays a border that makes the element appear embossed. It is the opposite of inset. When applied to a table cell with border-collapse set to collapsed, this value behaves like ridge. ...
...osite of inset. When applied to a table cell with border-collapse set to collapsed, this value behaves like ridge. 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. It also applies to ::first-letter.InheritednoComputed valueas each of the
properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedAnimation typediscrete Formal syntax <line-style>{1,4}where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset Examples Table with all property values Here is an example of all the property values. HTML ...
column-rule - CSS: Cascading Style Sheets
CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is a shorthand property that sets the individual column-rule-*
properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color. Note: As with all shorthand
properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand
properties). Syntax column-rule: dotted; column-rule: solid 8px; column-rule: solid blue; column-rule: thick...
...he column-rule property is specified as one, two, or three of the values listed below, in any order. Values <'column-rule-width'> Is a <length> or one of the three keywords, thin, medium, or thick. See border-width for details. <'column-rule-style'> See border-style for possible values and details. <'column-rule-color'> Is a <color> value. ...
...rds, thin, medium, or thick. See border-width for details. <'column-rule-style'> See border-style for possible values and details. <'column-rule-color'> Is a <color> value. ...
... 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'> | <'column-rule-style'> | <'column-rule-color'> Examples Example 1 /* Same as "medium dotted currentcolor" */ p.foo { column-rule: dotted; } /* Same as "medium solid blue" */ p.bar { column-rule: solid blue; } /* Same as "8px solid currentcolor" */ p.baz { c...
flex-flow - CSS: Cascading Style Sheets
The flex-flow CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...horthand property specifies the direction of a flex container, as well as its wrapping behavior. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* Global values */ flex-flow: inherit; flex-flow: initial; flex-flow: unset; Values See flex-direction and flex-wrap for details on the values. ...
...w nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* Global values */ flex-flow: inherit; flex-flow: initial; flex-flow: unset; Values See flex-direction and flex-wrap for details on the values. Formal definition Initial valueas each of the
properties of the shorthand:flex-direction: rowflex-wrap: nowrapApplies toflex containersInheritednoComputed valueas each of the
properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedAnimation typediscrete Formal syntax <'flex-direction'> | <'flex-wrap'> Examples Setting column-reverse and wrap element { /* Main-axis is the block direction with reversed main-start and main-end. Flex items are laid out in multiple lines */ flex-flow: column-reverse wrap; } Specifications Specification S...
grid-area - CSS: Cascading Style Sheets
a <custom-ident>, grid-row-end is set to that <custom-ident>; otherwise, it is set to auto. When grid-column-start is omitted, if grid-row-start is a <custom-ident>, all four longhands are set to that value. Otherwise, it is set to auto. The grid-area property can also be set to a <custom-ident> which acts as a name for the area, which can then be placed using grid-template-areas. ...
...otherwise, it is set to auto. When grid-column-start is omitted, if grid-row-start is a <custom-ident>, all four longhands are set to that value. Otherwise, it is set to auto. The grid-area property can also be set to a <custom-ident> which acts as a name for the area, which can then be placed using grid-template-areas. ...
... a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. ...
...ounting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. ...
grid-row - CSS: Cascading Style Sheets
or this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash. ...
...f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash. ...
...s omitted, it defaults to 1. Negative integers or 0 are invalid. Internet Explorer issues IE11 does not support automatic placement of grid items. All items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
... unless explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
Inheritance - CSS: Cascading Style Sheets
In CSS, inheritance controls what happens when no value is specified for a property on an element. CSS
properties can be categorized in two types: inherited
properties, which by default are set to the computed value of the parent element non-inherited
properties, which by default are set to initial value of the property Refer to any CSS property definition to see whether a specific property inherits by default ("Inherited: yes") or not ("Inherited: no"). Inherited
properties When no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element. Only the root element of the document gets the initial value given in the property's summary. A typical example of an inherited property is the color property. Given the...
...ules: p { color: green; } ... and the markup: <p>This paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will appear green, since the em element has inherited the value of the color property from the p element. It does not get the initial value of the property (which is the color that is used for the root element when the page specifies no color). Non-inherited
properties When no value for a non-inherited property has been specified on an element, the element gets the initial value of that property (as specified in the property's summary). A typical example of a non-inherited property is the border property. Given the style rules: p { border: medium solid; } ... and the markup: <p>This paragraph has <em>emphasized text</em> in it.</p> ... the words "empha...
...d property is the border property. Given the style rules: p { border: medium solid; } ... and the markup: <p>This paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will not have a border (since the initial value of border-style is none). Notes The inherit keyword allows authors to explicitly specify inheritance. It works on both inherited and non-inherited
properties. You can control inheritance for all
properties at once using the all shorthand property, which applies its value to all
properties. For example: font { all: revert; font-size: 200%; font-weight: bold; } This reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead. Then it doubles the font size and applies a f...
... ...
inset-block - CSS: Cascading Style Sheets
The inset-block CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the top and bottom, or right and left
properties depending on the values defined for writing-mode, direction, and text-orientation. ...
...riting-mode, direction, and text-orientation. ...
...es */ inset-block: 3px 10px; inset-block: 2.4em 3em; inset-block: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-block: 10% 5%; /* Keyword value */ inset-block: auto; /* Global values */ inset-block: inherit; inset-block: initial; inset-block: unset; Constituent
properties This property is a shorthand for the following CSS
properties: inset-block-end inset-block-start Syntax Values The inset-block property takes the same values as the left property. 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(); ...
... Editor's Draft Initial definition ...
inset-inline - CSS: Cascading Style Sheets
The inset-inline CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the top and bottom, or right and left
properties depending on the values defined for writing-mode, direction, and text-orientation. ...
...ode, direction, and text-orientation. ...
...set-inline: 3px 10px; inset-inline: 2.4em 3em; inset-inline: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-inline: 10% 5%; /* Keyword value */ inset-inline: auto; /* Global values */ inset-inline: inherit; inset-inline: initial; inset-inline: unset; Constituent
properties This property is a shorthand for the following CSS
properties: inset-inline-end inset-inline-start Syntax Values The inset-inline property takes the same values as the left property. 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()...
... Editor's Draft Initial definition ...
outline - CSS: Cascading Style Sheets
The outline CSS shorthand property set all the outline
properties in a single declaration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: outline-color outline-style outline-width Syntax /* style */ outline: solid; /* color | style */ outline: #f66 dashed; /* style | width */ outline: inset thick; /* color | style | width */ outline: green solid 3px; /* Global values */ outline: inherit; outline: initial; outline: unset; The outline property may be specified using one, two, or three of the values listed below. The order o...
...> Sets the thickness of the outline. Defaults to medium if absent. See outline-width. Description Borders and outlines are very similar. However, outlines differ from borders in the following ways: Outlines never take up space, as they are drawn outside of an element's content. According to the spec, outlines don't have to be rectangular, although they usually are. As with all shorthand
properties, any omitted sub-values will be set to their initial value. Accessibility concerns Assigning outline a value of 0 or none will remove the browser's default focus style. If an element can be interacted with it must have a visible focus indicator. Provide obvious focus styling if the default focus style is removed. How to Design Useful and Usable Focus Indicators WCAG 2.1: Understanding Su...
...signing outline a value of 0 or none will remove the browser's default focus style. If an element can be interacted with it must have a visible focus indicator. Provide obvious focus styling if the default focus style is removed. 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. For the color value, if the value is translucent, the computed value will be the rgba() corresponding one.
...keyword invert, the computed value is invert. For the color value, if the value is translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. ...
padding-inline - CSS: Cascading Style Sheets
The padding-inline CSS shorthand property defines the logical inline start and end padding of an element, which maps to physical padding
properties depending on the element's writing mode, directionality, and text orientation. ...
... Description Values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction,...
... Description Values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. Formal definition Initial value0Applie...
... Editor's Draft Initial definition ...
padding - CSS: Cascading Style Sheets
ive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: Padding creates extra space within an element. In contrast, margin creates extra space around an element. ...
...contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: Padding creates extra space within an element. In contrast, margin creates extra space around an element. ...
... the top, the second to the right and left, the third to the bottom. When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise). Values <length> The size of the padding as a fixed value. <percentage> The size of the padding as a percentage, relative to the width of the containing block. ...
... 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. ...
text-decoration - CSS: Cascading Style Sheets
<em>some emphasized words</em> in it.</p>, the style rule p { text-decoration: underline; } would cause the entire paragraph to be underlined. The style rule em { text-decoration: none; } would not cause any change; the entire paragraph would still be underlined. However, the rule em { text-decoration: overline; } would cause a second decoration to appear on "some emphasized words". Constituent
properties This property is a shorthand for the following CSS
properties: text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness Syntax The text-decoration property is specified as one or more space-separated values representing the various longhand text-decoration
properties. Values text-decoration-line Sets the kind of decoration used, such as underline o...
...Values text-decoration-line Sets the kind of decoration used, such as underline or line-through. text-decoration-color Sets the color of the decoration. text-decoration-style Sets the style of the line used for the decoration, such as solid, wavy, or dashed. text-decoration-thickness Sets the thickness of the line used for the decoration. ...
...n, such as solid, wavy, or dashed. text-decoration-thickness Sets the thickness of the line used for the decoration. Formal definition Initial valueas each of the
properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneApplies toall elements. ...
...ecoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneApplies toall elements. ...
Cross-browser audio basics - Developer guides
This article provides: a basic guide to creating a cross-browser HTML5 audio player with all the associated attributes,
properties, and events explained a guide to custom controls created using the Media API Basic Audio example The code below is an example of a basic audio implementation using HTML5: <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for non supporting browsers goes here --> <p>Your browser does not support HTML5 audio, but you can still <a href="audiofile.mp3">download the music</a>.</p> </audio> Note: You can also use an MP4 file instead of MP3. MP4 files typically contain AAC encoded audio. You can use type="audio/mp4". (Currently, browsers that support mp3 also support mp4 a...
...ode require that the user has the appropriate plugin installed, and that the browser cannot guarantee the security aspects of code running on those plugin platforms. These are also deprecated, and soon won't work in any modern browsers. Manipulating the Audio Element with JavaScript In addition to being able to specify various attributes in HTML, the <audio> element comes complete with several
properties and methods that you can manipulate via JavaScript. Given the following HTML: <audio id="my-audio" src="audiofile.mp3"> ... </audio> You can grab the <audio> element like this: var myAudio = document.getElementById('my-audio'); Alternatively, you can create a new element. Here's an example of creating an <audio> element, setting the media to play, playing and pausing, and then playing fr...
... play The play() method is used to tell the audio to play. It takes no parameters. myAudio.play(); pause The pause() method is used to tell the audio to pause. It takes no parameters. myAudio.pause(); Note: There is no stop method -- to implement a stop function, you'd have to pause the media then set the currentTime property value to 0. canPlayType The canPl...
... var clickPosition = (e.pageX - this.offsetLeft) / this.offsetWidth; var clickTime = clickPosition * myAudio.duration; // move the playhead to the correct position myAudio.currentTime = clickTime; }); Buffering Ok, we're getting there, but there is another piece of useful information we can display: the amount of audio has been buffered or downloaded in advance. There are a couple of
properties we haven't looked at yet, buffered and seekable. buffered This property lets us know which parts of the audio has been buffered (downloaded in advance). It returns something called a TimeRanges object. myBufferedTimeRanges = myAudio.buffered; seekable The seekable property informs you of whether you can jump directly to that part of the media without further buffering. mySeekableTimeRanges ...
Loops and iteration - JavaScript
function dump_props(obj, ...
...or...in statement The for...in statement iterates a specified variable over all the enumerable
properties of an object. For each distinct property, JavaScript executes the specified statements. A for...in statement looks as follows: for (variable in object) statement Example The following function takes as its argument an object and the object's name. It then iterates over all the object's
properties and returns a string that lists the property names and their values. ...
...ollowing function takes as its argument an object and the object's name. It then iterates over all the object's
properties and returns a string that lists the property names and their values. 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 s...
...ar.make = Ford car.model = Mustang Arrays Although it may be tempting to use this as a way to iterate over Array elements, the for...in statement will return the name of your user-defined
properties in addition to the numeric indexes. Therefore, it is better to use a traditional for loop with a numeric index when iterating over arrays, because the for...in statement iterates over user-defined
properties in addition to the array elements, if you modify the Array object (such as adding custom
properties or methods). for...of statement The for...of statement creates a loop Iterating over iterable objects (including Array, Map, Set, arguments object and so on), invoking a custom iteration hook with statements to be executed for the value of each distinct property. for (variable of object) state...
Deprecated and obsolete features - JavaScript
This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable). Deprecated features These deprecated features can still be used, but should be used with caution because they are expected to be removed entirely sometime in the future. You should work to remove their use from your code. RegExp
properties the following
properties are deprecated. This does not affect their use in replacement strings: Property Description $1-$9 Parenthesized substring matches, if any. Warning: Using these
properties can result in problems, since browser extensions can modify them. Avoid them! $_ See input. $* See multiline. $& See lastMatch. $+ ...
... $' See rightContext. input The string against which a regular expression is matched. lastMatch The last matched characters. lastParen The last parenthesized substring match, if any. leftContext The substring preceding the most recent match. rightContext The substring following the most recent match. The following are now
properties of RegExp instances, no longer of the RegExp object: Property Description global Whether or not to test the regular expression against all possible matches in a string, or only against the first. ignoreCase Whether or not to ignore case while attempting a match in a string. lastIndex The index at which to start the next match. multiline ...
... not to ignore case while attempting a match in a string. lastIndex The index at which to start the next match. multiline Whether or not to search in strings across multiple lines. source The text of the pattern. RegExp methods The compile() method is deprecated. The valueOf method is no longer specialized for RegExp. Use Object.valueOf(). Function
properties The caller and arguments
properties are deprecated, because they leak the function caller. Instead of the arguments property, you should use the arguments object inside function closures. Legacy generator Legacy generator function statement and Legacy generator function expression are deprecated. Use function* statement and function* expression instead. JS1.7/JS1.8 Array comprehension an...
...roduction states: "... Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. ..." Obsolete features These obsolete features have been entirely removed from JavaScript and can no longer be used as of the indicated version of JavaScript. Object Property Description __count__ Returns the number of enumerable
properties directly on a user-defined object. __parent__ Points to an object's context. Object.prototype.eval() Evaluates a string of JavaScript code in the context of the specified object. Object.observe() Asynchronously observing the changes to an object. Object.unobserve() Remove observers. Object.getNotifier() Creates an object that allows to s...
Object.preventExtensions() - JavaScript
The Object.preventExtensions() method prevents new
properties from ever being added to an object (i.e. prevents future extensions to the object). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.preventExtensions(obj) Parameters obj The object which should be made non-extensible. Return value The object being made non-extensible. Description An object is extensible if new
properties can be added to it. ...
...s://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.preventExtensions(obj) Parameters obj The object which should be made non-extensible. Return value The object being made non-extensible. Description An object is extensible if new
properties can be added to it. Object.preventExtensions() marks an object as no longer extensible, so that it will never have
properties beyond the ones it had at the time it was marked as non-extensible. Note that the
properties of a non-extensible object, in general, may still be deleted. Attempting to add new
properties to a non-extensible object will fail, either silently or by throwing a TypeError (most commonly, but not exclusively, when in strict mode). Object.preventExtensions() only prevents addition of own
properties. P...
... There is no way to make an object extensible again once it has been made non-extensible. Examples Using Object.preventExtensions // Object.preventExtensions returns the object // being made non-extensible. ...
... that can be changed. Object.preventExtensions(empty); Object.isExtensible(empty); // === false // Object.defineProperty throws when adding // a new property to a non-extensible object. var nonExtensible = { removable: true }; Object.preventExtensions(nonExtensible); Object.defineProperty(nonExtensible, 'new', { value: 8675309 }); // throws a TypeError // In strict mode, attempting to add new
properties // to a non-extensible object throws a TypeError. function fail() { 'use strict'; // throws a TypeError nonExtensible.newProperty = 'FAIL'; } fail(); A non-extensible object's prototype is immutable: var fixed = Object.preventExtensions({}); // throws a 'TypeError'. fixed.__proto__ = { oh: 'hai' }; Non-object coercion In ES5, if the argument to this method is not an object (a primitive...
Proxy - JavaScript
ou to create a proxy for another object, which can intercept and redefine fundamental operations for that object. Description A Proxy is created with two parameters: target: the original object which you want to proxy handler: an object that defines which operations will be intercepted and how to redefine intercepted operations. ...
...an intercept and redefine fundamental operations for that object. Description A Proxy is created with two parameters: target: the original object which you want to proxy handler: an object that defines which operations will be intercepted and how to redefine intercepted operations. ...
... Handler functions are sometimes called traps, presumably because they trap calls to the target object. The very simple trap in handler2 above redefines all property accessors: console.log(proxy2.message1); // world console.log(proxy2.message2); // world With the help of the Reflect class we can give some accessors the original behavior and redefine others: const target = { me...
...pass a string (by mistake) console.log(products.browsers); // ['Firefox'] <- no problem, the value is an array products.latestBrowser = 'Chrome'; console.log(products.browsers); // ['Firefox', 'Chrome'] console.log(products.latestBrowser); // 'Chrome' Finding an array item object by its property This proxy extends an array with some utility features. As you see, you can flexibly "define"
properties without using Object.define
Properties. This example can be adapted to find a table row by its cell. In that case, the target will be table.rows. let products = new Proxy([ { name: 'Firefox', type: 'browser' }, { name: 'SeaMonkey', type: 'browser' }, { name: 'Thunderbird', type: 'mailer' } ], { get: function(obj, prop) { // The default behavior to return the value; prop is usually an ...
Standard built-in objects - JavaScript
Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference. ...
... Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference. ...
...bjects, including their methods and
properties. The term "global objects" (or standard built-in objects) here is not to be confused with the global object. Here, "global objects" refer to objects in the global scope. The global object itself can be accessed using the this operator in the global scope. In fact, the global scope consists of the
properties of the global object, including inherited
properties, if any. Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference. For more information about the distinction between the DOM and core JavaScript, see JavaScript technologies overview. ...
...l object, including inherited
properties, if any. Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference. For more information about the distinction between the DOM and core JavaScript, see JavaScript technologies overview. Standard objects by category Value
properties These global
properties return a simple value. They have no
properties or methods. Infinity NaN undefined globalThis Function
properties These global functions--functions which are called globally, rather than on an object--directly return their results to the caller. eval() uneval() isFinite() isNaN() parseFloat() parseInt() encodeURI() encodeURIComponent() decodeURI() ...
Fills and Strokes - SVG: Scalable Vector Graphics
parately in SVG. These are controlled by the fill-opacity and stroke-opacity attributes. Note: in Firefox 3+, rgba values are also allowed, and will give the same effect. But for compatibility with other viewers, it's often best to specify the fill/stroke opacity separately. If you specify both an rgba value and a fill/stroke opacity value, both will be applied. Stroke In addition to its color
properties, there are a few other attributes available to control the way a stroke is drawn on a line. <?xml version="1.0" standalone="no"?> <svg width="160" height="140" xmlns="http://www.w3.org/2000/svg" version="1.1"> <line x1="40" x2="120" y1="20" y2="20" stroke="black" stroke-width="20" stroke-linecap="butt"/> <line x1="40" x2="120" y1="60" y2="60" stroke="black" stroke-width="20" stroke-linecap...
...xt dash of 5 units. You can specify more numbers if you would like a more complicated dash pattern. The first example specifies three numbers, in which case the renderer loops the numbers twice to create an even pattern. So the first path renders 5 filled, 10 empty, 5 filled, and then loops back to create 5 empty, 10 filled, 5 empty. The pattern then repeats. There are additional stroke and fill
properties available, including fill-rule, which specifies how to color in shapes that overlap themselves; stroke-miterlimit, which determines if a stroke should draw miters; and stroke-dashoffset, which specifies where to start a dasharray on a line. Using CSS In addition to setting attributes on objects, you can also use CSS to style fills and strokes. Not all attributes can be set via CSS. Attributes t...
...ng and filling are usually available, so fill, stroke, stroke-dasharray, etc... can all be set this way, in addition to the gradient and pattern versions of those shown below. Attributes like width, height, or <path> commands cannot be set through CSS. It's easiest just to test and find out what is available and what isn't. Note: The SVG specification decides strictly between attributes that are
properties and other attributes. The former can be modified with CSS, the latter not. CSS can be inserted inline with the element via the style attribute: <rect x="10" height="180" y="10" width="180" style="stroke: black; fill: red;"/> Or it can be moved to a special style section that you include. Instead of shoving such a section into a <head> section like you do in HTML, though, it's included in an ...
...ents. <?xml version="1.0" standalone="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. You can also use things like the :hover pseudo class to create rollover effects: #MyRect:hover { stroke: black; fill: blue; } You can also specify an external stylesheet for your CSS rules through normal XML-stylesheet syntax: <?xml version="1.0" standalone="no"?> <?xml-stylesheet type="text/css" href="style.css"?> <svg width="200" height="150" xmlns="htt...
Content Processes - Archive of obsolete content
ect is that a malicious page could override methods on the window object that it knows are being used by the add-on, in order to trick the add-on into doing something it does not expect. Similarly, if the content script defines any values on the window object, a malicious page could potentially steal that information. To avoid problems like this, content scripts should always see the built-in
properties of the window object, even when they are overridden by another script. Conversely, other scripts should not see any
properties added to the window object by the content script. This is where xray wrappers come in. Xray wrappers automatically wrap native objects like the window object, and only exposes their native
properties, even if they have been overridden on the wrapped object. Conversely, an...
...f the window object, even when they are overridden by another script. Conversely, other scripts should not see any
properties added to the window object by the content script. This is where xray wrappers come in. Xray wrappers automatically wrap native objects like the window object, and only exposes their native
properties, even if they have been overridden on the wrapped object. Conversely, any
properties defined on the wrapper are not visible from the wrapped object. This avoids both problems we mentioned earlier. ...
...ontent script. This is where xray wrappers come in. Xray wrappers automatically wrap native objects like the window object, and only exposes their native
properties, even if they have been overridden on the wrapped object. Conversely, any
properties defined on the wrapper are not visible from the wrapped object. This avoids both problems we mentioned earlier. The fact that you can't override the
properties of the window object via a content script is sometimes inconvenient, so it is possible to circumvent this: by defining the property on window.wrappedObject, the property is defined on the underlying object, rather than the wrapper itself. This feature should only be used when you really need it, however. A few Notes on Security As we stated earlier, the SDK was designed with multiprocess suppor...
Modules - Archive of obsolete content
the above example, the value of foo depends on the order in which the subscripts are loaded: there is no way to access the property foo defined by "a.js", since it is overwritten by "b.js". To prevent scripts from interfering with each other, loadScript should evaluate each script to be loaded in the scope of their own global object, and then return the global object as its result. In effect, any
properties defined by the script being loaded on its global object are exported to the loading script. The script loader we obtained from Components allows us to do just that: function loadScript(url) { let global = {}; loader.loadSubScript(url, global); return global; } If present, the loadSubScript function evaluates the script to be loaded in the scope of the second argument. Using this new...
...resent, the loadSubScript function evaluates the script to be loaded in the scope of the second argument. ...
...of the second argument. ...
Contributor's Guide - Archive of obsolete content
Inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
...Inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
...rcing logical boundaries between them. Unfortunately, JavaScript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. We will show how to do each of these things using the built-in Components object provided by Xulrunner application such as Firefox and Thunderbird. Private
Properties People have come up with several ways to emulate private
properties using existing language features. This article discusses two common techniques: one using prefixes, the other closures. ...
l10n - Archive of obsolete content
ipts or HTML files, but you can share the localized strings you want by assigning it's values to a JSON serializable object. Globals Functions get(identifier, count, placeholder1...n) This function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for Firefox. ...
...calized string in the locale currently set for Firefox. Localized strings are supplied by the add-on developer in .
properties files stored in the add-ons "locale" directory. The gettext tools uses "_" for the name of the function that retrieves localized strings. For compatibility with tools that expect this syntax, you can assign this function to "_": var _ = require("sdk/l10n").get; Given a .
properties file for the current locale containing an entry like: hello_string= Hello! and the following code: var _ = require("sdk/l10n").get; console.log(_("hello_string")); the following output will be logged: info: Hello! If this function can't find the string referenced by the identifier parameter, it returns the identifier itself. This enables you to write functional, localizable code without lo...
... parameter, it returns the identifier itself. This enables you to write functional, localizable code without localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("Hello!")); However, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .
properties files. If you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a second integer parameter which indicates the number of items there are. You can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be ins...
simple-storage - Archive of obsolete content
ss.storage.myBoolean = true; ss.storage.myNull = null; ss.storage.myNumber = 3.1337; ss.storage.myObject = { a: "foo", b: { c: true }, d: null }; ss.storage.myString = "O frabjous day!"; You can store array, boolean, number, object, null, and string values. If you'd like to store other types of values, you'll first have to convert them to strings or another one of these types. Be careful to set
properties on the storage object and not the module itself, as demonstrated below: // This is not good! var ss = require("sdk/simple-storage"); ss.foo = "I will not be saved! :("; Simple storage and "jpm run" The simple storage module stores its data in your profile. Because jpm run by default uses a fresh profile each time it runs, simple storage won't work with add-ons executed using jpm run - that is,...
... icon: "./read.png", onClick: function() { console.log(ss.storage.pages); } }); But this isn't going to work, because it empties the array each time the add-on runs (for example, each time Firefox is started). Line 2 needs to be made conditional, so the array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; Deleting data You can delete
properties using the delete operator. Here's an add-on that adds three buttons to write, read, and delete a value: var ss = require("sdk/simple-storage"); require("sdk/ui/button/action").ActionButton({ id: "write", label: "Write", icon: "./write.png", onClick: function() { ss.storage.value = 1; console.log("Setting value"); } }); require("sdk/ui/button/action").ActionButton({ id: "rea...
...s.storage.myList.pop(); }); Private browsing If your storage is related to your users' Web history, personal information, or other sensitive data, your add-on should respect private browsing. To read about how to opt into private browsing mode and how to use the SDK to avoid storing user data associated with private windows, refer to the documentation for the private-browsing module. Globals
Properties storage A persistent object private to your add-on.
Properties with array, boolean, number, object, null, and string values will be persisted. quotaUsage A number in the range [0, Infinity) that indicates the percentage of quota occupied by storage. A value in the range [0, 1] indicates that the storage is within quota. A value greater than 1 indicates that the storage exceeds quota. Events ...
windows - Archive of obsolete content
our add-on does not support private browsing this will have no effect. See the private-browsing documentation for more information. Optional options: Name Type onOpen function A callback function that is called when the window has opened. This does not mean that the URL content has loaded, only that the window itself is fully functional and its
properties can be accessed. This is an optional property. onClose function A callback function that is called when the window will be called. This is an optional property. onActivate function A callback function that is called when the window is made active. This is an optional property. onDeactivate function A callback function that is...
...that is called when the window will be called. This is an optional property. onActivate function A callback function that is called when the window is made active. This is an optional property. onDeactivate function A callback function that is called when the window is made inactive. This is an optional property. Returns BrowserWindow :
Properties browserWindows browserWindows provides access to all the currently open browser windows as BrowserWindow objects. var windows = require("sdk/windows"); for (let window of windows.browserWindows) { console.log(window.title); } console.log(windows.browserWindows.length); The currently active window is given by BrowserWindows.activeWindow: var windows = require("sdk/windows").browserWindows;...
...e); } // close the active window windows.activeWindow.close(function() { console.log("The active window was closed"); }); Methods activate() Makes window active, which will focus that window and bring it to the foreground. close(callback) Close the window. Parameters callback : function A function to be called when the window finishes its closing process. This is an optional argument.
Properties title The current title of the window. Usually the title of the active tab, plus an app identifier. This property is read-only. tabs A live list of tabs in this window. This object has the same interface as the tabs API, except it contains only the tabs in this window, not all tabs in all windows. This property is read-only. ...
/loader - Archive of obsolete content
o modules that eventually may be // replaced with a real ones :) "devtools/gcli": Cu.import("resource:///modules/gcli.jsm", {}), "net/utils": Cu.import("resource:///modules/NetUtil.jsm", {}) } }); Loader Instances The loader produces instances that are nothing more than representations of the environment into which modules are loaded. It is intentionally made immutable and all its
properties are just an implementation detail that no one should depend on, they may change at any point without any further notice. Loading Modules The CommonJS specification defines the notion of a main module, which represents an entry point to a program. The loader module exposes a main() function that can be used to load a main module. All other modules will be loaded by this module or its dependenci...
...y-addon/' ], [ '', 'resource:///modules/' ] ]; resolveURI('./main', mapping); // => resource://my-addon/main.js resolveURI('devtools/gcli', mapping); // => resource:///modules/devtools/gcli.js resolveURI('sdk/core/promise', mapping); // => resource://gre/modules/commonjs/sdk/core/promise.js override() This function is used to create a fresh object that contains own
properties of two arguments it takes. If arguments have
properties with conflicting names the property from the second argument overrides that from the first. This function is helpful for combining default and passed
properties: override({ a: 1, b: 1 }, { b: 2, c: 2 }) // => { a: 1, b: 2, c: 2 } descriptor() This utility function takes an object and as an argument and returns property descriptor map for ...
...arguments it takes. If arguments have
properties with conflicting names the property from the second argument overrides that from the first. This function is helpful for combining default and passed
properties: override({ a: 1, b: 1 }, { b: 2, c: 2 }) // => { a: 1, b: 2, c: 2 } descriptor() This utility function takes an object and as an argument and returns property descriptor map for its own
properties. It is useful when working with object functions introduced in ES5 (Object.create, Object.define
Properties, ..): // define
properties of `source` on `target`. Object.define
Properties(target, descriptor(source)) ...
lang/type - Archive of obsolete content
escendant of Object.prototype or null. Similar to jQuery's isPlainObject. let { isFlat } = require('sdk/lang/type'); isFlat({}); // true isFlat(new Type()); // false function Type () {} Parameters value : mixed The variable to check. Returns boolean : Boolean indicating if value is a direct descendant of Object.prototype or null. isEmpty(value) Returns true if value is an Object with no
properties and false otherwise. let { isEmpty } = require('sdk/lang/type'); isEmpty({}); // true isEmpty({ init: false }); // false Parameters value : object The variable to check. Returns boolean : Boolean indicating if value is an Object with no
properties. isJSON(value) Returns true if value is a string, number, boolean, null, array of JSON-serializable values, or an object whose property values...
... instanceOf } = require('sdk/lang/type'); instanceOf(new Class(), Class); // true function Class() {} Parameters value : object The variable to check. Type : object The constructor to compare to value Returns boolean : Boolean indicating if value is an instance of Type. source(value, indent, limit) Returns the textual representation of value, containing property descriptors and types of
properties contained within the object. let { source } = require('sdk/lang/type'); var obj = { name: undefined, twitter: '@horse_js', tweets: [ { id: 100, text: 'What happens to you if you break the monad laws?' }, { id: 101, text: 'JAVASCRIPT DUBSTEP GENERATOR' } ] }; console.log(source(obj)); // Prints the below /* { // [object Object] // writable configurable enumerable name: u...
... Returns string : The textual representation of value. ...
places/history - Archive of obsolete content
// results is an array of objects containing visit data, // sorted by visit date, with all entries from more than a week ago // that contain 'ruby', *in addition to* entries from this last week // that contain 'javascript' }); Globals Functions search(queries, options) Queries can be performed on history entries by passing in one or more query options. Each query option can take several
properties, which are AND'd together to make one complete query. For additional queries within the query, passing more query options in will OR the total results. An options object may be specified to determine overall settings, like sorting and how many objects should be returned. Parameters queries : object|array An Object representing a query, or an Array of Objects representing queries. Each query ob...
...ther to make one complete query. For additional queries within the query, passing more query options in will OR the total results. An options object may be specified to determine overall settings, like sorting and how many objects should be returned. Parameters queries : object|array An Object representing a query, or an Array of Objects representing queries. Each query object can take several
properties, which are queried against the history database. Each property is AND'd together, meaning that bookmarks must match each property within a query object. Multiple query objects are then OR'd together. options : object Optional options: Name Type count number The number of bookmark items to return. If left undefined, no limit is set. sort ...
...e, accessCount and title of the entry. error The error event is emitted whenever a search could not be completed. Arguments string : A string indicating the error that occurred. end The end event is called when all search results have returned. Arguments array : The value passed into the handler is an array of all entries found in the history search. Each entry is an object containing the
properties url, time, accessCount and title. ...
platform/xpcom - Archive of obsolete content
y property of the instance (for example, any classes added to this object via the implements option defined in heritage). If it finds a match, it returns this, otherwise it throws Components.results.NS_ERROR_NO_INTERFACE. Parameters interface : iid The interface to ask for. This is typically given as a property of the Components.interfaces object. Returns object : The object itself(this).
Properties interfaces The set of interfaces supported by this class. Unknown sets this to nsISupports. Factory Use this class to register an XPCOM factory. To register a factory for a component, construct a Factory, giving it: a constructor for the component a contract ID and/or a class ID // Create and register the factory var factory = Factory({ contract: '@me.org/myComponent', Component: My...
...nent: MyComponent }); The component constructor typically returns a descendant of Unknown, although it may return a custom object that satisfies the nsISupports interface. The contract ID and/or class ID may be used by XPCOM clients to retrieve the factory. If a class ID is not given, a new one will be generated. The contract ID and class ID are accessible as the values of the contract and id
properties, respectively. By default, the factory is registered when it is created and unregistered when the add-on that created it is unloaded. To override this behavior, you can pass register and/or unregister options, set to false. If you do this, you can use the register() and unregister() functions to register and unregister. Methods createInstance(outer, iid) Creates an instance of the component ...
...ar custom = factory.createInstance(null, Ci.nsISupports).wrappedJSObject; // You can now access the interface defined for the 'custom' object Returns object : The component created by the factory. lockFactory() This method is required by the nsIFactory interface, but as in most implementations it does nothing interesting. QueryInterface() See the documentation for Unknown.QueryInterface().
Properties interfaces The set of interfaces supported by this object. Factory sets this to nsIFactory. id This factory's class ID. contract This factory's contract ID. Service Use this class to register an XPCOM service. To register a service for a component, construct a Service, giving it: a constructor for the object implementing the service a contract ID and/or a class ID var service = Serv...
remote/child - Archive of obsolete content
Listener functions that enable you to listen to DOM events dispatched by the frame. Communicating with the parent process To communicate with the parent process, the process, frames, and frame objects in sdk/remote/child have a port object that you can use to receive messages from, and send messages to, code in the parent. See the documentation for sdk/remote/parent for more details. Globals
Properties process A Process object. frames A Frames object. Process A link to the main process.
Properties port An event emitter that sends and receives events from the main process. isRemote A boolean property indicating whether this process is remote from the main process or not. Frames A list of the content frames in this process. Each element in this list is a Frame. Listen to attach and d...
...every existing frame and any new frames created in the future. This is a shortcut for enumerating existing frames and then listening for attach events. getFrameForWindow Finds the frame for a top level DOM window. addEventListener Adds an event listener for DOM events dispatched to any existing and future frames. removeEventListener Removes an event listener that was previously registered.
Properties port An event emitter that sends and receives events from every frame in this process. Events attach Triggered when a new content frame is opened (for example, the user opened a new tab). The event listener gets a Frame object as an argument. At this point you can't access frame's content yet, but you can add event listeners: const { frames } = require("sdk/remote/child"); frames.on("att...
...ocess. Methods addEventListener(event, listener, isCapturing) Adds an event listener for DOM events dispatched by this content frame. This can include load and unload events from any content that is loaded in the frame. Listeners are automatically removed when this frame is destroyed. removeEventListener(event, listener, isCapturing) Removes an event listener that was previously registered.
Properties port An event emitter that can be used to send and receive frame specific events to and from code in the main process. content The top level DOM window currently displaying in this frame. isTab A boolean property indicating whether this frame displays in one of the application's main browser tabs. Events detach Event emitted when this frame disconnects from the application. ...
Bootstrapped extensions - Archive of obsolete content
The add-on is being upgraded. ADDON_DOWNGRADE 8 The add-on is being downgraded. Bootstrap data Each of the entry points is passed a simple data structure containing some useful information about the add-on being bootstrapped. More information about the add-on can be obtained by calling AddonManager.getAddonByID(). The data is a simple JavaScript object with the following
properties: Property Type Description id string The ID of the add-on being bootstrapped. version string The version of the add-on being bootstrapped. installPath nsIFile The installation location of the add-on being bootstrapped. This may be a directory or an XPI file depending on whether the add-on is installed unpacked or not. resourceU...
... bootstrapped add-ons is very much the same since Firefox 7, as that is when chrome.manifest compatibility landed. JS and JSM Files - Using Property Files To localize your .js and .jsm files you have to use property files. The absolute minimum needed here is: File: install.rdf File: chrome.manifest File: bootstrap.js Folder: locale Folder: VALID_LOCALE_HERE File: ANYTHING.
properties In the locale folder you must have folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-US). Inside this folder must be a property file. Inside the chrome.manifest file these locale must be defined. For example if you had a subfolder of en-US in locale folder your chrome.manifest file will have to contain: locale NAME_OF_YOUR_ADDO...
...folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-US). Inside this folder must be a property file. Inside the chrome.manifest file these locale must be defined. For example if you had a subfolder of en-US in locale folder your chrome.manifest file will have to contain: locale NAME_OF_YOUR_ADDON en-US locale/ Here is an example: GitHub :: l10n-
properties - on startup of this add-on it will show a prompt saying USA or Great Britain, which ever it deems closest to your locale. You can test different locale by going to about:config and changing preference of general.useragent.locale to en-US and then to en-GB and disabling then re-enabling the add-on. XUL and HTML Files - Using Entities from DTD Files Many times HTML pages are used, however they c...
Preferences - Archive of obsolete content
lizedString. It is similar to nsISupportsString, except that when there is no user value, getComplexValue() gets the default value from a locale file (thus making the default value localizable). It's easier to explain this by example. Let's say you want to make the default value for the extensions.myext.welcomemessage preference localizable. You should do the following: Add this line to some .
properties file (for all of your locales), say to chrome://myext/locale/defaults.
properties: extensions.myext.welcomemessage=Localized default value Add the default value for extensions.myext.welcomemessage, pointing to that
properties file, by adding the following line to your file with default preferences (see below). pref("extensions.myext.welcomemessage", "chrome://myext/locale/defaults.properti...
... Setting nsIPrefLocalizedString preferences is similar to setting nsISupportsString: var pls = Components.classes["@mozilla.org/pref-localizedstring;1"] .createInstance(Components.interfaces.nsIPrefLocalizedString); pls.data = val; prefs.setComplexValue("prefer...
...e applied immediately in your extension. In this case, you can use the nsIPrefBranch2 interface to "listen" for changes to preferences in a certain branch. Note that it need not be your own extension's preferences; you can set an observer on any preference or branch. When a change is made to the preferences, you can take the appropriate action (such as reinitializing variables or toggling display
properties in XUL components). This technique will work no matter how or where the preferences are changed: in another browser window, directly in the about:config interface, or even by another extension. Note: During Gecko 13 development, nsIPrefBranch2 was deprecated, and its methods moved to nsIPrefBranch. Calling .QueryInterface(Components.interfaces.nsIPrefBranch2) is no longer required, although it s...
Enhanced Extension Installation - Archive of obsolete content
tup system that there is an install operation pending that needs to be finalized, e.g. needs-install, needs-upgrade, needs-uninstall, needs-enable, needs-disable, needs-install When the Extension Manager starts, this dataset is read into two data structures: The Startup Cache - a hashtable keyed off Install Location name and then GUID, each entry having persistentDescriptor, mtime and id
properties. The Pending Operations List - a set of entries organized into arrays hashed by operation key, each entry having a locationKey and id
properties. The Startup Cache data structure is used to reflect the extensions-startup.manifest file over the lifetime of the running application, the extensions-startup.manifest file is written from the current state of the cache. The Pending Operati...
...ister command line flag, so support for that has been removed. Datasource Structure Since there is now only a single RDF/XML datasource for storage of all installed items, the staggered datasource structure used by Firefox 1.0 and the use of an internal composite datasource is no longer required. The Extension System retains an object implementing nsIRDFDataSource (so that it can supply special
properties in addition to the set stored simply in the XML datasource) and an internal member that holds the single RDF/XML datasource.
Properties are read and are written directly to this, there are no shims. Tracking Install Locations Since there is now only a single datasource, Install Location information is tracked for every item in the single datasource in the form of a string <em:installLocation> p...
...ies when the Install function returns. If the item is a Theme, we perform the installation immediately (thanks to Benjamin Smedberg's Chrome Registry changes this operation is now so simple that it can be performed by a function on the ExtensionManager, rather than creating a separate object). If the item is an Extension, we add it to the Extension container and set the same set of initial setup
properties on it that we used to, with the addition of the installLocation key and the type value. At this stage we rewrite the extensions-startup.manifest and extensions.ini manifests and create the .autoreg file in the profile directory. Finalization On the next startup, the Startup system discovers the .autoreg file (as before) and starts the Extension System with the dirty flag, which causes the syst...
Extension Etiquette - Archive of obsolete content
nflicts There are many namespaces which extensions often must share with other consumers, be they other add-ons, web code, or the browser itself. These often include areas such as: Object prototypes, such as String.prototype, which are often extended to add methods to native objects. Global variables, such as top-level declarations on scripts loaded into shared windows or web pages. Expando
properties of shared objects, such as document objects, or DOM nodes. IDs and class names in HTML and XUL documents, when extensions add elements to web pages or browser windows. chrome: or resource: packages, which are often defined in chrome.manifest files. about: page URLs. XPCOM contract IDs, which are often registered in chrome.manifest files. While these are among the most common examples of nam...
...n whenever defining a name anywhere that other code might do likewise. Strategies to avoid such conflicts include: Avoid shared namespaces where possible Many naming conflicts are best avoided by simply not sharing namespaces. Scripts can be loaded into their own globals, such as CommonJS modules, JavaScript modules, or Sandboxes, to avoid most global variable and prototype conflicts. ...
... Some namespaces have specific conflict prevention conventions, which should be followed as appropriate. ...
JavaScript Object Management - Archive of obsolete content
w a more practical approach of having just one namespace with the project name. Notice how the <Namespace> namespace is declared using var. We need the namespace to be a global object that it can be used everywhere in the window chrome. You can include functions in any namespace, since namespaces are just regular JS objects. That should come in handy when you have general utility functions or
properties that you want to use across all objects within the namespace. For instance, there are frequently used XPCOM services such as the Observer service that can be included as members in the namespace: /** * <Namespace> namespace. */ if (typeof <Namespace> == "undefined") { var <Namespace> = { /** * Initializes this object. */ init : function() { this.obsService = ...
...(Ci.nsIObserverService); } }; <Namespace>.init(); }; JS objects can also be treated as string-indexed arrays: // equivalent. <Namespace>.Hello = {}; <Namespace>["Hello"] = {}; // equivalent. <Namespace>.Hello.init(); <Namespace>.Hello["init"](); This is very useful in cases where you have to set attributes or functions with dynamically generated names. It's one of the funky
properties of JavaScript: all objects are nothing more than name / value mappings. You can add or replace functions and attributes to any Javascript object, at any moment you want. This is an odd, but powerful feature that comes in handy at times when things get complicated. For instance, you could replace a method in any object in the Firefox chrome, so that it behaves differently than how it normally does...
...{ return this._url; } }; In this example we defined a fictitious User class for the Hello World extension. Using the function keyword to define a class is odd, but this is just the JavaScript way: functions are also objects. The definition of the class acts as a constructor as well, and then you can define all other members using the prototype attribute. In this case we defined "getter"
properties for the name and url members. This way we have immutable instances of our class. Well, only if consumers of the class play nice and don't change anything they shouldn't. Creating an instance and using it is simple enough: let user = new <ModuleNamespace>.User("Pete", "http://example.com/pete"); window.alert(user.name); This is something you can do with JS in general. You can use it in JS...
The Box Model - Archive of obsolete content
flexible elements using the minwidth, maxwidth, minheight and maxheight attributes, or their CSS counterparts: min-width, max-width, min-height and max-height. The latter are recommended to keep style code in the skin section of the chrome. As their names should make clear, you can control the flexibility boundaries of elements, thus preventing them from growing or shrinking too much. All CSS
properties involving lengths should be handled with caution. We recommended that you use proportional units (em, %) instead of absolute units (px) whenever possible. Using the former allows the UI to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations. A common exception to this rule is when your CSS is directly related to images, where you'...
...g the former allows the UI to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations. A common exception to this rule is when your CSS is directly related to images, where you'll usually handle measurements in pixels (px). Also, just like in HTML, you can control the dimensions of inflexible elements using the width and height CSS
properties and attributes. These attributes won't have any effect on flexible elements. Margins, paddings and spacers Margins and paddings are frequently used in both HTML and XUL to define spacing between elements and inside of elements. The margin determines the space between an element and the elements surrounding it, while the padding determines the space between the borders of a container element and...
...t do more than take space. You should only use it when you need flexible space. If you need fix-sized space it's best to use margins and paddings and avoid adding unnecessary nodes to your XUL document. Alignment XUL, unlike HTML, provides an easy way to align elements both horizontally and vertically. You can either use the align and pack attributes, or the -moz-box-align and -moz-box-pack CSS
properties. Packing determines the positioning of the child elements in the direction of the container's orientation. Alignment determines the positioning in the other direction. So, in a flexed hbox, having center alignment and end packing results in this: One important thing to notice is that aligment and flexibility can't be mixed in some cases. If you add flexibility to one of the buttons, the packin...
Localizing an extension - Archive of obsolete content
pt code If your JavaScript code contains literal strings that need to be localized, as does our stock watcher sample, we need to make those localizable as well. We can do this by moving the strings into a string bundle. String bundles are created by establishing a property file that maps keys to string values. For a detailed explanation of how this works, see XUL Tutorial:Property Files. Create a
properties file The first thing we do is create a property file for the literal strings used by the JavaScript code in stockwatcher2.js: changeString=Chg: openString=Open: lowString=Low: highString=High: volumeString=Vol: The stockwatcher2.
properties file shown above maps five keys (changeString, openString, lowString, highString, and volumeString) to the corresponding text in English. Create the string bu...
...ring, openString, lowString, highString, and volumeString) to the corresponding text in English. Create the string bundle The next step is to modify the stockwatcher2.xul file to reference this property file. We do this by creating a string bundle, using the following code: <stringbundleset id="stringbundleset"> <stringbundle id="string-bundle" src="chrome://stockwatcher2/locale/stockwatcher2.
properties"/> </stringbundleset> This establishes a new string bundle, referenced by the ID "string-bundle", whose keys and values are to be loaded from the stockwatcher2.
properties file we've already created. Note: You should use a unique ID for each string bundle element for each file you use to avoid conflicts. (e.g. id="myextensionname-filename") Update the JavaScript code Now we're ready to revise ...
...lized versions of those property files in the chrome/locale/es-ES directory as well. Only the strings should be localized; the keys should be the same for each localization. << PreviousNext >> See Also How to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: Bootstrapped Extensions :: Localization (L10n) XUL School Localization Tutorial: DTD/Entities method and
Properties method ...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
pruntime sample plugin source code into the dir of the new VS project and add the files to the project using the VS GUI (.cpp files to "Source Files", .h files to "Header Files", .rc file to "Resource Files"). Samples can be obtained from: https://developer.mozilla.org/en/Plugins/Samples_and_Test_Cases Get the NPAPI SDK. ...
...ned from: https://developer.mozilla.org/en/Plugins/Samples_and_Test_Cases Get the NPAPI SDK. Add the NPAPI SDK include path (example : C:\npapi-sdk\headers) to Project
Properties|(all configurations)|C++|General|Additional Include Directories. Note: If your project is still empty, the C++ tree might not be visible. So, add some files first. ...
...operties|(all configurations)|C++|General|Additional Include Directories. Note: If your project is still empty, the C++ tree might not be visible. So, add some files first. Add the following preprocessor definitions to Project
Properties|(all configurations)|C++|Preprocessor|Preprocessor Definitions: WIN32;_WINDOWS;XP_WIN32;XP_WIN;_X86_;NPSIMPLE_EXPORTS Disable precompiled headers using Project
Properties|(all configurations)|C++|Precompiled headers|Create/Use precompiled header. They may be already disabled. Define the function exports by adding the .def filename (e.g. nprt.def) to Project
Properties|(all configurations)|Linker|Input|Module Definition File. It could be either the full path or the path relative to the project directory. Optional: Open the above .def file and change "NPRT" to the...
In-Depth - Archive of obsolete content
All of the
properties follow the W3C's standards for vendor extensions, which is why they all begin with -moz. This is only a list of
properties which may be useful to you; it is in no way all of the Mozilla specific
properties available. ...
... System Colours CSS2 defines colours which are the same as your operating systems theme. A list of the different operating system colours can be found on the W3C's web site. Mozilla CSS
Properties Mozilla.org created their own CSS
properties to allow them to use the technology for the UI of Mozilla. All of the
properties follow the W3C's standards for vendor extensions, which is why they all begin with -moz. This is only a list of
properties which may be useful to you; it is in no way all of the Mozilla specific
properties available. Other sites which list Mozilla specific CSS
properties XulPlanet.com [dead link, 26.03.13] Mozilla-prefixed
properties on the standard track 26.03.13 -moz-appearance Makes a widget look like it's from your operating system. Possible are (This is probably an incom...
...Adding an image to the right of a toolbar This tutorial is done with Mozilla 1.2 in mind. The layout of files can and probably will change over time, but the basics should remain the same. By default, Mozilla 1.2 doesn't support images on the right hand side of the toolbars, but that can be changed with some XBL hacking. Plac...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
andle the XPCOM interfaces and pass a simpler data structure to functions of the observer object. The observer is an object that you declare yourself. In the above examples, this observer is stored in the buttonObserver and textObserver variables. The observer is declared in a script which you would include in the XUL file using the script tag. The observer is an object which may have a number of
properties, each set to a function which handles a particular aspect of drag and drop. Five functions may be defined. You only have to define the ones that you need. onDragStart(event, transferData, action) Define this function to have something happen when a drag starts. It takes three arguments, the event object as was originally passed to the event handler, the data to drag and the type of drag action.
...ion) { var htmlText = "<strong>Cabbage</strong>"; var plainText = "Cabbage"; transferData.data = new TransferData(); transferData.data.addDataForFlavour("text/html",htmlText); transferData.data.addDataForFlavour("text/unicode",plainText); } } Here, an observer has been declared and stored in the variable textObserver. It has one property called onDragStart. (In JavaScript,
properties can be declared with the syntax name : value). This property is a function which sets the data that is being dragged. Once called, it starts a drag for the string data "Cabbage". Of course, you would want to calculate this value from the element that was clicked on. Conveniently, this element is available from the event object's target property. The event object is passed as the first argument to...
...d for elements that accept dragged data however. Next, the onDrop function should be created. Its second argument is the transfer data object that holds the data being dragged. By the time onDrop is called, the wrapper has called getSupportedFlavours to determine the best flavour for the drop, so the transfer object only contains the data for the best matching flavour. The transfer object has two
properties, data which holds the data and flavour which holds the flavour of the data. Once you have the data, you can add it to the element is some way. For example, you might set the value of a textbox. var textObserver = { onDrop : function (event, transferData, session) { event.target.setAttribute("value",transferData.data); } } The flavour system used allows multiple objects of various types t...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
art embedding, we use the methods provided by the Mozilla singleton class. ...
...Range[1]; range[0] = new GREVersionRange("1.8.0", true, "1.9", false); // work with trunk nightly version 1.9a1 ^^ try { File grePath = Mozilla.getGREPathWith
Properties(range, null); LocationProvider locProvider = new LocationProvider(grePath); mozilla.initEmbedding(grePath, grePath, locProvider); } catch (FileNotFoundException e) { // this exception is thrown if greGREPathWith
Properties cannot find a GRE } catch (XPCOMException e) { // this exception is thrown if initEmbedding failed } LocationProvider is a class provided by the Java application. ...
...PathWith
Properties cannot find a GRE } catch (XPCOMException e) { // this exception is thrown if initEmbedding failed } LocationProvider is a class provided by the Java application. It implements the IAppFileLocProvider interface, and tells XPCOM where to find certain files and directories. If your code cannot find the GRE and keeps throwing FileNotFoundExceptions during the getGREPathWith
Properties(...) call, check whether you already registered the GRE on your system: GRE Registration The initEmbedding method kicks off the embedding process, allowing the Java application to work with XPCOM and Mozilla. Once the Java application is done using Mozilla, it needs to terminate the embedding process: try { mozilla.termEmbedding(); } catch (XPCOMException e) { // this exception is throw...
Venkman Introduction - Archive of obsolete content
s for the current function. The scope object holds all arguments and local variables, and the this object holds the value of the this keyword. e Enumerable property r Read Only property p Permanent (cannot be deleted) A Alias to another property a Argument to a function v Declared with var Figure 8. Property flags
Properties of both scope and this objects are listed alphabetically, grouped by data type. Figure 9 shows which icons represent which data types.
Properties which are of the type Object are displayed with the name of their constructor function in curly braces as their value. You can locate the source code of the constructor by selecting "Find Constructor" from the property's context menu. You can find the ...
...re 9 shows which icons represent which data types.
Properties which are of the type Object are displayed with the name of their constructor function in curly braces as their value. You can locate the source code of the constructor by selecting "Find Constructor" from the property's context menu. You can find the place where the object was instantiated with the "Find Creator" command. By default,
properties of type function are not displayed, in order to conserve space in the view. If you would like to have functions displayed, check the "Include Functions" menu item in the view's context menu. You may need to close and re-open any objects you had open to see the change.
Properties that show up in a bold grey font are defined on an object from the prototype chain, and not on the actual object you a...
...If a property shows up in a bold red font, an exception occurred when Venkman tried to read the value. The exception object will appear as the value of the property. ...
Binding Attachment and Detachment - Archive of obsolete content
t explicitly extends in its inheritance chain) will be detached. No bindings will be attached to elements that match the style rule, but are inside an element that has style display:none set. See bug 307098. Whenever an element is removed from a document, any bindings attached via CSS loaded by the document will be detached. Attachment using element.style property None of the XBL inheritance
properties of element.style.MozBinding described here are implemented (if ever). Bindings can be attached to elements through the scripting by assigning the element.style.MozBinding property. Respectively bindings can be detached by setting element.style.MozBinding to empty string. Note: Some older papers mentioned DOM methods document.addBinding and document.removeBinding; these were subsequently discar...
...e assumed that all bindings are attached to all elements in the page. For elements that are created during or after the load event is fired, no assumptions can be made regarding order of binding attachment. When a binding is attached, the following events occur: If required, anonymous content is cloned from the binding's content template and inserted around the bound element. The methods and
properties of the binding are installed on the element and become available to scripts that reference the bound element. Any specified event handlers are installed on their requested targets. If the binding needs to execute any initialization code following its attachment to an element, it can do so using a <constructor> block inside <implementation> section. This block contains script that executes upon...
...oved from the bound document The element is destroyed (e.g., by closing the document) Bindings attached through the DOM are detached when the following conditions are met: MozBinding style rule is removed The element is destroyed (e.g., by closing the document) When a binding is detached, the following events occur: Anonymous content generated by the binding is destroyed. Methods and
properties with getters/setters are no longer accessible from the binding, although
properties with raw values remain. Any specified event handlers are unhooked from their respective targets. A binding can specify a <destructor> block within <implementation> section that executes prior to the binding detachment. Using a <destructor> block, a binding can perform any necessary cleanup before it is torn dow...
Elements - Archive of obsolete content
,content?,implementation?,handlers?)"> <!ELEMENT binding %binding-content;> <!ATTLIST binding id ID #REQUIRED extends CDATA #IMPLIED display CDATA #IMPLIED inheritstyle true #IMPLIED > The binding element describes a single XBL binding. A XBL binding can add anonymous content, fields,
properties, methods, and event handlers to HTML/XML elements. A single XBL binding can be attached to an element by using style sheets or by scripting. (See bug 83830 for <table> specifics). CSS: div { -moz-binding: url(myBinding.xml#default); } DOM: elementReference.style.MozBinding = "url(myBinding.xml#default)"; In both cases above we are using binding with id="default" contained in file myBindi...
...hoge" doesn't match for the immediate child foobar element. implementation <!ENTITY % implementation-content "(method|property)*"> <!ELEMENT implementation %implementation-content;> <!ATTLIST implementation id ID #IMPLIED name CDATA #IMPLIED implements CDATA #IMPLIED > The implementation element describes the set of methods and
properties that are attached to the bound element. Once the binding is attached, these methods and
properties can be invoked directly from the bound element. id - The id attribute is a document-unique identifier. name - The name attribute can be used to provide a specific name for an implementation. This name can then be used to reference the implementation. For example, in JavaScript the value of this ...
... Prior to Firefox 3, the constructor could be called at a time when reflow of the document layout was locked down, so that attempting to get layout information from within the constructor could return out of date information. In Firefox 3 and later, the constructor is called when reflow can take place, which results in up-to-date information being returned. See bug 398404 for details. Note: All
properties of the binding are "imported" as local variables in a constructor's scope. See bug 407314 for more details. destructor The code inside the destructor is called when a binding is being removed from an element. You can use this to unload resources to free memory. However the destructor is often not called when it should, see bug 230086. The destructor tag must be placed inside the implementation ...
XPInstall API reference - Archive of obsolete content
Parts of this page show the use of the XPInstall API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension. ...
...onfirm deleteRegisteredFile execute gestalt getComponentFolder getFolder getLastError getWinProfile getWinRegistry initInstall loadResources logComment patch performInstall refreshPlugins registerChrome resetError setPackageFolder InstallTrigger No
properties Methods compareVersion enabled getVersion install installChrome startSoftwareUpdate InstallVersion
Properties Methods compareTo init toString File No
properties Methods copy dirCreate dirGetParent dirRemove dirRename ...
... copy dirCreate dirGetParent dirRemove dirRename diskSpaceAvailable execute exists isDirectory isFile macAlias modDate modDateChanged move remove rename size windowsGetShortName windowsRegisterServer windowsShortcut WinProfile No
properties Methods getString writeString WinReg No
properties Methods createKey deleteKey deleteValue enumKeys enumValueNames getValue getValueNumber getValueString isKeyWritable keyExists setRootKey setValue setValueNumber setValueString ...
Sorting and filtering a custom tree view - Archive of obsolete content
1 : -1; //if the column is passed and it's already sorted by that column, reverse sort if (column) { column...
...1 : -1; //if the column is passed and it's already sorted by that column, reverse sort if (column) { columnName = column.id; if (tree.getAttribute("sortRe...
...1 : -1; //if the column is passed and it's already sorted by that column, reverse sort if (column) { columnName = column.id; if (tree.getAttribute("sortResource") == columnName) { order *= -1; } } else {...
textbox (Toolkit autocomplete) - Archive of obsolete content
It is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. Toolkit applications (such as Firefox) use a different autocomplete mechanism than the Mozilla suite. The example below will create an autocomplete textbox that will search the user's history. ...
...ndex,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value
Properties accessibleType, completeDefaultIndex, controller, crop, disableAutoComplete, disableKeyNavigation, disabled, editable, focused, forceComplete, highlightNonMatches, ignoreBlurWhileSearching, inputField, label, maxLength, maxRows, minResultsForPopup, open, popup, popupOpen, searchCount, searchParam, selectionEnd, selectionStart, showCommentColumn, showImageColumn,size, tabIndex, tabScrolling, t...
...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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. completeDefaultIndex New in Thunderbird 3Requires SeaMonkey 2.0 Type: boolean Gets and sets the value of the completedefaultindex attribute. controller Type: nsIAutoCompleteController Returns the controller for the auto complete element. ...
Textbox (XPFE autocomplete) - Archive of obsolete content
It is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. The autocomplete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox. The sessions can be set using the searchSessions attribute or by calling the addSession method. ...
...ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minResultsForPopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchSessions, showCommentColumn, showcommentcolumn, showpopup, size, tabindex, tabScrolling, tabscrolling, timeout, type, userAction, value
Properties accessible, alwaysOpenPopup, autoFill, autoFillAfterMatch, completeDefaultIndex, crop, disableAutocomplete, disabled, editable, focused, forceComplete, highlightNonMatches, ignoreBlurWhileSearching, inputField, isSearching, isWaiting, label, maxLength, maxRows, minResultsForPopup, noMatch, open, popup, popupOpen, resultsPopup, searchCount, searchParam, searchSessions, selectionEnd, selecti...
...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.
Properties accessible Type: nsIAccessible Returns the accessibility object for the element. alwaysOpenPopup Obsolete since Gecko 1.9.1 Type: boolean Gets and sets the value of the alwaysopenpopup attribute. autoFill Type: boolean Gets and sets the value of the autofill (or autoFill) attribute. autoFillAfterMatch Obsolete since Gecko 1.9.1 Type: boolean ...
The Joy of XUL - Archive of obsolete content
m environments because the skills required to develop these two parts are often satisfied by different people. XUL provides a clear separation among the client application definition and programmatic logic ("content" consisting of XUL, XBL, and JavaScript), presentation ("skin" consisting of CSS and images), and language-specific text labels ("locale" consisting of DTDs and string bundles in .
properties files). The layout and appearance of XUL applications can be altered independently of the application definition and logic. Further, the application can be localized for different languages and regions independently of its logic or presentation. This degree of separation results in applications that are easier to maintain by programmers and readily customized by designers and language transl...
...There are number of other technologies introduced by Mozilla that complement XUL for building cross platform web applications. XBL The eXtensible Bindings Language (XBL) is a markup language that defines special new elements, or "bindings" for XUL widgets. With XBL, developers can define new content for XUL widgets, add additional event handlers to a XUL widget, and add new interface
properties and methods. Essentially, XBL empowers developers with the ability to extend XUL by customizing existing tags and creating new tags of their own. By using XBL, developers can easily build custom user interface widgets such as progress meters, fancy pop-up menus, and even toolbars and search forms. These custom components can then be used in XUL applications by specifying the custom tag and as...
...ther simplify their implementation. XPCOM/XPConnect enables integration of native code.A fully-featured open source calendar library, libical, was harvested for the Calendar project. Libical is an Open Source implementation of the IETF's iCalendar Calendaring and Scheduling protocols (RFC 2445, RFC 2446, and RFC 2447). It parses iCal components and provides a C API for manipulating the component
properties, parameters, and subcomponents. The library was initially integrated by writing an XPCOM wrapper to adapt its interface. To improve performance a greater proportion of application logic was migrated from JavaScript to the XPCOM component. Separation of presentation from logic makes applications resilient to change.The original UI implementation made extensive use of graphics for rendering the mo...
Complete - Archive of obsolete content
place--it keeps each set of files separate. In the allcustom directory, the file allcustom.dtd contains the translated strings. The file contents.rdf contains registration data used by SeaMonkey. Localizing the description Firefox etc. display a description of the extension in the Extensions window. The description in install.rdf is the default. For each supported locale, a description in install.
properties overrides the default. A preference setting in defaults/preferences/allcustom.js makes the connection between the description and the
properties file, specifying the URL: chrome://allcustom/locale/install.
properties Again, the application's chrome registry converts this URL to the correct file for the locale you are using. For example, if your locale is fr-FR, it gets the description from: locale...
... preference setting in defaults/preferences/allcustom.js makes the connection between the description and the
properties file, specifying the URL: chrome://allcustom/locale/install.
properties Again, the application's chrome registry converts this URL to the correct file for the locale you are using. For example, if your locale is fr-FR, it gets the description from: locale/fr-FR/allcustom/install.
properties Testing a locale To test the alternative locale, install the extension in the normal way. Restart the application using the command line switch: -uiLocale fr-FR (Of course, if your application is already in French, specify en-US here to switch the extension to English.) Notes: If you use a shortcut or launcher icon to start the application, then you can add the command line switch by editing t...
... locale To test the alternative locale, install the extension in the normal way. Restart the application using the command line switch: -uiLocale fr-FR (Of course, if your application is already in French, specify en-US here to switch the extension to English.) Notes: If you use a shortcut or launcher icon to start the application, then you can add the command line switch by editing the icon's
properties. The application's user interface only switches language if you have the appropriate language pack installed. But this extension switches between English and French without needing any language pack. Some versions of Firefox etc. have a bug that prevents this from working. To work around the bug, close the application, delete the file XUL.mfl in its profile, then restart it with the command l...
Adding Methods to XBL-defined Elements - Archive of obsolete content
These methods can be called from a script. Methods are the functions of objects, such as Window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">Window.open(). You can define custom methods for your elements using the method element. ...
...elements using the method element. The general syntax of methods is as follows: <implementation> <method name="method-name"> <parameter name="parameter-name1"/> <parameter name="parameter-name2"/> . . . <body> <-- method script goes here --> </body> </method> </implementation> A method declaration goes inside the implementation element, like the fields and
properties do. 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. The value of the name attribute becomes the name of the method. Similarly, the name attributes on the parameter elements become the names of each parameter. Each parameter element is used to declare one parameter for the met...
... } else { document.getAnonymousNodes(this)[0].setAttribute("style","visibility: collapse"); } </body> </method> </implementation> </binding> The oncommand handlers here first get a reference to their parent bound element. (In this example, it is the box with the labeledbutton class). Then, the 'showTitle' method is called, which functions as it did before. Custom
properties and methods are added only to the outer XUL element the XBL is bound to. None of the elements declared inside the content tag have these
properties or methods. This is why we have to get the parent first. The children of an element placed in the XUL file can be retrieved in the normal way and don't move even if you use the children tag. For example: XUL: <box id="outer" class="container"> <b...
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. Containers Each XUL box is a container that can contain any other element. There are a number of elements that are specialized types of boxes, such as toolbars and tabbed panels. The box tag creates the simplest box with no special
properties. However, the specialized types of boxes work just like regular boxes in the way they orient the elements inside them, but they have additional features. In fact, many components can contain other elements. We've already seen that buttons may contain other things besides the default. A scroll bar is just a special type of box that creates its own elements if you don't provide them. It also handles t...
...all on top of each other. The first child of the stack is drawn underneath, the second child is drawn next, followed by the third and so on. Any number of elements may be stacked up in a stack. The orient property has little meaning on a stack as children are laid out above each other rather than from side to side. The size of the stack is determined by its largest child, but you can use the CSS
properties width, height, min-width and other related
properties on both the stack and its children. The stack element might be used for cases where a status indicator needs to be added over an existing element. For example, a progress bar might be created using a bar and a label overlaid on top of it. Shadowing with stacks One convenient use of the stack element however is that you could emulate a numbe...
...eight, min-width and other related
properties on both the stack and its children. The stack element might be used for cases where a status indicator needs to be added over an existing element. For example, a progress bar might be created using a bar and a label overlaid on top of it. Shadowing with stacks One convenient use of the stack element however is that you could emulate a number of CSS
properties with it. For example, you could create an effect similar to the text-shadow property with the following: Example 1 : Source View <stack> <description value="Shadowed" style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/> <description value="Shadowed" style="color: red; font-size: 15pt;"/> </stack> Both description elements create text with a size of 15 points. The first, howeve...
Trees - Archive of obsolete content
r instance, a tree might have thousands of rows, yet most of them will be scrolled off the border of the tree, hidden from view. This means that the tree is scalable to any number of rows without any performance problems. Of course, this is independant of the performance of the view object itself. A tree view is an object which implements the nsITreeView interface. This interface contains thirty
properties and functions which you may implement. These functions will be called by the tree as necessary to retrieve data and state about the tree. For instance, the getCellText() function will be called to get the label for a particular cell in the tree. An advantage of using a tree view is that it allows the view to store the data in a manner which is more suitable for the data, or to load the data on d...
... For instance, the getCellText() function will be called to get the label for a particular cell in the tree. An advantage of using a tree view is that it allows the view to store the data in a manner which is more suitable for the data, or to load the data on demand as rows are displayed. This allows more flexibility when using trees. Naturally, having to implement a tree view with thirty or so
properties and methods for every tree can be very cumbersome, especially for simple trees. Fortunately, XUL provides a couple of built-in view implementations which do most of the hard work for you. For most trees, especially when you first start to use trees, you will use one of these built-in types. However, you can create a view entirely from scratch if necessary. If you do, you might store the data in a...
... function, which in turn gets the data from the label of the appropriate treecell. However, the three elements listed above are not displayed directly. They are used only as the source for the data for the view. Thus, only a handful of attributes apply to the treeitem and related elements. For instance, you cannot change the appearance of the tree rows using the style attribute or with other CSS
properties and the box related features such as flexibility and orientation cannot be used. In addition, mouse and other user interface events do not fire at these elements. In fact, apart from some tree specific attributes, the only attributes that will have any effect will be the label attribute to set a text label for a cell and the src attribute to set an image. However, there are special ways of styli...
XUL Structure - Archive of obsolete content
orms it into a document tree. The tree is then converted into a set of objects that can be displayed on the screen. Style sheets (CSS), images, and other technologies are used to control the presentation. XUL functions in much the same way. In fact, in Mozilla, all document types, whether they are HTML or XUL, or even SVG, are all handled by the same underlying code. This means that the same CSS
properties may be used to style both HTML and XUL, and many of the features can be shared between both. However, there are some features that are specific to HTML, such as forms, and others which are specific to XUL, such as overlays. Since XUL and HTML are handled in the same way, you can load both from either your local file system, from a web page, or from an extension or standalone XULRunner application...
...kin part changes independently. Locales The file en-US.jar describes the language information for each component, in this case for US English. Like the skins, each language file contains files that specify text used by the package for a specific language. The locale structure is similar to the others, so it won't be listed here. The localized text is stored in two types of files: DTD files and
properties files. The DTD files have a .dtd extension and contain entity declarations, one for each text string that is used in a window. For example, the file browser.dtd contains entity declarations for each menu command. In addition, keyboard shortcuts for each command are also defined, because they may be different for each language. DTD files are used by XUL files so, in general, you will have one per ...
...ion and contain entity declarations, one for each text string that is used in a window. For example, the file browser.dtd contains entity declarations for each menu command. In addition, keyboard shortcuts for each command are also defined, because they may be different for each language. DTD files are used by XUL files so, in general, you will have one per XUL file. The locale part also contains
properties files, which are similar, but are used by script files. The file browser.
properties contains a few such localized strings. This structure allows you to translate Mozilla or a component into a different language by just adding a new locale for that language. You don't have to change the XUL code at all. In addition, another person could supply a separate package that applies a skin or locale to y...
XUL element attributes - Archive of obsolete content
boolean If true, then the element is collapsed and does not appear. It is equivalent to setting the CSS visibility property to collapse. container Type: boolean Set to true if the element is to act as a container which can have child elements. This would be used for folders. This will be set by the template builder as needed. containment Type: URI This attribute specifies RDF
properties (an RDF predicate) that indicate that a resource is a container. When generating content from a template this is used to determine which resources from the datasource are containers and thus can have child nodes and which ones are not containers. This attribute should be placed on the same element that the datasources and the ref attribute is on. It may be set to a space-separated list of RDF pr...
...equal in size. always For a horizontally oriented element, this will make all of its children have the width of the widest child. For a vertically oriented element, this will make its children all have the height of the tallest child. never All of the children are displayed at the size required by the content or as specified by the width and height attributes or the CSS width and height
properties. flags Type: space-separated list of the values below A set of flags used for miscellaneous purposes. Two flags are defined, which may be the value of this attribute. dont-test-empty: For template generated content, the builder will not check that a container is empty. dont-build-content: This flag may be used on a tree to indicate that content elements should not be generated.
...he broadcaster it is also changed in the observer. ordinal Type: string (representing an integer) An integer which specifies the position of the element within its parent. By default, elements appear in the order they appear in the XUL code. The ordinal attribute can be used to change the order. Note the default ordinal for elements is 1. You can retrieve the displayed order by using the
properties of the boxObject of the container. orient Type: one of the values below Used to specify whether the children of the element are oriented horizontally or vertically. The default value depends on the element. You can also use the -moz-box-orient style property. horizontal Child elements of the element are placed next to each other in a row in the order that they appear in the XUL sou...
binding - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Should be contained within a bindings element. A binding is used to bind a variable to a node. Like the triple element in syntax, it can be used to bind a particular property of a matched node to a particular variable name. That name can then be used within the action of a rule. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Should be contained within a bindings element. A binding is used to bind a variable to a node. Like the triple element in syntax, it can be used to bind a particular property of a matched node to a particular variable name. That name can then be used within the action of a rule. ...
...sources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties object Type: string The object of the element. It can be a variable reference, an RDF resource URI, or an RDF literal value. predicate Type: URI The predicate or property to match. This must be a URI of the property. subject Type: string The subject of the element. It can be a variable reference or an RDF resource URI. Inherited
Properties align, , allowEvents, , boxObje...
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. More information is available in the Template Guide. ...
...ip, tooltiptext, top, uri, wait-cursor, width object Type: string The object of the element. It can be a variable reference, an RDF resource URI, or an RDF literal value. predicate Type: URI The predicate or property to match. This must be a URI of the property. subject Type: string The subject of the element. It can be a variable reference or an RDF resource URI. ...
..., wait-cursor, width object Type: string The object of the element. It can be a variable reference, an RDF resource URI, or an RDF literal value. predicate Type: URI The predicate or property to match. This must be a URI of the property. subject Type: string The subject of the element. It can be a variable reference or an RDF resource URI. ...
checkbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element that can be turned on and off. This is most commonly rendered as a box when the element is off and a box with a check when the element is on. The user can switch the state of the check box by selecting it with the mouse. A label, specified with the label attribute, may be added beside the check box. More information is available in the XUL tutorial. ...
...ly rendered as a box when the element is off and a box with a check when the element is on. The user can switch the state of the check box by selecting it with the mouse. A label, specified with the label attribute, may be added beside the check box. More information is available in the XUL tutorial. Attributes accesskey, checked, command, crop, disabled, src, label, preference, tabindex
Properties accessKey, accessibleType, checked, command, crop, disabled, src, label, tabIndex Examples <checkbox label="Enable JavaScript" checked="true"/> <checkbox label="Enable Java" checked="false"/> Attributes accesskey Type: character This should be set to a character that is used as a shortcut key. This should be one of the characters that appears in the label attribute for the ele...
...nects the element to a corresponding preference. This attribute only has any effect when used inside a prefwindow. More information is available in the Preferences System article. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. checked Type: boolean Gets and sets the value of the checked attribute. command Type: element id Gets and sets the value of the command attri...
command - Archive of obsolete content
For example, a clipboard paste operation can be invoked from the Edit menu, a context menu and by pressing a keyboard shortcut. You attach the code to the command using the oncommand attribute. It will be called no matter how it is invoked by the user. In addition, disabling the command will automatically disable the menu items and keyboard shortcuts. Commands are identified by their id. If you include the script chrome://global/content/globalOverlay.js in your window, you can use the function goDoCommand function to invoke the command. ...
...reserved for Chrome code and is not available for use in the content. This means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed. Currently, the content still receives these key events, even though it can't override them. In future releases, it won't receive them. See bug 1173061 for details. ...
...nd is not available for use in the content. This means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed. Currently, the content still receives these key events, even though it can't override them. In future releases, it won't receive them. See bug 1173061 for details. ...
commandset - Archive of obsolete content
In addition, this element can hold a command updater which is used to update commands when certain events occur. A common use of the command updater is to update cut, copy, and paste menu items. More information is available in the XUL tutorial. ...
...u would use this to update the disabled status of items. targets Type: comma-separated list of element ids A comma-separated list of element ids that the command updater will update upon. If this attribute is not specified, or you set it to the value '*', all elements are valid. The command update will only occur when the event occurs to one of the specified elements. ...
... the disabled status of items. targets Type: comma-separated list of element ids A comma-separated list of element ids that the command updater will update upon. If this attribute is not specified, or you set it to the value '*', all elements are valid. The command update will only occur when the event occurs to one of the specified elements. ...
description - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used to create a block of text. The text can be set either with the value attribute or by placing text inside the open and close description tags. The value attribute is used to set text that appears in a single line. If text appears as a child of the description, it will wrap to multiple lines. It may contain arbitrary markup, which can be styled as needed. More information is available in the XUL tutorial. ...
... the value attribute or by placing text inside the open and close description tags. The value attribute is used to set text that appears in a single line. If text appears as a child of the description, it will wrap to multiple lines. It may contain arbitrary markup, which can be styled as needed. More information is available in the XUL tutorial. Attributes crop, disabled, tabindex value
Properties accessibleType, crop, disabled, tabIndex, value Style classes header, indent, monospace, plain, small-margin Examples This is a long section of text that will word wrap when displayed <description> This is a long section of text that will word wrap when displayed. </description> This is a long section of text that will not word wrap <description value="This is a long section of text t...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. crop Type: string Gets and sets the value of the crop attribute. disabled Type: boolean Gets and sets the value of the disabled attribute. tabIndex Type: integer Gets and sets the value of the tabindex ...
dialog - Archive of obsolete content
The buttons attribute may be used to set which buttons should appear in the dialog box. These buttons will be placed in the correct locations for the user's platform. More information is available in the XUL tutorial and Dialogs and prompts (code snippets). ...
...ompts (code snippets). ...
...ssed. This should be set to one of the same values as those for the buttons attribute. inactivetitlebarcolor Type: color string Specify background color of the window's titlebar when it is inactive (background). Moreover this hides separator between titlebar and window contents. This affects only on Mac OS X. title Type: string The text to appear in the title bar of the window.
Properties buttons Type: comma-separated list of the values below A comma-separated list of buttons to appear on the dialog box. The buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. The following values can be used in the list: accept: The OK button, which will accept the changes when pressed. This button will also be th...
dialogheader - Archive of obsolete content
This element should be placed inside a dialog element. The header may have a title and a description. ...
...e maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description Type: string Descriptive text to appear in addition to the dialog title. title Type: string The text to appear in the title bar of the window. ...
...verride this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description Type: string Descriptive text to appear in addition to the dialog title. title Type: string The text to appear in the title bar of the window. ...
dropmarker - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A dropmarker is a button with an arrow which will reveal more details when pressed. A dropmarker is not intended to be used as a separate element, but as part of another element. For instance the menulist and the popup type of datepicker use a dropmarker, that when pressed, will reveal a popup menu. ...
...ference home [ Examples | Attributes |
Properties | Methods | Related ] A dropmarker is a button with an arrow which will reveal more details when pressed. A dropmarker is not intended to be used as a separate element, but as part of another element. For instance the menulist and the popup type of datepicker use a dropmarker, that when pressed, will reveal a popup menu. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ord...
editor - Archive of obsolete content
Set the value of the editortype attribute to html to create an editor document. Mozilla provides two types of editors, the HTML editor and the plaintext editor. The editor does not provide any editing user interface; you would supply that yourself. However, text editing, image resizing, and table row and cell editing capabilities are provided. If you do not set the editortype attribute on an editor, you must enable editing using the makeEditable method. To specify the document to load in the editor use the src attribute. ...
...e to about:blank. To access most of the functionality of the editor, your application must be part of an extension or part of the chrome. XUL applications loaded via a URL from a web server will not be able to access most of the features of the editor. See the Rich text editing and Midas pages for more information about Gecko's built-in rich text editor. ...
...ype of the document in the editor. html An HTML editor. text A plaintext editor. src Type: URI The URI of the content to appear in the element. type Type: string If set to the string content-primary, this editor becomes the primary content for the page. The window for the primary content can be retrieved more conveniently using window.content.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. commandManager Type: nsICommandManager The command manager handles operations on the editor. contentDocument Type: document This read-only property contains the document object in the element. contentWindow Type: TODO Use the co...
groupbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] The groupbox is used to group related elements together. If a caption element is placed inside the groupbox, it will be used as a caption which appears along the top of the groupbox. Typically, the groupbox will be drawn with a border around it and the caption either above or over the top border, however the actual appearance will be platform specific. On Linux, for instance, only the caption appears with no border around the group. More information is available in the XUL tutorial. ...
...de the groupbox, it will be used as a caption which appears along the top of the groupbox. Typically, the groupbox will be drawn with a border around it and the caption either above or over the top border, however the actual appearance will be platform specific. On Linux, for instance, only the caption appears with no border around the group. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ord...
iframe - Archive of obsolete content
The src attribute can be used to specify the content of the frame. This content is a separate document. The children of the iframe are ignored. Currently, XUL iframes running in remote processes are not supported. If you want to run content in a remote process, use a XUL browser element. Warning: When used in chrome-privileged documents (either HTML or XUL) such as Firefox addons, the contents of the frame may have the same permissions as Firefox itself. This can be a serious security vulnerability, for example if you use src="http://...". ...
...TML or XUL) such as Firefox addons, the contents of the frame may have the same permissions as Firefox itself. This can be a serious security vulnerability, for example if you use src="http://...". When used in this case, please see Displaying web content in an extension without security issues. More information is available in the XUL tutorial. ...
... contentDocument Type: document This read-only property contains the document object in the element. contentWindow Type: TODO Use the contentWindow.wrappedJSObject to obtain a DOM(html) window object docShell Type: nsIDocShell Th...
key - Archive of obsolete content
When a key matching the attributes on the key element is pressed, the command will be fired on the key element. The key pressed must match the key attribute (or keycode attribute) as well as the modifiers attribute in order for the key element to be activated. For the shortcut defined using the key element to work, you must specify a command attribute (or an oncommand handler) on the key element. To display the shortcut defined with the key element in the UI, you can use <menuitem key="key element's id" command="command id" .../>. ...
...ler is called when the command is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. phase Type: string The event phase where the handler is invoked. This should be set to the value capturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase. ...
...mand is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. phase Type: string The event phase where the handler is invoked. This should be set to the value capturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase. ...
keyset - Archive of obsolete content
The keyset and its descendants are not displayed. More information is available in the XUL tutorial. ...
...te is allowed only for form controls. Using it with an anchor tag (an <a> link) will have no effect. The element will, however, still respond to mouse events. To enable the element, leave this attribute out entirely. Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. ...
...m controls. Using it with an anchor tag (an <a> link) will have no effect. The element will, however, still respond to mouse events. To enable the element, leave this attribute out entirely. Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. ...
listbox - Archive of obsolete content
A listbox may contain multiple columns. There are numerous methods which allow the items in the listbox to be retrieved and modified. You may specify the number of rows to display in the list using the rows attribute. Additional rows can be viewed using a scroll bar. A listbox is expected to contain listitem elements. All the rows in the listbox are the same height, which is the height of the tallest item in the list. ...
...item elements. All the rows in the listbox are the same height, which is the height of the tallest item in the list. If you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element. See List Controls for more information. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. currentIndex Type: integer Set to the index of the currently focused item in the list. If no item is focused, the value will be -1. (or, on some platforms, typeof(listboxcurrentIndex) will be undefined) In a single selection list, the current index will always be the sa...
listitem - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A single row in a listbox. The text of the listitem is specified either using listcell elements, or by placing a label attribute directly on the listitem element. By default it contains a single listcell element of type and class appropriate to that of the listitem. More information is available in the XUL tutorial. ...
...m is specified either using listcell elements, or by placing a label attribute directly on the listitem element. By default it contains a single listcell element of type and class appropriate to that of the listitem. More information is available in the XUL tutorial. ...
...n 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.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessible Type: nsIAccessible Returns the accessibility object for the element. checked Type: boolean Gets and sets the value of the checked attribute. control Type: element id Gets and sets the value of the control attribute. ...
menu - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element, much like a button, that is placed on a menubar. When the user clicks the menu element, the child menupopup of the menu will be displayed. This element is also used to create submenus. More information is available in the XUL tutorial. ...
...elated ] An element, much like a button, that is placed on a menubar. When the user clicks the menu element, the child menupopup of the menu will be displayed. This element is also used to create submenus. More information is available in the XUL tutorial. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. control Type: menu element Returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu. itemCount Type: integer Read only property holding the number of child items. menupopup Type: menupopup element A reference to t...
menulist - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element that can be used for drop-down choice lists. The user may select one of the elements displayed in the menulist. The currently selected choice is displayed on the menulist element. To create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. The command event may be used to execute code when the menulist selection changes. More information is available in the XUL tutorial. ...
...te the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. The command event may be used to execute code when the menulist selection changes. More information is available in the XUL tutorial. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. crop Type: string Gets and sets the value of the crop attribute. description Type: string Set to the description of the currently selected menuitem. disableautoselect Type: boolean Gets and sets the value of the disableautoselect attribute. ...
menuseparator - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Used to create a separator between menu items. Typically drawn as a thin line. More information is available in the XUL tutorial. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Used to create a separator between menu items. Typically drawn as a thin line. More information is available in the XUL tutorial. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. accessKey Type: character Gets and sets the value of the accesskey attribute. command Type: element id Gets and sets the value of the command attribute. control Type: menu element Returns the enclosing menu that the item is inside, if an...
notification - Archive of obsolete content
If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes. ...
...If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. image Type: image URL Gets and sets the value of the image attribute. label Type: string Gets and sets the value of the label attribute. persistence Type: integer Gets and sets the value of the persistence attribute. ...
panel - Archive of obsolete content
It does not have any window decorations. When open, it floats above the window and may extend outside the border of the main window. Typically, it will be attached to a button using the button's type attribute so that when the button is pressed, the panel will be displayed. A panel may also be opened via a script using the openPopup method. The panel is closed when the user clicks outside the panel, presses Escape or when the panel's hidePopup method is called. ...
... but only on some platforms. For those versions of Firefox, it is best to avoid child frames in a panel, if possible. This limitation was resolved as of Firefox 4.0. Attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type
Properties accessibleType, label, popupBoxObject, popup, state Methods hidePopup, moveTo, openPopup, openPopupAtScreen, sizeTo Examples The following example shows how a panel may be attached to a label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="You have 6 new messages."/> <hbox> <button label="Read Mail"/> ...
.... drag Specify this for a panel that's being used as a drag image for a drag and drop operation. Otherwise leave this attribute out. Note: The arrow will draw as long as the panel doesn't overlap the anchor. If they overlap, the anchor won't be drawn. The panel may not appear on the side of the anchor that you requested in which case the arrow will automatically adjust.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. label Type: string Gets and sets the value of the label attribute. popupBoxObject Type: nsIPopupBoxObject This read-only property holds the nsIPopupBoxObject that implements the popup. You wouldn't normally need to use this pr...
param - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] For SQL templates, used to bind values to parameters specified within an SQL statement. The value to bind should be text as a child of the param element. For more information, see Query_Parameters. Attributes index, name, type Attributes index Type: integer The index within the SQL statement of the parameter. name Type: string The name of a parameter within the SQL statement. This name should appear within the query preceded by a colon. ...
...tement of the parameter. name Type: string The name of a parameter within the SQL statement. This name should appear within the query preceded by a colon. ...
... name Type: string The name of a parameter within the SQL statement. This name should appear within the query preceded by a colon. ...
preference - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Declares a preference that may be adjusted in a prefpane. This element must be placed inside a preferences element. Each preference element corresponds to a preference which is stored in the user's preferences file. You can connect a user interface element such as a checkbox to a preference element using the user interface element's preference attribute. More information is available in the Preferences System article. ...
.... Each preference element corresponds to a preference which is stored in the user's preferences file. You can connect a user interface element such as a checkbox to a preference element using the user interface element's preference attribute. More information is available in the Preferences System article. Attributes disabled, instantApply, inverted, name, onchange, readonly, tabindex, type
Properties defaultValue, disabled, hasUserValue, inverted, locked, name, preferences, readOnly, tabIndex, type, value, valueFromPreferences Methods reset Examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences> See Preferences System for a complete example. Attributes disabled Type: boolean Indicates whether the element is disabled or not. If thi...
...ool A boolean set to either true or false. Usually a checkbox would be connected to these preferences. int An integer string A string unichar A Unicode string wstring A localized string. In this situation the preference will save the path to a property file which contains the actual value of the preference. file A file. The file path will be stored in the preferences.
Properties defaultValue (readonly) Returns the default value of the preference. The type of the property depends on the value of the type property. If the preference has no default value, this property returns null. disabled Type: boolean Gets and sets the value of the disabled attribute. hasUserValue Type: boolean True if the preference has been changed from its defa...
prefpane - Archive of obsolete content
A prefpane is made up of two parts, the preferences descriptions, which specify the set of preferences that will be modified, and the user interface for adjusting those preferences. The former is specified using a preferences element while the latter may be specified using other XUL elements. Both may be specified directly as children of the prefpane element, or the src attribute may be used to put a pane in a separate file. In this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. ...
... children of the prefpane element, or the src attribute may be used to put a pane in a separate file. In this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. More information is available in the Preferences System article. 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...
...oaded, much like the load event for a window. selected Type: boolean This attribute will be set to true for the currently selected prefpane. To change the selected pane, use the prefwindow's showPane method. src Type: URI The URI of the overlay contents of preference pane. If this is not specified, the contents of the prefpane element is used.
Properties contentHeight (readonly) The height (in pixels) of current pane's content. image Type: image URL Gets and sets the value of the image attribute. label Type: string Gets and sets the value of the label attribute. loaded Indicates whether the pane is fully loaded. preferenceElements Type: DOM Nodelist ...
prefwindow - Archive of obsolete content
This element should be used in place of the window tag and should contain one or more prefpane elements. A row of buttons appears across the preference dialog, one for each prefpane. Each pane will usually group together a set of related preferences. If there is only one prefpane, the navigation area will be hidden. On platforms where the convention is to apply changes immediately, the preferences are adjusted as soon as the user interface element is changed. On other platforms, the preferences are not applied until the dialog is closed. ...
... the window and in particular the list of prefpanes. Prefer the classical window.openDialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
...alls this event handler on the prefwindow element. title Type: string The text to appear in the title bar of the window. type Type: string Set this attribute to child for preference dialogs that are child dialogs of a main preferences window. This ensures that the preferences are only saved when the main dialog is closed, if this is the appropriate behaviour for the platform.
Properties buttons Type: comma-separated list of the values below A comma-separated list of buttons to appear on the dialog box. The buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. The following values can be used in the list: accept: The OK button, which will accept the changes when pressed. This button will...
radio - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element that can be turned on and off. Radio buttons are almost always listed together in groups. Only one radio button within the same radiogroup may be selected at a time. The user can switch which radio button is turned on by selecting it with the mouse or keyboard. Other radio buttons in the same group are turned off. A label, specified with the label attribute may be added beside the radio button. More information is available in the XUL tutorial. ...
...ime. The user can switch which radio button is turned on by selecting it with the mouse or keyboard. Other radio buttons in the same group are turned off. A label, specified with the label attribute may be added beside the radio button. More information is available in the XUL tutorial. ...
...n 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.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. control Type: radiogroup element Returns the enclosing radiogroup that the radio element is contained within, which may or may not be its direct parent. cro...
radiogroup - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A group of radio buttons. Only one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to vertical orientation. More information is available in the XUL tutorial. ...
... one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to vertical orientation. More information is available in the XUL tutorial. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. disabled Type: boolean Gets and sets the value of the disabled attribute. focusedItem Type: radio element Holds the currently focused item in the radiogroup, which may or may not be the same as the selected item. You can change the focused ite...
richlistbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. Note: In versions of Firefox prior to Firefox 3, rich list boxes support only single selection. Firefox 3 introduced multiple selection to rich list boxes. ...
...a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. Note: In versions of Firefox prior to Firefox 3, rich list boxes support only single selection. Firefox 3 introduced multiple selection to rich list boxes. ...
...n 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.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. currentIndex Type: integer Set to the index of the currently focused item in the list. If no item is focused, the value will be -1. (or, on some platforms, typeof(listboxcurrentIndex) will be undefined) In a single selection list, the current index will always be the ...
rule - Archive of obsolete content
The children of the rule are used to declare the conditions in which the rule matches and the content that is generated. A rule may contain where, binding and/or action elements. A condition is defined used a where element. For each result that matches all of the conditions, content within the rule's action body is generated. The bindings element is optional and may specify additional variable bindings to be used. When no query element is used in a template, a default query is used and the simple query syntax may be used for RDF datasources. For more information about this, see the Simple Query Syntax. ...
...alse: The rule will only match nodes that contain one or more child elements. parent Type: element tag name If set, the rule will only match the corresponding tag. This may be used to have separate rules for leaf and container nodes with different tags. parsetype Type: string If this attribute is set to Integer, the rule will only match RDF nodes with a parse type of Integer. ...
...atch nodes that contain one or more child elements. parent Type: element tag name If set, the rule will only match the corresponding tag. This may be used to have separate rules for leaf and container nodes with different tags. parsetype Type: string If this attribute is set to Integer, the rule will only match RDF nodes with a parse type of Integer. ...
scale - Archive of obsolete content
A bar displayed either horizontally or vertically allows the user to select a value by dragging a thumb on the bar. Use the orient attribute to specify the orientation of the scale. The default value is horizontal which displays a horizontal scale. Lower values are to the left and higher values are to the right. Set the orient attribute to vertical to use a vertical scale. ...
...unit, or the page up and page down keys to increment and decrement the value by one page, as specified by the pageincrement attribute. The home and end keys set the scale's value to the minimum and maximum values, respectively. A scale will fire a change event whenever the scale's value is modified. Attributes dir, disabled, increment, max, min, movetoclick, pageincrement, 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, th...
...n 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.
Properties disabled Type: boolean Gets and sets the value of the disabled attribute. increment Type: integer Gets and sets the value of the increment attribute. min Type: integer Gets and sets the value of the min attribute. max Type: integer Gets and sets the value of the max attribute. pageIncrement...
scrollbar - Archive of obsolete content
The scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. The user can adjust the position of the scroll bar by clicking arrows on either end of the scroll bar or by dragging the scroll bar thumb around. More information is available in the XUL tutorial. ...
...). The default value is 1. maxpos Type: integer The maximum position of the scrollbar. The default value is 100. pageincrement Type: integer The amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. The default value is 10. ...
... maxpos Type: integer The maximum position of the scrollbar. The default value is 100. pageincrement Type: integer The amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. The default value is 10. ...
splitter - Archive of obsolete content
When the splitter is dragged, the sibling elements of the splitter are resized. If a grippy is placed inside the splitter, one sibling element of the splitter is collapsed when the grippy is clicked. More information is available in the XUL tutorial. Attributes collapse, resizeafter, resizebefore, state, substate Style classes tree-splitter Examples <!-- This bar has some styling associated with it. ...
...Type: one of the values below On splitters which have state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in. Since collapse="both" is a Gecko 1.9+ feature, this will have no effect on earlier versions. before The element immediately before the splitter is collapsed. after The element immediately after the splitter is collapsed. ...
...low On splitters which have state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in. Since collapse="both" is a Gecko 1.9+ feature, this will have no effect on earlier versions. before The element immediately before the splitter is collapsed. after The element immediately after the splitter is collapsed. ...
statusbar - Archive of obsolete content
I suggest using The add-on bar instead. << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element used to create a status bar, usually placed along the bottom of a window. It is virtually equivalent to a standard box, but may be rendered differently. Contains statusbarpanels. ...
... I suggest using The add-on bar instead. << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element used to create a status bar, usually placed along the bottom of a window. It is virtually equivalent to a standard box, but may be rendered differently. Contains statusbarpanels. ...
...sources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordi...
stringbundle - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An element which can be used to load localized resources from property files. Stringbundles should be placed inside a stringbundleset element. A property file is a list of property key-value pairs each on a separate line. The key and value is separated with an equals sign. For example, the following defines two
properties: message.displayError=An error occured trying to display this message message.nameAlreadyUsed=The name %S is already being used by another account. More information is available in the XUL tutorial. ...
...d value is separated with an equals sign. For example, the following defines two
properties: message.displayError=An error occured trying to display this message message.nameAlreadyUsed=The name %S is already being used by another account. More information is available in the XUL tutorial. The "src" attribute accepts only absolute chrome:// URLs (see bugs 133698, 26291) Attributes src
Properties appLocale , src, stringBundle, strings Methods getFormattedString, getString Examples (example needed) Attributes src Type: URI The URI of the property file that contains the localized strings. Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, e...
...This is an object which implements nsILocale. src Type: URL Gets and sets the value of the src attribute. stringBundle Type: nsIStringBundle Returns the XPCOM string bundle object which implements nsIStringBundle. strings Type...
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. A row of tabs is displayed at the top of tabbox which may be used to switch between each page. The tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. More information is available in the XUL tutorial. ...
...d pages of elements. A row of tabs is displayed at the top of tabbox which may be used to switch between each page. The tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. More information is available in the XUL tutorial. ...
...he document level. Tab navigation will occur as long as any element in the document is focused. handleCtrlTab Type: boolean If set to true or omitted, the tabbox will switch to the next tab when the Control and Tab keys are pressed. If the Shift key is also held down, the previous tab will be displayed. If this attribute is set to false, these keys do not navigate between tabs.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. eventNode Type: EventTarget Indicates the node where keyboard navigation events listener is set up. The initial value for this property is determined by the value of the eventnode attribute. handleCtrlPageUpDown Type: boolean Gets and sets the value of the hand...
tabpanels - Archive of obsolete content
The tabpanels element should be placed in a tabbox although it does not have to be a direct child. The children of the tabpanels element become the panels of the tabbox. In most cases you would use a vbox, but they can be any element, although some people like to use tabpanel elements. By clicking the first tab, the first panel will be displayed. By clicking the second tab, the second panel will be displayed and so on. There should be the same number of panels as there are tabs. Panels should never be hidden; hiding the tab suffices to make the panel inaccessible. ...
...like to use tabpanel elements. By clicking the first tab, the first panel will be displayed. By clicking the second tab, the second panel will be displayed and so on. There should be the same number of panels as there are tabs. Panels should never be hidden; hiding the tab suffices to make the panel inaccessible. More information is available in the XUL tutorial. Attributes selectedIndex
Properties selectedIndex, selectedPanel Examples (example needed) Attributes selectedIndex Type: integer Gets and sets the index of the currently selected panel. The first item is at index 0. Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flag...
... selectedIndex Type: integer Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning -1 to this property, all items will be deselected. Returns -1 if no items are selected selectedPanel Type: e...
tabs - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A row of tabs. A tabs element should be placed inside a tabbox and should contain tab elements. NB: You can add some other elements to tabs such as button, but they will receive an index. Activating them will not change the selectedIndex. More information is available in the XUL tutorial. ...
... inside a tabbox and should contain tab elements. NB: You can add some other elements to tabs such as button, but they will receive an index. Activating them will not change the selectedIndex. More information is available in the XUL tutorial. ...
...igation. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. tooltiptextnew Not in Firefox Type: string Used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. disabled Type: boolean Gets and sets the value of the disabled attribute. itemCount Type: integer Read only property holding the number of child items. selectedIndex Type: integer Returns the index of the currently ...
textbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] An input field where the user can enter text. It is similar to the HTML input element. Only one line of text is displayed by default. The multiline attribute can be specified to display a field with multiple rows. More information is available in the XUL tutorial. ...
...be specified to display a field with multiple rows. More information is available in the XUL tutorial. ...
...e min property, whichever is higher. wrap Type: string Set this attribute to the value off to disable word wrapping in the textbox. If this attribute is not specified, word wrapping is enabled. wraparound Type: boolean If true, the value of the number box will wrap around when the maximum or minimum value is exceeded. The minimum and maximum values must both not be infinity.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. clickSelectsAll Type: boolean If set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged. decimalPlaces Type: integer Gets and sets the value of the decimalplaces attribute. ...
titlebar - Archive of obsolete content
This element can't be used to change the platform-native titlebar of normal windows; instead, it's used to create custom titlebars for chromeless windows. If the titlebar is in a panel element, dragging it will move the panel. Elements inside the titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and textboxes can't be focused with the mouse. If you don't want this behavior, you can override it by setting allowevents="true" on the titlebar element. ...
...rtbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width Note: The allowevents attribute did not work for title bars prior to Firefox 3. ...
... maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width Note: The allowevents attribute did not work for title bars prior to Firefox 3. ...
toolbar - Archive of obsolete content
It is a type of box that defaults to horizontal orientation. It can be collapsed with a grippy when the toolbar is placed inside a toolbox. The toolbar should always have an id attribute. Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a toolbox element. You can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. ...
...lbar. This means that the palette now only contains items not already in the toolbar. This introduces a potential compatibility problem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette. ...
...efines the default for all toolbars that don't specify an icon size. mode Not in SeaMonkey 1.x Type: one of the values below How the toolbarbuttons on the toolbar are displayed. icons Show only icons. text Show only text. full Show both. toolbarname Not in SeaMonkey 1.x Type: string The name of the toolbar, which is listed on the Show/Hide toolbars menu.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. currentSet Not in SeaMonkey 1.x Type: comma-separated list of strings Holds a comma-separated list of the IDs of the items currently on the toolbar. For spacers, separators, and flexible spacers the following strings are used instead of IDs: "spacer", "separator", "spring". An empty ...
toolbarbutton - Archive of obsolete content
It is equivalent to a regular button except that it may be rendered differently. Typically, it is expected to have an image. More information is available in the XUL tutorial. Relevant accessbility guidelines All toolbar functionality should be duplicated elsewhere in the application Where possible, provide keyboard alternatives. Where possible, duplicate functionality in a menu item or context menu. Where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...ard alternatives. Where possible, duplicate functionality in a menu item or context menu. Where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...icates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling: always The image is always checked to see whether it should be reloaded. never The image will be loaded from the cache if possible.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. autoCheck Type: boolean Gets and sets the value of the autoCheck attribute. checkState Type: integer, values 0, 1, or 2 Gets and sets the value of ...
toolbargrippy - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Not in Firefox The notch on the side of a toolbar which can be used to collapse and expand it. This element is used internally by the toolbar and should only be used directly when modifying its theme. More information is available in the XUL tutorial. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Not in Firefox The notch on the side of a toolbar which can be used to collapse and expand it. This element is used internally by the toolbar and should only be used directly when modifying its theme. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessible Type: nsIAccessible Returns the accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pa...
toolbarseparator - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Creates a separator between groups of toolbar items. It is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Creates a separator between groups of toolbar items. It is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
...sources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordin...
toolbarspacer - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox only A space between toolbar items. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox only A space between toolbar items. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ord...
toolbarspring - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox only A flexible space between toolbar items. ...
... << XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox only A flexible space between toolbar items. ...
...sources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordi...
toolbox - Archive of obsolete content
It is a type of box but defaults to vertical orientation. If a toolbar is placed inside a toolbox, a grippy is displayed on its left or upper edge. The user may click the grippy to collapse the toolbar. If multiple toolbars are placed in the same toolbox, they will all collapse into the same row. The Firefox browser does not have grippies so toolbars cannot be collapsed and expanded. Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a toolbox. ...
... with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. The external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externalToolbars property. More information is available in the XUL tutorial. If you'd like to detect when toolbars in a toolbox are changed, see Toolbar customization events. ...
... customToolbarCount Firefox only Type: integer The number of custom toolbars currently within the toolbox. externalToolbars Type: array of elements An array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbo...
tree - Archive of obsolete content
The tree may contain any number of rows and any number of columns. Each row of the tree may contain child rows which are displayed indented from the parent. Unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object. The view object implements the nsITreeView interface. The view is queried for the data to appear in the tree. There are several ways in which trees are used, as listed below. The second column lists the interfaces available via the tree's view property. ...
...dget Changes. Relevant accessbility guidelines Provide alternative access (for example, via menus) to column picker and for header behaviors like sorting (these have no default keyboard access). ...
...(rdf:local-store). tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. treelines Type: boolean When set to true, lines are drawn connecting the lines in the tree; when false, the lines are not drawn. This is false by default.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. builderView Type: nsIXULTreeBuilder A reference to the tree builder which constructed the tree data. The builder provides access to the RDF resources for each row in the tree, and allows sorting the data by column. In newer versions of Mozilla, the builderView property ...
treecol - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A column of a tree. It displays the column header and holds the size and other information about the column. You can also place splitter elements between the columns to allow column resizing. You should always place an id attribute on a treecol element to ensure that the column positioning is handled properly. More information is available in the XUL tutorial. Attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortActive, sortDirection, src, type, width
Properties accessibleType Style classes treecol-image Examples This example shows a checkbox in the first column, requires the style below. <tree flex="1" editable="...
.... This is used in Mozilla's download manager window. text The content of the columns is text. width Type: string (representing an integer) The preferred width of the tree column. The value should not include a unit as all values are in pixels. Specifying widths for your columns causes Gecko to allow the tree to be scrolled horizontally if it is wider than the available space. ...
...nteger) The preferred width of the tree column. The value should not include a unit as all values are in pixels. Specifying widths for your columns causes Gecko to allow the tree to be scrolled horizontally if it is wider than the available space.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. ...
treeitem - Archive of obsolete content
The treeitem can be clicked by the user to select the row of the tree. The treeitem contains a single row and all of what appear to the user as that row's descendants. In a template condition, you should use a treeitem instead of a content element when the dont-build-content flag is specified. Set the uri attribute to the variable name to bind to a content node during matching. More information is available in the XUL tutorial. ...
...ype: string For template-generated content, the attribute should be placed on the element where content generation should begin. Thus, it should be placed on an element that is a descendant of a template. The value should be set to rdf:*. 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. ...
...generated content, the attribute should be placed on the element where content generation should begin. Thus, it should be placed on an element that is a descendant of a template. The value should be set to rdf:*. 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. ...
treerow - Archive of obsolete content
It should be placed inside a treeitem element. Children of the treerow should be treecell elements. If child rows are necessary, they should be placed in a treechildren element inside the parent treeitem. More information is available in the XUL tutorial. Attributes
properties Examples (example needed) Attributes
properties Type: space-separated list of property names Sets the
properties of the element, which can be used to style the element. For more information, see Styling a Tree. ...
...For more information, see Styling a Tree. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
treeseparator - Archive of obsolete content
Attributes
properties Examples (example needed) Attributes
properties Type: space-separated list of property names Sets the
properties of the element, which can be used to style the element. For more information, see Styling a Tree. ...
...For more information, see Styling a Tree. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
window - Archive of obsolete content
It is the root node of a XUL document. It is by default a horizontally oriented box. As it is a box, all box attributes can be used. By default, the window will have a platform-specific frame around it. To set an icon for the window, create a platform-specific icon file <windowid>.ico and/or <windowid>.xpm and place or install these files into the <mozilla-directory>/chrome/icons/default/ directory. The <windowid> is the value of the id attribute on the window. This allows you to have a different icon for each window. ...
...or window. Some of Mozilla's window handling functions use this attribute to group windows of the same type together. ...
...'s window handling functions use this attribute to group windows of the same type together. ...
wizard - Archive of obsolete content
It is used for a window with several steps contained on several pages. This element provides the header and buttons along the bottom, and also handles navigation between the pages. Each page should be constructed using a wizardpage. The pages are displayed in the order that they are placed in the wizard, unless you use the next and pageid attributes on the pages to change the sequence. The wizard will rendered in a manner suitable for the user's selected theme and platform. ...
...t and pageid attributes on the pages to change the sequence. The wizard will rendered in a manner suitable for the user's selected theme and platform. In newer versions of Mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages. More information is available in the XUL tutorial. ...
... window. Some of Mozilla's window handling functions use this attribute to group windows of the same type together. Values for window type as found on MXR: http://mxr.mozilla.org/mozilla-release/search?string=windowtype navigator:browser - Looks like if window has gBrowser it has this window type devtools:scratchpad - Scratchpad windows navigator:view-source - The view source windows
Properties canAdvance Type: boolean This property is set to true if the user can press the Next button to go to the next page. If this property is false, the user cannot navigate to the next page. Set this property to true to indicate that the user can go to the next page. Set to false to disallow moving to the next page. This has the effect of enabling or disabling the Next button, or, on the last ...
Building a Theme - Archive of obsolete content
extension works with Firefox 39 and any subsequent 39.x release. Themes are compatible by default, unless you set strict compatibility mode for your theme. If you get a message that the install.rdf is malformed, it is helpful to load it into firefox using the File->Open File command and it will report XML errors to you. See Install Manifests for a complete listing of the required and optional
properties. Save the file. Styling the Browser's UI with CSS Firefox's user interface is written in XUL and JavaScript. XUL is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees, etc. User actions are bound to functionality using JavaScript. These XUL elements are styled using CSS. If you don't know CSS, it's going to be a steep learning curve, and you may want to ...
...led as a (chrome). Compare (chrome) to (http) which tells Firefox to treat the URI as a web page. Secondly, a package name (in the example above, browser) which identifies the bundle of user interface components. Thirdly, the type of data being requested. There are three types: content (XUL, JavaScript, XBL bindings, etc. that form the structure and behavior of an application UI), locale (DTD, .
properties files etc that contain strings for the UI's localization), and skin (CSS and images that form the theme of the UI) Finally, the path of a file to load. So, chrome://foo/skin/bar.png loads the file bar.png from the foo theme's skin section. When you load content using a Chrome URI, Firefox uses the Chrome Registry to translate these URIs into the actual source files on disk (or in JAR packages...
...me://foo/skin/bar.png loads the file bar.png from the foo theme's skin section. When you load content using a Chrome URI, Firefox uses the Chrome Registry to translate these URIs into the actual source files on disk (or in JAR packages). Create a Chrome Manifest The Chrome Manifest is the file that maps these Chrome URIs to your theme's files. For more information on Chrome Manifests and the
properties they support, see the Chrome Manifest Reference. Open the file called chrome.manifest that you created alongside the chrome directory at the root of your extension's source folder hierarchy. Add in this code: skin browser sample chrome/browser/ skin communicator sample chrome/communicator/ skin global sample chrome/global/ skin mozapps sample chr...
-ms-filter - Archive of obsolete content
From'); filterImg.addEventListener('click', doFilter); function doFilter () { filterFrom.filters.item(0).Apply(); // 12 is the dissolve filter. ...
...ddEventListener('click', doFilter); function doFilter () { filterFrom.filters.item(0).Apply(); // 12 is the dissolve filter. filterFrom.filters.item(0).Transition=12; imageFrom.style.visibility = "hidden"; filterTo.style.visibility = ""; filterFrom.filters.item(0).play(14); } </script> </body> Gradient progid:DXImageTransform.Microsoft.Gradient( <
properties> ) where <
properties> = [ <Enabled> | <EndColor> | <EndColorStr> | <GradientType> | <StartColor> | <StartColorStr> ]# where <Enabled> = 'Enabled=' [ true | false ] <EndColor> = 'StartColor=' <color> <EndColorStr> = 'StartColorStr=' <color> <GradientType> = 'GradientType=' <integer> <StartColor> = 'StartColor=' <color> <StartColorStr> = 'StartColorStr=' <color> Enabled Default: true Set to false to disable. End...
...Not part of any specification. 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 text-shadow or box-shadow Matrix transform, transform-origin In Windows Internet Explorer 8, the -ms-filter attribute is an extension to CSS, and can be used as a synonym for filter in IE8 Standards mode. When you use -ms-filter, enclose the progid in single quotes (') or double quotes ("). Use comm...
-ms-scroll-limit - Archive of obsolete content
The -ms-scroll-limit CSS property is a Microsoft extension that specifies values for the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max
properties. ...
... The -ms-scroll-limit CSS property is a Microsoft extension that specifies values for the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max
properties. ...
...the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max
properties. 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, separated by spaces. Values -ms-scroll-limit-x-min The value of the -ms-scroll-lim...
Iterator - Archive of obsolete content
Non-standard. The Iterator function is a SpiderMonkey-specific feature, and will be removed at some point. For future-facing usages, consider using for..of loops and the iterator protocol. The Iterator function returns an object which implements legacy iterator protocol and iterates over enumerable
properties of an object. Syntax Iterator(object, [keyOnly]) Parameters object Object to iterate over
properties. keyOnly If keyOnly is truthy value, Iterator.prototype.next returns property_name only. Description Returns Iterator instance that iterates over object. Iterator instance returns [property_name, property_value] array for each iteration if keyOnly is falsy, otherwise, if keyOnly is truthy, it returns property_name for each iteration. If object is the Iterator instance or G...
...thy value, Iterator.prototype.next returns property_name only. Description Returns Iterator instance that iterates over object. Iterator instance returns [property_name, property_value] array for each iteration if keyOnly is falsy, otherwise, if keyOnly is truthy, it returns property_name for each iteration. If object is the Iterator instance or Generator instance, it returns object itself.
Properties Iterator.prototype[@@iterator] Returns a function that returns iterator object. Methods Iterator.prototype.next Returns next item in the [property_name, property_value] format or property_name only. It throws StopIteration if there are no more items. Examples Iterating over
properties of an object var a = { x: 10, y: 20, }; var iter = Iterator(a); console.log(iter.next()); // ["...
...pe.next Returns next item in the [property_name, property_value] format or property_name only. It throws StopIteration if there are no more items. ...
Debug - Archive of obsolete content
Non-standard. Do not use! ...
... apps. In Windows 8.x Store apps, the write and writeln functions of the Debug object display strings in the Visual Studio Output window at run time. To debug Internet Explorer scripts, you must have a script debugger installed and the script must run in debug mode. Internet Explorer 8 and later versions include the JavaScript debugger. If the script is not being debugged, the Debug methods and
properties have no effect. Constants Async Callback Status Codes Contant Description Value Debug.MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE The synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 Debug.MS_ASYNC_CALLBACK_STATUS_JOIN The synchronous work item satisfied part of a join asynchronous operation. 1 ...
... an asynchronous operation. 4 Async Operation Status Codes Contant Description Value Debug.MS_ASYNC_OP_STATUS_SUCCESS The asynchronous operation was successful. 1 Debug.MS_ASYNC_OP_STATUS_CANCELED The asynchronous operation was canceled. 2 Debug.MS_ASYNC_OP_STATUS_ERROR The asynchronous operation resulted in an error. 3
Properties Debug.debuggerEnabled Determines whether debugging is enabled for the script context. Debugging may be enabled or disabled whether or not a debugger is attached. Debug.setNonUserCodeExceptions Determines whether any try-catch blocks in this scope are to be treated by the debugger as user-unhandled. Functions Debug.msTraceAsyncCallbackCompleted Indicates that the callback stack associa...
for each...in - Archive of obsolete content
is deprecated as the part of ECMA-357 (E4X) standard. E4X support has been removed. Consider using for...of instead. Firefox now warns about the usage of for each...in and it no longer works starting with Firefox 57. Please see Warning: JavaScript 1.6's for-each-in loops are deprecated for migration help. The for each...in statement iterates a specified variable over all values of object's
properties. For each distinct property, a specified statement is executed. Syntax for each (variable in object) { statement } variable Variable to iterate over property values, optionally declared with the var keyword. This variable is local to the function, not to the loop. object Object for which the
properties are iterated. statement A statement to execute for each property. To execute ...
...riable Variable to iterate over property values, optionally declared with the var keyword. This variable is local to the function, not to the loop. object Object for which the
properties are iterated. statement A statement to execute for each property. To execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. Description Some built-in
properties are not iterated over. These include all built-in methods of objects, e.g. String's indexOf method. However, all user-defined
properties are iterated over. ...
...up those statements. Description Some built-in
properties are not iterated over. These include all built-in methods of objects, e.g. String's indexOf method. However, all user-defined
properties are iterated over. Examples Using for each...in Warning: Never use a loop like this on arrays. Only use it on objects. See for...in for more details. The following snippet iterates over an object's
properties, calculating their sum: var sum = 0; var obj = {prop1: 5, prop2: 13, prop3: 8}; for each (var item in obj) { sum += item; } console.log(sum); // logs "26", which is 5+13+8 Specifications Not part of any standard. ...
Archived JavaScript Reference - Archive of obsolete content
ting. Intl.DateTimeFormat is an alternative to format dates in a standards-compliant way. See also the newer version of Date.prototype.toLocaleDateString().ECMAScript 2016 to ES.Next support in MozillaExpression closuresExpression closures are a shorthand function syntax for writing simple functions.for each...inThe for each...in statement iterates a specified variable over all values of object's
properties. For each distinct property, a specified statement is executed.Function.arityNot part of any standard.Function.prototype.isGenerator()The non-standard isGenerator() method used to determine whether or not a function is a generator. It has been removed from Firefox starting with version 58.Generator comprehensionsThe generator comprehension syntax was a JavaScript expression which allowed you to q...
...and removed in browsers.Object.observe()The Object.observe() method was used for asynchronously observing the changes to an object. It provided a stream of changes in the order in which they occur. However, this API has been deprecated and removed from browsers. ...
...for a property to be assigned a value and runs a function when that occurs.Object.unobserve()The Object.unobserve() method was used to remove observers set by Object.observe(), but has been deprecated and removed from Browsers. You can use the more general Proxy object instead.Reflect.enumerate()The static Reflect.enumerate() method used to return an iterator with the enumerable own and inherited
properties of the target object, but has been removed in ECMAScript 2016 and is deprecated in browsers.String.prototype.quote()The non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes ("). ...
LiveConnect Overview - Archive of obsolete content
ped in an instance of the class netscape.javascript.JSObject and passed to Java. When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type JSObject; when a JSObject is sent from Java to JavaScript, the runtime engine unwraps it to its original JavaScript object type. The JSObject class provides an interface for invoking JavaScript methods and examining JavaScript
properties. JavaScript to Java Communication When you refer to a Java package or class, or work with a Java object or array, you use one of the special LiveConnect objects. All JavaScript access to Java takes place with these objects, which are summarized in the following table. Table 9.1 The LiveConnect Objects Object Description JavaArray A wrapped Java array, accessed from...
...leNotFound } else { throw e; } } See Exception Handling Statements for more information about JavaScript exceptions. Java to JavaScript Communication If you want to use JavaScript objects in Java, you must import the netscape.javascript package into your Java file. This package defines the following classes: netscape.javascript.JSObject allows Java code to access JavaScript methods and
properties. netscape.javascript.JSException allows Java code to handle JavaScript errors. See the JavaScript Reference for more information about these classes. Locating the LiveConnect classes In older versions of the Netscape browser, these classes were distributed along with the browser. Starting with JavaScript 1.2, these classes are delivered in a .jar file; in previous versions of JavaScript, these ...
...The previous example uses getMember to assign the value of the JavaScript property jsDog.breed to the Java data member JavaDog.dogBreed. Note: A more realistic example would place the call to getMember inside a try...catch statement to handle errors of type JSException. See Handling JavaScript Exceptions in Java for more information. To get a better sense of how getMembe...
Describing microformats in JavaScript - Archive of obsolete content
ontain the following entries: mfVersion Specifies the version number of the microformat API to which the definition was written. For Firefox 3, this should be set to 0.8. mfObject The JavaScript object that implements the microformat. className A string specifying the name of the microformat's class as referenced in HTML (class="className"). required An array indicating the names of any
properties that must be specified. This may be left out if all
properties are optional.
properties A structure describing the
properties of the microformat. Property specifications Each property in the
properties structure is specified by its name, and may include additional attributes if the property so requires. Standard attributes are: plural A boolean value indicating that, if true indicates th...
...f a property is plural, it is returned as an array. virtual A boolean value indicating whether or not the property is virtual. If it's virtual, the virtualGetter() method will be called to attempt to create the property if it doesn't exist. virtualGetter A function that is called to get a virtual property's value. This is only used if virtual is true. value The property's default value. sub
properties It's possible for a property to itself include more
properties; to do so, include them in a sub
properties structure within the property. dataType The type of data contained by the property. Possible values are: dateTime An ISO date anyURI A URI email An email address tel A telephone number HTML HTML including tags float A floating-point number microformat A microformat micr...
...mber microformat A microformat microformat_property A specific property within the microformat specified by microformat. custom Custom data A simple example The hCard microformat for defining contact information makes use of the adr microformat to define an address. The adr microformat is defined as follows: var adr_definition = { mfVersion: 0.8, mfObject: adr, className: "adr",
properties: { "type" : { plural: true, types: ["work", "home", "pref", "postal", "dom", "intl", "parcel"] }, "post-office-box" : { }, "street-address" : { plural: true }, "extended-address" : { }, "locality" : { }, "region" : { }, "postal-code" : { }, "country-name" : { } } }; The
properties are quite simple here. The type...
Efficient animation for web games - Game development
and end of animations that allow you to attach JavaScript callbacks and form a rudimentary form of synchronisation (though there are no guarantees on how promptly these callbacks will happen). Speaking of the assumptions that the browser can make, you should avoid causing it to have to re-layout during animations. In this vein, it is worth trying to stick to animating only transform and opacity
properties. Though some browsers make some effort for other
properties to be animated quickly, these are pretty much the only ones semi-guaranteed to be fast across all browsers. Something to be careful of is that overflow may end up causing re-layout, or other expensive calculations. If you are setting a transform on something that would overlap its container's bounds, you may want to set overflow: hidden ...
...ing in an arbitrary browsing session, you can never really know how long the browser will take to draw a particular frame. requestAnimationFrame causes the browser to redraw and call your function before that frame gets to the screen. The downside of using this vs. setTimeout is that your animations must be time-based instead of frame-based, i.e. you must keep track of time and set your animation
properties based on elapsed time. requestAnimationFrame includes a DOMHighResTimeStamp in its callback function prototype, which you definitely should use (as opposed to using the Date object), as this will be the time the frame began rendering, and ought to make your animations look more fluid. You may have a callback that ends up looking something like this: var startTime = -1; var animationLength = 2000...
...y various parts of Clutter, but with a focus on avoiding scope-creep. It does one thing, and it does it well. Animator.js is a fire-and-forget style animation library, designed to be used with games, or other situations where you need many, synchronised, custom animations. It includes a handful of built-in tweening functions, the facility to add your own, and helper functions for animating object
properties. Puzzowl uses it to drive all the drawing updates and transitions, by overriding its requestAnimationFrame function with a custom version that makes the request, and appending the game's drawing function onto the end of the callback like so: animator.requestAnimationFrame = function(callback) { requestAnimationFrame(function(t) { callback(t); redraw(); }); }; The game's re...
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
Developers should wait to include the unprefixed property until browser behavior is standardized. Browser vendors are working to stop using vendor prefixes for experimental features. Web developers have been using them on production Web sites, despite their experimental nature. ...
...rsions of Opera) -ms- (Internet Explorer and Microsoft Edge) Sample usage: -webkit-transition: all 4s ease; -moz-transition: all 4s ease; -ms-transition: all 4s ease; -o-transition: all 4s ease; transition: all 4s ease; API prefixes Historically, vendors have also used prefixes for experimental APIs. If an entire interface is experimental, then the interface's name is prefixed (but not the
properties or methods within). If an experimental property or method is added to a standardized interface, then the individual method or property is prefixed. Interface prefixes Prefixes for interface names are upper-cased: WebKit (Chrome, Safari, newer versions of Opera, almost all iOS browsers (including Firefox for iOS); basically, any WebKit based browser) Moz (Firefox) O (Older, pre-WebKit, vers...
...ndividual method or property is prefixed. ...
Advanced styling effects - Learn web development
re of the box. 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. Blend modes are again very familiar to users of graphics applications like Photoshop. There are two
properties that use blend modes in CSS: background-blend-mode, which blends together multiple background images and colors set on a single element. mix-blend-mode, which blends together the element it is set on with elements it is overlapping -- both background and content. You can find a lot more examples than are available here in our blend-modes.html example page (see source code), and on the <blen...
... { background-color: purple; position: absolute; bottom: -10px; right: 0; z-index: -1; } .multiply-mix { mix-blend-mode: multiply; } This gives us the following results: You can see here that the multiply mix blend has blended together not only the two background images, but also the color from the <div> below it too. Note: Don't worry if you don't understand some of the layout
properties above, like position, top, bottom, z-index, etc. We will cover these in detail in our CSS Layout module. CSS shapes While it is true that everything in CSS is a rectangular box, and images are a physical rectangular box, we can make it look as if our content flows around non-rectangular things by using CSS Shapes. The CSS Shapes specification enables the wrapping of text around a non-rectangu...
... value for background-clip. When used along with the proprietary -webkit-text-fill-color: transparent; feature, this allows you to clip background images to the shape of the element's text, making for some nice effects. This is not an official standard, but has been implemented across multiple browsers, as it is popular, and used fairly widely by developers. ...
Organizing your CSS - Learn web development
uely remember there was a great tutorial about that thing, but where is it? Create logical sections in your stylesheet It is a good idea to have all of the common styling first in the stylesheet. This means all of the styles which will generally apply unless you do something special with that element. You will typically have rules set up for: body p h1, h2, h3, h4, h5 ul and ol The table
properties Links In this section of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and lists and so on. /* || GENERAL STYLES */ body { ... } h1, h2, h3, h4 { ... } ul { ... } blockquote { ... } After this section we could define a few utility classes, for example a class that removes the default list style for lists we're going ...
...pular pre-processor is Sass. This is not a Sass tutorial, so I will briefly explain a couple of the things that Sass can do, which are really helpful in terms of organisation, even if you don't use any of the other Sass features. If you want to learn a lot more about Sass, start with the Sass basics article, then move on to their other documentation. Defining variables CSS now has native custom
properties, making this feature increasingly less important, however one of the reasons you might use Sass is to be able to define all of the colors and fonts used in a project as settings, then use that variable around the project. This means that if you realise you have used the wrong shade of blue, you only need change it in one place. If we created a variable called $base-color as in the first line bel...
...ple of a post-processor solution for doing this would be cssnano. Wrapping up This is the final part of our Learning CSS Guide, and as you can see there are many ways in which your exploration of CSS can continue from this point. To learn more about layout in CSS, see the Learn CSS Layout section. You should also now have the skills to explore the rest of the MDN CSS material. You can look up
properties and values, explore our CSS Cookbook for patterns to use, and read more in some of the specific guides such as our Guide to CSS Grid Layout. 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 ...
CSS values and units - Learn web development
roperty. In this lesson we will take a look at some of the most common values and units in use. 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 learn about the different types of values and units used in CSS
properties. What is a CSS value? In CSS specifications and on the property pages here on MDN you will be able to spot values as they will be surrounded by angle brackets, such as <color> or <length>. When you see the value <color> as valid for a particular property, that means you can use any valid color as a value for that property, as listed on the <color> reference page. Note: You'll also see C...
...n use any valid color as a value for that property, as listed on the <color> reference page. Note: You'll also see CSS values referred to as data types. The terms are basically interchangeable -- when you see something in CSS referred to as a data type, it is really just a fancy way of saying value. Note: Yes, CSS values tend to be denoted using angle brackets, to differentiate them from CSS
properties (e.g. the color property, versus the <color> data type). 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. In the following example we have set the color of our heading using a keyword, and the background using the rgb() function: h1 { color: black; background-color: rgb(19...
...lement's font, or the size of the viewport. 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. Some of the most useful units for web development are listed in the table below. Unit Relative to em Font size of the parent, in the case of typographical
properties like font-size, and font size of the element itself, in the case of other
properties like width. ex x-height of the element's font. ch The advance measure (width) of the glyph "0" of the element's font. rem Font size of the root element. lh Line height of the element. vw 1% of the viewport's width. vh 1% of the viewport's hei...
Supporting older browsers - Learn web development
ey display in a row. Any browser that does not support CSS Grid Layout will see the row of boxes as a floated layout. A floated item that becomes a grid item loses the float behaviour, which means that by turning the wrapper into a Grid Container, the floated items become Grid Items. If the browser supports Grid Layout it will display the grid view, if not it ignores the display: grid and related
properties and the floated layout is used. * {box-sizing: border-box;} .wrapper { background-color: rgb(79,185,227); padding: 10px; max-width: 400px; display: grid; grid-template-columns: 1fr 1fr 1fr; } .item { float: left; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } <div class="wrapper"> <div class="item">Item One</div> <div class="item">Item Two</div...
...ct once the cleared item becomes a grid item, so you could have a layout with a cleared footer, which is then turned into a Grid Layout. Fallback Methods There are a number of layout methods which can be used in a similar way to this float example. You can choose the one that makes the most sense for the layout pattern you need to create. Float and clear As shown above, the float and clear
properties cease to affect the layout if floated or cleared items become flex or grid items. display: inline-block This method can be used to create column layouts, if an item has display: inline-block set but then becomes a flex or grid item, the inline-block behaviour is ignored. display: table The method of creating CSS Tables described in the introduction to these lessons can be used as a fallback. ...
...ables described in the introduction to these lessons can be used as a fallback. Items that have CSS table layouts set on them will lose this behaviour if they become flex or grid items. Importantly, the anonymous boxes created to fix up the table structure are not created. Multiple-column Layout For certain layouts you could use multi-col as a fallback, if your container has any of the column-*
properties defined on it and then becomes a grid container, the multicol behaviour will not happen. Flexbox as a Fallback for Grid Flexbox has greater browser support than Grid due to being supported by IE10 and 11, although do check out the information later in this lesson explaining the rather patchy and confusing support for Flexbox in older browsers. If you make a flex container into a grid container,...
Using your new knowledge - Learn web development
this CSS to a separate file when you create the example on your local computer. Alternatively use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. Note: If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Working with CSS The following live example shows a biography, which has been styled using CSS. The CSS
properties that I have used are as follows -- each one links to its property page on MDN, which will give you more examples of its use. 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 change how this biography looks by changing the ...
...sed are as follows -- each one links to its property page on MDN, which will give you more examples of its use. 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 change how this biography looks by changing the values of the
properties I have used. Make the level one heading pink, using the CSS color keyword hotpink. Give the heading a 10px dotted border-bottom which uses the CSS color keyword purple. Make the level 2 heading italic. Give the ul used for the contact details a background-color of #eeeeee, and a 5px solid purple border. Use some padding to push the content away from the border. Make the links green on hove...
...ive the heading a 10px dotted border-bottom which uses the CSS color keyword purple. Make the level 2 heading italic. Give the ul used for the contact details a background-color of #eeeeee, and a 5px solid purple border. Use some padding to push the content away from the border. Make the links green on hover. You should end up with something like this image. Afterwards try looking up some
properties not mentioned on this page in the MDN CSS reference and get adventurous! Remember that there is no wrong answer here -- at this stage in your learning you can afford to have a bit of fun. Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post ...
Styling links - Learn web development
ll, just that you should not stray too far from the expected behaviour. You should at least: Use underlining for links, but not for other things. If you don't want to underline links, at least highlight them in some other way. Make them react in some way when hovered/focused, and in a slightly different way when activated. The default styles can be turned off/changed using the following CSS
properties: color for the text color. cursor for the mouse pointer style -- you shouldn't turn this off unless you've got a very good reason. outline for the text outline (an outline is similar to a border, the only difference being that border takes up space in the box and an outline doesn't; it just sits over the top of the background). The outline is a useful accessibility aid, so think carefully be...
...ne (an outline is similar to a border, the only difference being that border takes up space in the box and an outline doesn't; it just sits over the top of the background). The outline is a useful accessibility aid, so think carefully before turning it off; you should at least double up the styles given to the link hover state on the focus state too. Note: You are not just limited to the above
properties to style your links -- you are free to use any
properties you like. Just try not to go too crazy! Styling some links Now we've looked at the default states in some detail, let's look at a typical set of link styles. To start off with, we'll write out our empty rulesets: a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { } This order is important because the link s...
...px; } So what's going on here? We'll skip over most of the CSS, as it's just the same information you've looked at before. The last rule however is interesting -- here we are inserting a custom background image on external links in a similar manner to how we handled custom bullets on list items in the last article -- this time however we are using background shorthand instead of the individual
properties. We set the path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. We also use background-size to specify the size we want the background image to be shown at -- it is useful to have a larger icon and then resize it like this as needed for responsiv...
CSS property compatibility table for form controls - Learn web development
h will help you learn how to do things. How to read the tables Values For each property, there are four possible values: Yes There's reasonably consistent support for the property across browsers. You may still face strange side effects in certain edge cases. Partial While the property works, you may frequently face strange side effects or inconsistencies. You should probably avoid these
properties unless you master those side effects first. No The property simply doesn't work or is so inconsistent that it's not reliable. n.a. The property has no meaning for this type of widget. Rendering For each property there are two possible renderings: N (Normal) Indicates that the property is applied as it is T (Tweaked) Indicates that the property is applied with the extra rule below: ...
...Be careful when you use them. line-height This property is supported inconsistently across browsers and you should avoid it. text-decoration This property is not supported by Opera on form widgets. text-overflow Opera, Safari, and IE9 do not support this property on form widgets. text-shadow Opera does not...
...ransform No No Border and background background No[1] No[1] Supported, but there is too much inconsistency between browsers to be reliable. border-radius No No box-shadow No Partial[1] IE9 does not support this property. Date pickers See the date and time input types. Many
properties are supported, but there is too much inconstency between browsers to be reliable. Property N T Note CSS box model width No No height No No border No No margin Yes Yes padding No No Text and font color No No font No No ...
Manipulating documents - Learn web development
at goes along with it. Add a <script></script> element just above the closing </body> tag. To manipulate an element inside the DOM, you first need to select it and store a reference to it inside a variable. Inside your script element, add the following line: const link = document.querySelector('a'); Now we have the element reference stored in a variable, we can start to manipulate it using
properties and methods available to it (these are defined on interfaces like HTMLAnchorElement in the case of <a> element, its more general parent interface HTMLElement, and Node -- which represents all nodes in a DOM). First of all, let's change the text inside the link by updating the value of the Node.textContent property. Add the following line below the previous one: link.textContent = 'Mozilla Devel...
...s as wished. However, we're not going to expand on those features because they are a somewhat archaic and difficult way to manipulate style. There are much easier ways. The first way is to add inline styles directly onto elements you want to dynamically style. This is done with the HTMLElement.style property, which contains inline styling information for each element in the document. You can set
properties of this object to directly update element styles. As an example, try adding these lines to our ongoing example: para.style.color = 'white'; para.style.backgroundColor = 'black'; para.style.padding = '10px'; para.style.width = '250px'; para.style.textAlign = 'center'; Reload the page and you'll see that the styles have been applied to the paragraph. If you look at that paragraph in your br...
...ering a small part of the screen, which has got a background tile applied to it. We'll use that to represent our app UI area. First of all, let's grab a reference to the div, and then grab the width and height of the viewport (the inner window, where your document is displayed) and store them in variables -- these two values are handily contained in the Window.innerWidth and Window.innerHeight
properties. Add the following lines inside the existing <script> element: const div = document.querySelector('div'); let winWidth = window.innerWidth; let winHeight = window.innerHeight; Next, we'll dynamically alter the width and height of the div to equal that of the viewport. Add the following two lines below your first ones: div.style.width = winWidth + 'px'; div.style.height = winHeight + 'px'; ...
A first splash into JavaScript - Learn web development
This is necessary, because if we didn't, the user could submit more guesses after the game is over, which would mess things up. The next three lines generate a new <button> element, set its text label to "Start new game", and add it to the bottom of our existing HTML. The final line sets an event listener on our new button so that when it is clicked, a function called resetGame() is ru...
...ur declarations near the top of the code: const guessField = document.querySelector('.guessField'); To get this reference, we used the querySelector() method of the document object. querySelector() takes one piece of information -- a CSS selector that selects the element you want a reference to. Because guessField now contains a reference to an <input> element, it now has access to a number of
properties (basically variables stored inside objects, some of which can't have their values changed) and methods (basically functions stored inside objects). 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. For example, the guesses const...
...extContent property instead. Try this: guesses.textContent = 'Where is my paragraph?'; Now for some fun stuff. Try entering the below lines, one by one: guesses.style.backgroundColor = 'yellow'; guesses.style.fontSize = '200%'; guesses.style.padding = '10px'; guesses.style.boxShadow = '3px 3px 6px black'; Every element on a page has a style property, which itself contains an object whose
properties contain all the inline CSS styles applied to that element. This allows us to dynamically set new CSS styles on elements using JavaScript. Finished for now... So that's it for building the example. You got to the end -- well done! Try your final code out, or play with our finished version here. If you can't get the example to work, check it against the source code. Previous Overview: Firs...
Adding features to our bouncing balls demo - Learn web development
To give you more of an idea, have a look at the finished example (no peeking at the source code!) Steps to complete The following sections describe what you need to do. ...
...e code!) Steps to complete The following sections describe what you need to do. Creating our new objects First of all, change your existing Ball() constructor so that it becomes a Shape() constructor and add a new Ball() constructor: The Shape() constructor should define the x, y, velX, and velY
properties in the same way as the Ball() constructor did originally, but not the color and size
properties. It should also define a new property called exists, which is used to track whether the balls exist in the program (have not been eaten by the evil circle). This should be a boolean (true/false). The Ball() constructor should inherit the x, y, velX, velY, and exists
properties from the Shape() constructor. It should also define a color and a size property, like the original Ball() constructor ...
..., or have several computer-controlled evil circles. You're probably not going to take over the world with a single evil circle, but it will do for this assessment. The EvilCircle() constructor should inherit x, y, velX, velY, and exists from Shape(), but velX and velY should always equal 20. You should do this something like Shape.call(this, x, y, 20, 20, exists); It should also define its own
properties, as follows: color -- 'white' size -- 10 Again, remember to define your inherited
properties as parameters in the constructor, and set the prototype and constructor
properties correctly. Defining EvilCircle()'s methods EvilCircle() should have four methods, as described below. draw() This method has the same purpose as Ball()'s draw() method: It draws the object instance on the canvas. ...
Working with JSON - Learn web development
ppercut", "age": 39, "secretIdentity": "Jane Wilson", "powers": [ "Million tonne punch", "Damage resistance", "Superhuman reflexes" ] } ] The above is perfectly valid JSON. You'd just have to access array items (in its parsed version) by starting with an array index, for example [0]["powers"][0]. Other notes JSON is purely a data format -- it contains only
properties, no methods. JSON requires double quotes to be used around strings and property names. Single quotes are not valid. Even a single misplaced comma or colon can cause a JSON file to go wrong, and not work. You should be careful to validate any data you are attempting to use (although computer-generated JSON is less likely to include errors, as long as the generator program is working correctly). ...
...er-generated JSON is less likely to include errors, as long as the generator program is working correctly). You can validate JSON using an application like JSONLint. JSON can actually take the form of any data type that is valid for inclusion inside JSON, not just arrays or objects. So for example, a single string or number would be a valid JSON object. Unlike in JavaScript code in which object
properties may be unquoted, in JSON only quoted strings may be used as
properties. Active learning: Working through a JSON example So, let's work through an example to show how we could make use of some JSON data on a website. Getting started To begin with, make local copies of our heroes.html and style.css files. The latter contains some simple CSS to style our page, while the former contains some ver...
...Here we first create an <h1> element with createElement(), set its textContent to equal the squadName property of the object, then append it to the header using appendChild(). We then do a very similar operation with a paragraph: create it, set its text content and append it to the header. The only difference is that its text is set to a concatenated string containing both the homeTown and formed
properties of the object. Creating the hero information cards Next, add the following function at the bottom of the code, which creates and displays the superhero cards: function showHeroes(jsonObj) { const heroes = jsonObj['members']; for (let i = 0; i < heroes.length; i++) { const myArticle = document.createElement('article'); const myH2 = document.createElement('h2'); const myPara1 = ...
Ember interactivity: Events, classes and state - Learn web development
rest of the file is vanilla JavaScript, and would work in any application. The @action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template. @action also binds the this of the function to the class instance. Note: A decorator is basically a wrapper function, which wraps and calls other functions or
properties, providing additional functionality along the way. For example, the @tracked decorator (see slightly later on) runs code it is applied to, but additionally tracks it and automatically updates the app when values change. Read JavaScript Decorators: What They Are and When to Use Them for more general information on decorators. Coming back to our browser tab with the app running, we can type whate...
...s whether the todo has been completed or not. When instantiated, a Todo object will have an initial text value equal to the text given to it when created (see below), and an isCompleted value of false. The only Ember-specific part of this class is the @tracked decorator -- this hooks in to the reactivity system and allows Ember to update what you're seeing in your app automatically if the tracked
properties change. More information on tracked can be found here. Now it's time to add to the body of the service. First add another import statement below the previous one, to make actions available inside the service: import { action } from '@ember/object'; Update the existing export default class TodoDataService extends Service { ... } block as follows: export default class TodoDataService extends S...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Introduction to client-side frameworks - Learn web development
The tenth line of this snippet references another build function: buildDeleteButtonEl(). It follows a similar pattern to the one we used to build a list item element: function buildDeleteButtonEl(id) { const button = document.createElement('button'); const textContent = document.createTextNode('Delete'); button.setAttribute('type', 'button'); button.appendChild(t...
...None of this code actually handles user interactions, or addresses adding or deleting a task. If we add those features, we have to remember to update our UI in the right time and in the right way. JavaScript frameworks were created to make this kind of work a little easier -- they exist to provide a better developer experien...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
your existing checkAllTodos() function to the following: const checkAllTodos = (completed) => { todos.forEach(t => t.completed = completed) console.log('todos', todos) } Go back to your browser, open your DevTools console, and click Check All/Uncheck All a few times. You'll notice that the array is successfully updated every time you press the button (the todo objects' completed
properties are toggled between true and false), but Svelte is not aware of that. This also means that in this case, a reactive statement like $: console.log('todos', todos) won't be very useful. To find out why this is happening, we need to understand how reactivity works in Svelte when updating arrays and objects. Many web frameworks use the virtual DOM technique to update the page. Basically, the virtua...
...nally Svelte will flag todos as changed and remove the apparently redundant self-assignment. Apart from the fact that it looks weird, it's perfectly ok to use this technique, and sometimes it's the most concise way to do it. We could also access the todos array by index, like this: const checkAllTodos = (completed) => { todos.forEach( (t,i) => todos[i].completed = completed) } Assignments to
properties of arrays and objects -- e.g. obj.foo += 1 or array[i] = x -- work the same way as assignments to the values themselves. When Svelte analyzes this code, if can detect that the todos array is being modified. Another solution is to assign a new array to todos containing a copy of all the todos with the completed property updated accordingly, like this: const checkAllTodos = (completed) => { tod...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Creating our first Vue component - Learn web development
in production. Additionally, prop validation functions are invoked before the component instance is created, so they do not have access to the component state (or other props). For this component, we'll use the object registration method. Go back to your ToDoItem.vue file. Add a props property inside the export default {} object, which contains an empty object. Inside this object, add two
properties with the keys label and done. The label key's value should be an object with 2
properties (or props, as they are called in the context of being available to the components). The first is a required property, which will have a value of true. This will tell Vue that we expect every instance of this component to have a label field. Vue will warn us if a ToDoItem component does not have a labe...
...tion. This is to keep the data values unique for each instance of a component at runtime -- the function is invoked separately for each component instance. If you declared data as just an object, all instances of that component would share the same values. This is a side-effect of the way Vue registers components and something you do not want. You use this to access a component's props and other
properties from inside data, as you may expect. We'll see an example of this shortly. Note: Because of the way that this works in arrow functions (binding to the parent's context), you wouldn't be able to access any of the necessary attributes from inside data if you used an arrow function. So don't use an arrow function for the data property. So let's add a data property to our ToDoItem component. This...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Accessibility API cross-reference
hird of the states and roles in Sun's accessibility API's are the same as in MSAA. To do Fill out Mac API column.(Mac OS X - Carbon Accessibility API and Accessibility Constants) Finish ARIA column - add explanation of the term 'Abstract role' Fill out HTML column Create AOM column Fill out XUL column. ...
...most common content type in most documents. A paragraph generally encloses distinct portions of content that are not otherwise specified with other block level structure element types such as heading, table or list elements. <p> <P> Shows percentage completion for task PROGRESSBAR PROGRESS_BAR n/a progressbar Page showing
properties of something PROPERTYPAGE n/a n/a n/a Your average, run-of-the-mill button PUSHBUTTON PUSH_BUTTON PUSH_BUTTON button <button> Only one radio button in a group is selectable. ARIA requires the parent to have role radiogroup RADIOBUTTON RADIO_BUTTON RADIO_BUTTON radio <input type=radio> A co...
... COLOR_CHOOSER n/a <input type=color> A dialog for picking a file n/a FILE_CHOOSER FILE_CHOOSER n/a Invoked with <input type=file> No explanation given n/a n/a INVALID n/a Contains accessible info, but its role is not known n/a n/a UNKNOWN Accessible States and
Properties Description & Notes MSAA State (STATE_SYSTEM_*) Java Accessibility State Gnome Accessibility State (ATK_STATE_*) Mac OS X Accessibility State ARIA State or property HTML attribute Tagged PDF Relevant XUL Used in ARIA to denote non-conformant user input n/a n/a INVALID aria-invalid This window is currently the acti...
The Firefox codebase: CSS Guidelines
ilable, use the pseudo :-moz-locale-dir(ltr|rtl) (for XUL files) or :dir(ltr|rtl) (for HTML files). Remember that while a tab content's scrollbar still shows on the right in RTL, an overflow scrollbar will show on the left. Write padding: 0 3px 4px; instead of padding: 0 3px 4px 3px;. This makes it more obvious that the padding is symmetrical (so RTL won't be an issue). Note: See CSS Logical
Properties and Values for more information. Testing To test for RTL layouts, you can go to about:config and set intl.uidirection to -1. Writing cross-platform CSS Firefox supports many different platforms and each of those platforms can contain many different configurations: Windows 7, 8 and 10 Default theme Aero basic (Windows 7, 8) Windows classic (Windows 7) High contrast (All ve...
... especially for large blocks of CSS. Content CSS vs. Theme CSS The following directories also contain CSS: browser/base/content/ toolkit/content/ These directories contain content CSS, that applies on all platforms, which is styling deemed to be essential for the browser to behave correctly. To determine whether some CSS is theme-side or content-side, it is useful to know that certain CSS
properties are going to lean one way or the other: color - 99% of the time it will be theme CSS, overflow - 99% content. 99% theme 70% theme 70% content 99% content font-*, color, *-color, border-*, -moz-appearance [1] line-height, padding, margin cursor, width, max-width, top, bottom [2], etc overflow, direction, display, *-align, align-*, *-box-*, flex-*, order ...
...the correct values for different platform configurations, so using those CSS variables can definitively save some testing time, as you can assume they already work correctly. Using the currentcolor keyword or inheriting is also good practice, because sometimes the needed value is already in the color or on the parent element. This is especially useful in conjunction with icons using -moz-context-
properties: fill; where the icon can adjust to the right platform color automatically from the text color. It is also possible to use currentcolor with other
properties like opacity or fill-opacity to have different opacities of the platform color. High contrast mode Content area On Windows high contrast mode, in the content area, Gecko does some automatic color adjustments regarding page colors. Part...
Communicating with frame scripts
If you're using the message manager in an add-on, a good way to do that is to prefix messages with your add-on's ID. After the name, you can pass detailed data as a string or a JSON-serializable object, and after that you can pass any objects it wants to pass to content as CPOWs. ...
...ent) { sendAsyncMessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagName }, { target : event.target }); }, false); To receive messages from content, a chrome script needs to add a message listener using the message manager's addMessageListener() API. ...
... an object containing the following
properties: name String containing the message name. sync Boolean declaring whether the message was send synchronously or aynchronously. data The JSON object passed as the second parameter to sendAsyncMessage(). target The XUL <browser> element from which this message was sent. ...
mozbrowsercaretstatechanged
mplementations and the behavior may change in the future. The mozbrowsercaretstatechanged event is fired when the user selects content in a page loaded in a browser <iframe>. This is used by the embedder to show a context menu for clipboard actions. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: rect An object that defines information about the bounding rectangle of the current selection. Its
properties are width: The width of the bounding rectangle, in CSS pixels. height: The height of the bounding rectangle, in CSS pixels. top: The top position of the bounding rectangle, in CSS pixels. bottom: The bottom position of the bounding rectangle, in CSS pixels. left: The left...
..., in CSS pixels. top: The top position of the bounding rectangle, in CSS pixels. bottom: The bottom position of the bounding rectangle, in CSS pixels. left: The left position of the bounding rectangle, in CSS pixels. right: The right position of the bounding rectangle, in CSS pixels. commands An object that defines what commands can currently be executed in the browser <iframe>. ...
mozbrowserselectionstatechanged
ay change in the future. The mozbrowserselectionstatechanged event is fired when the text selected inside the browser <iframe> content changes. Note that this is deprecated, and current implementations should use mozbrowsercaretstatechanged instead. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: rect An object that represents the bounding rectangle of the selection. Its
properties are: width: The width of the selection, in CSS pixels. height: The height of the selection, in CSS pixels. top: The Y coordinate of the top of the bounding box, in CSS pixels. bottom: The Y coordinate of the bottom of the bounding box, in CSS pixels. left: The X coordinate of the left of the bo...
...Y coordinate of the top of the bounding box, in CSS pixels. bottom: The Y coordinate of the bottom of the bounding box, in CSS pixels. left: The X coordinate of the left of the bounding box, in CSS pixels. right: The X coordinate of the right of the bounding box, in CSS pixels. commands An object that stores information about what commands can be executed on the current selection. Its
properties are: canSelectAll: A Boolean Indicating whether the select all command can be issued (true) or not (false). canCut: A Boolean Indicating whether the cut command can be issued (true) or not (false). canCopy: A Boolean Indicating whether the copy command can be issued (true) or not (false). canPaste: A Boolean Indicating whether the paste command can be issued (true) or not (false). ...
mozbrowsershowmodalprompt
be large incompatibilities between implementations and the behavior may change in the future. The mozbrowsershowmodalprompt event is fired when the content of a browser <iframe> calls the window.alert(), window.confirm(), or window.prompt() methods. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property is an anonymous JavaScript object with the following
properties: promptType A DOMString defining the type of the prompt. It can be alert, confirm, or prompt. title A DOMString representing the title of the prompt. message A DOMString representing the value passed to the window.alert(), window.confirm(), or window.prompt() methods within the browser <iframe>'s content. returnValue A DOMString representing the return value for the window.prompt() meth...
... window.confirm(), or window.prompt() methods within the browser <iframe>'s content. returnValue A DOMString representing the return value for the window.prompt() methods. This should be set by the embedder. unblock() A function to be called when the iframe is unblocked. Note that if the embedder calls preventDefault() on this event, the iframe is blocked until unblock() is called. Obsolete
properties of details msg_name A string representing the type of message. For that event, it's always showmodalprompt. initialValue A string representing the initial value for the window.prompt() methods. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowsershowmodalprompt", function( event ) { console.log("Asking for prompt:" + JSON.stringify(event.detail)...
::-moz-tree-row
is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. ...
... track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. ...
...ge in the future. The ::-moz-tree-row CSS pseudo-element is used to select rows and apply styles to tree rows. ...
SourceMap.jsm
relative. mappings: A string of base64 VLQs which contain the actual mappings. file: The generated filename this source map is associated with. SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated source's line and column positions provided. The only argument is an object with the following
properties: line: The line number in the generated source. column: The column number in the generated source. and an object is returned with the following
properties: source: The original source file, or null if this information is not available. line: The line number in the original source, or null if this information is not available. column: The column number in the orig...
...The column number in the original source, or null if this information is not available. name: The original identifier, or null if this information is not available. SourceMapGenerator An instance of the SourceMapGenerator represents a source map which is being built incrementally. new SourceMapGenerator(startOfSourceMap) To create a new one, you must pass an object with the following
properties: file: The filename of the generated source that this source map is associated with. sourceRoot: An optional root for all relative URLs in this source map. SourceMapGenerator.prototype.addMapping(mapping) Add a single mapping from original source line and column to the generated source's line and column for this source map being created. The mapping object should have the followi...
... file: The filename of the generated source that this source map is associated with. sourceRoot: An optional root for all relative URLs in this source map. SourceMapGenerator.prototype.addMapping(mapping) Add a single mapping from original source line and column to the generated source's line and column for this source map being created. The mapping object should have the following
properties: generated: An object with the generated line and column positions. original: An object with the original line and column positions. source: The original source file (relative to the sourceRoot). name: An optional original token name for this mapping. SourceMapGenerator.prototype.toString() Renders the source map being generated to a string. SourceNode SourceNodes p...
Bootstrapping a new locale
]/ path and can start localizing. ...
...browser To see what is contained in "browser" type $ ls And, you should see the following output from your terminal: aboutCertError.dtd pageInfo.dtd aboutDialog.dtd pageInfo.
properties aboutPrivateBrowsing.dtd pageReportFirstTime.dtd aboutRobots.dtd places aboutSessionRestore.dtd preferences aboutSupport.dtd quitDialog.
properties baseMenuOverlay.dtd safeMode.dtd browser.dtd safebrowsing browser.
properties sanitize.dtd credits.dtd search.
properties engineManager.dtd searchbar.dtd engineManager.
properties setDesktopBackground.dtd feeds shellservice.
properties history sidebar migration ...
... safebrowsing browser.
properties sanitize.dtd credits.dtd search.
properties engineManager.dtd searchbar.dtd engineManager.
properties setDesktopBackground.dtd feeds shellservice.
properties history sidebar migration tabbrowser.dtd openLocation.dtd tabbrowser.
properties openLocation.
properties As a localizer, you are responsible for localizing each of the ".dtd" and ".
properties" in *all* of the sub-directories found in your ab-CD directory. Directories to localize If you're starting from scratch, you should have just downloaded: mozilla-1.9.x/browser/locales/ mozilla-1.9.x/dom/locales/ mozilla-1.9.x/netwerk/locales/ mozilla-1.9.x/other-licenses/branding/fir...
Mozilla Quirks Mode Behavior
behavior. Miscellaneous & Style All of the style rules in layout/style/res/quirk.css apply only in quirks mode: Orphaned LI has an inside bullet (bug 1049). Add padding if the very first node in an LI is another UL or OL (bug 98636). Obsolete since Gecko 50 List bullets do not inherit the font size of the list (bug 97351). Removed in Firefox 50 (bug 648331). Don't inherit font
properties into tables except for font-family. Make TABLE borders gray rather than using the foreground color. Collapse top margin of BODY and TD and bottom margin of TD. Collapse the bottom or top margins of empty elements (bug 97361). Support <PRE wrap>, <PRE cols>, <PRE width>. Orphaned DD has generated content :before instead of margin (bug 5119). Indent nested DL elements (bug 8749). ...
... case sensitive. (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. The CSS parser accepts colors not beginning with #, except in shorthands. The CSS parser interprets unitless numbers as px (except for line-height and any other
properties where they have distinct meaning, and except in shorthands). In quirks mode, the CSS parser allows {} around the contents of style attributes (bug 99554). This behavior is being removed in Firefox 27, for interoperability. (bug 915053) An empty string for the background attribute sets the background URL to empty only in quirks mode. The topmargin, bottommargin, leftmargin, and rightmargin attr...
...ute sets the background URL to empty only in quirks mode. The topmargin, bottommargin, leftmargin, and rightmargin attributes on BODY are supported only in quirks mode (bug 9258). Obsolete since Gecko 35 (Firefox 35.0 / Thunderbird 35.0 / SeaMonkey 2.32) (bug 95530) This quirk is now HTML5 conform and has been adopted in standards mode. The scrollLeft, scrollTop, scrollWidth, and scrollHeight
properties are relative to BODY in quirks mode (instead of HTML) (bug 211030). HTML (1-7) and CSS (xx-small - xx-large) font sizes are calculated slightly differently (see bug 18136). The :hover and :active pseudo-classes will only be applied to links, and only if there is no other pseudo-class in the selector. To match other elements, the selector must include a tag name, id, class or attribute. Prior...
Profile Manager
of Firefox 3.6.10, while ProfileB might be linked with a copy of Firefox 3.5.3. When launched, Profile Manager will look in some default locations for installed versions of Firefox (or other application you're using Profile Manager with). Additionally, you can manually add Firefox versions by clicking the "Manage Firefox versions..." button: Each Firefox version in the list has the following
properties: path, version, and default. The default property indicates that this version of Firefox will be used with profiles that don't have a specific application version associated with them. Creating a profile To create a new profile, just click the New button from Profile Manager's toolbar. A dialog will appear that allows you to specify the profile's name, and optionally the profile's path, an...
...be prompted for the location of the archive, and then for the name of the profile you'd like to create from the archive. Other Operations Context-clicking any profile in the profile list will cause a popup menu to appear with the following commands: Copy - makes a copy of the profile using a name and location of your choice. Delete - deletes the profile, and all files associated with it.
Properties - shows a dialog that displays the profile's path and last-modified date. Rename - allows you to specify a new name for the profile. Version - allows you change the default application version to be used with the profile. Future Enhancements Ability to install/uninstall/enable/disable extensions in profiles. Ability to copy certain assets (e.g., bookmarks) between profiles. Add 'Profil...
...og that displays the profile's path and last-modified date. Rename - allows you to specify a new name for the profile. Version - allows you change the default application version to be used with the profile. Future Enhancements Ability to install/uninstall/enable/disable extensions in profiles. Ability to copy certain assets (e.g., bookmarks) between profiles. Add 'Profile Size' to the
Properties dialog. Ability to reset a profile (return it to a default state excluding bookmarks and passwords). Add option to specify the location of profiles.ini. ...
An overview of NSS Internals
use lookup functions, and NSS will provide an access handle that will be subsequently used by the application's code. Those handles are reference counted. NSS will usually create an in-memory (RAM) presentation of certificates, once a certificate has been received from the network, read from disk, or looked up from the database, and prepare in-memory data structures that contain the certificate's
properties, as well as providing a handle for the programmer to use. Once the application is done with a handle, it should be released, allowing NSS to free the associated resources. When working with handles to private keys it's usually difficult (and undesired) that an application gets access to the raw key data; therefore it may be difficult to extract such data from NSS. The usual minimum requirement is...
... requirement is that private keys must be wrapped using a protective layer (such as password-based encryption). The intention is to make it easier to review code for security. The less code that has access to raw secret keys, the less code that must be reviewed. NSS has only limited functionality to look up raw keys. The preferred approach is to use certificates, and to look up certificates by
properties such as the contained subject name (information that describes the owner of the certificate). For example, while NSS supports random calculation (creation) of a new public/private key pair, it's difficult to work with such a raw key pair. The usual approach is to create a certificate signing request (CSR) as soon as an application is done with the creation step, which will have created a handle t...
...though it still makes sense to use that principle today for good performance). In order to process data available in the ASN.1 format, the usual approach is to parse it and transfer it to a presentation that requires more space but is easier to work with, such as (nested) C data structures. Over the time NSS has received three different ASN.1 parser implementations, each having their own specific
properties, advantages and disadvantages, which is why all of them are still being used (nobody has yet dared to replace the older with the newer ones because of risks for side effects). When using the ASN.1 parser(s), a template definition is passed to the parser, which will analyze the ASN.1 data stream accordingly. The templates are usually closely aligned to definitions found in RFC documents. A data...
Index
use lookup functions, and NSS will provide an access handle that will be subsequently used by the application's code. Those handles are reference counted. NSS will usually create an in-memory (RAM) presentation of certificates, once a certificate has been received from the network, read from disk, or looked up from the database, and prepare in-memory data structures that contain the certificate's
properties, as well as providing a handle for the programmer to use. Once the application is done with a handle, it should be released, allowing NSS to free the associated resources. When working with handles to private keys it's usually difficult (and undesired) that an application gets access to the raw key data; therefore it may be difficult to extract such data from NSS. The usual minimum requirement is...
... requirement is that private keys must be wrapped using a protective layer (such as password-based encryption). The intention is to make it easier to review code for security. The less code that has access to raw secret keys, the less code that must be reviewed. NSS has only limited functionality to look up raw keys. The preferred approach is to use certificates, and to look up certificates by
properties such as the contained subject name (information that describes the owner of the certificate). For example, while NSS supports random calculation (creation) of a new public/private key pair, it's difficult to work with such a raw key pair. The usual approach is to create a certificate signing request (CSR) as soon as an application is done with the creation step, which will have created a handle t...
...though it still makes sense to use that principle today for good performance). In order to process data available in the ASN.1 format, the usual approach is to parse it and transfer it to a presentation that requires more space but is easier to work with, such as (nested) C data structures. Over the time NSS has received three different ASN.1 parser implementations, each having their own specific
properties, advantages and disadvantages, which is why all of them are still being used (nobody has yet dared to replace the older with the newer ones because of risks for side effects). When using the ASN.1 parser(s), a template definition is passed to the parser, which will analyze the ASN.1 data stream accordingly. The templates are usually closely aligned to definitions found in RFC documents. A data...
Tutorial: Embedding Rhino
All it does it read a script from the command line, execute it, and print a result. Here's an example use of RunScript from a shell command line: $ java RunScript "Math.cos(Math.PI)" -1 $ java RunScript "funct...
...ndefined or not a function."); } else { Object functionArgs[] = { "my arg" }; Function f = (Function)fObj; Object result = f.call(cx, scope, scope, functionArgs); String report = "f('my args') = " + Context.toString(result); System.out.println(report); } JavaScript host objects Defining Host Objects Custom host objects can implement special JavaScript features like dynamic
properties. Counter example The Counter example is a simple host object. We'll go through it method by method below. It's easy to try out new host object classes in the shell using its built-in defineClass function. We'll see how to add it to RunScript later. (Note that because the java -jar option preempts the rest of the classpath, we can't use that and access the Counter class.) $ java -cp "js.jar;ex...
... public Counter () { } The method jsConstructor defines the JavaScript constructor that was called with the expression new Counter(7) in the JavaScript code above. public void jsConstructor(int a) { count = a; } Class name The class name is defined by the getClassName method. This is used to determine the name of the constructor. public String getClassName() { return "Counter"; } Dynamic
properties Dynamic
properties are defined by methods beginning with jsGet_ or jsSet_. The method jsGet_count defines thecount property. public int jsGet_count() { return count++; } The expression c.count in the JavaScript code above results in a call to this method. Defining JavaScript "methods" Methods can be defined using the jsFunction_ prefix. Here we define resetCount for JavaScript. public void...
Rhino overview
es introduced in JavaScript 1.2 are now deprecated. These features allow "computational reflection": that is, the ability for a script to determine and influence aspects of the way it is evaluated. These features are generally not broadly useful, yet they impose significant constraints on implementations that hamper or prevent optimization. ...
... JavaScript Language Versions Some behavior in the JavaScript engine is dependent on the language version. ...
... JavaScript Language Versions Some behavior in the JavaScript engine is dependent on the language version. In browser embeddings, this language version is selected using the LANGUAGE attribute of the SCRIPT tag with values such as "JavaScript1.2". ...
Rhino shell
to force interpretation mode. Starting with Rhino 1.7 this options is no longer available. Note If the shell is invoked with the system property rhino.use_java_policy_security set to true and with a security manager installed, the shell restricts scripts permissions based on their URLs according to Java policy settings. This is available only if JVM implements Java2 security model. Predefined
Properties Scripts executing in the shell have access to some additional
properties of the top-level object. arguments The arguments object is an array containing the strings of all the arguments given at the command line when the shell was invoked. environment Returns the current environment object. history Displays the shell command history. help() Executing the help function will print usage and...
...mmand(command) runCommand(command, arg1, ..., argN) runCommand(command, arg1, ..., argN, options) All except the last arguments to runCommand are converted to strings and denote command name and its arguments. If the last argument is a JavaScript object, it is an option object. Otherwise it is converted to string denoting the last argument and options objects assumed to be empty. The following
properties of the option object are processed: args - provides an array of additional command arguments env - explicit environment object. All its enumeratable
properties define the corresponding environment variable names. input - the process input. If it is not java.io.InputStream, it is converted to string and sent to the process as its input. If not specified, no input is provided to the process. ...
...ut as the new value of the output property. err - the process error output instead of java.lang.System.err. If it is not instance of java.io.OutputStream, the process error output is read, converted to a string, appended to the err property value converted to string and put as the new value of the err property. seal(object) Seal the specified object so any attempt to add, delete or modify its
properties would throw an exception. serialize(object, filename) Serialize the given object to the specified file. spawn(functionOrScript) Run the given function or script in a different thread. sync(function) creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchronizes on the this object of its invocation. quit() Quit shell. T...
Invariants
There may be other reasons that cover more cases, but nobody can remember one.) All JSObjects and heap-allocated JSStrings must be 8-byte-aligned. (The jsval encoding depends on this.) The JSStackFrame::down chain never forms a cycle. (It's a stack. ...
...racejit must not trace into a function whose scope chain ends in a different global object. (If it is a script function, global names accessed in that function would refer to a different global object. Even if the function is native, there is serious trouble: js_NewObject with null parent argument calculates the parent from cx->fp->scopeChain, which can be stale if we're on trace.) The chain of
properties starting at any JSShape and chasing JSShape::parent never forms a cycle and does not contain any duplicate JSScopeProperty::slot values other than -1. (A cycle would be very silly and could cause infloops. The same slot being allocated to more than one property would be a problem for obvious reasons.) All JSShapes in dictionary-mode objects have the IN_DICTIONARY flag set. All JSShapes in proper...
... that object. Property locks Each thread may have a lock on at most one property at a time. (Nesting them would risk deadlock. JS_SetWatchPoint violates this rule.) Whether a property is locked, and which one, is static information for almost every line of code. The locking scheme is described under JSObjectOps.dropProperty. (Note that the locking scheme applies to all objects and talks about
properties being locked. As implemented for native objects, the locking is not really that fine-grained, but that is a transparent optimization as long as we follow the rules.) A thread holding a property lock never leaves or suspends the current request. With a few exceptions (known to brendan and probably jst and mrbkap), we never call a JSAPI callback with a property locked. (That would risk deadlock ...
JIT Optimization Outcomes
y and occurs if the target object is obtained in some roundabout way. NoAnalysisInfo TODO NoShapeInfo The baseline compiler recorded no usable shape information for this operation. UnknownObject The type of the object is not known. This can happen if the operation sees many different types of objects, and so the type of the input to the operation cannot be resolved to a single type. Unknown
Properties Optimization failed because the object containing the property was marked as having unknown
properties. This can happen if too many
properties are defined on the object, or if delete is used to remove one of the object's
properties. Singleton One of the types present in the typeset was a singleton type, preventing the optimization from being enabled. NotSingleton Optimization failed because ...
...e property did not have a 'singleton' type. Singleton types are assigned to objects that are "one of a kind", such as global objects, literal objects declared in the global scope, and top-level function objects. NotFixedSlot The property being accessed is not stored at a known location in the object. This can occur if one of the expected types of objects to be used in this operation has unknown
properties, or if different instances of the object store the property at different locations (for example, some instances have the property assigned in a different order than others). InconsistentFixedSlot The property being accessed is not stored at a known location in the object. This can occur if the operation is polymorphic on different object types and one or more of the object types contain the pro...
...ionary objects and their types marked as such. NoProtoFound A prototype object was not found for all the object used by this operation. MultiProtoPaths Objects used in this operation had differing prototypes. NonWritableProperty The property being assigned to is not writable for some types of objects which are used in this operation. ProtoIndexedProps The object being accessed has indexed
properties that are exotic (for example, defined as a property on a prototype object and left as a hole in the underlying object). ArrayBadFlags The array being accessed may have flags that the optimization strategy cannot handle. For example, if the array has sparse indexes, or has indexes that overflow the array's length, the optimization strategy may fail. ArrayDoubleConversion The type-system indica...
JSClass
A JSClass describes a class of JavaScript objects. A C/C++ program can use a JSClass with the JS_InitClass and JS_NewObject APIs to create objects that have custom methods and
properties implemented in C/C++. Syntax struct JSClass { const char *name; uint32_t flags; /* Optional since SpiderMonkey 37 */ JSPropertyOp addProperty; JSDeletePropertyOp delProperty; JSPropertyOp getProperty; JSStrictPropertyOp setProperty; JSEnumerateOp enumerate; JSResolveOp resolve; JSConvertOp convert; /* Obsolete since SpiderMonkey 44 */ /* Optional since SpiderMonkey 25 */ JSFinalizeOp finalize; /* Optional */ JSClassInternal reserved0; /* Obsolete since SpiderMonkey 13 */ J...
...er) for default behavior. setProperty JSStrictPropertyOp A hook called when setting a property. This is the default setter for the class. When a script creates a new property, this is called after addProperty. Use NULL or JS_StrictPropertyStub (SpiderMonkey 31 or older) for default behavior. enumerate JSEnumerateOp Method for enumerating object
properties. Use NULL or JS_EnumerateStub (SpiderMonkey 31 or older) for default behavior. Obsolete since JSAPI 37 The JSCLASS_NEW_ENUMERATE flag instructs SpiderMonkey to call this as a JSNewEnumerateOp. resolve JSResolveOp Hook for implementing lazy
properties. See JSClass.resolve for details. Use NULL or JS_ResolveStub (SpiderMonkey 31 or older) for default...
... Private data Custom classes very often need to store private C/C++ data that should not be visible to scripts. To do this, use the JSCLASS_HAS_PRIVATE (JSCLASS_CONSTRUCT_PROTOTYPE wad removed) flags. Implement a JSNative constructor function that allocates this private data and stores it in the new object using JS_SetPrivate. Implement a JSClass.finalize callback that f...
JSResolveOp
JS::HandleId id, bool *resolvedp); // Added in JSAPI 36 typedef bool (* JSResolveOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id); // Obsolete since JSAPI 36 Name Type Description cx JSContext * Pointer to the JS context in which the property access is taking place. ...
... The callback must set *resolvedp to true and return true if the property is resolved, or set *resolvedp to false and return true if the object has no lazy property with the given id; or return false to indicate any other error. ...
...ty is resolved, or set *resolvedp to false and return true if the object has no lazy property with the given id; or return false to indicate any other error. Obsolete since JSAPI 36 The callback must return true if the property is resolved, or if the object has no lazy property with the given id; or false to indicate any other error. Note: JSNewResolveOp provides a cheaper way to resolve lazy
properties. JSClass hooks JSClass offers the following hook: JSClass.resolve callback is called when a property is not found on an object. It can be used to implement lazy
properties. JS looks for a property in an object, and if not found, tries to resolve the given id. After calling resolve, the engine looks again to see if resolve defined obj[id]. If so, the property lookup succeeds. If not, th...
JS_ClearNonGlobalObject
Obsolete since JSAPI 34This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. This article covers features introduced in SpiderMonkey 24 Remove all
properties associated with an object. Syntax void JS_ClearNonGlobalObject(JSContext *cx, JSObject *obj); Name Type Description cx JSContext * The context in which to clear the object. Requires request. ...
...
Properties belonging to objects on obj's prototype chain are not affected. To remove a single property from an object, use JS_DeleteProperty. To remove a single array object element, use JS_DeleteElement. ...
...S_ClearNonGlobalObject(JSContext *cx, JSObject *obj); Name Type Description cx JSContext * The context in which to clear the object. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JSObject * Object from which to delete all
properties. Description JS_ClearNonGlobalObject removes all of obj's own
properties, except the special __proto__ and __parent__
properties, in a single operation.
Properties belonging to objects on obj's prototype chain are not affected. To remove a single property from an object, use JS_DeleteProperty. To remove a single array object element, use JS_DeleteElement. See Also JS_DeleteProperty JS_DeleteElement bug 1043281 ...
JS_DefineConstDoubles
Create multiple constant double or integer valued
properties on an object. Syntax bool JS_DefineConstDoubles(JSContext *cx, JS::HandleObject obj, const JSConstDoubleSpec *cds); bool JS_DefineConstIntegers(JSContext *cx, JS::HandleObject obj, const JSConstIntegerSpec *cis); // Added in SpiderMonkey 38 Name Type Description cx JSContext * The context in which to define the new
properties. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JSObject * Object for which to create new
properties. cds JSConstDoubleSpec * Pointer to an array of JSConstDoubleSpec records containing property names and values to create. The last array element mus...
...o an array of JSConstDoubleSpec records containing property names and values to create. The last array element must contain zero-valued members. cis JSConstIntegerSpec * Pointer to an array of JSConstIntegerSpec records containing property names and values to create. The last array element must contain zero-valued members. Description JS_DefineConstDoubles creates one or more
properties for a specified object, obj, where each property consists of a double value. JS_DefineConstIntegers creates one or more
properties for a specified object, obj, where each property consists of a int32_t value. The attributes for each property is set to JSPROP_READONLY | JSPROP_PERMANENT. Obsolete from JSAPI 35 Each property is automatically assigned attributes as specified in the flags field of...
...ntegerSpec structures. Each array element defines a single property name and property value to create. The name field of the last element of the array must contain 0. JS_DefineConstDoubles/JS_DefineConstIntegers create one property for each element in the array what contains a non-zero name field. On success, JS_DefineConstDoubles/JS_DefineConstIntegers returns true, indicating it has created all
properties listed in the array. Otherwise it returns false. See Also MXR ID Search for JS_DefineConstDoubles MXR ID Search for JS_DefineConstIntegers JSConstDoubleSpec JSConstIntegerSpec JS_DefineElement JS_Define
Properties JS_DefineProperty JS_DefinePropertyWithTinyId bug 1066020 - added JS_DefineConstIntegers ...
JS_Enumerate
Get an array of the enumerable
properties of a given object. Syntax JSIdArray * JS_Enumerate(JSContext *cx, JS::HandleObject obj); Name Type Description cx JSContext * The context in which to enumerate object
properties. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JS::HandleObject The object whose
properties are to be enumerated. Description JS_Enumerate gets the ids of all own
properties of the specified object, obj, that have the JSPROP_ENUMERATE attribute. (The term own property refers to a property that is not inherited from the object's prototype.) This is not quite the same behavior as a JavaScript for...in loop, which converts all property ids to strings and also enumerates inherited ...
...This calls obj's JSClass.enumerate hook. On success, JS_Enumerate returns a pointer to the first element of an array of property IDs. The application must free this array using JS_DestroyIdArray. On error or exception, JS_Enumerate returns NULL. ...
...ation must free this array using JS_DestroyIdArray. On error or exception, JS_Enumerate returns NULL. The property ids in the returned JSIdArray are subject to garbage collection. As long as obj is reachable, its current property ids are reachable. But, for example, if an application calls back into JavaScript while it is looping over the property ids in the JSIdArray, the script could delete
properties from obj. The property ids would then become unreachable and could be collected. Therefore a program that loops over the property ids must either root them all, ensure that the
properties are not deleted (in a multithreaded program this requires even greater care), or ensure that garbage collection does not occur. See Also MXR ID Search for JS_Enumerate ...
JS_InitStandardClasses
ntext for which to initialize JS function and object classes. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JS::Handle<JSObject*> The global object to initialize. This object must be of a JSClass that has the JSCLASS_GLOBAL_FLAGS bits set. Description JS_InitStandardClasses initializes the built-in JavaScript global
properties. ...
... Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JS::Handle<JSObject*> The global object to initialize. This object must be of a JSClass that has the JSCLASS_GLOBAL_FLAGS bits set. Description JS_InitStandardClasses initializes the built-in JavaScript global
properties. ...
...RangeError, ReferenceError, RegExp, String, SyntaxError, TypeError, undefined, and URIError as well as a few SpiderMonkey-specific globals, depending on compile-time options: escape, unescape, uneval, InternalError, Script, XML, Namespace, QName, File, Generator, Iterator, and StopIteration, as of SpiderMonkey 1.7. These global objects, functions, constructors, and constants are created as
properties of obj. As a side effect, JS_InitStandardClasses establishes obj as the global object for cx, if one is not already established. This means that scripts executed in cx will see the
properties of obj as global variables. See JS_SetGlobalObject for details. obj must be of a JSClass that has the JSCLASS_GLOBAL_FLAGS flag. JS_InitStandardClasses returns JS_TRUE on success, and JS_FALSE if an error ...
TPS History Lists
An integer value from one of the transition types listed at https://developer.mozilla.org/en/nsINavHistoryService#Constants. date: required. ...
...An integer value from one of the transition types listed at https://developer.mozilla.org/en/nsINavHistoryService#Constants. date: required. ...
... looks different. It's an array of objects, each of which represents a type of history to delete. ...
Components.interfaces
Each object represents one of the XPCOM interfaces -- that some component or another might or might not implement. It reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which XPConnect is capable of reflecting into JavaScript.
Properties of the Components.interfaces object are used where XPCOM methods expect a parameter of type nsID. ...
...tion Components.interfaces is a read-only object whose
properties implement the nsIJSIID interface. Each object represents one of the XPCOM interfaces -- that some component or another might or might not implement. It reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which XPConnect is capable of reflecting into JavaScript.
Properties of the Components.interfaces object are used where XPCOM methods expect a parameter of type nsID. This includes nsISupports.QueryInterface(), the optional parameter accepted by nsIJSCID.getService(), nsIJSCID.createInstance() when called from JavaScript, and nsIClassInfo.getInterfaces(). The
properties of the Components.interfaces object can be enumerated using a for...in loop. Usage Accessing...
...erfaces object are used where XPCOM methods expect a parameter of type nsID. This includes nsISupports.QueryInterface(), the optional parameter accepted by nsIJSCID.getService(), nsIJSCID.createInstance() when called from JavaScript, and nsIClassInfo.getInterfaces(). The
properties of the Components.interfaces object can be enumerated using a for...in loop. Usage Accessing an interface object
Properties of the Components.interfaces object are indexed by interface name. You can retrieve an interface object using: var iface = Components.interfaces.nsISupportsArray; This will return you the interface object for the nsISupportsArray interface. Accessing constants defined in an interface Interface descriptions (cf. XPIDL) may not only contain method declarations, but also constants. For example,...
Components.utils.createObjectIn
To create an object with a specified name, use defineAs: var foo = Components.utils.createObjectIn(myWindow, {defineAs: "foo"}...
... To create an object with a specified name, use defineAs: var foo = Components.utils.createObjectIn(myWindow, {defineAs: "foo"}); Now the target compartment's window has a new global object named foo. ...
...ls.createObjectIn(myWindow); var propList = { name: genPropDesc("name"), date: genPropDesc("date"), id: genPropDesc("id"), func: genPropDesc(function() { alert("Called func!"); }) }; Object.define
Properties(myObject, propList); Components.utils.makeObjectPropsNormal(myObject); This sets up the new object in the scope of the object myWindow, then adds
properties by calling Object.define
Properties(), then normalizes them by calling Components.utils.makeObjectPropsNormal(). To create an object with a specified name, use defineAs: var foo = Components.utils.createObjectIn(myWindow, {defineAs: "foo"}); Now the target compartment's window has a new global object named foo. ...
Components.utils.waiveXrays
rivileged JavaScript in Gecko accesses objects belonging to less-privileged code (such as untrusted web content), it does so, by default, with "Xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. Any expando
properties are not visible, and if any native
properties have been redefined, this has no effect. Xray vision is designed to make most simple operations safe. However, in some cases it can be too restrictive: for example, if you need to see an expando property on a DOM object. In these cases you can use waiveXrays to remove Xray vision for the object. Waiving Xrays is transitive, so waiving it for an object...
...To undo waiveXrays and get Xray vision back, call Components.utils.unwaiveXrays on the object. ...
...is has no effect. Xray vision is designed to make most simple operations safe. However, in some cases it can be too restrictive: for example, if you need to see an expando property on a DOM object. In these cases you can use waiveXrays to remove Xray vision for the object. Waiving Xrays is transitive, so waiving it for an object automatically waives it for any
properties of that object (and their
properties, and so on). If you waive Xray vision, you can no longer trust that any of the object's
properties are what you expect: any of them, including prototypes and accessors, could have been redefined by the less-privileged code. To undo waiveXrays and get Xray vision back, call Components.utils.unwaiveXrays on the object. The result of waiveXrays is just like the wrappedJSObject property for Xrayed ob...
mozIStorageStatementParams
This interface has no defined
properties, but has
properties based on the named parameters found in the SQL from the statement it was accessed off of. For example, say you create a statement like so: var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :item_id"); This object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; For more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters. ...
...for (let param in statement.params) statement.params[param] = valuesToBind[param]; ...
...for (let param in statement.params) statement.params[param] = valuesToBind[param]; ...
nsIAbCard
Complex
properties are expected to be accessed through a call to getProperty. See //github.com/RealityRipple/UXP/blob/master//mailnews/addrbook/public/nsIAbCard.idl for more details. ...
...See //github.com/RealityRipple/UXP/blob/master//mailnews/addrbook/public/nsIAbCard.idl for more details. ...
...ing the firstName, lastName and the displayName. We allow the caller to cache the pref value, so we don't have to go to prefs every time. AString generateName(in long aGenerateFormat,[optional] in nsIStringBundle aBundle) Parameters aGenerateFormat The format to present the name in: 0 Generated name is displayName 1 lastFirst, formatted following lastFirstFormat property in addressBook.
properties. 2 firstLast, formatted following firstLastFormat property in addressBook.
properties. aBundle An optional parameter that is a pointer to a string bundle that holds: addressBook.
properties. If this bundle is not supplied, then the function will obtain the bundle itself. If cached by the caller and supplied to this function, then performance will be improved over many calls. Return value A...
nsIAccessibleText
nds(in long selectionNum, out long startOffset, out long endOffset); AString getText(in long startOffset, in long endOffset); AString getTextAfterOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); AString getTextAtOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); nsIPersistent
Properties getTextAttributes(in boolean includeDefAttrs, in long offset, out long rangeStartOffset, out long rangeEndOffset); AString getTextBeforeOffset(in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); void removeSelection(in long selectionNum); void scrollSubstringTo(in long startIndex, in long endIndex, in unsigned long scrollType); void scrol...
...tIndex, in long endIndex, in unsigned long coordinateType, in long x, in long y); void setSelectionBounds(in long selectionNum, in long startOffset, in long endOffset); Attributes Attribute Type Description caretOffset long The current current caret offset. If set < 0 then caret will be placed at the end of the text. characterCount long Read only. defaultTextAttributes nsIPersistent
Properties Return the text attributes that apply to the entire accessible. Read only. selectionCount long Read only. Constants Text Offset Constants Constant Value Description TEXT_OFFSET_END_OF_TEXT -1 Will be treated as the equal to the end of the text. TEXT_OFFSET_CARET -2 Will be treated as the caret position. Text Boundary Constants Constant Value Description BOUNDARY_CHAR 0 B...
...ould return "string" values which are UTF-8. AString getTextAtOffset( in long offset, in nsAccessibleTextBoundary boundaryType, out long startOffset, out long endOffset ); Parameters offset boundaryType startOffset endOffset Return value getTextAttributes() Get the accessible start/end offsets around the given offset, return the text attributes for this range of text. nsIPersistent
Properties getTextAttributes( in boolean includeDefAttrs, in long offset, out long rangeStartOffset, out long rangeEndOffset ); Parameters includeDefAttrs Points whether text attributes applied to the entire accessible should be included or not. offset Text offset. rangeStartOffset Start offset of the range of text. rangeEndOffset End offset of the range of text. Return value Exceptions thrown ...
nsIDocShell
the channel for the currently loaded document, if any. For a new document load, this will be the channel of the previous document until after OnLocationChange fires. Read only. documentCharsetInfo nsIDocumentCharsetInfo The document character set info. This is used by a load to determine priorities for charset detection and so on. Obsolete since Gecko 12.0 Note: The
properties of the old nsIDocumentCharsetInfo interface were merged into nsIDocShell in Gecko 12.0. eldestPresShell nsIPresShell Presentation shell for the oldest document, if this docshell is currently transitioning between documents. Read only. Native code only! forcedCharset nsIAtom A character set to override the page's default character set while processing; t...
...pe The type (MIME) of data being loaded (empty if unknown). aContentCharset The charset of the data being loaded (empty if unknown). aLoadInfo This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo(). Once you have this object you can set the needed
properties on it and then pass it to loadStream. Native code only!loadURI Loads a given URI. This will give priority to loading the requested URI in the object implementing this interface. If it can not be loaded here however, the URL dispatcher will go through its normal process of content loading. void loadURI( in nsIURI uri, in nsIDocShellLoadInfo loadInfo, in unsigned long aLoadFlags, in boolea...
...sIURI uri, in nsIDocShellLoadInfo loadInfo, in unsigned long aLoadFlags, in boolean firstParty ); Parameters uri The URI to load. loadInfo This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo(). Once you have this object you can set the needed
properties on it and then pass it to loadURI. aLoadFlags Flags to modify load behaviour. Flags are defined in nsIWebNavigation. Note that using flags outside LOAD_FLAGS_MASK is only allowed if passing in a non-null loadInfo. And even some of those might not be allowed. Use at your own risk. firstParty true if this is the master top-level document. prepareForNewContentModel() Reset state to ...
nsILoginManager
oveAllLogins(); void removeLogin(in nsILoginInfo aLogin); void searchLogins(out unsigned long count, in nsIPropertyBag matchData, [retval, array, size_is(count)] out nsILoginInfo logins); void setLoginSavingEnabled(in AString aHost, in boolean isEnabled); Methods addLogin() Stores a new login in the Login Manager. Note: Default values for the nsILoginMetaInfo
properties are created if the specified login doesn't explicitly specify them. void addLogin( in nsILoginInfo aLogin ); Parameters aLogin The login to store. Exceptions thrown An exception is thrown if the login information is already stored in the Login Manager. To change a login, you have to use modifyLogin(). autoCompleteSearch() Generates results for a user field autocomplete menu. ...
... in AString aHost ); Parameters aHost The hostname to check. This argument should be in the origin URL format, with no pathname. For example: "https://www.site.com". Return value true if login saving is enabled for the host, otherwise false. modifyLogin() Modifies an existing login by replacing it with a new one. If newLoginData is a nsILoginInfo, all of the old login's nsILoginInfo
properties are changed to the values from newLoginData (but the old login's nsILoginMetaInfo
properties are unmodified). If newLoginData is a nsIPropertyBag, only the specified
properties will be changed. The nsILoginMetaInfo
properties of oldLogin can be changed in this manner. If the propertybag contains an item named "timesUsedIncrement", the login's timesUsed property will be incremented by the item's...
...ed as either an nsILoginInfo or an nsIPropertyBag2 object. removeAllLogins() Removes all logins known by the Login Manager. This works without a need for the master password, if one is set. void removeAllLogins(); Parameters None. removeLogin() Removes a login from the Login Manager. Note: The specified login must exactly match a stored login. However, the values of any nsILoginMetaInfo
properties are ignored. void removeLogin( in nsILoginInfo aLogin ); Parameters aLogin The login to remove from the Login Manager. Only a login that is an exact match is deleted. searchLogins() Searches for logins in the login manager's data store, returning an array of matching logins. If there are no matching logins, an empty array is returned. void searchLogins( out unsigned long count, i...
nsILoginManagerStorage
g matchData, [retval, array, size_is(count)] out nsILoginInfo logins); void setLoginSavingEnabled(in AString aHost, in boolean isEnabled); Attributes Attribute Type Description uiBusy boolean true when a master password prompt is being shown. Read only. Methods addLogin() Called by the Login Manager to store a new login. Gecko 1.9.1 note Default values for the nsILoginMetaInfo
properties are created if the specified login doesn't explicitly specify them. void addLogin( in nsILoginInfo aLogin ); Parameters aLogin The login to add to the login storage. countLogins() Implement this method to return the number of logins matching the specified criteria. This method is called, for example, to check to see if there is a login that will match the criteria without having to ask the ...
...e( in nsIFile aInputFile, in nsIFile aOutputFile ); Parameters aInputFile The file from which to read stored logins. aOutputFile The file to which to write stored logins, if not null. If this is null, use the default output file. modifyLogin() Implement this method to modify an existing login in the login store. If newLoginData is specified as an nsILoginInfo object, all of the old login's
properties are changed to the values from the newLoginData parameter. If newLoginData is a nsIPropertyBag, only the
properties specified in the nsIPropertyBag are changed in oldLogin and its corresponding nsILoginMetaInfo. void modifyLogin( in nsILoginInfo oldLogin, in nsISupports newLoginData ); Parameters oldLogin The login to be modified. newLoginData The login information to replace the oldLogin w...
...ar all stored passwords. The user interface allows this to be done without getting each login first (which might require knowing the master password). No password should be required in order to remove all logins. void removeAllLogins(); Parameters None. removeLogin() Implement this method to remove the specified login from the login store. Gecko 1.9.1 note The values of any nsILoginMetaInfo
properties are ignored. void removeLogin( in nsILoginInfo aLogin ); Parameters aLogin The login to remove from the login store. A login must match completely (except for its nsILoginMetaInfo data) to be removed. searchLogins() Implement this to search for logins in the login manager's data store, returning an array of matching logins. If there are no matching logins, return an empty array. void search...
nsIMsgCustomColumnHandler
this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsITreeView This interface is meant to be implemented by extensions, as shown in the tutorial. The interface inherits from nsITreeView, however when you're implementing a custom handler in Javascript its not necessary to implement all of nsITreeView's methods. You must implement: nsITreeView.isEditable() nsITreeView.GetCell
Properties() nsITreeView.GetImageSrc() nsITreeView.GetCellText() nsITreeView.cycleCell() nsIMsgCustomColumnHandler.getSortStringForRow() nsIMsgCustomColumnHandler.getSortLongForRow() nsIMsgCustomColumnHandler.isString() and optionally: nsITreeView.GetRow
Properties() From C++ you must implement all of nsITreeView and nsIMsgCustomColumnHandler. Example Implementation An example Javascript implementation that...
...l of nsITreeView and nsIMsgCustomColumnHandler. ...
...mplementation An example Javascript implementation that does nothing: var columnHandler = { isEditable: function(aRow, aCol) {return false;}, cycleCell: function(aRow, aCol) { }, getCellText: function(aRow, aCol) { }, getSortStringForRow: function(aHdr) { return ""; }, isString: function() {return true;}, getCell
Properties: function(aRow, aCol, aProps) { }, getRow
Properties: function(aRow, aProps) { }, getImageSrc: function(aRow, aCol) {return null;}, getSortLongForRow: function(aHdr) {return 0;} } to attach it use the nsIMsgDBView.addColumnHandler() method (recall gDBView is the global nsIMsgDBView in Thunderbird): gDBView.addColumnHandler("newColumn", columnHandler); after which it can be retrieved using the nsIMsgDBView.getColumnHandler() met...
Using IndexedDB in chrome
The indexedDB API is typically used to store data in the user's browser from content JavaScript. (See Using IndexedDB for an overview.) However, the APIs can also be accessed from system-privileged JavaScript using the Components.utils.importGlobal
Properties() function: Components.utils.importGlobal
Properties(["indexedDB"]); // From here on, it's like using IndexedDB from content var req = indexedDB.open("my-database"); // ... ...
...verview.) However, the APIs can also be accessed from system-privileged JavaScript using the Components.utils.importGlobal
Properties() function: Components.utils.importGlobal
Properties(["indexedDB"]); // From here on, it's like using IndexedDB from content var req = indexedDB.open("my-database"); // ... ...
...aScript using the Components.utils.importGlobal
Properties() function: Components.utils.importGlobal
Properties(["indexedDB"]); // From here on, it's like using IndexedDB from content var req = indexedDB.open("my-database"); // ... ...
Mail and RDF
ages --> "2" | +-- http://home.netscape.com/NC-rdf#IsServer --> "false" | +-- http://home.netscape.com/NC-rdf#MessageChild --> | | mailbox_message://alecf@pop.mywork.com/INBOX#1 | +-- http://home.netscape.com/NC-rdf#MessageChild --> | mailbox_message://alecf@pop.mywork.com/INBOX#2 | etc... There are of course many more
properties that are exposed via RDF, but this should give you a feel for it. Datasources We have a few primary datasources used in mail: nsMsgAccountDataSource - answers queries about arcs coming out of msgaccounts:/. If you ask it for #child nodes out of msgaccounts:/, it returns the root URIs of all servers in the account manager. Note that it does not actually know anything about the servers who's U...
...nything about the servers who's URIs it returns. nsMsgFolderDataSource - answer queries about any mail folders, including toplevel server folders. If asked about a folder along the #child arc, it will return resources for all subfolders in that folder. If asked about a folder along the #MessageChild arc, it will return resources for all messages in a folder. It also answers queries about various
properties of folders such as the total number of messages, whether or not this folder is actually a root server, and so forth. nsMsgMessageDataSource - answers queries about messages in folders. All RDF
properties of a message currently come from the database that backs the containing folder. Datasources and the UI Mail does not link the UI to datasources in a "traditional" manner. Instead of having a...
...mail object's data changes and the data is reflected in RDF by notifying all of the observers that RDF has registered with the datasource. In the example of mail folders, each folder datasource first registers itself with the mail session as a nsIFolderListener because it wants information about when a folder changes. Each template registers itself as an RDF observer. When a folder's contents or
properties change, it tells the mail session to notify the folder listeners that the data has changed. The folder datasource then translates these property changes into OnAssert() or OnUnassert() calls to the observers. The calling chain essentially looks like this: Registration: Folder datasource registers itself with the mail session as a folder listener RDF Template registers itself with the dataso...
Adding items to the Folder Pane
Each item in this array satisfies the following interface: id (attribute) a unique string for this object. Must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also conforming to this spec get
Properties (function) a call from getRow
Properties or getCell
Properties for this item will be passed into this function command (function) this function will be called when the item is double-clicked For our example extension, two different types of folder-tree-items will be defined. First, our "Numbers" container looks like this: let containerRow = { _NUMBERS: 3, id: "numbers-main-c...
...containerRow = { _NUMBERS: 3, id: "numbers-main-container", text: "Numbers", level: 0, open: false, _children: null, get children() { if (!this._children) { this._children = []; for (var i = 1; i <= this._NUMBERS; i++) this._children.push(new numberRow(i)); } return this._children; }, get
Properties: function gne_getProps() { // Put your css attributes here }, command: function gne_command() { // Just going to alert, to do something here Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService) .alert(window, null, this.text); } }; Second, our child items...
...indow, null, this.text); } }; Second, our child items (the numbers 1, 2, and 3) are copies of the following prototype: function numberRow(aNumber) { this._number = aNumber; } numberRow.prototype = { get id() { return "numbers-child-row-" + this._number; }, get text() { return this._number; }, level: 1, open: false, children: [], get
Properties: function gne_kid_getProps() {}, // no-op command: function gne_kid_command() { // Just going to alert, to do something here Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService) .alert(window, null, this.text); } }; Putting it all together All that is left at this poi...
Creating a Custom Column
-in column, but more about that later. nsIMsgCustomColumnHandler extends (inherits from) nsITreeView and as such needs to implement functions from both. The following is a list of functions that must be implemented to ensure that your extension works well with Thunderbird. Rest assured that these functions will be called - so implement them, even with empty function. ...
...nds (inherits from) nsITreeView and as such needs to implement functions from both. The following is a list of functions that must be implemented to ensure that your extension works well with Thunderbird. Rest assured that these functions will be called - so implement them, even with empty function. ...
...rface looks like: var columnHandler = { getCellText: function(row, col) { //get the message's header so that we can extract the reply to field var hdr = gDBView.getMsgHdrAt(row); return hdr.getStringProperty("replyTo"); }, getSortStringForRow: function(hdr) {return hdr.getStringProperty("replyTo");}, isString: function() {return true;}, getCell
Properties: function(row, col, props){}, getRow
Properties: function(row, props){}, getImageSrc: function(row, col) {return null;}, getSortLongForRow: function(hdr) {return 0;} } Basically, all we are doing here is making sure that both the text that is displayed to the user (getCellText()) and the string we sort according to (when the user decided to sort the view by our custom col...
Using the Multiple Accounts API
Warning: The content of this article may be out of date. It was imported from mozilla.org and last updated in 2003. By Alec Flett alecf@flett.org Structure Servers Identities Storage Creating new accounts SMTP Servers Appendix A: Listing of all preferences and
properties Structure The account system consists of: The Account Manager (nsIMsgAccountManager): There is a single account manager in the the client, which maintains the list of accounts, servers, etc. It is also responsible for the creation of any new account-related objects. The account manager maintains the main list of Accounts. Accounts (nsIMsgAccount): An account consists of a single incoming server, and one or more identities. An account is merely a container to bind incoming servers and ide...
...esponsible for the creation of all accounts, incoming servers, and identities. You should not use CreateInstance() to create any of the relevant objects because the account manager needs to keep track of all of these objects as they are created. To create accounts using the API, you should do the following: Create a fresh identity with createIdentity(); Assign values to the various identity
properties as necessary. Create a fresh incoming server with createIncomingServer(). You will need to pass it the server type as a string, from the list above. Assign values to the various server
properties as necessary. The most important
properties here are the userName and the hostname. Create a fresh account with createAccount(); Assign the server to the account with the incomingServer attribute...
...to something else by setting the defaultServer property on the smtpService, but that will not be saved to disk. Eventually there will be the concept of a session default server, and a permenant default server. Relevant API calls: nsISmtpService.smtpServers: list of SMTP servers nsISmtpService.createSmtpServer(): Create a new SMTP server nsISmtpServer.hostname, nsISmtpServer.username: Useful
properties of the SMTP server. Appendix A: Listing of all
properties (When brendan's idldoc comes along, I'll just link to that) All preferences are strings, unless otherwise noted. Account Manager Pref: mail.accountmanager.accounts Account Preference: mail.account.account.server IDL: nsIMsgAccount.incomingServer The incoming server associated with this account. The preference is the prefere...
PointerType
the type to which the pointer type points. This can be any CType object to declare the new type as a pointer to that type. Return value A CType object describing the newly created data type. Exceptions thrown TypeError Thrown if the parameter isn't a CType. Examples Creating a type "pointer to 32-bit integer" looks like this: var intPtrType = new ctypes.PointerType(ctypes.int32_t);
Properties Property Type Description targetType CType The type of object the pointer points to. Read only.
Properties inherited from CType These
properties are available on all CType objects. Property Type Description name String The type's name. Read only. For primitive types, this is just the name of the corresponding C type. ...
... the same value as the C sizeof. Read only. Note: ctypes.void_t.size is undefined. Method overview Methods inherited from CType CType array([n]) String toSource() String toString() PointerType CData Syntax CData pointertype(); pointertype is PointerType CType. Return value A CData representing the newly allocated pointer. ...
...Read only. Note: This is never ctypes.void_t or an array type with an unspecified length. value object The JavaScript equivalent of the CData object's value. ...
Edit fonts - Firefox Developer Tools
s like when rendered. The default text for the sample is "Abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value. Once entered, all of the sample text will be set to the same custom value. Variable font support in Firefox Developer Tools Firefox 62 added support for variable fonts and Firefox 63 features support for editing the
properties of variable fonts in the Font Editor. What are variable fonts? Variable Fonts, or OpenType Font Variations, define a new font file format that allows the font designer to include multiple variations of a typeface inside a single font file. That means you no longer have to apply several different web fonts to a single page to represent a complete typeface for which a variable font is available, ...
...nt-variation-settings, you could do something like this: font-variation-settings: "wght" 350; However, you should only use font-variation-settings as a last resort if there is no basic font property available for setting those characteristic values (e.g. custom axes). ...
...settings as a last resort if there is no basic font property available for setting those characteristic values (e.g. custom axes). Note: font characteristics set using font-variation-settings will always override those set using the corresponding basic font
properties, e.g. font-weight, no matter where they appear in the cascade. Here are the registered axes along with their corresponding CSS
properties: Axis Tag CSS Property "wght" font-weight "wdth" font-stretch "slnt" (slant) font-style: oblique + angle "ital" font-style: italic "opsz" font-optical-sizing Any axis that is not on the list of registered axes is considered a custom axis. Custom axes do not have corresponding CSS font
properties. Font des...
Examine and edit HTML - Firefox Developer Tools
nu contains the following items -- click on the links to find the description of each command in the Context menu reference: Edit As HTML Create New Node Duplicate Node Delete Node Attributes Add Attribute Copy Attribute Value Edit Attribute Remove Attribute Break on ... ...
... -- click on the links to find the description of each command in the Context menu reference: Edit As HTML Create New Node Duplicate Node Delete Node Attributes Add Attribute Copy Attribute Value Edit Attribute Remove Attribute Break on ... ...
...rms this action. (Copy) Unique Selector/CSS Selector Copy a CSS selector that uniquely selects the element. (Copy) CSS Path Copy a CSS selector that represents the full path to the element. (Copy) Image Data-URL Copy image as a data:// URL, if the selected element is an image. (Copy) Attribute Copy the attribute of the element. Show DOM
Properties Open the split console and enter the console command "inspect($0)" to inspect the currently selected element. Use in Console Assigns the currently selected node to a variable named temp0 (or temp1 if temp0 is already taken, and so on), then opens the split console, enabling you to interact with that node using the console's command line. Expand All In the tree view, exp...
Web Audio Editor - Firefox Developer Tools
ls. With the Web Audio API, developers create an audio context. Within that context they then construct a number of audio nodes, including: nodes providing the audio source, such as an oscillator or a data buffer source nodes performing transformations such as delay and gain nodes representing the destination of the audio stream, such as the speakers Each node has zero or more AudioParam
properties that configure its operation. For example, the GainNode has a single gain property, while the OscillatorNode has frequency and detune
properties. The developer connects the nodes in a graph, and the complete graph defines the behavior of the audio stream. The Web Audio Editor examines an audio context constructed in the page and provides a visualization of its graph. This gives you a high-level...
... developer connects the nodes in a graph, and the complete graph defines the behavior of the audio stream. The Web Audio Editor examines an audio context constructed in the page and provides a visualization of its graph. This gives you a high-level view of its operation, and enables you to ensure that all the nodes are connected in the way you expect. You can then examine and edit the AudioParam
properties for each node in the graph. Some non-AudioParam
properties, like an OscillatorNode's type property, are displayed, and you can edit these as well. This tool is still experimental. If you find bugs, we'd love it if you filed them in Bugzilla. If you have feedback or suggestions for new features, dev-developer-tools or Twitter are great places to register them. Opening the Web Audio Editor The W...
... nodes are displayed as solid lines. If, instead, you've connected a node to an AudioParam in another node, then the connection is shown as a dashed line between the nodes, and is labeled with the name of the AudioParam: Inspecting and modifying AudioNodes If you click on a node, it's highlighted and you get a node inspector on the right hand side. This list the values of that node's AudioParam
properties. For example, here's what the OscillatorNode looks like: With the Violent Theremin demo, the frequency parameter is modified as the user moves the mouse left and right, and you can see this reflected in the node inspector. However, the value isn't updated in real time: you have to click the node again to see the updated value. If you click on a value in the node inspector you can modify it: pre...
AddressErrors - Web APIs
ccurred for the member of the same name in an address described using PaymentAddress. AddressErrors is the type of the object returned by shippingAddressErrors in the PaymentDetailsUpdate passed into PaymentRequestUpdateEvent.updateWith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. See the examples below to see how this works.
Properties addressLine A DOMString which, if present, indicates that the addressLine property of the PaymentAddress could not be validated. The contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. city A DOMString which, if present, indicates that the city property of the PaymentAddress could not be validated. The conten...
...string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. sortingCode A DOMString which, if present, indicates that the sortingCode property of the PaymentAddress could not be validated. The contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. Obsolete
properties These
properties have been removed from the specification and should no longer be used. languageCode A DOMString which, if present, indicates that the languageCode property of the PaymentAddress could not be validated. The contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. Usage notes Keep in mind that s...
...contains a country property which is an error message describing why the stated country isn't being permitted as a value. Then a PaymentDetailsUpdate object is created with its error set to a generic message about address errors and with the reset of the object's values taken from shippingAddressErrors, and, using "...defaultPaymentDetails" as the final entry in the object, the remeainder of the
properties' values are taken from defaultPaymentDetails. The final step is to call the event's updateWith() method, passing along the updateDetails object. This lets the Payment Request API know to present the specified error or errors but to allow the user to keep trying to edit the address. Setting up the Donate Now button This code creates a handler for the load event on the window which in turn adds ...
AudioNode - Web APIs
e free to use either constructors or factory methods, or mix both, however there are advantages to using the constructors: All parameters can be set during construction time and don't need to be set individually. You can sub-class an audio node. While the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom
properties and methods. Slightly better performance: In both Chrome and Firefox, the factory methods call the constructors internally. Keep in mind that Microsoft Edge does not yet appear to support the constructors; it will throw a "Function expected" error when you use the constructors. Brief history: The first version of the Web Audio spec only defined the factory methods. After a design review in Oc...
... when you use the constructors. Brief history: The first version of the Web Audio spec only defined the factory methods. After a design review in October 2013, it was decided to add constructors because they have numerous benefits over factory methods. The constructors were added to the spec from August to October 2016. Factory methods continue to be included in the spec and are not deprecated.
Properties AudioNode.context Read only Returns the associated BaseAudioContext, that is the object representing the processing graph the node is participating in. AudioNode.numberOfInputs Read only Returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property with a value of 0. AudioNode.numberOfOutputs Read only Returns the number of outp...
... from the interface EventTarget. AudioNode.connect() Allows us to connect the output of this node to be input into another node, either as audio data or as the value of an AudioParam. AudioNode.disconnect() Allows us to disconnect the current node from another one it is already connected to. Example This simple snippet of code shows the creation of some audio nodes, and how the AudioNode
properties and methods can be used. You can find examples of such usage on any of the examples linked to on the Web Audio API landing page (for example Violent Theremin.) const audioCtx = new AudioContext(); const oscillator = new OscillatorNode(audioCtx); const gainNode = new GainNode(audioCtx); oscillator.connect(gainNode).connect(audioCtx.destination); oscillator.context; oscillator.numberOfInputs; ...
CSS Painting API - Web APIs
The CSS Painting API -- part of the CSS Houdini umbrella of APIs -- allows developers to write JavaScript functions that can draw directly into an element's background, border, or content. Concepts and usage Essentially, the CSS Painting API contains functionality allowing developers to create custom values for paint(), a CSS <image> function. You can then apply these values to
properties like background-image to set complex custom backgrounds on an element. For example: aside { background-image: paint(myPaintedImage); } The API defines PaintWorklet, a worklet that can be used to programmatically generate an image that responds to computed style changes. To find out more about how this is used, consult Using the CSS Painting API. Interfaces PaintWorklet Programmatically generates an ima...
...round using JavaScript in our CSS, we define a paint worklet using the registerPaint() function, tell the document to include the worklet using the paintWorklet addModule() method, then include the image we created using the CSS paint() function. ...
... Specifications Specification Status Comment CSS Painting API Level 1 Working Draft Initial definition. ...
CanvasRenderingContext2D - Web APIs
The Canvas tutorial has more explanation, examples, and resources, as well. ...
...t. CanvasRenderingContext2D.fillRect() Draws a filled rectangle at (x, y) position whose size is determined by width and height. CanvasRenderingContext2D.strokeRect() Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style. Drawing text The following methods draw text. See also the TextMetrics object for text
properties. CanvasRenderingContext2D.fillText() Draws (fills) a given text at the given (x, y) position. CanvasRenderingContext2D.strokeText() Draws (strokes) a given text at the given (x, y) position. CanvasRenderingContext2D.measureText() Returns a TextMetrics object. Line styles The following methods and
properties control how lines are drawn. CanvasRenderingContext2D.lineWidth Width of li...
...anvasRenderingContext2D.miterLimit Miter limit ratio. Default 10. CanvasRenderingContext2D.getLineDash() Returns the current line dash pattern array containing an even number of non-negative numbers. CanvasRenderingContext2D.setLineDash() Sets the current line dash pattern. CanvasRenderingContext2D.lineDashOffset Specifies where to start a dash array on a line. Text styles The following
properties control how text is laid out. CanvasRenderingContext2D.font Font setting. Default value 10px sans-serif. CanvasRenderingContext2D.textAlign Text alignment setting. Possible values: start (default), end, left, right, center. CanvasRenderingContext2D.textBaseline Baseline alignment setting. Possible values: top, hanging, middle, alphabetic (default), ideographic, bottom. CanvasRenderingCon...
CustomEvent - Web APIs
This interface inherits
properties from its parent, Event: Event.bubbles Read only A boolean indicating whether or not the event bubbles up through the DOM. Event.cancelBubble A historical alias to Event.stopPropagation(). ...
... The CustomEvent interface represents events initialized by an application for any purpose. Note: This feature is available in Web Workers. Constructor CustomEvent() Creates a CustomEvent.
Properties CustomEvent.detail Read only Any data passed when initializing the event. This interface inherits
properties from its parent, Event: Event.bubbles Read only A boolean indicating whether or not the event bubbles up through the DOM. Event.cancelBubble A historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event. Event.cancelable Read only A boolean indicating whether the event is cancelable. Event.composed Read only A boolean indicating whether or not the event can bubble across the boundary be...
...ut in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead. Event.type Read only The name of the event. Case-insensitive. Event.isTrusted Read only Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like Event.initEvent). Obsolete
properties Event.scoped Read only Obsolete; use composed instead. (A Boolean indicating whether the given event will bubble across through the shadow root into the standard DOM.) Methods CustomEvent.initCustomEvent() Initializes a CustomEvent object. If the event has already being dispatched, this method does nothing. This interface inherits methods from its parent, Event: Event.crea...
DOMPoint.fromPoint() - Web APIs
The static DOMPoint method fromPoint() creates and returns a new mutable DOMPoint object given a source point. The source point is specified as a DOMPointInit-compatible object, which includes both DOMPoint and DOMPointReadOnly. You can also create a new DOMPoint object using the new DOMPoint() constructor. ...
...t given a source point. The source point is specified as a DOMPointInit-compatible object, which includes both DOMPoint and DOMPointReadOnly. You can also create a new DOMPoint object using the new DOMPoint() constructor. Although this interface is based on DOMPointReadOnly, it is not read-only; the
properties within may be changed at will. Syntax var point = DOMPoint.fromPoint(sourcePoint);
Properties sourcePoint A DOMPointInit-compliant object, which includes both DOMPoint and DOMPointReadOnly, from which to take the values of the new point's
properties. Return value A new DOMPoint object whose coordinate and perspective values are identical to those in the source point. The point's
properties are mutable and may be changed at any time. Examples Creating a mutable point from a read-o...
... var center = DOMPoint.fromPoint({x: 75, y: -50, z: -55, w: 0.25}); Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'fromPoint()' in that specification. ...
DataTransfer.effectAllowed - Web APIs
ation. all All operations are permitted. uninitialized The default value when the effect has not been set, equivalent to all. Assigning any other value to effectAllowed has no effect and the old value is retained. Internet Explorer will change the value to be lowercased; thus, linkMove will become linkmove, and so on. Example This example shows the use of the effectAllowed and dropEffect
properties. ...
...en set, equivalent to all. Assigning any other value to effectAllowed has no effect and the old value is retained. Internet Explorer will change the value to be lowercased; thus, linkMove will become linkmove, and so on. Example This example shows the use of the effectAllowed and dropEffect
properties. ...
...hild(document.getElementById(data)); } function dragover_handler(ev) { console.log("dragOver: dropEffect = " + ev.dataTransfer.dropEffect + " ; effectAllowed = " + ev.dataTransfer.effectAllowed); ev.preventDefault(); // Set the dropEffect to move ev.dataTransfer.dropEffect = "move" } </script> <body> <h1>Examples <code>DataTransfer</code>.{<code>dropEffect</code>, <code>effectAllowed</code>}
properties</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> Select this element, drag it to the Drop Zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">Drop Zone</div> </body> </html> Specifications Specification Status Comment HTML Li...
DataTransfer.items - Web APIs
ration and if the operation had no items, the list is empty. Syntax itemList = dataTransfer.items; Return value A DataTransferItemList object containing DataTransferItem objects representing the items being dragged in a drag operation, one list item for each object being dragged. If the drag operation had no data, the list is empty. Example This example shows the use of the items and types
properties. ...
...fer.items; Return value A DataTransferItemList object containing DataTransferItem objects representing the items being dragged in a drag operation, one list item for each object being dragged. If the drag operation had no data, the list is empty. Example This example shows the use of the items and types
properties. ...
...h; i++) { console.log("... ...
DataTransfer.types - Web APIs
ial-cased for legacy reasons (for example "text"). Syntax dataTransfer.types; Return value An array of the data formats used in the drag operation. Each format is string. If the drag operation included no data, this list will be empty. If any files are included in the drag operation, then one of the types will be the string Files. Example This example shows the use of the types and items
properties. ...
...value An array of the data formats used in the drag operation. Each format is string. If the drag operation included no data, this list will be empty. If any files are included in the drag operation, then one of the types will be the string Files. Example This example shows the use of the types and items
properties. ...
...h; i++) { console.log("... ...
DataTransfer - Web APIs
he DataTransfer object is used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. This object is available from the dataTransfer property of all drag events. Constructor DataTransfer() Creates and returns a new DataTransfer object.
Properties Standard
properties DataTransfer.dropEffect Gets the type of drag-and-drop operation currently selected or sets the operation to a new type. The value must be none, copy, link or move. DataTransfer.effectAllowed Provides all of the types of operations that are possible. Must be one of none, copy, copyLink, copyMove, link, linkMove, move, all or uninitialized. DataTransfer.files Contains ...
...aTransfer.files Contains a list of all the local files available on the data transfer. If the drag operation doesn't involve dragging files, this property is an empty list. DataTransfer.items Read only Gives a DataTransferItemList object which is a list of all of the drag data. DataTransfer.types Read only An array of strings giving the formats that were set in the dragstart event. Gecko
properties Note: All of the
properties in this section are Gecko-specific. DataTransfer.mozCursor Gives the drag cursor's state. This is primarily used to control the cursor during tab drags. DataTransfer.mozSourceNode Read only The Node over which the mouse cursor was located when the button was pressed to initiate the drag operation. This value is null for external drags or if the caller can't ...
...on. This value is null for external drags or if the caller can't access the node. DataTransfer.mozUserCancelled Read only This property applies only to the dragend event, and is true if the user canceled the drag operation by pressing escape. It will be false in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location. Deprecated
properties DataTransfer.mozItemCount Read only Gives the number of items in the drag operation. Removed in Firefox 71. Methods Standard methods DataTransfer.clearData() Remove the data associated with a given type. The type argument is optional. If the type is empty or not specified, the data associated with all types is removed. If data for the specified type does not exist, or the data trans...
DedicatedWorkerGlobalScope - Web APIs
The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. ...
... The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers.
Properties This interface inherits
properties from the WorkerGlobalScope interface, and its parent EventTarget, and therefore implements
properties from WindowTimers, WindowBase64, and WindowEventHandlers. DedicatedWorkerGlobalScope.name Read only The name that the Worker was (optionally) given when it was created using the Worker() constructor. This is mainly useful for debugging purposes.
Properties inherited from WorkerGlobalScope WorkerGlobalScope.self R...
...workers. WorkerGlobalScope.navigator Read only Returns the WorkerNavigator associated with the worker. WorkerNavigator is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers. WorkerGlobalScope.performance Read only Returns the Performance object associated with the worker, which is a regular performance object, but with a subset of its
properties and methods available. Event handlers This interface inherits event handlers from the WorkerGlobalScope interface, and its parent EventTarget, and therefore implements event handlers from WindowTimers, WindowBase64, and WindowEventHandlers. DedicatedWorkerGlobalScope.onmessage Is an EventHandler representing the code to be called when the message event is raised. These events are of type M...
Element.computedStyleMap() - Web APIs
eturn back a definition list of all the CSS property values using computedStyleMap(). ...
...I...
...Styles) { //
properties const cssProperty = document.createElement('dt'); cssProperty.appendChild(document.createTextNode(prop)); stylesList.appendChild(cssProperty); // values const cssValue = document.createElement('dd'); cssValue.appendChild(document.createTextNode(val)); stylesList.appendChild(cssValue); } In browsers that support computedStyleMap(), you'll see a list of all the CSS
properties and values. In other browsers you'll just see a link. Did you realize how many default CSS
properties a link had? Update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values. Specifications Specification Status Comment CSS Typed OM Level 1The definition of 'computedStyleMap()' in that specification. Workin...
Event - Web APIs
ated by APIs to represent the progress of an asynchronous task. It can also be triggered programmatically, such as by calling the HTMLElement.click() method of an element, or by defining the event, then sending it to a specified target using EventTarget.dispatchEvent(). There are many types of events, some of which use other interfaces based on the main Event interface. Event itself contains the
properties and methods which are common to all events. 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 att...
...teEvent PointerEvent PopStateEvent ProgressEvent RelatedEvent RTCDataChannelEvent RTCIdentityErrorEvent RTCIdentityEvent RTCPeerConnectionIceEvent SensorEvent StorageEvent SVGEvent SVGZoomEvent TimeEvent TouchEvent TrackEvent TransitionEvent UIEvent UserProximityEvent WebGLContextEvent WheelEvent Constructor Event() Creates an Event object, returning it to the caller.
Properties Event.bubbles Read only A boolean indicating whether or not the event bubbles up through the DOM. Event.cancelBubble A historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event. Event.cancelable Read only A boolean indicating whether the event is cancelable. Event.composed Read only A boolean indica...
... in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead. Event.type Read only The name of the event. Case-insensitive. Event.isTrusted Read only Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like Event.initEvent). Deprecated
properties Event.scoped Read only A Boolean indicating whether the given event will bubble across through the shadow root into the standard DOM. Use composed instead. Methods Event.composedPath() Returns the event's path (objects on which listeners will be invoked). This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed. Event.preventDefau...
EventTarget.addEventListener() - Web APIs
ort In older versions of the DOM specification, the third parameter of addEventListener() was a Boolean value indicating whether or not to use capture. Over time, it became clear that more options were needed. Rather than adding more parameters to the function (complicating things enormously when dealing with optional values), the third parameter was changed to an object that can contain various
properties defining the values of options to configure the process of removing the event listener. Because older browsers (as well as some not-too-old browsers) still assume the third parameter is a Boolean, you need to build your code to handle this scenario intelligently. You can do this by using feature detection for each of the options you're interested in. For example, if you want to check for the pa...
..., within the same outer scope. Why? Simply because by the time the event listener would execute, the scope in which it was defined would have already finished executing. Getting data into and out of an event listener using objects Unlike most functions in JavaScript, objects are retained in memory as long as a variable referencing them exists in memory. ...
...sing objects Unlike most functions in JavaScript, objects are retained in memory as long as a variable referencing them exists in memory. This, and the fact that objects can have
properties, and that they can be passed around by reference, makes them likely candidates for sharing data among scopes. Let's explore this. Note: Functions in JavaScript are actually objects. (Hence they too can have
properties, and will be retained in memory even after they finish executing if assigned to a variable that persists in memory.) Because object
properties can be used to store data in memory as long as a variable referencing the object exists in memory, you can actually use them to get data into an event listener, and any changes to the data back out after an event handler executes. Consider this example. ...
FileSystemDirectoryEntry - Web APIs
Methods This interface inherits methods from its parent interface, FileSystemEntry. createReader() Creates a FileSystemDirectoryReader object which can be used to read the entries in this directory. getDirectory() Returns a FileSystemDirectoryEntry object representing a direct...
... Methods This interface inherits methods from its parent interface, FileSystemEntry. createReader() Creates a FileSystemDirectoryReader object which can be used to read the entries in this directory. getDirectory() Returns a FileSystemDirectoryEntry object representing a directory located at a given path, relat...
... Methods This interface inherits methods from its parent interface, FileSystemEntry. createReader() Creates a FileSystemDirectoryReader object which can be used to read the entries in this directory. getDirectory() Returns a FileSystemDirectoryEntry object representing a directory located at a given path, relative to the directory on which the me...
Using the Gamepad API - Web APIs
) This can then be used to get the same information. For example, the first code example above you be rewritten as shown below: window.addEventListener("gamepadconnected", function(e) { var gp = navigator.getGamepads()[e.gamepad.index]; console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", gp.index, gp.id, gp.buttons.length, gp.axes.length); }); The Gamepad object's
properties are as follows: id: A string containing some information about the controller. This is not strictly specified, but in Firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and product id of the controller, and the name of the controller as provided by the driver. This information is intended to allow you to find a...
...ly increasing, meaning that they can be compared to determine the ordering of updates, as newer values will always be greater than or equal to older values. Note that this property is not currently supported in Firefox. Note: The Gamepad object is available on the gamepadconnected event rather than the Window object itself, for security reasons. Once we have a reference to it, we can query its
properties for information about the current state of the gamepad. Behind the scenes, this object will be updated every time the gamepad's state changes. Using button information Let's look at a simple example that displays connection information for one gamepad (it ignores subsequent gamepad connections) and allows you to move a ball around the screen using the four gamepad buttons on the right hand sid...
...ndex " + gp.index + ": " + gp.id + ". It has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes."; gameLoop(); clearInterval(interval); } } } Now on to the main game loop. In each execution of the loop we check if one of four buttons is being pressed; if so, we update the values of the a and b movement variables appropriately, then update the left and top
properties, changing their values to the current values of a and b respectively. This has the effect of moving the ball around the screen. In current versions of Chrome (version 34 as of this writing) the button values are stored as an array of double values, instead of GamepadButton objects. This is fixed in development versions. After all this is done, we use our requestAnimationFrame() to request the n...
HTMLAudioElement - Web APIs
The HTMLAudioElement interface provides access to the
properties of <audio> elements, as well as methods to manipulate them. It's based on, and inherits
properties and methods from, the HTMLMediaElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">E...
...t-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLAudioElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Audio() Creates and returns a new HTMLAudioElement object, optionally starting the process of loading an audio file into it if the file URL is given.
Properties No specific
properties; inherits
properties from its parent, HTMLMediaElement, and from HTMLElement. Methods Inherits methods from its parent, HTMLMediaElement, and from HTMLElement. It offers no methods of its own. Obsolete Mozilla-only methods The following methods are non-standard and should not be used. mozCurrentSampleOffset() Returns the number of samples form the beginning of...
... the Audio() constructor: var audioElement = new Audio('car_horn.wav'); then you can invoke the play() method on the element audioElement.play(); A common gotcha is trying to play an audio element immediately on page load. Modern browser's default autoplay policy will block that from happening. Refer to firefox and chrome for best practices and work arounds. Some of the more commonly used
properties of the audio element include src, currentTime, duration, paused, muted, and volume. This snippet copies the audio file's duration to a variable: var audioElement = new Audio('car_horn.wav'); audioElement.addEventListener('loadeddata', () => { let duration = audioElement.duration; // The duration variable now holds the duration (in seconds) of the audio clip }) Events Inherits methods fr...
HTMLBaseElement - Web APIs
The HTMLBaseElement interface contains the base URI for a document. This object inherits all of the
properties and methods as described in the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 1...
... HTMLBaseElement.href Is a DOMString that reflects the href HTML attribute, containing a base URL for relative URLs in the document. 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. Methods No spe...
... HTMLBaseElement.href Is a DOMString that reflects the href HTML attribute, containing a base URL for relative URLs in the document. 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. Methods No specific method; inherit...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyli...
... HTMLButtonElement.accessKey Is a DOMString indicating the single-character keyboard key to give access to the button. HTMLButtonElement.autofocus Is a Boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated...
... HTMLButtonElement.accessKey Is a DOMString indicating the single-character keyboard key to give access to the button. HTMLButtonElement.autofocus Is a Boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a documen...
HTMLCanvasElement - Web APIs
The HTMLCanvasElement interface provides
properties and methods for manipulating the layout and presentation of <canvas> elements. The HTMLCanvasElement interface also inherits the
properties and methods of the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle...
... HTMLCanvasElement.height The height HTML attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or RGBA values) going down one column of the canvas. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. If no [separate] CSS height ...
... HTMLCanvasElement.height The height HTML attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or RGBA values) going down one column of the canvas. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. If no [separate] CSS height is assigned to the <c...
HTMLCollection - Web APIs
Note: This interface is called HTMLCollection for historical reasons (before the modern DOM, collections implementing this interface could only have HTML elements as their items). An HTMLCollection in the HTML DOM is live; it is automatically updated when the underlying document is changed.
Properties HTMLCollection.length Read only Returns the number of items in the collection. ...
...rguments) of elements (in document order) and offers methods and
properties for selecting from the list. Note: This interface is called HTMLCollection for historical reasons (before the modern DOM, collections implementing this interface could only have HTML elements as their items). An HTMLCollection in the HTML DOM is live; it is automatically updated when the underlying document is changed.
Properties HTMLCollection.length Read only Returns the number of items in the collection. Methods HTMLCollection.item() Returns the specific node at the given zero-based index into the list. Returns null if the index is out of range. An alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds). This is mostly useful for non-JavaScript DOM implementations. ...
... only done as a last resort, only in HTML, and only if the referenced element supports the name attribute. Returns null if no node exists by the given name. An alternative to accessing collection[name] (which instead returns undefined when name does not exist). This is mostly useful for non-JavaScript DOM implementations. Usage in JavaScript HTMLCollection also exposes its members directly as
properties by both name and index. HTML IDs may contain : and . as valid characters, which would necessitate using bracket notation for property access. Currently HTMLCollections does not recognize purely numeric IDs, which would cause conflict with the array-style access, though HTML5 does permit these. For example, assuming there is one <form> element in the document and its id is myForm: var elem1, ele...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget...
... HTMLDListElement.compact Is a Boolean indicating that spacing between list items should be reduced. Methods No specific methods; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDListElement' in that specification. Living Sta...
... HTMLDListElement.compact Is a Boolean indicating that spacing between list items should be reduced. Methods No specific methods; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDListElement' in that specification. Living Standard H...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline point...
... HTMLDataElement.value Is a DOMString reflecting the value HTML attribute, containing a machine-readable form of the element's value. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDataElement' in that...
... HTMLDataElement.value Is a DOMString reflecting the value HTML attribute, containing a machine-readable form of the element's value. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDataElement' in that specification. Li...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</te...
... Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDataListElement' in that specifica...
... Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDataListElement' in that specification. Living Stand...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/HTMLDetailsElement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLDetailsElement</t...
... HTMLDetailsElement.open Is a boolean reflecting the open HTML attribute, indicating whether or not the element's contents (not counting the <summary>) is to be shown to the user. Methods No specific method; inherits methods from its parent, HTMLElement. Events Listen to this event using addEventListener() or by assigning an event listene...
... HTMLDetailsElement.open Is a boolean reflecting the open HTML attribute, indicating whether or not the element's contents (not counting the <summary>) is to be shown to the user. Methods No specific method; inherits methods from its parent, HTMLElement. Events Listen to this event using addEventListener() or by assigning an event listener to the oneventname ...
HTMLDialogElement - Web APIs
The HTMLDialogElement interface provides methods to manipulate <dialog> elements. It inherits
properties and methods from the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/HTMLDialogElement" target="_top"><rect x="1" y="1" width="170" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="86" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLDialogElement</text></a></svg></div> a:...
... HTMLDialogElement.open A Boolean reflecting the open HTML attribute, indicating whether the dialog is available for interaction. HTMLDialogElement.returnValue A DOMString that sets or returns the return value for the dialog. Methods Inherits methods from its parent, HTMLElement. HTMLDialogElement.close() Closes the dialog. An optiona...
... HTMLDialogElement.open A Boolean reflecting the open HTML attribute, indicating whether the dialog is available for interaction. HTMLDialogElement.returnValue A DOMString that sets or returns the return value for the dialog. Methods Inherits methods from its parent, HTMLElement. HTMLDialogElement.close() Closes the dialog. An optional DOMString may be pa...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points=...
... HTMLDivElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specificatio...
... HTMLDivElement.align Is a DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Commen...
HTMLHeadElement - Web APIs
The HTMLHeadElement interface contains the descriptive information, or metadata, for a document. This object inherits all of the
properties and methods described in the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><...
... HTMLHeadElement.profile Is a DOMString representing the URIs of one or more metadata profiles (white space separated). Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHeadElement' in that specificati...
... HTMLHeadElement.profile Is a DOMString representing the URIs of one or more metadata profiles (white space separated). Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHeadElement' in that specification. Living Standar...
HTMLHeadingElement - Web APIs
The HTMLHeadingElement interface represents the different heading elements, <h1> through <h6>. It inherits methods and
properties from the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="11...
... HTMLHeadingElement.align Is a DOMString representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification S...
... HTMLHeadingElement.align Is a DOMString representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment ...
HTMLHtmlElement - Web APIs
You can retrieve the HTMLHtmlElement object for a given document by reading the value of the document.documentElement property. ...
... HTMLHtmlElement.version Is a DOMString representing the version of the HTML Document Type Definition (DTD) that governs this document. This property should not be used any more as it is non-conforming. Simply omit it. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Sta...
... HTMLHtmlElement.version Is a DOMString representing the version of the HTML Document Type Definition (DTD) that governs this document. This property should not be used any more as it is non-conforming. Simply omit it. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment ...
HTMLImageElement.border - Web APIs
The obsolete HTMLImageElement property border specifies the number of pixels thick the border surrounding the image should be. A value of 0, the default, indicates that no border should be drawn. You should not use this property! Instead, you should use CSS to style the border. The border property or its longhand
properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it. ...
...his property! Instead, you should use CSS to style the border. The border property or its longhand
properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it. The width, specifically, is controlled using the writing-mode aware border-block-start-width, border-block-end-width, border-inline-start-width, and border-inline-end-width
properties. For compatibility (or perhaps other) reasons, you can use the older
properties instead (or in addition): border-top-width, border-right-width, border-bottom-width, and border-left-width. Syntax htmlImageElement.border = thickness; let thickness = htmlImageElement.border; Value A DOMString containing an integer value specifying the thickness of the border that should surround the image, in ...
...ess; let thickness = htmlImageElement.border; Value A DOMString containing an integer value specifying the thickness of the border that should surround the image, in CSS pixels. A value of 0, or an empty string, indicates that there should be no border drawn. The default value of border is 0 Usage notes Do not use border. It is obsolete. Instead, use the CSS border property and its longhand
properties to establish borders around images. For example, if you have the following HTML: <img src="image.png" border="2"> The following will provide the same appearance using CSS instead of this obsolete property: <img src="image.png" style="border: 2px;"> You can further provide additional information to change the color and other features of the border: <img src="image.png" style="border: dashed ...
HTMLImageElement.x - Web APIs
In other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>. ...
... Note: The x property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. Example The example below demonstrates the use of the HTMLImageElement
properties x and y. HTML In this example, we see a table showing information about users of a web site, including their user ID, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>UserID</th> <th>Name</th> <th>Avatar</th> </tr> <tr> <td>12345678</td> <td>Johnny Rocket</td> <td><img sr...
...at <tr> (table row) element's cells property to get a list of the cells in that row. The third cell is taken from that row (once again, specifying 2 as the zero-based offset). From there, we can get the <img> element itself from the cell by calling querySelector() on the HTMLTableCellElement representing that cell. Finally, we can look up and display the values of the HTMLImageElement's x and y
properties. CSS The CSS defining the appearance of the table: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } Result The resulting table looks like this: Specifications Specification ...
HTMLImageElement.y - Web APIs
In other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>. ...
... Note: The y property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. Example The example below demonstrates the use of the HTMLImageElement
properties x and y. HTML In this example, we see a table showing information about users of a web site, including their user ID, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>UserID</th> <th>Name</th> <th>Avatar</th> </tr> <tr> <td>12345678</td> <td>Johnny Rocket</td> <td><img sr...
...at <tr> (table row) element's cells property to get a list of the cells in that row. The third cell is taken from that row (once again, specifying 2 as the zero-based offset). From there, we can get the <img> element itself from the cell by calling querySelector() on the HTMLTableCellElement representing that cell. Finally, we can look up and display the values of the HTMLImageElement's x and y
properties. CSS The CSS defining the appearance of the table: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } Result The resulting table looks like this: Specifications Specification ...
HTMLLabelElement - Web APIs
The HTMLLabelElement interface gives access to
properties specific to <label> elements. It inherits methods and
properties from the base HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 ...
... HTMLLabelElement.control Read only Is a HTMLElement representing the control with which the label is associated. HTMLLabelElement.form Read only Is a HTMLFormElement object representing the form with which the labeled control is associated, or null if there is no associated control, or if that control isn't associated with a form. In othe...
... HTMLLabelElement.control Read only Is a HTMLElement representing the control with which the label is associated. HTMLLabelElement.form Read only Is a HTMLFormElement object representing the form with which the labeled control is associated, or null if there is no associated control, or if that control isn't associated with a form. In other words, this is just...
HTMLLegendElement - Web APIs
The HTMLLegendElement is an interface allowing to access
properties of the <legend> elements. It inherits
properties and methods from the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20...
... HTMLLegendElement.form Read only Is a HTMLFormElement representing the form that this legend belongs to. If the legend has a fieldset element as its parent, then this attribute returns the same value as the form attribute on the parent fieldset element. Otherwise, it returns null. HTMLLegendElement.accessKey Is a DOMString representing a...
... HTMLLegendElement.form Read only Is a HTMLFormElement representing the form that this legend belongs to. If the legend has a fieldset element as its parent, then this attribute returns the same value as the form attribute on the parent fieldset element. Otherwise, it returns null. HTMLLegendElement.accessKey Is a DOMString representing a single-character acc...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle"...
... HTMLMapElement.name Is a DOMString representing the <map> element for referencing it other context. If the id attribute is set, this must have the same value; and it cannot be null or empty. HTMLMapElement.areas Read only Is a live HTMLCollection representing the <area> elements associated to this <map>. Methods No specific method; inhe...
... HTMLMapElement.name Is a DOMString representing the <map> element for referencing it other context. If the id attribute is set, this must have the same value; and it cannot be null or empty. HTMLMapElement.areas Read only Is a live HTMLCollection representing the <area> elements associated to this <map>. Methods No specific method; inherits methods from its...
HTMLMarqueeElement - Web APIs
The HTMLMarqueeElement interface provides methods to manipulate <marquee> elements. It inherits
properties and methods from the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/HTMLMarqueeElement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLMarqueeElement</text></a></svg><...
... HTMLMarqueeElement.behavior Sets how the text is scrolled within the marquee. Possible values are scroll, slide and alternate. If no value is specified, the default value is scroll. HTMLMarqueeElement.bgColor Sets the background color through color name or hexadecimal value. HTMLMarqueeElement.direction Sets the direction of the scrolling...
... HTMLMarqueeElement.behavior Sets how the text is scrolled within the marquee. Possible values are scroll, slide and alternate. If no value is specified, the default value is scroll. HTMLMarqueeElement.bgColor Sets the background color through color name or hexadecimal value. HTMLMarqueeElement.direction Sets the direction of the scrolling within the marquee. ...
HTMLMetaElement - Web APIs
The HTMLMetaElement interface contains descriptive metadata about a document. It inherits all of the
properties and methods described in the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121...
... Name Type Description content DOMString Gets or sets the value of meta-data property. httpEquiv DOMString Gets or sets the name of an HTTP response header to define for a document. name DOMString Gets or sets the name of a meta-data property to define for a document. scheme...
... Name Type Description content DOMString Gets or sets the value of meta-data property. httpEquiv DOMString Gets or sets the name of an HTTP response header to define for a document. name DOMString Gets or sets the name of a meta-data property to define for a document. scheme DOMString Ge...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E5...
... HTMLMeterElement.high A double representing the value of the high boundary, reflecting the high attribute. HTMLMeterElement.low A double representing the value of the low boundary, reflecting the lowattribute. HTMLMeterElement.max A double representing the maximum value, reflecting the max attribute. HTMLMeterElement.min A double r...
... HTMLMeterElement.high A double representing the value of the high boundary, reflecting the high attribute. HTMLMeterElement.low A double representing the value of the low boundary, reflecting the lowattribute. HTMLMeterElement.max A double representing the maximum value, reflecting the max attribute. HTMLMeterElement.min A double representing the minimum va...
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>. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-a...
... HTMLModElement.cite Is a DOMString reflecting the cite HTML attribute, containing a URI of a resource explaining the change. HTMLModElement.dateTime Is a DOMString reflecting the datetime HTML attribute, containing a date-and-time string representing a timestamp for the change. Specifications Specification Status Comment ...
... HTMLModElement.cite Is a DOMString reflecting the cite HTML attribute, containing a URI of a resource explaining the change. HTMLModElement.dateTime Is a DOMString reflecting the datetime HTML attribute, containing a date-and-time string representing a timestamp for the change. Specifications Specification Status Comment HTML Living S...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Ev...
... HTMLOListElement.reversed Is a Boolean value reflecting the reversed and defining if the numbering is descending, that is its value is true, or ascending (false). HTMLOListElement.start Is a long value reflecting the start and defining the value of the first number of the first element of the list. HTMLOListElement.type Is a DOMString val...
... HTMLOListElement.reversed Is a Boolean value reflecting the reversed and defining if the numbering is descending, that is its value is true, or ascending (false). HTMLOListElement.start Is a long value reflecting the start and defining the value of the first number of the first element of the list. HTMLOListElement.type Is a DOMString value reflecting the typ...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" al...
... HTMLOptGroupElement.disabled Is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false). HTMLOptGroupElement.label Is a DOMString representing the label for the group. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification S...
... HTMLOptGroupElement.disabled Is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false). HTMLOptGroupElement.label Is a DOMString representing the label for the group. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment ...
HTMLOutputElement - Web APIs
The HTMLOutputElement interface provides
properties and methods (beyond those inherited from HTMLElement) for manipulating the layout and presentation of <output> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="11...
... HTMLOutputElement.defaultValue A DOMString representing the default value of the element, initially the empty string. HTMLOutputElement.formRead only An HTMLFormElement indicating the form associated with the control, reflecting the form HTML attribute if it is defined. HTMLOutputElement.htmlForRead only A DOMTokenLi...
... HTMLOutputElement.defaultValue A DOMString representing the default value of the element, initially the empty string. HTMLOutputElement.formRead only An HTMLFormElement indicating the form associated with the control, reflecting the form HTML attribute if it is defined. HTMLOutputElement.htmlForRead only A DOMTokenList reflecting the for HTML attribute, con...
HTMLParagraphElement - Web APIs
The HTMLParagraphElement interface provides special
properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <p> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points=...
... HTMLParagraphElement.align A DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific methods, inherits methods from its parent, HTMLElement. Specifications Specific...
... HTMLParagraphElement.align A DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". Methods No specific methods, inherits methods from its parent, HTMLElement. Specifications Specification Status Co...
HTMLPictureElement - Web APIs
The HTMLPictureElement interface represents a <picture> HTML element. It doesn't implement specific
properties or methods. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D...
... Methods No specific method, but inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLPictureElement' in that specification. Living Standard Initial definition ...
... Methods No specific method, but inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLPictureElement' in that specification. Living Standard Initial definition ...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><pol...
... HTMLSourceElement.media Is a DOMString reflecting the media HTML attribute, containing the intended type of the media resource. HTMLSourceElement.sizes Is a DOMString representing image sizes between breakpoints HTMLSourceElement.src Is a DOMString reflecting the src HTML attribute, containing the URL for the media resource. The HTMLSou...
... HTMLSourceElement.media Is a DOMString reflecting the media HTML attribute, containing the intended type of the media resource. HTMLSourceElement.sizes Is a DOMString representing image sizes between breakpoints HTMLSourceElement.src Is a DOMString reflecting the src HTML attribute, containing the URL for the media resource. The HTMLSourceElement.src proper...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></...
... HTMLTableColElement.align Is a DOMString that indicates the horizontal alignment of the cell data in the column. HTMLTableColElement.ch Is a DOMString representing the alignment character for cell data. HTMLTableColElement.chOff Is a DOMString representing the offset for the alignment character. HTMLTableColElement.span Is an u...
... HTMLTableColElement.align Is a DOMString that indicates the horizontal alignment of the cell data in the column. HTMLTableColElement.ch Is a DOMString representing the alignment character for cell data. HTMLTableColElement.chOff Is a DOMString representing the offset for the alignment character. HTMLTableColElement.span Is an unsigned long that ref...
HTMLTableSectionElement - Web APIs
The HTMLTableSectionElement interface provides special
properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an HTML table. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4...
... HTMLTableSectionElement.align Is a DOMString containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center". HTMLTableSectionElement.rows Read only Returns a live HTMLCollection containing th...
... HTMLTableSectionElement.align Is a DOMString containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center". HTMLTableSectionElement.rows Read only Returns a live HTMLCollection containing the rows in the section...
HTMLTextAreaElement - Web APIs
The HTMLTextAreaElement interface provides special
properties and methods for manipulating the layout and presentation of <textarea> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" ...
... autocapitalize string: Returns / Sets the element's capitalization behavior for user input. Valid values are: none, off, characters, words, sentences. autocomplete autofocus boolean: Returns / Sets the element's autofocus attribute, indicating that the control should have inpu...
...is a candidate for constraint validation. false if any conditions bar it from constraint validation, including its readOnly or disabled property is true. wrap string: Returns / Sets the wrap HTML attribute, indicating how the control wraps text. HTMLTextAreaElement.labelsRead only NodeList: Returns a list of label elements associated with this element. The two
properties tabIndex and accessKey are inherited from HTMLElement from HTML5 on, but were defined on HTMLTextAreaElement in DOM Level 2 HTML and earlier specifications. Methods blur() Removes focus from the control; keystrokes will subsequently go nowhere. focus() Gives focus to the control; keystrokes will subsequently go to this element. select() Selects the contents o...
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. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline point...
... HTMLTimeElement.dateTime Is a DOMString that reflects the datetime HTML attribute, containing a machine-readable form of the element's date and time value. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'H...
... HTMLTimeElement.dateTime Is a DOMString that reflects the datetime HTML attribute, containing a machine-readable form of the element's date and time value. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTimeElement' in th...
HTMLTitleElement - Web APIs
The HTMLTitleElement interface contains the title for a document. This element inherits all of the
properties and methods of the HTMLElement interface. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 ...
... HTMLTitleElement.text Is a DOMString representing the text of the document's title. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTitleElement' in that specification. Living Standard ...
... HTMLTitleElement.text Is a DOMString representing the text of the document's title. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTitleElement' in that specification. Living Standard HTML 5.1The definiti...
IDBRequest - Web APIs
to results of asynchronous requests to databases and database objects using event handler attributes. Each reading and writing operation on a database is done using a request. The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the
properties of the IDBRequest instance. All asynchronous operations immediately return an IDBRequest instance. Each request has a readyState that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. When the state is set to done, every request returns a result and an error, and an event is fired on the request. When the state is still pending, any attempt to access t...
... IDBRequest.error Read only Returns a DOMException in the event of an unsuccessful request, indicating what went wrong. IDBRequest.result Read only Returns the result of the request. If the the request failed and the result is not available, an InvalidStateError exception is thrown. IDBRequest.source Read only The source of the request, su...
... IDBRequest.error Read only Returns a DOMException in the event of an unsuccessful request, indicating what went wrong. IDBRequest.result Read only Returns the result of the request. If the the request failed and the result is not available, an InvalidStateError exception is thrown. IDBRequest.source Read only The source of the request, such as an IDBIndex or an ID...
IDBVersionChangeEvent - Web APIs
IDBVersionChangeEvent.oldVersion Read only Returns the old version of the database. IDBVersionChangeEvent.newVersion Read only Returns the new version of the database. ...
... The IDBVersionChangeEvent interface of the IndexedDB API indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. Note: This feature is available in Web Workers.
Properties Also inherits
properties from its parent, Method. IDBVersionChangeEvent.oldVersion Read only Returns the old version of the database. IDBVersionChangeEvent.newVersion Read only Returns the new version of the database. Deprecated
properties IDBVersionChangeEvent.version Read only The new version of the database in a versionchange transaction. Warning: While this property is still implemented in older browsers, the latest specification replaces it with the oldVersion and newVersion attributes. See the compatibility table to know w...
... Example In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. Upon a version change (after an upgradedneeded event), the success event will implement the IDBVersionChangeEvent interface. ...
Basic concepts - Web APIs
WebSQL Database is a relational database access system, whereas IndexedDB is an indexed table system. Big concepts If you have assumptions from working with other types of databases, you might get thrown off when working with IndexedDB. So keep the following important concepts in mind: IndexedDB databases store key-value pairs. The values can be complex structured objects, and keys can be
properties of those objects. You can create indexes that use any property of the objects for quick searching, as well as sorted enumeration. Keys can be binary objects. IndexedDB is built on a transactional database model. Everything you do in IndexedDB always happens in the context of a transaction. The IndexedDB API provides lots of objects that represent indexes, tables, cursors, and so on, but eac...
...nd the type of event you get lets you know if the operation succeeded or failed. This sounds a little complicated at first, but there are sanity measures baked in. It's not that different from the way that XMLHttpRequest works. IndexedDB uses a lot of requests. Requests are objects that receive the success or failure DOM events that were mentioned previously. They have onsuccess and onerror
properties, and you can call addEventListener() and removeEventListener() on them. They also have readyState, result, and errorCode
properties that tell you the status of the request. The result property is particularly magical, as it can be many different things, depending on how the request was generated (for example, an IDBCursor instance, or the key for a value that you just inserted into the database).
... following: an empty string, a JavaScript identifier, or multiple JavaScript identifiers separated by periods or an array containing any of those. It cannot include spaces. value Each record has a value, which could include anything that can be expressed in JavaScript, including boolean, number, string, date, object, array, regexp, undefined, and null. When an object or array is stored, the
properties and values in that object or array can also be anything that is a valid value. Blobs and files can be stored, cf. specification . Range and scope scope The set of object stores and indexes to which a transaction applies. The scopes of read-only transactions can overlap and execute at the same time. On the other hand, the scopes of writing transactions cannot overlap. You can still start...
Using IndexedDB - Web APIs
eneeded is the only place where you can alter the structure of the database. In it, you can create and delete object stores and build and remove indices. Object stores are created with a single call to createObjectStore(). The method takes a name of the store, and a parameter object. Even though the parameter object is optional, it is very important, because it lets you define important optional
properties and refine the type of object store you want to create. In our case, we've asked for an object store named "customers" and defined a keyPath, which is the property that makes an individual object in the store unique. That property in this example is "ssn" since a social security number is guaranteed to be unique. "ssn" must be present on every object that is stored in the objectStore. We've a...
...e'll get to in a minute. Second, you can specify the direction that you want to iterate. In the above example, we're iterating over all objects in ascending order. The success callback for cursors is a little special. The cursor object itself is the result of the request (above we're using the shorthand, so it's event.target.result). Then the actual key and value can be found on the key and value
properties of the cursor object. If you want to keep going, then you have to call continue() on the cursor. When you've reached the end of the data (or if there were no entries that matched your openCursor() request) you still get a success callback, but the result property is undefined. One common pattern with cursors is to retrieve all objects in an object store and add them to an array, like this: var ...
... client-side JavaScript, which is not very efficient. This new functionality enables developers to specify a locale when creating an index using IDBObjectStore.createIndex() (check out its parameters.) In such cases, when a cursor is then used to iterate through the dataset, and you want to specify locale-aware sorting, you can use a specialized IDBLocaleAwareKeyRange. ...
Timing element visibility with the Intersection Observer API - Web APIs
ld(adBox); } adObserver.observe(adBox); } First is the array ads. This array contains the data needed to create each ad. We have four here to choose from at random. In a real-world scenario, of course, the ads would come from a database or, more likely, an advertising service from which you fetch ads using an API. However, our needs are simple: each ad is represented by an object with three
properties: a background color (bgcolor), a title (title), and a body text string (body). Then we define several variables: adBox This will be set to the element that represents the ad. For new ads being appended to the page, this is created using Document.createElement(). When replacing an existing ad, this is set to the specified ad element (replaceBox). title Will hold the <h2> element representin...
... we begin by ending observation of the element by calling IntersectionObserver.unobserve(). Then the local variables for each of the elements that comprise an ad: the ad box itself, the title, the body, and the timer box, are all set to the corresponding elements in the existing ad. If no value is specified for replaceBox, we create a new ad element. The ad's new <div> element is created and its
properties established by setting its class name to "ad". Next, the ad title element is created, along with the body and the visibility timer; these are an <h2>, a <p>, and a <div> element, respectively. These elements are appended to the adBox element. After that, the code paths converge once again. The ad's background color is set to the value specified in the new ad's record, and elements' classes and c...
...ted, along with the body and the visibility timer; these are an <h2>, a <p>, and a <div> element, respectively. These elements are appended to the adBox element. After that, the code paths converge once again. The ad's background color is set to the value specified in the new ad's record, and elements' classes and contents are set appropriately as well. Next, it's time to set up the custom data
properties to track the ad's visibility data by setting adBox.dataset.totalViewTime and adBox.dataset.lastViewStarted to 0. Finally, we set the ID of the <div> which will show the timer we'll present in the ad to show how long it's been visible, giving it the class "timer". The initial text is set to "0:00", to represent the starting time of 0 minutes and 0 seconds, and it's appended to the ad. If we're n...
KeyboardEvent - Web APIs
e key is located on the numeric keypad, or is a virtual key associated with the numeric keypad if there's more than one place the key could originate from. The NumLock key does not fall into this group and is always encoded with the location DOM_KEY_LOCATION_STANDARD. Examples include the digits on the numeric keypad, the keypad's Enter key, and the decimal point on the keypad.
Properties This interface also inherits
properties of its parents, UIEvent and Event. KeyboardEvent.altKey Read only Returns a Boolean that is true if the Alt ( Option or ? on OS X) key was active when the key event was generated. KeyboardEvent.code Read only Returns a DOMString with the code value of the physical key represented by the event. Warning: This ignores the user's keyboard layout, so t...
...Returns a DOMString with the code value of the physical key represented by the event. Warning: This ignores the user's keyboard layout, so that if the user presses the key at the "Y" position in a QWERTY keyboard layout (near the middle of the row above the home row), this will always return "KeyY", even if the user has a QWERTZ keyboard (which would mean the user expects a "Z" and all the other
properties would indicate a "Z") or a Dvorak keyboard layout (where the user would expect an "F"). KeyboardEvent.ctrlKey Read only Returns a Boolean that is true if the Ctrl key was active when the key event was generated. KeyboardEvent.isComposing Read only Returns a Boolean that is true if the event is fired between after compositionstart and before compositionend. KeyboardEvent.key Read only R...
...s created. Obsolete methods KeyboardEvent.initKeyEvent() Initializes a KeyboardEvent object. This was implemented only by Firefox, and is no longer supported even there; instead, you should use the KeyboardEvent() constructor. KeyboardEvent.initKeyboardEvent() Initializes a KeyboardEvent object. This is now deprecated. You should instead use the KeyboardEvent() constructor. Obsolete
properties KeyboardEvent.char Read only Returns a DOMString representing the character value of the key. If the key corresponds to a printable character, this value is a non-empty Unicode string containing that character. If the key doesn't have a printable representation, this is an empty string. Note: If the key is used as a macro that inserts multiple characters, this attribute's value is the ent...
Lock - Web APIs
The mode is either "exclusive" (the default) or "shared". Lock.name Read only Returns the name passed to LockManager.request() when the lock was requested. Examples The following examples show how the mode and name
properties are passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. ...
...ch is received in the callback to LockManager.request().
Properties Lock.mode Read only Returns the access mode passed to LockManager.request() when the lock was requested. The mode is either "exclusive" (the default) or "shared". Lock.name Read only Returns the name passed to LockManager.request() when the lock was requested. ...
...as requested. The mode is either "exclusive" (the default) or "shared". Lock.name Read only Returns the name passed to LockManager.request() when the lock was requested. Examples The following examples show how the mode and name
properties are passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. navigator.locks.request("net_db_sync", show_lock_
properties); navigator.locks.request("another_lock", {mode: "shared"}, show_lock_
properties); function show_lock_
properties(lock) { console.log(`The lock name is: ${lock.name}`); console.log(`The lock mode is: ${lock.mode}`); } Specifications Specification Status Comment Web Locks APIThe definition of 'Lock' in that specification. Draft Initial definition. ...
MathMLElement - Web APIs
The MathMLElement interface represents any MathML element. ...
... The MathMLElement interface represents any MathML element. ...
... The MathMLElement interface represents any MathML element. ...
MediaStreamTrack.getConstraints() - Web APIs
The getConstraints() method of the MediaStreamTrack interface returns a MediaTrackConstraints object containing the set of constraints most recently established for the track using a prior call to applyConstraints(). These constraints indicate values and ranges of values that the Web site or application has specified are required or acceptable for the included constrainable
properties. Constraints can be used to ensure that the media meets certain guidelines you prefer. For example, you may prefer high definition video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. Constraints can also specify ideal and/or acceptable sizes or ranges of sizes. See Capabilities, constraints, and settings for details on how to work with constrainable pro...
...me rate be a little low to help keep the data rate low enough not overtax the network. Constraints can also specify ideal and/or acceptable sizes or ranges of sizes. See Capabilities, constraints, and settings for details on how to work with constrainable
properties. Syntax const constraints = track.getConstraints() Return value A MediaTrackConstraints object which indicates the constrainable
properties the Web site or app most recently set using applyConstraints(). The
properties in the returned object are listed in the same order as when they were set, and only
properties specifically set by the site or app are included. Note: The returned set of constraints doesn't necessarily describe the actual state of the media. Even if any of the constraints couldn't be met, they are still included in ...
... Example This example obtains the current constraints for a track, sets the facingMode, and applies the updated constraints. ...
MediaTrackSupportedConstraints - Web APIs
An object conforming to MediaTrackSupportedConstraints is returned by MediaDevices.getSupportedConstraints(). Because of the way interface definitions in WebIDL work, if a constraint is requested but not supported, no error will occur. ...
...use getSupportedConstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted. An actual constraint set is described using an object based on the MediaTrackConstraints dictionary. To learn more about how constraints work, see Capabilities, constraints, and settings.
Properties Some combination--but not necessarily all--of the following
properties will exist on the object. autoGainControl A Boolean whose value is true if the autoGainControl constraint is supported in the current environment. width A Boolean value whose value is true if the width constraint is supported in the current environment. height A Boolean value whose value is true if the height constrai...
...raint is supported in the current environment. channelCount A Boolean value whose value is true if the channelCount constraint is supported in the current environment. deviceId A Boolean value whose value is true if the deviceId constraint is supported in the current environment. groupId A Boolean value whose value is true if the groupId constraint is supported in the current environment.
Properties specific to shared screen tracks For tracks containing video sources from the user's screen contents, the following additional
properties are may be included in addition to those available for video tracks. cursor A Boolean value which is true if the cursor constraint is supported in the current environment. displaySurface A Boolean value which is true if the cursor constraint is sup...
Using the Media Capabilities API - Web APIs
es, frame rates, and other such details. With the Media Capabilities API, you can determine not just if the browser can support a given format, but whether or not it can do so efficiently and smoothly. In short, this API replaces--and improves upon--the MediaSource method isTypeSupported() or the HTMLMediaElement method canPlayType(). More and more finely-detailed information about the display's
properties, so that informed decisions can be made when choosing the best format to play on the user's device. For example, you can use the API to ensure that you don't try to play High Dynamic Range (HDR) content on a Standard Dynamic Range (SDR) screen. Support for getting real-time feedback about the playback of media, so your code can make informed decisions about adapting the stream's quality or other...
...yed per second of time when playing the video. ...
...determine if a video matching this configuration would be decodable and if the playback would be smooth and power efficient. var promise = navigator.mediaCapabilities.decodingInfo(videoConfiguration); The decodingInfo() and encodingInfo() methods both return promises. Once the promises state is fulfilled, you can access the MediaCapabilitiesInfo interface's supported, smooth, and powerEfficient
properties. Handling the response Instead of the assigning the promise to a variable, we can output the values returned by the promise to the console: navigator.mediaCapabilities.decodingInfo(videoConfiguration).then(result => { console.log('This configuration is ' + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') + 'smooth, and ' + (result.powerEfficient ? ...
NodeList - Web APIs
Although NodeList is not an Array, it is possible to iterate over it with forEach(). It can also be converted to a real Array using Array.from(). However, some older browsers have not implemented NodeList.forEach() nor Array.from(). This can be circumvented by using Array.prototype.forEach() -- see this document's Example. Live vs. Static NodeLists Although they are both considered NodeLists, there are 2 varieties of NodeList: live and static. Live NodeLists In some cases, the NodeList is live, which means that changes in the DOM automatically update the collection. ...
..._nodes.length); // outputs "3" Static NodeLists In other cases, the NodeList is static, where any changes in the DOM does not affect the content of the collection. The ubiquitous document.querySelectorAll() method returns a static NodeList. It's good to keep this distinction in mind when you choose how to iterate over the items in the NodeList, and whether you should cache the list's length.
Properties NodeList.length The number of nodes in the NodeList. Methods NodeList.item() Returns an item in the list by its index, or null if the index is out-of-bounds. An alternative to accessing nodeList[i] (which instead returns undefined when i is out-of-bounds). This is mostly useful for non-JavaScript DOM implementations. NodeList.entries() Returns an iterator, allowing code to go throug...
...List.values() Returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection. Example It's possible to loop over the items in a NodeList using a for loop: for (let i = 0; i < myNodeList.length; i++) { let item = myNodeList[i]; } Don't use for...in to enumerate the items in NodeLists, since they will also enumerate its length and item
properties and cause errors if your script assumes it only has to deal with element objects. Also, for..in is not guaranteed to visit the
properties in any particular order. for...of loops will loop over NodeList objects correctly: const list = document.querySelectorAll('input[type=checkbox]'); for (let checkbox of list) { checkbox.checked = true; } Recent browsers also support iterator methods (forEac...
Notification - Web APIs
s available in Web Workers. The Notification interface of the Notifications API is used to configure and display desktop notifications to the user. These notifications' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously provide information to the user. Constructor Notification() Creates a new instance of the Notification object.
Properties Static
properties These
properties are available only on the Notification object itself. Notification.permission Read only A string representing the current permission to display notifications. Possible values are: denied -- The user refuses to have notifications displayed. granted -- The user accepts having notifications displayed. default -- The user choice is unknown and therefo...
...ion.permission Read only A string representing the current permission to display notifications. Possible values are: denied -- The user refuses to have notifications displayed. granted -- The user accepts having notifications displayed. default -- The user choice is unknown and therefore the browser will act as if the value were denied. Notification.maxActions Read only Instance
properties These
properties are available only on instances of the Notification object. Notification.actions Read only The actions array of the notification as specified in the constructor's options parameter. Notification.badge Read only The URL of the image used to represent the notification when there is not enough space to display the notification itself. Notification.body Read only The body...
... error event. It is triggered each time the notification encounters an error. Notification.onshow A handler for the show event. It is triggered when the notification is displayed. Methods Static methods These methods are available only on the Notification object itself. Notification.requestPermission() Requests permission from the user to display notifications. Instance methods These
properties are available only on an instance of the Notification object or through its prototype. The Notification object also inherits from the EventTarget interface. Notification.close() Programmatically closes a notification instance. Examples Assume this basic HTML: <button onclick="notifyMe()">Notify me!</button> It's possible to send a notification as follows -- here we present a fairly verbo...
ParentNode - Web APIs
It's implemented by Element, Document, and DocumentFragment objects. 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.children Read only Returns a live HTMLCollection containing all of the Element objects that are children of this ParentNode, omitting all of its non-element nodes. ParentNode.firstElementChild Read only Returns the first node which is both a child of this ParentNode and is also an Element, or null if there is none. ...
...dren() Replaces the existing children of a node with a specified new set of children. Specification Specification Status Comment DOMThe definition of 'ParentNode' in that specification. Living Standard Split the ElementTraversal interface into ChildNode and ParentNode. ...
...ementChild, and ParentNode.childElementCount
properties are now defined on the latter. Added the ParentNode.children property, and the ParentNode.querySelector(), ParentNode.querySelectorAll(), ParentNode.append(), and ParentNode.prepend() methods. Element Traversal SpecificationThe definition of 'ElementTraversal' in that specification. Obsolete Added the initial definition of its
properties to the ElementTraversal pure interface and used it on Element. ...
PaymentAddress - Web APIs
The PaymentAddress interface of the Payment Request API is used to store shipping or payment address information. It may be useful to refer to the Universal Postal Union web site's Addressing S42 standard materials, which provide information about international standards for postal addresses.
Properties PaymentAddress.addressLine Read only An array of DOMString objects providing each line of the address not included among the other
properties. The exact size and content varies by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box number. PaymentAddress.country Read only A DOMString specifying the country in which the address is located, using the ISO-3166-1 alpha-2 s...
...ple a state, province, oblast, or prefecture. PaymentAddress.regionCode Read only A DOMString specifying the region of the address, represented as a "code element" of an ISO3166-2 country subdivision name (e.g. "QLD" for Queensland, Australia, "CA" for California, and so on). PaymentAddress.sortingCode Read only A DOMString providing a postal sorting code such as is used in France. Note:
Properties for which values were not specified contain empty strings. Obsolete
properties The following
properties are obsolete and should no longer be used, but may still be present in some browser versions. PaymentAddress.languageCode Read only A DOMString indicating the language code of the address. This identifies the language in which the address is given, and is intended to aid in localizati...
...till be present in some browser versions. PaymentAddress.languageCode Read only A DOMString indicating the language code of the address. This identifies the language in which the address is given, and is intended to aid in localization of the display of the address. Methods PaymentAddress.toJSON() A standard serializer that returns a JSON representation of the PaymentAddress object's
properties. Examples In the following example, the PaymentRequest() constructor is used to create a new payment request, which takes three objects as parameters -- one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. The first of these thre...
PaymentResponse.retry() - Web APIs
The PaymentResponse interface's retry() method makes it possible to ask the user to retry a payment after an error occurs during processing. This lets your app gracefully deal with situations such as invalid shipping addresses or declined credit cards. ...
... payer Optional A PayerErrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation. ...
... payer Optional A PayerErrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation. paymentMethod Optional Any payment method specific errors which may have occurred. ...
PerformanceEntry - Web APIs
licit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). PerformanceEntry instances will always be one of the following subtypes: PerformanceMark PerformanceMeasure PerformanceFrameTiming PerformanceNavigationTiming PerformanceResourceTiming PerformancePaintTiming Note: This feature is available in Web Workers.
Properties PerformanceEntry.name Read only A value that further specifies the value returned by the PerformanceEntry.entryType property. The value of both depends on the subtype. See property page for valid values. PerformanceEntry.entryType Read only A DOMString representing the type of performance metric such as, for example, "mark". See property page for valid values. PerformanceEntry.startTime ...
...ry.startTime Read only A DOMHighResTimeStamp representing the starting time for the performance metric. PerformanceEntry.duration Read only A DOMHighResTimeStamp representing the time value of the duration of the performance event. Methods PerformanceEntry.toJSON() Returns a JSON representation of the PerformanceEntry object. Example The following example checks all PerformanceEntry
properties to see if the browser supports them and if so, write their values to the console. function print_PerformanceEntries() { // Use getEntries() to get a list of all performance entries var p = performance.getEntries(); for (var i=0; i < p.length; i++) { console.log("PerformanceEntry[" + i + "]"); print_PerformanceEntry(p[i]); } } function print_PerformanceEntry(perfEntry) { var pro...
...es() to get a list of all performance entries var p = performance.getEntries(); for (var i=0; i < p.length; i++) { console.log("PerformanceEntry[" + i + "]"); print_PerformanceEntry(p[i]); } } function print_PerformanceEntry(perfEntry) { var
properties = ["name", "entryType", "startTime", "duration"]; for (var i=0; i <
properties.length; i++) { // Check each property var supported =
properties[i] in perfEntry; if (supported) { var value = perfEntry[
properties[i]]; console.log("... " +
properties[i] + " = " + value); } else { console.log("... " +
properties[i] + " is NOT supported"); } } } Specifications Specification Status Comment Resource Timing Level 3 ...
PerformanceResourceTiming - Web APIs
The PerformanceResourceTiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. The interface's
properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, DNS lookup start and end times, response start and end times, etc.. Additionally, the interface extends PerformanceEntry with other
properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. <div id="interfaceDiagram" style="display: in...
..." y="1" width="250" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">PerformanceResourceTiming</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Note: This feature is available in Web Workers.
Properties This interface extends the following PerformanceEntry
properties for resource performance entry types by qualifying and constraining them as follows: PerformanceEntry.entryTypeRead only Returns "resource". PerformanceEntry.nameRead only Returns the resources URL. PerformanceEntry.startTimeRead only Returns the timestamp for the time a resource fetch started. This value is equivalent ...
... PerformanceEntry.entryTypeRead only Returns "resource". PerformanceEntry.nameRead only Returns the resources URL. PerformanceEntry.startTimeRead only Returns the timestamp for the time a resource fetch started. This value is equivalent to PerformanceEntry.fetchStart. PerformanceEntry.durationRead only Returns a timestamp that is the difference between the responseEnd and the startTime
properties. The interface also supports the following
properties which are listed in the order in which they are recorded for the fetching of a single resource. An alphabetical listing is shown in the navigation, at left. PerformanceResourceTiming.initiatorTypeRead only A string representing the type of resource that initiated the performance entry, as specified in PerformanceResourceTiming.initiator...
PointerEvent - Web APIs
dinate (or set of coordinates) on the contact surface such as a screen. A pointer's hit test is the process a browser uses to determine the target element for a pointer event. Typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media. Constructors PointerEvent() Creates a synthetic--and untrusted--PointerEvent.
Properties This interface inherits
properties from MouseEvent and Event. PointerEvent.pointerId Read only A unique identifier for the pointer causing the event. PointerEvent.width Read only The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer. PointerEvent.height Read only The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the po...
... For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. pointermove This event is fired when a pointer changes coordinates. pointerrawupdate This event is fired when any of a pointer's
properties change. pointerup This event is fired when a pointer is no longer active. pointercancel A browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived). pointerout This event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event f...
... Pointer EventsThe definition of 'PointerEvent' in that specification. Obsolete Initial definition. ...
Pointer Lock API - Web APIs
it stops when the mouse button is released. Pointer lock is different from mouse capture in the following ways: It is persistent: Pointer lock does not release the mouse until an explicit API call is made or the user uses a specific release gesture. It is not limited by browser or screen boundaries. It continues to send events regardless of mouse button state. It hides the cursor. Method/
properties overview This section provides a brief description of each property and method related to the pointer lock specification. requestPointerLock() The Pointer lock API, similar to the Fullscreen API, extends DOM elements by adding a new method, requestPointerLock(). As it has recently unprefixed, you would currently declare it something like this, for example if you wanted to request pointer lock ...
...ck failed"); } Note: until Firefox 50 the above events were prefixed with moz in Firefox. Extensions to mouse events The Pointer lock API extends the normal MouseEvent interface with movement attributes. Two new attributes to mouse events--movementX and movementY--provide the change in mouse positions. ...
...tY--provide the change in mouse positions. The values of the parameters are the same as the difference between the values of MouseEvent
properties, screenX and screenY, which are stored in two subsequent mousemove events, eNow and ePrevious. In other words, the Pointer lock parameter movementX = eNow.screenX - ePrevious.screenX. Locked state When Pointer lock is enabled, the standard MouseEvent
properties clientX, clientY, screenX, and screenY are held constant, as if the mouse is not moving. The movementX and movementY
properties continue to provide the mouse's change in position. There is no limit to movementX and movementY values if the mouse is continuously moving in a single direction. The concept of the mouse cursor does not exist and the cursor cannot move off the window or be clamped by a ...
RTCIceCandidatePairStats - Web APIs
The WebRTC RTCIceCandidatePairStats dictionary reports statistics which provide insight into the quality and performance of an RTCPeerConnection while connected and configured as described by the specified pair of ICE candidates. If a RTCStats-based object's type is candidate-pair, it's an RTCIceCandidatePairStats object.
Properties RTCIceCandidatePairStats is based upon RTCStats and inherits its
properties. In addition, it adds the following new
properties: availableIncomingBitrate Optional Provides an informative value representing the available inbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's incoming RTP streams. This does not take into account the size of the IP overhead, nor any other transport layers such as TCP...
...this candidate pair. This includes botyh connectivity check and consent check requests. You can compute the average round trip time (RTT) by dividing this value by responsesReceived. transportId Optional A DOMString that uniquely identifies the RTCIceTransport that was inspected to obtain the transport-related statistics (as found in RTCTransportStats) used in generating this object. Obsolete
properties The following
properties have been removed from the specification and should no longer be used. You should update any existing code to avoid using them as soon as is practical. Check the compatibility table for details on which browsers support them and in which versions. priority Optional An integer value indicating the candidate pair's priority. readable Optional A Boolean value indi...
...ort them and in which versions. priority Optional An integer value indicating the candidate pair's priority. readable Optional A Boolean value indicating whether or not data can be sent over the connection described by the candidate pair. writable Optional A Boolean value indicating whether or not data can be received on the connection described by the candidate pair. Non-standard
properties selected Optional A Firefox-specific Boolean value which is true if the candidate pair described by this object is the one currently in use. The spec-compliant way to determine the selected candidate pair is to look for a stats object of type transport, which is an RTCTransportStats object. That object's selectedCandidatePairId property indicates whether or not the specified transport is th...
RTCIceTransport - Web APIs
It also offers the following
properties: component Read only The ICE component being used by the transport. The value is one of the strings from the RTCIceTransport enumerated type: "RTP" or "RTSP". ...
...The value is one of the strings from the RTCIceTransport enumerated type: "RTP" or "RTSP". ...
...The value is one of the strings from the RTCIceTransport enumerated type: "RTP" or "RTSP". ...
RTCPeerConnection - Web APIs
t-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">RTCPeerConnection</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} ConstructorRTCPeerConnection() The RTCPeerConnection() constructor returns a newly-created RTCPeerConnection, which represents a connection between the local device and a remote peer.
PropertiesAlso inherits
properties from: EventTargetcanTrickleIceCandidatesThe read-only RTCPeerConnection property canTrickleIceCandidates returns a Boolean which indicates whether or not the remote peer can accept trickled ICE candidates.connectionState The read-only connectionState property of the RTCPeerConnection interface indicates the current state of the peer connection by returning one of the stri...
...dentityProvider() method sets the Identity Provider (IdP) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username. The IdP will be used only when an assertion is needed.setLocalDescription()The RTCPeerConnection method setLocalDescription() changes the local description associated with the connection. This description specifies the
properties of the local end of the connection, including the media format.setRemoteDescription()The RTCPeerConnection method setRemoteDescription() sets the specified session description as the remote peer's current offer or answer. The description specifies the
properties of the remote end of the connection, including the media format. Obsolete method The following method was obsoleted long ago and was n...
...through the ondatachannel event handler property. icecandidate Sent to the peer connection to request that the specified candidate be transmitted to the remote peer. Also available through the onicecandidate event handler property. icecandidateerror An error of type RTCPeerConnectionIceErrorEvent which is sent to the connection if an error occurred during ICE candidate gathering. The event's
properties describe the error. Also available through the onicecandidateerror event handler property. iceconnectionstatechange Sent to the RTCPeerConnection when the state of the ICE connection changes, such as when it disconnects. Also available using the oniceconnectionstatechange event handler property. icegatheringstatechange Sent to the RTCPeerConnection when the ICE layer's gathering state, refl...
RTCRtpReceiveParameters - Web APIs
It inherits all of the
properties of its parent, RTCRtpParameters. Examples This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpReceiver. ...
... Examples This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpReceiver. ...
... Examples This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpReceiver. ...
SVGAnimateColorElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGAnimateColorElement' in that specification. Recommendation...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGAnimateColorElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGAnimateColorElement' in that specification. Recommendation Initial definition ...
SVGAnimateElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateElement' in that specification. Editor's Draft Removed the inheritance from S...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateElement' in that specification. Editor's Draft Removed the inheritance from SVGStylable. Scalable Vect...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateElement' in that specification. Editor's Draft Removed the inheritance from SVGStylable. Scalable Vector Graphics (SVG) 1.1 (S...
SVGAnimateMotionElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateMotionElement' in that specification. Editor's Draft No change Scala...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateMotionElement' in that specification. Editor's Draft No change Scalable Vector Graphics (SVG) 1.1 (Sec...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateMotionElement' in that specification. Editor's Draft No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definiti...
SVGAnimateTransformElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateTransformElement' in that specification. Editor's Draft No change Sc...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateTransformElement' in that specification. Editor's Draft No change Scalable Vector Graphics (SVG) 1.1 (...
... Methods This interface has no methods but inherits methods from its parent, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGAnimateTransformElement' in that specification. Editor's Draft No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The defin...
SVGClipPathElement - Web APIs
The SVGClipPathElement interface provides access to the
properties of <clipPath> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,2...
... SVGClipPathElement.clipPathUnits Read only An SVGAnimatedEnumeration corresponding to the clipPathUnits attribute of the given <clipPath> element. Takes one of the constants defined in SVGUnitTypes. Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGElement. Specific...
... SVGClipPathElement.clipPathUnits Read only An SVGAnimatedEnumeration corresponding to the clipPathUnits attribute of the given <clipPath> element. Takes one of the constants defined in SVGUnitTypes. Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGElement. Specifications Specification Status ...
SVGEllipseElement - Web APIs
The SVGEllipseElement interface provides access to the
properties of <ellipse> elements. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1...
... SVGEllipseElement.cx Read only This property returns a SVGAnimatedLength reflecting the cx attribute of the given <ellipse> element. SVGEllipseElement.cy Read only This property returns a SVGAnimatedLength reflecting the cy attribute of the given <ellipse> element. SVGEllipseElement.rx Read only Thi...
... SVGEllipseElement.cx Read only This property returns a SVGAnimatedLength reflecting the cx attribute of the given <ellipse> element. SVGEllipseElement.cy Read only This property returns a SVGAnimatedLength reflecting the cy attribute of the given <ellipse> element. SVGEllipseElement.rx Read only This property returns a SVGAnimatedLength re...
SVGFEComponentTransferElement - Web APIs
SVGFEComponentTransferElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and implement...
... SVGFEComponentTransferElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and implements methods of SVGFilterPrimitiveStandardAt...
...4" stroke-width="2px" /><text x="336" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEComponentTransferElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFEComponentTransferElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Co...
SVGFEDiffuseLightingElement - Web APIs
SVGFEDiffuseLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDiffuseLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of t...
... SVGFEDiffuseLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDiffuseLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of the given element. SVGFEDiffuseLightingEl...
...stroke-width="2px" /><text x="346" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEDiffuseLightingElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFEDiffuseLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDiffuseLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of the given element. SVGFEDiffuseLightingElement.diffuseConstant Read only An SVGAnimatedNumber corresponding t...
SVGFEDropShadowElement - Web APIs
SVGFEDropShadowElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDropShadowElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEDropSh...
... SVGFEDropShadowElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDropShadowElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEDropShadowElement.dy Read only An SVGAnimated...
...DE4" stroke-width="2px" /><text x="371" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEDropShadowElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFEDropShadowElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEDropShadowElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEDropShadowElement.dy Read only An SVGAnimatedNumber corresponding to the dy attribute of the given element. SVGFED...
SVGFEFuncAElement - Web APIs
Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVG...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncAElement' in that specification. Working Dr...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncAElement' in that specification. Working Draft No change ...
SVGFEFuncBElement - Web APIs
Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVG...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncBElement' in that specification. Working Dr...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncBElement' in that specification. Working Draft No change ...
SVGFEFuncGElement - Web APIs
Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVG...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncGElement' in that specification. Working Dr...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncGElement' in that specification. Working Draft No change ...
SVGFEFuncRElement - Web APIs
Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVG...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncRElement' in that specification. Working Dr...
... Methods This interface does not provide any specific methods, but implements those of its parent, SVGComponentTransferFunctionElement. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEFuncRElement' in that specification. Working Draft No change ...
SVGFEImageElement - Web APIs
SVGFEImageElement.preserveAspectRatio Read only An SVGAnimatedPreserveAspectRatio corresponding to the preserveAspectRatio attribute of the given element. SVGFEImageElement.crossOrigin Read only An SVGAnimatedString reflects...
... SVGFEImageElement.preserveAspectRatio Read only An SVGAnimatedPreserveAspectRatio corresponding to the preserveAspectRatio attribute of the given element. SVGFEImageElement.crossOrigin Read only An SVGAnimatedString reflects the crossorigin attribute of the given e...
...roke="#D4DDE4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEImageElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and implements
properties of SVGFilterPrimitiveStandardAttributes and SVGURIReference. SVGFEImageElement.preserveAspectRatio Read only An SVGAnimatedPreserveAspectRatio corresponding to the preserveAspectRatio attribute of the given element. SVGFEImageElement.crossOrigin Read only An SVGAnimatedString reflects the crossorigin attribute of the given element, limited to only known values. Methods This interface d...
SVGFEOffsetElement - Web APIs
SVGFEOffsetElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEOffsetElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEOffsetElement.
... SVGFEOffsetElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEOffsetElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEOffsetElement.dy Read only An SVGAnimatedNumber corre...
...#D4DDE4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFEOffsetElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFEOffsetElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEOffsetElement.dx Read only An SVGAnimatedNumber corresponding to the dx attribute of the given element. SVGFEOffsetElement.dy Read only An SVGAnimatedNumber corresponding to the dy attribute of the given element. Methods This int...
SVGFESpecularLightingElement - Web APIs
SVGFESpecularLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFESpecularLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of...
... SVGFESpecularLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFESpecularLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of the given element. SVGFESpecularLightin...
...troke-width="2px" /><text x="341" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFESpecularLightingElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFESpecularLightingElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFESpecularLightingElement.surfaceScale Read only An SVGAnimatedNumber corresponding to the surfaceScale attribute of the given element. SVGFESpecularLightingElement.specularConstant Read only An SVGAnimatedNumber correspondi...
SVGFETileElement - Web APIs
SVGFETileElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements m...
... SVGFETileElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttri...
...="#D4DDE4" stroke-width="2px" /><text x="401" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFETileElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement, and also implements
properties of SVGFilterPrimitiveStandardAttributes. SVGFETileElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment ...
SVGFontFaceElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceElement' in that specification. Recommendation Initial definition...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceElement' in that specification. Recommendation Initial definition ...
SVGFontFaceFormatElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceFormatElement' in that specification. Recommendation Initial defi...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceFormatElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceFormatElement' in that specification. Recommendation Initial definition ...
SVGFontFaceNameElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceNameElement' in that specification. Recommendation Initial defini...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceNameElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceNameElement' in that specification. Recommendation Initial definition ...
SVGFontFaceSrcElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceSrcElement' in that specification. Recommendation Initial definit...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceSrcElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceSrcElement' in that specification. Recommendation Initial definition ...
SVGFontFaceUriElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceUriElement' in that specification. Recommendation Initial definit...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceUriElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGFontFaceUriElement' in that specification. Recommendation Initial definition ...
SVGGElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGGElement' in...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGGElement' in that specification. Candidate Recommendation Change...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGGElement' in that specification. Candidate Recommendation Changed the inheritance from SV...
SVGGlyphRefElement - Web APIs
SVGGlyphRefElement.glyphRef A DOMString corresponding to the glyphRef attribute of the given element. SVGGlyphRefElement.format A DOMString corresponding to the format attribute of the given element. SVGGlyphRefElement.x A float corresponding to the x attrib...
... SVGGlyphRefElement.glyphRef A DOMString corresponding to the glyphRef attribute of the given element. SVGGlyphRefElement.format A DOMString corresponding to the format attribute of the given element. SVGGlyphRefElement.x A float corresponding to the x attribute of the given element. SVGGlyphRefEle...
...#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGGlyphRefElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent, SVGElement and implements
properties from SVGURIReference and SVGStylable. SVGGlyphRefElement.glyphRef A DOMString corresponding to the glyphRef attribute of the given element. SVGGlyphRefElement.format A DOMString corresponding to the format attribute of the given element. SVGGlyphRefElement.x A float corresponding to the x attribute of the given element. SVGGlyphRefElement.y A float corresponding to the y attribute of th...
SVGHKernElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGHKernElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGHKernElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGHKernElement' in that specification. Recommendation Initial definition ...
SVGLineElement - Web APIs
The SVGLineElement interface provides access to the
properties of <line> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" strok...
... SVGLineElement.x1 Read only Returns an SVGAnimatedLength that corresponds to attribute x1 on the given <line> element. SVGLineElement.y1 Read only Returns an SVGAnimatedLength that corresponds to attribute y1 on the given <line> element. SVGLineElement.x2 Read only Returns an SVGAnimatedLength that correspond...
... SVGLineElement.x1 Read only Returns an SVGAnimatedLength that corresponds to attribute x1 on the given <line> element. SVGLineElement.y1 Read only Returns an SVGAnimatedLength that corresponds to attribute y1 on the given <line> element. SVGLineElement.x2 Read only Returns an SVGAnimatedLength that corresponds to attribute x2 on the given <line> ele...
SVGMPathElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGMPathElement' in that specification. ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGMPathElement' in that specification. Editor's Draft Removed the implemented interface SVGE...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGMPathElement' in that specification. Editor's Draft Removed the implemented interface SVGExternalResourcesRequired.
SVGMarkerElement - Web APIs
SVG path segment interface The SVGMarkerElement interface corresponds to the marker element. ...
...s. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_MARKERUNITS_USERSPACEONUSE 1 Attribute markerUnits is 'userSpaceOnUse'. SVG_MARKERUNITS_STROKEWIDTH 2 Attribute markerUnits is 'strokeWidth'.
Properties This interface also inherits
properties from its parent interface, SVGElement, and implements
properties from SVGExternalResourcesRequired, SVGAnimatedPreserveAspectRatio, and SVGStylable. Name Type Description refX SVGAnimatedLength Corresponds to attribute refX o...
...ed on this interface. orientAngle SVGAnimatedAngle Corresponds to attribute orient on the given marker element. If markerUnits is SVG_MARKER_ORIENT_ANGLE, the angle value for attribute orient; otherwise, it will be set to zero. Methods This also inherits methods from its parent, SVGElement, and implements
properties from SVGStylable. setOrientToAngle(in SVGAngle angle) void Sets the value of attribute orient to the given angle. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the object itself is read only. ...
SVGMaskElement - Web APIs
The SVGMaskElement interface provides access to the
properties of <mask> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" strok...
... SVGMaskElement.maskUnits Read only An SVGAnimatedEnumeration corresponding to the maskUnits attribute of the given <mask> element. Takes one of the constants defined in SVGUnitTypes. SVGMaskElement.maskContentUnits Read only An SVGAnimatedEnumeration corresponding to the maskContentUnits attribute of the given <mask> el...
... SVGMaskElement.maskUnits Read only An SVGAnimatedEnumeration corresponding to the maskUnits attribute of the given <mask> element. Takes one of the constants defined in SVGUnitTypes. SVGMaskElement.maskContentUnits Read only An SVGAnimatedEnumeration corresponding to the maskContentUnits attribute of the given <mask> element. Takes one of the constants defined...
SVGMetadataElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGMetadataElement' in that spe...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGMetadataElement' in that specification. Candidate Recommendation No change ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGMetadataElement' in that specification. Candidate Recommendation No change Scalable Vector Graph...
SVGRectElement - Web APIs
The SVGRectElement interface provides access to the
properties of <rect> elements, as well as methods to manipulate them. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" strok...
... SVGRectElement.x Read only Returns an SVGAnimatedLength corresponding to the x attribute of the given <rect> element. SVGRectElement.y Read only Returns an SVGAnimatedLength corresponding to the y attribute of the given <rect> element. SVGRectElement.width Read only Returns an SVGAnimatedLength corresponding ...
... SVGRectElement.x Read only Returns an SVGAnimatedLength corresponding to the x attribute of the given <rect> element. SVGRectElement.y Read only Returns an SVGAnimatedLength corresponding to the y attribute of the given <rect> element. SVGRectElement.width Read only Returns an SVGAnimatedLength corresponding to the width attribute of the given <rect...
SVGSVGElement - Web APIs
This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. ...
... SVGSVGElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <svg> element. SVGSVGElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given <svg> element. SVGSVG...
... SVGSVGElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <svg> element. SVGSVGElement.y Read only An SVGAnimatedLength corresponding to the y attribute of the given <svg> element. SVGSVGElement.width Read only An SVGAnimatedL...
SVGSetElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGSetElement' in that ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGSetElement' in that specification. Editor's Draft No change Sca...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGAnimationElement. Specifications Specification Status Comment SVG Animations Level 2The definition of 'SVGSetElement' in that specification. Editor's Draft No change Scalable Vector Graphics (SV...
SVGSolidcolorElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. ...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. ...
SVGStyleElement - Web APIs
SVGStyleElement.type A DOMString corresponding to the type attribute of the given element. SVG 1.1 defined that a DOMException is raised with code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2.
... SVGStyleElement.type A DOMString corresponding to the type attribute of the given element. SVG 1.1 defined that a DOMException is raised with code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2. SVGStyleElement.media A DOMString co...
... stroke="#D4DDE4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGStyleElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;}
Properties This interface also inherits
properties from its parent interface, SVGElement and implements
properties from LinkStyle. SVGStyleElement.type A DOMString corresponding to the type attribute of the given element. SVG 1.1 defined that a DOMException is raised with code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2. SVGStyleElement.media A DOMString corresponding to the media attribute of the given element. SVG 1.
SVGSwitchElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGSwitchElemen...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGSwitchElement' in that specification. Candidate Recommendation C...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGSwitchElement' in that specification. Candidate Recommendation Changed the inheritance fr...
SVGTSpanElement - Web APIs
Methods This interface doesn't provide any specific methods. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTSpanElement' in that specification. Candidate Recommendation No changes ...
... Methods This interface doesn't provide any specific methods. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTSpanElement' in that specification. Candidate Recommendation No changes Scalable Vector Graphics (SVG) 1.1 (Second Edition)...
... Methods This interface doesn't provide any specific methods. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTSpanElement' in that specification. Candidate Recommendation No changes Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGTSpanEl...
SVGTextElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGTextPositioningElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'S...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGTextPositioningElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTextElement' in that specification. Candidate Recomme...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGTextPositioningElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTextElement' in that specification. Candidate Recommendation Removed the im...
SVGTitleElement - Web APIs
Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTitleElement' in that sp...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTitleElement' in that specification. Candidate Recommendation Removed inheri...
... Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGTitleElement' in that specification. Candidate Recommendation Removed inheritance from SVGLangSpace a...
SVGVKernElement - Web APIs
Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGVKernElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGVKernElement' in that specification. Recommendation Initial definition ...
... Methods This interface has no methods but inherits methods from its parent, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGVKernElement' in that specification. Recommendation Initial definition ...
SharedWorkerGlobalScope - Web APIs
The SharedWorkerGlobalScope object (the SharedWorker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.
Properties This interface inherits
properties from the WorkerGlobalScope interface, and its parent EventTarget, and therefore implements
properties from WindowTimers, WindowBase64, and WindowEventHandlers. SharedWorkerGlobalScope.name Read only The name that the SharedWorker was (optionally) given when it was created using the SharedWorker() constructor. This is mainly useful for debugging purposes. SharedWorkerGlobalScope.applicationCache Read ...
... WindowBase64, and WindowEventHandlers. SharedWorkerGlobalScope.name Read only The name that the SharedWorker was (optionally) given when it was created using the SharedWorker() constructor. This is mainly useful for debugging purposes. SharedWorkerGlobalScope.applicationCache Read only This property returns the ApplicationCache object for the worker (see Using the application cache).
Properties inherited from WorkerGlobalScope WorkerGlobalScope.self Returns an object reference to the DedicatedWorkerGlobalScope object itself. WorkerGlobalScope.console Read only Returns the Console associated with the worker. WorkerGlobalScope.location Read only Returns the WorkerLocation associated with the worker. WorkerLocation is a specific location object, mostly a subset of the Location fo...
...workers. WorkerGlobalScope.navigator Read only Returns the WorkerNavigator associated with the worker. WorkerNavigator is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers. WorkerGlobalScope.performance Read only Returns the Performance object associated with the worker, which is a regular performance object, but with a subset of its
properties and methods available. Event handlers This interface inherits event handlers from the WorkerGlobalScope interface, and its parent EventTarget, and therefore implements event handlers from WindowTimers, WindowBase64, and WindowEventHandlers. SharedWorkerGlobalScope.onconnect Is an EventHandler representing the code to be called when the connect event is raised -- that is, when a MessagePort...
StylePropertyMapReadOnly - Web APIs
The StylePropertyMapReadOnly interface of the the CSS Typed Object Model API provides a read-only representation of a CSS declaration block that is an alternative to CSSStyleDeclaration. Retrieve an instance of this interface using Element.computedStyleMap().
Properties StylePropertyMapReadOnly.size Returns an unsinged long integer containing the size of the StylePropertyMapReadOnly object. Methods StylePropertyMapReadOnly.entries() Returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates
properties in the prototype chain as well). StylePropertyMapReadOnly.forEach() Executes a provided function once for each element of StylePropertyMapReadOnly. StylePrope...
...eturn back a definition list of all the default CSS property values using computedStyleMap(). ...
... element const myElement = document.querySelector('p'); // get the <dl> we'll be populating const stylesList = document.querySelector('#output'); // Retrieve all computed styles with computedStyleMap() const stylePropertyMap = myElement.computedStyleMap(); // iterate thru the map of all the
properties and values, adding a <dt> and <dd> for each for (const [prop, val] of stylePropertyMap) { //
properties const cssProperty = document.createElement('dt'); cssProperty.appendChild(document.createTextNode(prop)); stylesList.appendChild(cssProperty); // values const cssValue = document.createElement('dd'); cssValue.appendChild(document.createTextNode(val)); stylesList.appendChild(cssValue); } Specifications Specification Status Comment CSS Typed OM Level 1The definit...
Text - Web APIs
ight="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="473.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Text</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor Text() Returns a Text node with the parameter as its textual content.
Properties Inherits
properties from its parent, CharacterData. Text.isElementContentWhitespace Read only Returns a Boolean flag indicating whether or not the text node contains only whitespace. Text.wholeText Read only Returns a DOMString containing the text of all Text nodes logically adjacent to this Node, concatenated in document order. Text.assignedSlot Read only Returns the HTMLSlotEle...
...acterData. Text.isElementContentWhitespace Read only Returns a Boolean flag indicating whether or not the text node contains only whitespace. Text.wholeText Read only Returns a DOMString containing the text of all Text nodes logically adjacent to this Node, concatenated in document order. Text.assignedSlot Read only Returns the HTMLSlotElement object associated with the element.
Properties included from Slotable The Text interface includes the following property, defined on the Slotable mixin. Slotable.assignedSlot Read only Returns a HTMLSlotElement representing the <slot> the node is inserted in. Methods Inherits methods from its parent, CharacterData. Text.replaceWholeText Replaces the text of the current node and all logically adjacent nodes with the specified...
...tion of 'Text' in that specification. Living Standard Removed the isElementContentWhitespace property. Removed the replaceWholeText() method. Added the Text() constructor. Added the assignedSlot property. Document Object Model (DOM) Level 3 Core SpecificationThe definition of 'Text' in that specification. Obsolete Added the isElementContentWhitespace and wholeText
properties. Added the replaceWholeText() method. Document Object Model (DOM) Level 2 Core SpecificationThe definition of 'Text' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification. Document Object Model (DOM) Level 1 SpecificationThe definition of 'Text' in that specification. Obsolete Initial definition. ...
Touch - Web APIs
screen or trackpad. The Touch.radiusX, Touch.radiusY, and Touch.rotationAngle describe the area of contact between the user and the screen, the touch area. This can be helpful when dealing with imprecise pointing devices such as fingers. These values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip). Note: Many of the
properties' values are hardware-dependent; for example, if the device doesn't have a way to detect the amount of pressure placed on the surface, the force value will always be 0. This may also be the case for radiusX and radiusY; if the hardware reports only a single point, these values will be 1. Constructor Touch() Creates a Touch object.
Properties This interface has no parent, and doesn't inh...
...f the device doesn't have a way to detect the amount of pressure placed on the surface, the force value will always be 0. This may also be the case for radiusX and radiusY; if the hardware reports only a single point, these values will be 1. Constructor Touch() Creates a Touch object.
Properties This interface has no parent, and doesn't inherits or implements any other property. Basic
properties Touch.identifier Read only Returns a unique identifier for this Touch object. A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the time. Touch.screenX Read only Returns the X coordinate of the touch point relative to the left edge of the screen. Touch.scre...
...ed to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure). Methods This interface has no method and no parent, and doesn't inherits or implements any method. Specifications Specification Status Comment Touch Events - Level 2The definition of 'Touch' in that specification. Draft Added radiusX, radiusY, rotationAngle, force
properties, as well as the Touch() constructor. Touch EventsThe definition of 'Touch' in that specification. Recommendation Initial definition. ...
URL - Web APIs
You normally create a new URL object by specifying the URL as a string when calling its constructor, or by providing a relative URL and a base URL. You can then easily read the parsed components of the URL or make changes to the URL. If a browser doesn't yet support the URL() constructor, you can access a URL object using the Window interface's Window.URL property. Be sure to check to see if any of your target browsers require this to be prefixed. Note: This feature is available in Web Workers. ...
...URL() constructor, you can access a URL object using the Window interface's Window.URL property. Be sure to check to see if any of your target browsers require this to be prefixed. Note: This feature is available in Web Workers. Constructor new URL() Creates and returns a URL object referencing the URL specified using an absolute URL string, or a relative URL string and a base URL string.
Properties hash A USVString containing a '#' followed by the fragment identifier of the URL. host A USVString containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL. hostname A USVString containing the domain of the URL. href A stringifier that returns a USVString containing the whole URL. origin Read only Returns a USVString containing ...
...he browser. revokeObjectURL() Revokes an object URL previously created using URL.createObjectURL(). Usage notes The constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative URL: const url = new URL('../cats', 'http://www.example.com/dogs'); console.log(url.hostname); // "www.example.com" console.log(url.pathname); // "/cats" URL
properties can be set to construct the URL: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" URLs are encoded according to the rules found in RFC 3986. For instance: url.pathname = 'demonstration.html'; console.log(url.href); // "http://www.example.com/d%C3%A9monstration.html" The URLSearchParams interface can be used to build and manipulate the URL query string. To g...
URLUtilsReadOnly - Web APIs
URLUtilsReadOnly.href Read only Is a DOMString containing the whole URL. URLUtilsReadOnly.protocol Read only Is a DOMString containing the protocol scheme of the URL, including the final ':'. ...
... URLUtilsReadOnly.href Read only Is a DOMString containing the whole URL. ...
... URLUtilsReadOnly.href Read only Is a DOMString containing the whole URL. URLUtilsReadOnly.protocol Read only Is a DOMString containing the protocol scheme of the URL, including the final ':'. ...
URL API - Web APIs
it is structured and parsed. Also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing IP addresses and DOM addresses are specified. More interesting to most developers is the API itself. Accessing URL components Creating an URL object for a given URL parses the URL and provides quick access to its constituent parts through its
properties. ...
...t developers is the API itself. Accessing URL components Creating an URL object for a given URL parses the URL and provides quick access to its constituent parts through its
properties. let addr = new URL("/docs/Web/API/URL_API"); let host = addr.host; let path = addr.pathname; The snippet above creates a URL object for the article you're reading right now, then fetches the host and pathname
properties. In this case, those strings are developer.mozilla.org and /docs/Web/API/URL_API, respectively. Changing the URL Most of the
properties of URL are settable; you can write new values to them to alter the URL represented by the object. For example, to create a URL and set its username: let myUsername = "someguy"; let addr = new URL("https://mysite.com/login"); addr.username = myUsername; Setti...
... example, to create a URL and set its username: let myUsername = "someguy"; let addr = new URL("https://mysite.com/login"); addr.username = myUsername; Setting the value of username not only sets that property's value, but it updates the overall URL. After executing the code snippet above, the value returned by addr.href is https://someguy@mysite.com/login. This is true for any of the writable
properties. Queries The search property on a URL contains the query string portion of the URL. For example, if the URL is https://mysite.com/login?user=someguy&page=news, then the value of the search property is ?user=someguy&page=news. You can also look up the values of individual parameters with the URLSearchParams object's get() method: let addr = new URL("https://mysite.com/login?user=someguy&page=ne...
Visual Viewport API - Web APIs
The visual viewport is the visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page. Visual Viewport concepts and usage The mobile web contains two viewports, the layout viewport and the visual viewport. The layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. When the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. ...
... set of image controls to remain on screen regardless of the pinch zoom level of the device? Current browsers vary in how they handle this. The visual viewport lets web developers solve this by positioning elements relative to what's shown on screen. To access a window's visual viewport, you can obtain a VisualViewport object from the window.visualViewport property. The object includes a set of
properties describing the viewport. It also adds two events, onresize and onscroll, that fire whenever the visual viewport changes. These events allow you to position elements relative to the visual viewport that would normally be anchored to the layout viewport. Accessing the API window.visualViewport Read only A read-only reference to the window's VisualViewport object. If this property doesn't exi...
...rmation about the viewport's position and size, and receives the resize and event:VisualViewport:scroll events you can onitor to know when chances occur to the window's viewport. Example The code below is based on the sample the specification, though it adds a few things that make it function better. It shows a function called viewportHandler(). When called it queries the offsetLeft and height
properties for values it uses in a CSS translate() method. You invoke this function by passing it to both event calls. One thing that may not be clear in this example is the use of the pendingUpdate flag and the call to requestAnimationFrame(). The pendingUpdate flag serves to prevent multiple invocations of the transfrom that can occur when onresize and onscroll fire at the same time. Using requestAnimati...
WebGLContextEvent - Web APIs
The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. Inheritance This interface inherits
properties and methods from its parent interface, Event. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/Event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill...
... WebGLContextEvent.statusMessage A read-only property containing additional information about the event. Methods This interface doesn't define any own methods, but inherits methods from its parent interface, Event. Examples With the help of the WEBGL_lose_context extension, you can simulate the webglcontextlost and webg...
... WebGLContextEvent.statusMessage A read-only property containing additional information about the event. Methods This interface doesn't define any own methods, but inherits methods from its parent interface, Event. Examples With the help of the WEBGL_lose_context extension, you can simulate the webglcontextlost and webglcontextrestored events: var canvas...
WebGLRenderingContext - Web APIs
gl'); Once you have the WebGL rendering context for a canvas, you can render within it. The WebGL tutorial has more information, examples, and resources on how to get started with WebGL. If you require a WebGL 2.0 context, see WebGL2RenderingContext; this supplies access to an implementation of OpenGL ES 3.0 graphics. Constants See the WebGL constants page. The WebGL context The following
properties and methods provide general information and functionality to deal with the WebGL context: WebGLRenderingContext.canvas A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element. WebGLRenderingContext.commit() Pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas. WebGLRe...
...rom a canvas element. The WebGL rendering context is an interface, through which you can set and query the state of the graphics machine, send data to the WebGL, and execute draw commands. Saving the state of the graphics machine within a single context interface is not unique to WebGL. This is also done in other graphics {{Glossary("API")}}, such as the canvas 2D rendering context. ...
...nvas 2D rendering context. However, the
properties and variables you can tweak are different for each API. Effect of canvas size on rendering with WebGL With scissor() and clear() we can demonstrate how the WebGL drawing buffer is affected by the size of the canvas. The size of the first canvas is set to the styled Element size, determined by CSS. This is done by assigning the width and height
properties of the canvas to the values of the clientWidth and clientHeight
properties, respectively. In contrast, no such assignment is done for the second canvas. The internal width and height
properties of the canvas remain at default values, which are different than the actual size of the canvas Element in the browser window. The effect is clearly visible when using scissor() and clear() to draw a squa...
Inputs and input sources - Web APIs
ry action. The section Primary squeeze action describes this in more detail. Any additional capabilities a WebXR controller may have are accessed through the input source's gamepad object. This object provides access to all of the buttons, axes, trackpads, and so forth that may be a part of the controller. See Advanced controllers using the gamepad object to learn how to use these controllers.
Properties of input sources Each individual XRInputSource has a set of
properties that describe the input's available axes and buttons, which hand the user's holding it in, and how the input source is used to handle targeting within the 3D space. Handedness Handedness, indicated by the XRInputSource property handedness, is a string which indicates which of the viewer's hands the controller is in: left or...
...andSource = source; break; case "right": rightHandSource = source; break; } }); }); The inputsourceschange event is also fired once when the session's creation callback first completes execution, so you can use it to fetch the input source list as soon as it's available at startup time. The event is delivered as an XRInputSourceChangeEvent, which includes three
properties of interest: session The XRSession for which the input sources have changed. added An array of zero or more XRInputSource objects indicating the input sources that have been newly added to the XR system. removed An array of zero or more XRInputSource objects indicating any input sources that have been removed from the XR system. Identifying the input's profile Each input source has a p...
...mple, where acceleration is constant and not particularly realistic. You can enhance this greatly by applying some knowledge of physics to have the acceleration change over time based on how long the key is held down and other factors. Applying inputs to the scene Now that we have the deltas that need to be applied to the position and orientation--in our example, in the posDelta and orientDelta
properties of our avatar object--we can write code to apply those changes. Since we're already rendering the scene on a schedule, we can just add the code to apply these changes there, along with preparing and drawing the scene. function drawFrame(time, frame) { applyExternalInputs(avatar); let pose = frame.getViewerPose(avatar.referenceSpace); animationFrameRequest = session.requestAnimationFrame(d...
Using Web Workers - Web APIs
e from the script that first spawned it, whereas shared workers can be accessed from multiple scripts. Note: See The Web Workers API landing page for reference documentation on workers and additional guides. You can run whatever code you like inside the worker thread, with some exceptions. For example, you can't directly manipulate the DOM from inside a worker, or use some default methods and
properties of the window object. But you can use a large number of items available under window, including WebSockets, and data storage mechanisms like IndexedDB. See Functions and classes available to workers for more details. Data is sent between workers and the main thread via a system of messages -- both sides send their messages using the postMessage() method, and respond to messages via the onmessage...
...hods: * sendQuery(queryable function name, argument to pass 1, argument to pass 2, etc. ...
...ssage = resultReceiver; worker.onerror = errorReceiver; worker.postMessage(n - i); } }; The worker sets the property onmessage to a function which will receive messages sent when the worker object's postMessage() is called (note that this differs from defining a global variable of that name, or defining a function with that name. var onmessage and function onmessage will define global
properties with those names, but they will not register the function to receive messages sent by the web page that created the worker). This starts the recursion, spawning new copies of itself to handle each iteration of the calculation. The HTML code <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Test threads fibonacci</title> </head> <body> <div id="result"></div> <sc...
Window.getComputedStyle() - Web APIs
Individual CSS property values are accessed through APIs provided by the object, or by indexing with CSS property names. Syntax var style = window.getComputedStyle(element [, pseudoElt]); element The Element for which to get the computed style. pseudoEltOptional A string specifying the pseudo-element to match. Omitted (or null) for real elements. The returned style is a live CSSStyleDeclaration object, which updates automatically when the element's styles are changed. ...
...lues with only longhand names like font-size. Shorthand names like font will not work with most browsers. CSS property values may be accessed using the getPropertyValue(propName) API or by indexing directly into the object such as obj['z-index'] or obj.zIndex. The values returned by getComputedStyle are resolved values. These are usually the same as CSS 2.1's computed values, but for some older
properties like width, height, or padding, they are instead the same as used values. Originally, CSS 2.0 defined the computed values as the "ready to be used" final values of
properties after cascading and inheritance, but CSS 2.1 redefined them as pre-layout, and used values as post-layout. For CSS 2.0
properties, getComputedStyle returns the old meaning of computed values, now called used values. An examp...
...ssue, browsers may lie about the computed styles for a visited link, returning values as if the user never visited the linked URL. See Plugging the CSS History Leak and Privacy-related changes coming to CSS :visited for examples of how this is implemented. During CSS transitions, getComputedStyle returns the original property value in Firefox, but the final property value in WebKit. In Firefox,
properties with the value auto return the used value, not the value auto. So if you apply top:auto and bottom:0 on an element with height:30px and a containing block of height:100px, Firefox's computed style for top returns 70px, as 100 - 30 = 70. Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'getComputedStyle()' in that specification. ...
Window.open() - Web APIs
hitespace in the string. See Window features below for documentation of each of the features that can be specified. Return value A WindowProxy object, which is basically a thin wrapper for the Window object representing the newly created window, and has all its features available. If the window couldn't be opened, the returned value is instead null. The returned reference can be used to access
properties and methods of the new window as long as it complies with Same-origin policy security requirements. Description The open() method creates a new secondary browser window, similar to choosing New Window from the File menu. The url parameter specifies the URL to be fetched and loaded in the new window. If url is an empty string, then a new blank, empty window (URL about:blank) is created with the ...
...indow.open(): it will be null if the window wasn't allowed to open. However, for most other popup blockers, there is no reliable way. What is the JavaScript relationship between the main window and the secondary window? The window.open() method gives a main window a reference to a secondary window; the opener property gives a secondary window a reference to its main window. I cannot access the
properties of the new secondary window. I always get an error in the javascript console saying "Error: uncaught exception: Permission denied to get property <property_name or method_name>. Why is that? It is because of the cross-domain script security restriction (also referred as the "Same Origin Policy"). A script loaded in a window (or frame) from a distinct origin (domain name) cannot get nor set prope...
... an error in the javascript console saying "Error: uncaught exception: Permission denied to get property <property_name or method_name>. Why is that? It is because of the cross-domain script security restriction (also referred as the "Same Origin Policy"). A script loaded in a window (or frame) from a distinct origin (domain name) cannot get nor set
properties of another window (or frame) or the
properties of any of its HTML objects coming from another distinct origin (domain name). Therefore, before executing a script targeting a secondary window, the browser in the main window will verify that the secondary window has the same domain name. More reading on the cross-domain script security restriction: http://www.mozilla.org/projects/secu...me-origin.html Usability issues Avoid resorting to win...
Window.openDialog() - Web APIs
of type Array, and this property gets added to the newly opened dialog window. To access these extra parameters from within dialog code, use the following scheme: var food = window.arguments[0]; var price = window.arguments[1]; Note that you can access this property from within anywhere in the dialog code. (Another example). Returning values from the dialog Since window.close() erases all
properties associated with the dialog window (i.e. the variables specified in the JavaScript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs). To be able to pass values back to the caller, you have to supply some object via the extra parameters. You can then access this object from within the dialog code ...
...ted with the dialog window (i.e. the variables specified in the JavaScript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs). To be able to pass values back to the caller, you have to supply some object via the extra parameters. ...
... to the caller, you have to supply some object via the extra parameters. You can then access this object from within the dialog code and set
properties on it, containing the values you want to return or preserve past the window.close() operation. var retVals = { address: null, delivery: null }; openDialog("http://example.tld/zzz.xul", "dlg", "modal", "pizza", 6.98, retVals); If you set the
properties of the retVals object in the dialog code as described below, you can now access them via the retVals array after the openDialog() call returns. Inside the dialog code, you can set the
properties as follows: var retVals = window.arguments[2]; retVals.address = enteredAddress; retVals.delivery = "immediate"; Specification This is not part of any specification. Browser Compatibility The comp...
XMLHttpRequest - Web APIs
retrieve any type of data, not just XML. If your communication needs to involve receiving event data or message data from a server, consider using server-sent events through the EventSource interface. For full-duplex communication, WebSockets may be a better choice. Constructor XMLHttpRequest() The constructor initializes an XMLHttpRequest. It must be called before any other method calls.
Properties This interface also inherits
properties of XMLHttpRequestEventTarget and of EventTarget. XMLHttpRequest.onreadystatechange An EventHandler that is called whenever the readyState attribute changes. XMLHttpRequest.readyState Read only Returns an unsigned short, the state of the request. XMLHttpRequest.response Read only Returns an ArrayBuffer, Blob, Document, JavaScript object, or a DOMS...
...MLHttpRequestEventTarget.ontimeout Is an EventHandler that is called whenever the request times out. XMLHttpRequest.upload Read only Is an XMLHttpRequestUpload, representing the upload process. XMLHttpRequest.withCredentials Is a Boolean that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. Non-standard
properties XMLHttpRequest.channelRead only Is a nsIChannel. The channel used by the object when performing the request. XMLHttpRequest.mozAnonRead only Is a boolean. If true, the request will be sent without cookie and authentication headers. XMLHttpRequest.mozSystemRead only Is a boolean. If true, the same origin policy will not be enforced on the request. XMLHttpRequest.mozBackgroundRequest I...
...tatechange as a property of the XMLHttpRequest instance is supported in all browsers. Since then, a number of additional event handlers have been implemented in various browsers (onload, onerror, onprogress, etc.). See Using XMLHttpRequest. More recent browsers, including Firefox, also support listening to the XMLHttpRequest events via standard addEventListener() APIs in addition to setting on*
properties to a handler function. Methods XMLHttpRequest.abort() Aborts the request if it has already been sent. XMLHttpRequest.getAllResponseHeaders() Returns all the response headers, separated by CRLF, as a string, or null if no response has been received. XMLHttpRequest.getResponseHeader() Returns the string containing the text of the specified header, or null if either the response has not yet...
ARIA: listbox role - Accessibility
such an element becomes visible, screen readers announce the label and role of the listbox when it gets focus. If an option or item is focused within the list, it gets announced next, followed by an indication of the item's position with the list if the screen reader supports this. As focus moves within the list, the screen reader announces the relevant items. Associated ARIA roles, states, and
properties Associated Roles option One or more nested options are required. All selected options have aria-selected set to true. All options that are not selected have aria-selected set to false. If an option is not selectable, omit the aria-selected. list A section containing listitem elements States and
Properties aria-activedescendant Holds the id string of the currently active element with...
...l. (Note: "labelled", with two L's, is the correct spelling based on the accessibility API conventions.) aria-roledescription A human-readable string value which more clearly identifies the role of the listbox. Screen readers will often read this value to the user after reading the label (if there is one), in place of saying "listbox". (For further details and a full list of ARIA states and
properties see the ARIA listbox (role) documentation.) Keyboard interactions When a single-select listbox receives focus: If none of the options are selected before the listbox receives focus, the first option receives focus. Optionally, the first option may be automatically selected. If an option is selected before the listbox receives focus, focus is set on the selected option. When a multi...
...uld manage focus of all descendants of this role. It is recommended that authors use different styling for the selection when the list is not focused, e.g. a non-active selection is often shown with a lighter background colour. If the listbox is not part of another widget, it should have the aria-labelledby property set. If one or more entries are not DOM children of listbox, additional aria-*
properties will need to be set (see ARIA Best Practices). If there is a valid reason to expand the listbox, the combobox role may be more appropriate. Specifications Specification Status Accessible Rich Internet Applications (WAI-ARIA) 1.1The definition of 'ARIA listbox role' in that specification. Recommendation WAI-ARIA Authoring PracticesThe definition of 'Listbox Rol...
Web applications and ARIA FAQ - Accessibility
JAWS 8 10 Window-Eyes 7 No live region support currently ZoomText ? No live region support currently Note: Early versions of these tools often had partial or buggy ARIA implementations. For notes on JAWS support for ARIA as of JAWS 10, see this article from the Paciello Group: JAWS Support for ARIA. JavaScript Toolkits ARIA roles, states, and
properties have been added to a number of popular JavaScript user interface toolkits, including: Dojo/Dijit jQuery UI Fluid Infusion Google Closure Google Web Toolkit BBC Glow Yahoo! User Interface Library (YUI) For more information about JavaScript toolkit accessibility: Steve Faulkner's WAI-ARIA Implementation in JavaScript UI Libraries Can you show me an example of ARIA in action? Sure. ...
...s Can you show me an example of ARIA in action? Sure. Here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> This progress bar is built using a <div>, which is not very descriptive. Unfortunately, there isn't a more semantic tag available to developers in HTML 4, so we need to include ARIA roles and
properties. These are specified by adding attributes to the element. In this example, the role="progressbar" attribute informs the browser that this element is actually a JavaScript-powered progress bar widget. The aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it. Along with placing them directly ...
...ges for you. How does HTML5 relate to ARIA? HTML5 introduces a number of useful new semantic tags to HTML. A few of these tags overlap directly with roles available in ARIA, such as the new <progress> element. In cases where the browser supports an HTML5 tag that also exists in ARIA, there is usually no need to also add ARIA roles and states to the element. ARIA includes many roles, states, and
properties that aren't available in HTML5, so these will continue to be useful to developers who use HTML5. For more information, Steve Faulkner has written a good overview of the relationship between HTML5 and ARIA. Degrading Gracefully from HTML5 to ARIA When delivering content to browsers that aren't HTML5-aware, you may want to consider gracefully degrading to the use of ARIA where necessary. So, usin...
::cue-region - CSS: Cascading Style Sheets
The ::cue-region CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks. ::cue-region { color: yellow; font-weight: bold; } The
properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its shorthand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
...ia with VTT tracks. ::cue-region { color: yellow; font-weight: bold; } The
properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its shorthand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
...rties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its shorthand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
::cue - CSS: Cascading Style Sheets
The ::cue CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks. ::cue { color: yellow; font-weight: bold; } The
properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its longhand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... and other cues in media with VTT tracks. ::cue { color: yellow; font-weight: bold; } The
properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its longhand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
...d; } The
properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its longhand
properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
@keyframes - CSS: Cascading Style Sheets
that keyframe. You can list the keyframe percentages in any order; they will be handled in the order they should occur. Valid keyframe lists If a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states. This can be used to animate an element from its initial state and back.
Properties that can't be animated in keyframe rules are ignored, but supported
properties will still be animated. Resolving duplicates If multiple keyframe sets exist for a given name, the last one encountered by the parser is used. @keyframes rules don't cascade, so animations never derive keyframes from more than one rule set. If a given animation time offset is duplicated, all keyframes in the @keyfra...
... a given name, the last one encountered by the parser is used. @keyframes rules don't cascade, so animations never derive keyframes from more than one rule set. If a given animation time offset is duplicated, all keyframes in the @keyframes rule for that percentage are used for that frame. There is cascading within a @keyframes rule if multiple keyframes specify the same percentage values. When
properties are left out of some keyframes
Properties that aren't specified in every keyframe are interpolated if possible --
properties that can't be interpolated are dropped from the animation. For example: @keyframes identifier { 0% { top: 0; left: 0; } 30% { top: 50px; } 68%, 72% { left: 50px; } 100% { top: 100px; left: 100%; } } Here, the top property animates using the 0%, 30%, and 100% key...
... animation. For example: @keyframes identifier { 0% { top: 0; left: 0; } 30% { top: 50px; } 68%, 72% { left: 50px; } 100% { top: 100px; left: 100%; } } Here, the top property animates using the 0%, 30%, and 100% keyframes, and left animates using the 0%, 68%, 72% and 100% keyframes. When a keyframe is defined multiple times If a keyframe is defined multiple times but not all affected
properties are in each keyframe, all values specified in these keyframes are considered. For example: @keyframes identifier { 0% { top: 0; } 50% { top: 30px; left: 20px; } 50% { top: 10px; } 100% { top: 0; } } In this example, at the 50% keyframe, the values used are top: 10px and left: 20px. Cascading keyframes are supported starting in Firefox 14. !important in a keyframe Declarations in a ...
width - CSS: Cascading Style Sheets
} Values auto The used value is calculated from the other CSS descriptors' values. <length> A non-negative absolute or relative length. <percentage> A percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. Must be non-negative. ...
...lues. <length> A non-negative absolute or relative length. <percentage> A percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. Must be non-negative. ...
...or 1.0, for horizontal and vertical lengths respectively. Must be non-negative. ...
Using CSS animations - CSS: Cascading Style Sheets
p the performance as smooth as possible. Letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible. Configuring the animation To create a CSS animation sequence, you style the element you want to animate with the animation property or its sub-
properties. ...
... animation-duration Configures the length of time that an animation should take to complete one cycle. ...
...xamples to explain the different permutations: In this first example, we have three animation names set, but only one duration and iteration count. In this case all three animations are given the same duration and iteration count: animation-name: fadeInOut, moveLeft300px, bounce; animation-duration: 3s; animation-iteration-count: 1; In this second example, we have three values set on all three
properties. In this case each animation is run with the corresponding values in the same position on each property, so for example fadeInOut has a duration of 2.5s and an iteration count of 2, etc. animation-name: fadeInOut, moveLeft300px, bounce; animation-duration: 2.5s, 5s, 1s; animation-iteration-count: 2, 1, 5; In this third case, there are three animations specified, but only two durations and itera...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
the context of block layout, including floated, positioned, and table elements. As this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main Box Alignment page, which details the common features of box alignment across layout methods. Note: At the time of writing (May 2018), there is no real support for the box alignment
properties in block layout. This document details how the specification expects these
properties to be implemented for completeness, and is likely to change as the specification and browser implementations develop. align-content and justify-content The justify-content property does not apply to block containers or table cells. The align-content property applies to the block axis in order to align the co...
...solves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. Aligning in these layout methods today As we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment
properties as specified in flexbox. Alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. A margin of auto will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center: .container { width: 20em; margin-left: auto; margin-right: auto; } In table layout, you h...
...; } In table layout, you have access to the vertical-align property to align the contents of a cell inside that cell. For many use cases, turning the block container into a flex item will give you the alignment capability that you are looking for. In the example below, a container with a single item inside has been turned into a flex container for the purpose of being able to use the alignment
properties. Reference CSS
Properties justify-content align-content justify-self align-self Glossary Entries Alignment subject Alignment container Fallback alignment ...
CSS Color - CSS: Cascading Style Sheets
Tools Color picker tool This tool makes it easy to create, adjust, and experiment with custom colors. ...
...All color-related CSS
properties are touched upon. ...
... Tools Color picker tool This tool makes it easy to create, adjust, and experiment with custom colors. ...
Color picker tool - CSS: Cascading Style Sheets
is.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; Color.prototype.setFormat = function setFormat(format) { if (format === 'HSV') this.format = 'HSV'; if (format === 'HSL') this.format = 'HSL'; }; /*========== Methods to set Color
Properties ==========*/ Color.prototype.isValidRGBValue = function isValidRGBValue(value) { return (typeof(value) === 'number' && isNaN(value) === false && value >= 0 && value <= 255); }; Color.prototype.setRGBA = function setRGBA(red, green, blue, alpha) { if (this.isValidRGBValue(red) === false || this.isValidRGBValue(green) === false || this.isValidRGBValue(blue) === false) return; ...
...odeButton() { 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 (...
...************************************************/ ColorPicker.prototype.subscribe = function subscribe(topic, callback) { this.subscribers[topic] = callback; }; ColorPicker.prototype.notify = function notify(topic, value) { if (this.subscribers[topic]) this.subscribers[topic](value); }; /*************************************************************************/ // Set Picker
Properties /*************************************************************************/ ColorPicker.prototype.setColor = function setColor(color) { if(color instanceof Color !== true) { console.log('Typeof parameter not Color'); return; } if (color.format !== this.picker_mode) { color.setFormat(this.picker_mode); color.updateHSX(); } this.color.copy(color); this.updateHuePicker()...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
other implementations. The idea was not to use the experimental implementations in production code. However, prefixes ultimately were used in production code, and changes to the experimental specification caused people to need to update their sites to keep up. In 2009, the specification looked quite different. To create a flex container you would use display: box and there were a number of box-*
properties, which did things that you will recognise from flexbox today. There was an update to the spec that updated the syntax to display: flexbox -- this was again vendor-prefixed. Ultimately the specification was updated to define display: flex as the way to create a flex container. Browser support for the up-to-date version of the specification is excellent from this point forward. There are a few o...
...-block item becomes a flex item, it is blockified and so behavior of display: inline-block like preserving white space between items no longer applies. Remove display: flex to see the fallback behavior. You'll see white space added between the items, which is what happens when using display: inine-block as it prefers white space like other inline items. display: table- The CSS table display
properties are potentially very useful as a fallback, due to the fact that they allow design patterns such as full height columns and vertical centering and work back as far as Internet Explorer 8. If you use display: table-cell on an item in your HTML it takes on the styling of an HTML table cell. CSS creates anonymous boxes to represent these items so that you do not need to wrap each item in a wrapper t...
...trates use of the vertical-align property along with display: inline-block. Both display: table-cell and display: inline-block allow for the use of this property. Use of vertical-align enables vertical alignment prior to flexbox. The property is ignored by flexbox and so you can use it in conjunction with display: table-cell or display: inline-block as a fallback and then safely use box alignment
properties in flexbox instead. Feature Queries and flexbox You can use feature queries to detect flexbox support: @supports (display: flex) { // code for supporting browsers } Note that Internet Explorer 11 does not support feature queries yet does support flexbox. If you decide the IE11 implementation is too buggy and you wish to serve it the fallback layout then you could use feature queries to se...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
y on the main axis. An equal amount of space is placed between each item with the left and right items being flush with the edges of the flex container. You can also see that the items are stretching on the cross axis, due to the default value of align-items being stretch. The items stretch to the height of the flex container, making them each appear as tall as the tallest item. Reference CSS
Properties flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap order Alignment
Properties The
properties align-content, align-self, align-items and justify-content initially appeared in the Flexbox specification, but are now defined in Box Alignment. The Flexbox spec now refers to the Box Alignment specification for up to date definitions. Also additional alignment proper...
... Mastering wrapping of flex items How to create flex containers with multiple lines and control the display of the i...
... Mastering wrapping of flex items How to create flex containers with multiple lines and control the display of the items in those lines. Typical use cases of Flexbox Common design patterns that are typical Flexbox use cases. ...
Flow Layout and Overflow - CSS: Cascading Style Sheets
ll create a new Block Formatting Context. Note: In the Working Draft of Overflow Level 3, there is an additional value overflow: clip. This will act like overflow: hidden however it does not allow for programmatic scrolling, the box becomes non-scrollable. In addition it does not create a Block Formatting Context. The overflow property is in reality a shorthand for the overflow-x and overflow-y
properties. If you specify only one value for overflow, this value is used for both axes. However, you can specify both values in which case the first is used for overflow-x and therefore the horizontal direction, and the second for overflow-y and the vertical direction. In the below example, I have only specified overflow-y: scroll so we do not get the unwanted horizontal scrollbar. Flow Relative Proper...
...es. However, you can specify both values in which case the first is used for overflow-x and therefore the horizontal direction, and the second for overflow-y and the vertical direction. In the below example, I have only specified overflow-y: scroll so we do not get the unwanted horizontal scrollbar. Flow Relative
Properties In the guide to Writing Modes and Flow Layout, we looked at the newer
properties of block-size and inline-size which make more sense when working with different writing modes than tying our layout to the physical dimensions of the screen. The Level 3 Overflow Module also includes flow relative
properties for overflow - overflow-block and overflow-inline. These correspond to overflow-x and overflow-y but the mapping depends on the writing mode of the document. These propertie...
...odes than tying our layout to the physical dimensions of the screen. The Level 3 Overflow Module also includes flow relative
properties for overflow - overflow-block and overflow-inline. These correspond to overflow-x and overflow-y but the mapping depends on the writing mode of the document. These
properties currently do not have implementations in browsers, so you will need to use the physical
properties at the present time and adjust for your writing mode. Indicating Overflow In the Level 3 Overflow specification we have some
properties which can help improve the way content looks in an overflow situation. Inline-Axis Overflow The text-overflow property deals with text overflowing in the inline direction. It takes one of two values clip, in which case content is clipped when it overflows, th...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
modified document order Grid places items that have not been given a grid position in what is described in the specification as "order modified document order". This means that if you have used the order property at all, the items will be placed by that order, not their DOM order. Otherwise they will stay by default in the order that they are entered in the document source. Items with placement
properties The first thing grid will do is place any items that have a position. In the example below I have 12 grid items. Item 2 and item 5 have been placed using line based placement on the grid. You can see how those items are placed and the other items then auto-place in the spaces. The auto-placed items will place themselves before the placed items in DOM order, they don't start after the position of...
...What this means is that the start line of the item will be set by auto-placement, and the end line will span two tracks. You can se...
...What this means is that the start line of the item will be set by auto-placement, and the end line will span two tracks. ...
CSS values and units - CSS: Cascading Style Sheets
Below is an overview of most of these data types. Refer to the page for each value type for more detailed information. ...
...ification or the MDN property page, allowable keywords will be listed in the following form. The following values are the pre-defined keyword values allowed for float. left | right | none | inline-start | inline-end Such values are used without quotes: .box { float: left; } CSS-wide values In addition to the pre-defined keywords that are part of the specification for a property, all CSS
properties accept the CSS-wide property values initial, inherit, and unset, which explicitly specify defaulting behaviors. The initial keyword represents the value specified as the property's initial value. The inherit keyword represents the computed value of the property on the element's parent, provided it is inherited. The unset keyword acts as either inherit or initial, depending on whether the proper...
...hich the percentage refers. This quantity can be a value of another property of the same element, the value of a property of an ancestor element, a measurement of a containing block, or something else. As an example, if you specify the width of a box as a percentage, it refers to the percentage of the box's parent's computed width: .box { width: 50%; } Mixing percentages and dimensions Some
properties accept a dimension that could be either one of two types, for example a <length> or a <percentage>. In this case the allowed value is detailed in the specification as a combination unit, e.g. <length-percentage>. Other possible combinations are as follows: <frequency-percentage> <angle-percentage> <time-percentage> Special data types (defined in other specs) <color> <image> <position>...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
in the cascade, declarations contained in @keyframes don't. As with @font-face, only the at-rule as a whole is selected via the cascade algorithm. Finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm. Origin of CSS declarations The CSS cascade algorithm's job is to select CSS declarations in order to determine the correct values for CSS
properties. CSS declarations originate from different origins: the User-agent stylesheets, the Author stylesheets, and the User stylesheets. Though style sheets come from these different origins, they overlap in scope; to make this work, the cascade algorithm defines how they interact. User-agent stylesheets The browser has a basic style sheet that gives a default style to any document. These style sheet...
...code, but the end result is the same. Some browsers let users modify the user-agent stylesheet. Although some constraints on user-agent stylesheets are set by the HTML specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another. To simplify the development process, Web developers often use a CSS reset style sheet, forcing common
properties values to a known state before beginning to make alterations to suit their specific needs. Author stylesheets Author stylesheets are the most common type of style sheet. These are style sheets that define styles as part of the design of a given web page or site. The author of the page defines the styles for the document using one or more stylesheets, which define the look and feel of the websit...
...is considered to choose one or the other. Resetting styles After your content has finished altering styles, it may find itself in a situation where it needs to restore them to a known state. This may happen in cases of animations, theme changes, and so forth. The CSS property all lets you quickly set (almost) everything in CSS back to a known state. all lets you opt to immediately restore all
properties to any of their initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the
properties entirely. CSS animations and the cascade CSS animations, using @keyframes at-rules, define animations between states. Keyframes don't cascade, meaning that ...
Layout and the containing block - CSS: Cascading Style Sheets
nvestigate the factors that determine what an element's containing block is. Effects of the containing block Before learning what determines the containing block of an element, it's useful to know why it matters in the first place. The size and position of an element are often impacted by its containing block. Percentage values that are applied to the width, height, padding, margin, and offset
properties of an absolutely positioned element (i.e., which has its position set to absolute or fixed) are computed from the element's containing block. Identifying the containing block The process for identifying the containing block depends entirely on the value of the element's position property: If the position property is static, relative, or sticky, the containing block is formed by the edge of t...
...f filter (only works on Firefox). A contain value of paint (e.g. contain: paint;) Note: The containing block in which the root element (<html>) resides is a rectangle called the initial containing block. It has the dimensions of the viewport (for continuous media) or the page area (for paged media). ...
...aining block in which the root element (<html>) resides is a rectangle called the initial containing block. It has the dimensions of the viewport (for continuous media) or the page area (for paged media). Calculating percentage values from the containing block As noted above, when certain
properties are given a percentage value, the computed value depends on the element's containing block. The
properties that work this way are box model
properties and offset
properties: The height, top, and bottom
properties compute percentage values from the height of the containing block. The width, left, right, padding, and margin
properties compute percentage values from the width of the containing block. Some examples The HTML code for all our examples is: <body> <section> <p>This is a paragrap...
Linear-gradient Generator - CSS: Cascading Style Sheets
is.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; Color.prototype.setFormat = function setFormat(format) { if (format === 'HSV') this.format = 'HSV'; if (format === 'HSL') this.format = 'HSL'; }; /*========== Methods to set Color
Properties ==========*/ Color.prototype.isValidRGBValue = function isValidRGBValue(value) { return (typeof(value) === 'number' && isNaN(value) === false && value >= 0 && value <= 255); }; Color.prototype.setRGBA = function setRGBA(red, green, blue, alpha) { if (this.isValidRGBValue(red) === false || this.isValidRGBValue(green) === false || this.isValidRGBValue(blue) === false) return; ...
...odeButton() { 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 ...
...************************************************/ ColorPicker.prototype.subscribe = function subscribe(topic, callback) { this.subscribers[topic] = callback; }; ColorPicker.prototype.notify = function notify(topic, value) { if (this.subscribers[topic]) this.subscribers[topic](value); }; /*************************************************************************/ // Set Picker
Properties /*************************************************************************/ ColorPicker.prototype.setColor = function setColor(color) { if(color instanceof Color !== true) { console.log('Typeof parameter not Color'); return; } if (color.format !== this.picker_mode) { color.setFormat(this.picker_mode); color.updateHSX(); } this.color.copy(color); this.updateHuePicker()...
Value definition syntax - CSS: Cascading Style Sheets
and the interactions between them. A component can be a keyword, some characters considered as a literal, or a value of a given CSS data type or of another CSS property. Component value types Keywords Generic keywords A keyword with a predefined meaning appears literally, without quotation marks. For example: auto, smaller or ease-in. The specific case of inherit, initial and unset All CSS
properties accept the keywords inherit, initial and unset, that are defined throughout CSS. They are not shown in the value definition, and are implicitly defined. Literals In CSS, a few characters can appear on their own, like the slash ('/') or the comma (','), and are used in a property definition to separate its parts. The comma is often used to separate values in enumerations, or parameters in mathem...
...SS, a few characters can appear on their own, like the slash ('/') or the comma (','), and are used in a property definition to separate its parts. The comma is often used to separate values in enumerations, or parameters in mathematical-like functions; the slash often separates parts of the value that are semantically different, but have a common syntax. Typically, the slash is used in shorthand
properties; to separate component that are of the same type, but belong to different
properties. Both symbols appear literally in a value definition. Data types Basic data types Some kind of data are used throughout CSS, and are defined once for all values in the specification. Called basic data types, they are represented with their name surrounded by the symbol '<' and '>': <angle>, <string>, ... Non...
...mbol '<' and '>': <angle>, <string>, ... Non-terminal data types Less common data types, called non-terminal data types, are also surrounded by '<' and '>'. Non-terminal data types are of two kinds: data types sharing the same name of a property, put between quotes. In this case, the data type shares the same set of values as the property. They are often used in the definition of shorthand
properties. data type not sharing the same name of a property. These data types are very close to the basic data types. They only differ from the basic data types in the physical location of their definition. In this case, the definition is usually physically very close to the definition of the property using them. Component value combinators Brackets Brackets enclose several entities, combinators, and...
Viewport concepts - CSS: Cascading Style Sheets
The width of the viewport is not always the width of the window. If you query the width or height of the window and document in Chrome or Firefox, you may get: document.documentElement.clientWidth /* 1200 */ window.innerWidth /* 1200 */ window.outerWidth /* 1200 */ document.documentElement.clientHeight /* 800 */ window.innerHeight /* 800 */ window.outerHeight /* 900 */ There are several DOM
properties that can help you query viewport size, and other similar lengths: The document element's Element.clientWidth is the inner width of a document in CSS pixels, including padding (but not borders, margins, or vertical scrollbars, if present). This is the viewport width. The Window.innerWidth is the width, in CSS pixels, of the browser window viewport including, if rendered, the vertical scrollbar...
...-- the <img> if the source is an SVG file, the SVG itself if the SVG is included directly into the HTML, or the parent if the parent element has a width assigned and -- not the viewport's width. With the above media query being in our SVG file, the CSS is applied if the SVG container is between 400 and 500px. JavaScript The Visual Viewport API provides a mechanism for querying and modifying the
properties of the visual viewport. Mobile Viewports Mobile devices come in all shapes and sizes, with screens of differing device pixel ratios. The mobile browser's viewport is the area of the window in which web content can be seen, which is not necessarily the same size as the rendered page. Mobile browsers render pages in a virtual window or viewport, generally at 980px, which is usually wider than the...
...a mobile browser to use the viewport width instead of the default 980px as the width of the screen, developers can include a viewport meta tag, like the following: <meta name="viewport" content="width=device-width"> The width property controls the size of the viewport. It should preferably be set to device-width, which is the width of the screen in CSS pixels at a scale of 100%. There are other
properties, including maximum-scale, minimum-scale, and user-scalable, which control whether users can zoom the page in or out, but the default values are the best for accessibility and user experience, so these can be omitted. See Also @viewport CSS at-rule Visual Viewport API <meta>, specifically <meta name="viewport"> Using the viewport meta tag to control layout on mobile browsers ...
all - CSS: Cascading Style Sheets
The all shorthand CSS property resets all of an element's
properties except unicode-bidi, direction, and CSS Custom
Properties. It can set
properties to their initial or inherited values, or to the values specified in another stylesheet origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Global values */ all: initial; all: inherit; all: unset; /* CSS Cascading and Inheritance Level 4 */ all: revert; The all property is specified as one of the CSS global keyword values. Note that none of these values affect the unicode-bidi and direction
properties. Values initial Specifies that all the element's pro...
...l: initial; all: inherit; all: unset; /* CSS Cascading and Inheritance Level 4 */ all: revert; The all property is specified as one of the CSS global keyword values. Note that none of these values affect the unicode-bidi and direction
properties. Values initial Specifies that all the element's
properties should be changed to their initial values. inherit Specifies that all the element's
properties should be changed to their inherited values. unset Specifies that all the element's
properties should be changed to their inherited values if they inherit by default, or to their initial values if not. revert Specifies behavior that depends on the stylesheet origin to which the declaration belongs: User-agent origin Equivalent to unset. User origin Rolls back the cascade to the user...
...d values are calculated as if no author-level rules were specified for the element. For purposes of revert, the Author origin includes the Override and Animation origins. 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. </blockquote> Phasellus eget velit sagittis. CSS body { font-size: small; background-color: #F0F0F0; color: blue; } blockquote { background-color: skyblue; color: red; } ...
display - CSS: Cascading Style Sheets
id out in (assuming it is a non-replaced element). Valid <display-inside> values: flow The element lays out its contents using flow layout (block-and-inline layout). If its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. Otherwise it generates a block container box. Depending on the value of other
properties (such as position, float, or overflow) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (BFC) for its contents or integrates its contents into its parent formatting context. flow-root The element generates a block element box that establishes a new block formatting context, defining where the formatting root l...
...sive Enhancement Realizing common layouts using grids Accessibility concerns display: none Using a display value of none on an element will remove it from the accessibility tree. This will cause the element and all its descendant elements to no longer be announced by screen reading technology. If you want to visually hide the element, a more accessible alternative is to use a combination of
properties to remove it visually from the screen but keep it parseable by assistive technology such as screen readers. display: contents Current implementations in most browsers will remove from the accessibility tree any element with a display value of contents (but descendants will remain). This will cause the element itself to no longer be announced by screen reading technology. This is incorrect behav...
...specification. More accessible markup with display: contents | Hidde de Vries Display: Contents Is Not a CSS Reset | Adrian Roselli Tables Changing the display value of a <table> element to block, grid, or flex will alter its representation in the accessibility tree. This will cause the table to no longer be announced properly by screen reading technology. Short note on what CSS display
properties do to table semantics -- The Paciello Group Hidden content for better a11y | Go Make Things MDN Understanding WCAG, Guideline 1.3 explanations Understanding Success Criterion 1.3.1 | W3C Understanding WCAG 2.0 Formal definition Initial valueinlineApplies toall elementsInheritednoComputed valueas the specified value, except for positioned and floating elements and the root element. In both c...
gap (grid-gap) - CSS: Cascading Style Sheets
-gap'>. If <'column-gap'> is omitted, it's set to the same value as <'row-gap'>. <'row-gap'> and <'column-gap'> are each specified as a <length> or a <percentage>. Values <length> Is the width of the gutter separating the grid lines. <percentage> Is the width of the gutter separating the grid lines, relative to the dimension of the element. ...
...Values <length> Is the width of the gutter separating the grid lines. <percentage> Is the width of the gutter separating the grid lines, relative to the dimension of the element. ...
...p: 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 length, percentage or calc();column-gap: a length, percentage or calc(); Formal syntax <'row-gap'> <'column-gap'>? Examples Flex layout HTML <div id="flexbox"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> CSS #flexbox { display: flex; flex-wrap: wrap; width: 300px; gap: 20px 5px; } #flexbox > div { borde...
grid-column - CSS: Cascading Style Sheets
column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: grid-column-end grid-column-start Syntax This property is specified as one or two <grid-line> values. If two <grid-line> values are given they are separated by "/". The grid-column-start longhand is set to the value before the slash, and the grid-column-end longhand is set to the value after the slash. Each <grid-line> value...
...s omitted, it defaults to 1. Negative integers or 0 are invalid. Internet Explorer issues IE11 does not support automatic placement of grid items. All items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
...s explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
initial - CSS: Cascading Style Sheets
You should consider using the inherit, unset, or revert keywords instead. ...
...You should consider using the inherit, unset, or revert keywords instead. ...
...me for use.Requires a vendor prefix or different name for use. See also Use unset to set a property to its inherited value if it inherits, or to its initial value if not. Use revert to reset a property to the value established by the user-agent stylesheet (or by user styles, if any exist). Use inherit to make an element's property the same as its parent. The all property lets you reset all
properties to their initial, inherited, reverted, or unset state at once. ...
inset - CSS: Cascading Style Sheets
The inset CSS property, though part of the logical specification, doesn't define logical block or inline offsets, and instead defines physical offsets, regardless of the element's writing mode, directionality, and text orientation. It has the same multi-value syntax of the margin shorthand. It is a shorthand that corresponds to the top, right, bottom, and/or left
properties. /* <length> values */ inset: 10px; /* value applied to all edges */ inset: 4px 8px; /* top/bottom left/right */ inset: 5px 15px 10px; /* top left/right bottom */ inset: 2.4em 3em 3em 3em; /* top right bottom left */ /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */ inset: 10% 5% 5% 5%; /* Keyword value */ inset: auto; /* Global values */ inset: inherit; inset: initial; inset: unset...
...ning block */ inset: 10% 5% 5% 5%; /* Keyword value */ inset: auto; /* Global values */ inset: inherit; inset: initial; inset: unset; Syntax Values The inset property takes the same values as the left property. ...
... Editor's Draft Initial definition ...
<length> - CSS: Cascading Style Sheets
The <length> CSS data type represents a distance value. Lengths can be used in numerous CSS
properties, such as width, height, margin, padding, border-width, font-size, and text-shadow. Note: Although <percentage> values are also CSS dimensions, and are usable in some of the same
properties that accept <length> values, they are not themselves <length> values. See <length-percentage>. Syntax The <length> data type consists of a <number> followed by one of the units listed below. As with all CSS dimensions, there is no space between the unit literal and the number. The length unit is optional after the number 0. Note: Some
properties allow negative <length>s, while others do not. Units Relative length units Relative lengths represent a measurement in terms of some other distance. Depending...
...resents the font-size of the root element (typically <html>). When used within the root element font-size, it represents its initial value (a common browser default is 16px, but user-defined preferences may modify this). rlh Equal to the computed value of the line-height property on the root element (typically <html>), converted to an absolute length. When used on the font-size or line-height
properties of the root element, it refers to the
properties' initial value. Viewport-percentage lengths Viewport-percentage lengths define the <length> value relative to the size of the viewport, i.e., the visible portion of the document. Viewport lengths are invalid in @page declaration blocks. vh Equal to 1% of the height of the viewport's initial containing block. vw Equal to 1% of the width of ...
... to 1% of the size of the initial containing block, in the direction of the root element's inline axis. vb Equal to 1% of the size of the initial containing block, in the direction of the root element's block axis. vmin Equal to the smaller of vw and vh. vmax Equal to the larger of vw and vh. Absolute length units Absolute length units represent a physical measurement when the physical
properties of the output medium are known, such as for print layout. This is done by anchoring one of the units to a physical unit, and then defining the others relative to it. The anchor is done differently for low-resolution devices, such as screens, versus high-resolution devices, such as printers. For low-dpi devices, the unit px represents the physical reference pixel; other units are defined relative...
margin-inline - CSS: Cascading Style Sheets
Formal definition Initial value0Applies tosame as marginInheritednoPercentagesdepends o...
...in-inline: 10px; /* sets both start and end values */ /* Keyword values */ margin-inline: auto; /* Global values */ margin-inline: inherit; margin-inline: initial; margin-inline: unset; This property corresponds to the margin-top and margin-bottom, or margin-right, and margin-left
properties, depending on the values defined for writing-mode, direction, and text-orientation. Constituent
properties This property is a shorthand for the following CSS
properties: margin-inline-end margin-inline-start Syntax Values The margin-inline property takes the same values as the margin-left property. Formal definition Initial value0Applies tosame as marginInheritednoPercentagesdepends on layout modelComputed valueif specified as a length, the corresponding absolute length; if specified as a p...
... Editor's Draft Initial definition. Initial value0Applies tosame as marginInheritednoPercentagesdepends on layout modelComputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoAnimation typediscrete ...
overflow - CSS: Cascading Style Sheets
sets the desired behavior for an element's overflow -- i.e. when an element's content is too big to fit in its block formatting context -- in both directions. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...en an element's content is too big to fit in its block formatting context -- in both directions. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent
properties This property is a shorthand for the following CSS
properties: overflow-x overflow-y Syntax /* Keyword values */ overflow: visible; overflow: hidden; overflow: clip; overflow: scroll; overflow: auto; overflow: hidden visible; /* Global values */ overflow: inherit; overflow: initial; overflow: unset; The overflow property is specified as one or two keywords chosen from the list of values below. If two keywords are specified, the first applies to ov...
...t to nowrap. Setting one axis to visible (the default) while setting the other to a different value results in visible behaving as auto. The JavaScript Element.scrollTop property may be used to scroll an HTML element even when overflow is set to hidden. ...
padding-block - CSS: Cascading Style Sheets
The padding-block CSS shorthand property defines the logical block start and end padding of an element, which maps to physical padding
properties depending on the element's writing mode, directionality, and text orientation. /* <length> values */ padding-block: 10px 20px; /* An absolute length */ padding-block: 1em 2em; /* relative to the text size */ padding-block: 10px; /* sets both start and end values */ /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* Global values */ padding-block: inherit; padding-block: initial; padding-block: unset; These values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientati...
... /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* Global values */ padding-block: inherit; padding-block: initial; padding-block: unset; These values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. Constituent
properties This property is a shorthand for the following CSS
properties: padding-block-end padding-block-start Syntax Values The padding-block property takes the same values as the padding-left property. Formal definition Initial value0Applies toall elementsInheritednoPercentageslogical-width of containing blockComputed valueas <length>Animation typediscrete Formal syntax <'padding-left'>{1,2}...
... Editor's Draft Initial definition ...
place-content - CSS: Cascading Style Sheets
The place-content CSS shorthand property allows you to align content along both the block and inline directions at once (i.e. the align-content and justify-content
properties) in a relevant layout system such as Grid or Flexbox. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...along both the block and inline directions at once (i.e. the align-content and justify-content
properties) in a relevant layout system such as Grid or Flexbox. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ign-content and justify-content
properties) in a relevant layout system such as Grid or Flexbox. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
position - CSS: Cascading Style Sheets
This is the default value. ...
...repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The position property is specified as a single keyword chosen from the list of values below. Values static The element is positioned according to the normal flow of the document. The top, right, bottom, left, and z-index
properties have no effect. This is the default value. relative The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static. This value creates a new...
...estor. This effectively inhibits any "sticky" behavior (see the GitHub issue on W3C CSSWG). Description Types of positioning A positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky. (In other words, it's anything except static.) A relatively positioned element is an element whose computed position value is relative. The top and bottom
properties specify the vertical offset from its normal position; the left and right
properties specify the horizontal offset. An absolutely positioned element is an element whose computed position value is absolute or fixed. The top, right, bottom, and left
properties specify offsets from the edges of the element's containing block. (The containing block is the ancestor relative to which the element is pos...
scroll-padding-block - CSS: Cascading Style Sheets
The scroll-padding-block shorthand property sets the scroll padding of an element in the block dimension. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targeted element and the edges of the scrollport. ...
...lport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targeted element and the edges of the scrollport. ...
scroll-padding-inline - CSS: Cascading Style Sheets
The scroll-padding-inline shorthand property sets the scroll padding of an element in the inline dimension. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ies define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. ...
...port: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. ...
text-emphasis - CSS: Cascading Style Sheets
the font, and text-emphasis may affect line height when the current leading is not enough for the marks. text-emphasis doesn't reset the value of text-emphasis-position. This is because if the style and the color of emphasis marks may vary in a text, it is extremely unlikely that their position will. In the very rare cases when this is needed, the property text-emphasis-position. Constituent
properties This property is a shorthand for the following CSS
properties: text-emphasis-color text-emphasis-style Syntax /* Initial value */ text-emphasis: none; /* No emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '?'; text-emphasis: '\25B2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* Should NOT use. It may be computed to or rendered as 'f' only */ /* Keywords va...
... shape in vertical writing modes when no other shape is given. <string> Display the given string as marks. Authors should not specify more than one character in <string>. The UA may truncate or ignore strings consisting of more than one grapheme cluster. <color> Defines the color of the mark. If no color is present, it defaults to currentcolor. ...
...e character in <string>. The UA may truncate or ignore strings consisting of more than one grapheme cluster. <color> Defines the color of the mark. If no color is present, it defaults to currentcolor. 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 with triangles used to emphasize each character. C...
transition-property - CSS: Cascading Style Sheets
The transition-property CSS property sets the CSS
properties to which a transition effect should be applied. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The set of
properties that can be animated is subject to change. As such, you should avoid including any
properties in the list that don't currently animate, as someday they might, causing unexpected results. If you specify a shorthand property (e.g., background), all of its longhand sub-
properties that can be animated will be. Syntax /* Keyword values */ transition-property: none; transition-property: all; /* <custom-ident> values */ transition-property: te...
... <custom-ident> A string identifying the property to which a transition effect should be applied when its value changes. Formal definition Initial valueallApplies toall elements, ::before and ::after pseudo-elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax none | <single-transition-property>#wher...
..._05; transition-property: -specific; transition-property: sliding-vertically; /* Multiple values */ transition-property: test1, animation4; transition-property: all, height, color; transition-property: all, -moz-specific, sliding; /* Global values */ transition-property: inherit; transition-property: initial; transition-property: unset; Values none No
properties will transition. all All
properties that can transition will. <custom-ident> A string identifying the property to which a transition effect should be applied when its value changes. 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 |...
Used value - CSS: Cascading Style Sheets
The used value of a CSS property is its value after all calculations have been performed on the computed value. After the user agent has finished its calculations, every CSS property has a used value. The used values of dimensions (e.g., width, line-height) are in pixels. The used values of shorthand
properties (e.g., background) are consistent with those of their component
properties (e.g., background-color or background-size) and with position and float. Note: The getComputedStyle() DOM API returns the resolved value, which may either be the computed value or the used value, depending on the property. 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...
...h-inherit"); } updateAllUsedWidths(); window.addEventListener('resize', updateAllUsedWidths); Result Difference from computed value CSS 2.0 defined only computed value as the last step in a property's calculation. Then, CSS 2.1 introduced the distinct definition of used value. An element could then explicitly inherit a width/height of a parent, whose computed value is a percentage. ...
...puted value as the last step in a property's calculation. Then, CSS 2.1 introduced the distinct definition of used value. An element could then explicitly inherit a width/height of a parent, whose computed value is a percentage. For CSS
properties that don't depend on layout (e.g., display, font-size, or line-height), the computed values and used values are the same. ...
var() - CSS: Cascading Style Sheets
the variable.) Syntax The first argument to the function is the name of the custom property to be substituted. An optional second argument to the function serves as a fallback value. If the custom property referenced by the first argument is invalid, the function uses the second value. ...
... <declaration-value> The custom property's fallback value, which is used in case the custom property is invalid in the used context. ...
... Candidate Recommendation Initial definition ...
Localizations and character encodings - Developer guides
ection among multiple legacy encodings was introduced to Web browsers. This has then had the effect that Web authors have depended on heuristic detection being present, so Firefox still has heuristic detection in these locales. Finding canonical encoding names The text below refers to canonical names of encodings. The canonical names are the values to the right of the equals sign in unixcharset.
properties. Specifying the fallback encoding As of Firefox 28, this section is obsolete, since the preference intl.charset.default no longer exists. The mapping from locales onto fallback encodings is now built into Gecko itself. The fallback encoding is specified by the preference intl.charset.default in intl.
properties. It should be set to the canonical name of the legacy encoding that users of the loc...
...'t follow the guidance given above. (For example, the fallback encoding for the Polish, Hungarian and Czech locales should probably continue to be ISO-8859-2 even though IE has a different fallback encoding.) When in doubt, use windows-1252 as the fallback encoding. Specifying the heuristic detection mode The heuristic detection mode is specified by the preference intl.charset.detector in intl.
properties. The setting must be left blank for all locales other than Russian, Ukrainian and Japanese. Do not under any circumstances specify the "universal" detector. It is not actually universal despite its name! Exception for minority languages If the localization is for minority language and the users are typically literate in the majority language of the region and read Web content written in the maj...
... encoding and the heuristic detection mode to be the same as for the localization for the majority language of the region. For example, for a localization for minority language in Russia, it is appropriate to copy the settings from the Russian localization. Setting some encodings to be more easily selectable from the character encoding menu The preference intl.charsetmenu.browser.static in intl.
properties makes some character encodings more easily available in the Character Encoding menu in the browser. The value should be a comma-separated list of canonical encoding names. The list should include at least the fallback encoding, windows-1252 and UTF-8. For locales where there are multiple common legacy encodings, all those encodings should be included. For example, the fallback encoding for Japane...
Mobile Web Development - Developer guides
or touch screens. You can use the pointer or any-pointer media query to load different CSS on a touch-enabled device. Optimizing images To help users whose devices have low or expensive bandwidth, you can optimize images by loading images appropriate to the device screen size and resolution. You do this in CSS by querying for screen height, width, and pixel ratio. You can also make use of CSS
properties to implement visual effects like gradients and shadows without images. Mobile APIs Finally, you can take advantage of the new possibilities offered by mobile devices, such as orientation and geolocation. Cross-browser development Write cross-browser code To create web sites that will work acceptably across different mobile browsers: Try to avoid using browser-specific features, such as ve...
...al effects like gradients and shadows without images. Mobile APIs Finally, you can take advantage of the new possibilities offered by mobile devices, such as orientation and geolocation. Cross-browser development Write cross-browser code To create web sites that will work acceptably across different mobile browsers: Try to avoid using browser-specific features, such as vendor-prefixed CSS
properties. If you do need to use these features, check whether other browsers implement their own versions of these features, and target them too. For browsers that don't support these features, provide an acceptable fallback. For example, if you set a gradient as a background for some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed ver...
... some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed versions of the linear-gradient() property. If you don't do that, at least make sure that the default background contrasts with the text: that way, the page will at least be usable in a browser which is not targeted by your linear-gradient rule. See this list of Gecko-specific
properties, and this list of WebKit-specific
properties, and Peter Beverloo's table of vendor-specific
properties. Using tools like CSS Lint can help find problems like this in code, and preprocessors like SASS and LESS can help you to produce cross-browser code. Take care with user agent sniffing It's preferable for web sites to detect specific device features such as screen size and touch screens using...
<img>: The Image Embed element - HTML: Hypertext Markup Language
uery string, but not the fragment, password, or username. This is unsafe because it can leak information from TLS-protected resources to insecure origins. sizes One or more strings separated by commas, indicating a set of source sizes. Each source size consists of: A media condition. This must be omitted for the last item in the list. A source size value. Media Conditions describe
properties of the viewport, not of the image. For example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px. Source size values specify the intended display size of the image. User agents use the current source size to select one of the sources supplied by the srcset attribute, when those sources are described using width (w) descriptors. The se...
... width The intrinsic width of the image in pixels. Must be an integer without a unit. usemap The partial URL (starting with #) of an image map associated with the element. Note: You cannot use this attribute if the <img> element is inside an <a> or <button> element. Deprecated attributes align Aligns the image with its surrounding context. Use the float and/or vertical-align CSS
properties instead of this attribute. Allowed values: top Equivalent to vertical-align: top or vertical-align: text-top middle Equivalent to vertical-align: -moz-middle-with-baseline bottom The default, equivalent to vertical-align: unset or vertical-align: initial left Equivalent to float: left right Equivalent to float: right border The width of a border around the image. U...
...etails. name A name for the element. Use the id attribute instead. vspace The number of pixels of white space above and below the image. Use the margin CSS property instead. Styling with CSS <img> is a replaced element; it has a display value of inline by default, but its default dimensions are defined by the embedded image's intrinsic values, like it were inline-block. You can set
properties like border/border-radius, padding/margin, width, height, etc. on an image. <img> has no baseline, so when images are used in an inline formatting context with vertical-align: baseline, the bottom of the image will be placed on the text baseline. You can use the object-position property to position the image within the element's box, and the object-fit property to adjust the sizing of the image...
Global attributes - HTML: Hypertext Markup Language
marily on <input> elements, but is usable on any element while in contenteditable mode. is Allows you to specify that a standard HTML element should behave like a registered custom built-in element (see Using custom elements for more details). Note: The item* attributes are part of the WHATWG HTML Microdata feature. itemid The unique, global identifier of an item. itemprop Used to add
properties to an item. Every HTML element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref
Properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. It provides a list of element ids (not itemids) with additional
properties elsewhere in the document. itemscope itemscope (usually) ...
...itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. ...
... (usually) works along with itemtype to specify that the HTML contained in a block is about a particular item. itemscope creates the Item and defines the scope of the itemtype associated with it. itemtype is a valid URL of a vocabulary (such as schema.org) that describes the item and its
properties context. itemtype Specifies the URL of the vocabulary that will be used to define itemprops (item
properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. lang Helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. The attribute contains one "language tag" (made of hyphen-separated "language subtags") in th...
CSS Houdini
ts: no pre-processors, post-processors or JavaScript frameworks needed. <script> CSS.paintWorklet.addModule('csscomponent.js'); </script> This added module contains registerPaint() functions, which register completely configurable worklets. The CSS paint() function parameters include the name of the worklet, along with optional parameters. The worklet also has access to the element's custom
properties: they don't need to be passed as function arguments. li { background-image: paint(myComponent, stroke, 10px); --highlights: blue; --lowlights: green; } Note: With great power comes great responsibility! With Houdini you could invent your own masonry, grid, or regions implementation, but doing so is not necessarily the best idea. The CSS Working group does a lot of work to ensure every...
... help you if you need guidance in learning how to use them. Start by reading Houdini, an introduction -- this provides a brief history of Houdini and an overview of its many features. CSS Parser API An API exposing the CSS parser more directly, for parsing arbitrary CSS-like languages into a mildly typed representation. No guide or reference has currently been written for this API. ...
... by reading Houdini, an introduction -- this provides a brief history of Houdini and an overview of its many features. CSS Parser API An API exposing the CSS parser more directly, for parsing arbitrary CSS-like languages into a mildly typed representation. No guide or reference has currently been written for this API. CSS
Properties and Values API Defines an API for registering new CSS
properties.
Properties registered using this API are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value. CSS
Properties and Values API reference CSS
Properties and Values API guide CSS Typed OM Converting CSSOM value strings into meaningfully typed JavaScript representations and back can incur a significant performance overhead. The CSS Typed OM exposes CSS...
Control flow and error handling - JavaScript
n; You may throw any expression, not just expressions of a specific type. The following code throws several exceptions of varying types: throw 'Error2'; // String type throw 42; // Number type throw true; // Boolean type throw {toString: function() { return "I'm an object!"; } }; Note: You can specify an object when you throw an exception. You can then reference the object's
properties in the catch block. // Create an object type UserException function UserException(message) { this.message = message; this.name = 'UserException'; } // Make the exception convert to a pretty string when used as a string // (e.g., by the error console) UserException.prototype.toString = function() { return `${this.name}: "${this.message}"`; } // Create an instance of the object type and t...
...t one or more try...catch statements. If an inner try...catch statement does not have a catch block: it must contain a finally block, and the enclosing try...catch statement's catch block is checked for a match. For more information, see nested try-blocks on the try...catch reference page. ...
...nding on the type of error, you may be able to use the name and message
properties to get a more refined message. The name property provides the general class of Error (such as DOMException or Error), while message generally provides a more succinct message than one would get by converting the error object to a string. If you are throwing your own exceptions, in order to take advantage of these
properties (such as if your catch block doesn't discriminate between your own exceptions and system ones), you can use the Error constructor. For example: function doSomethingErrorProne() { if (ourCodeMakesAMistake()) { throw (new Error('The message')); } else { doSomethingToGetAJavascriptError(); } } ? try { doSomethingErrorProne(); } catch (e) { // NOW, we actually use `con...
Meta programming - JavaScript
tting a property on an object: let handler = { get: function(target, name) { return name in target? target[name] : 42 } } let p = new Proxy({}, handler) p.a = 1 console.log(p.a, p.b) // 1, 42 The Proxy object defines a target (an empty object here) and a handler object, in which a get trap is implemented. Here, an object that is proxied will not return undefined when getting undefined
properties, but will instead return the number 42. Additional examples are available on the Proxy reference page. Terminology The following terms are used when talking about the functionality of proxies. handler Placeholder object which contains traps. traps The methods that provide property access. (This is analogous to the concept of traps in operating systems.) target Object which the proxy vi...
...bout the functionality of proxies. handler Placeholder object which contains traps. traps The methods that provide property access. (This is analogous to the concept of traps in operating systems.) target Object which the proxy virtualizes. It is often used as storage backend for the proxy. Invariants (semantics that remain unchanged) regarding object non-extensibility or non-configurable
properties are verified against the target. invariants Semantics that remain unchanged when implementing custom operations are called invariants. If you violate the invariants of a handler, a TypeError will be thrown. Handlers and traps The following table summarizes the available traps available to Proxy objects. See the reference pages for detailed explanations and examples. Handler / trap ...
... Reflect.enumerate() The enumerate method must return an object. handler.ownKeys() Object.getOwnPropertyNames() Object.getOwnPropertySymbols() Object.keys() Reflect.ownKeys() The result of ownKeys is a List. The Type of each result List element is either String or Symbol. The result List must contain the keys of all non-configurable own
properties of target. If the target object is not extensible, then the result List must contain all the keys of the own
properties of target and no other values. handler.apply() proxy(..args) Function.prototype.apply() and Function.prototype.call() Reflect.apply() There are no invariants for the handler.apply method. handler.construct() new proxy(...args) ...
Regular expression syntax cheatsheet - JavaScript
groups. In results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. This is usually just the order of the capturing groups themselves. This becomes important when capturing groups are nested. Matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined RegExp object's
properties ($1, ..., $9). Capturing groups have a performance penalty. If you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). String.match() won't return groups if the /.../g flag is set. However, you can still use String.matchAll() to get all matches. \n Where "n" is a positive integer. A back reference to the last substring matc...
...ame. For example, to extract the United States area code from a phone number, we could use /\((?<area>\d\d\d)\)/. The resulting number would appear under matches.groups.area. (?:x) Non-capturing group: Matches "x" but does not remember the match. The matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined RegExp object's
properties ($1, ..., $9). Quantifiers If you are looking to contribute to this document, please also edit the original article Note: In the following, item refers not only to singular characters, but also includes character classes, Unicode property escapes, groups and ranges. Characters Meaning x* Matches the preceding item "x" 0 or more times. For example, /bo*...
...e of the tokens listed in the Values section, below. Many values have aliases or shorthand (e.g. ...
Unicode property escapes - JavaScript
Unicode property escapes Regular Expressions allows for matching characters based on their Unicode
properties. A character is described by several
properties which are either binary ("boolean-like") or non-binary. For instance, unicode property escapes can be used to match emojis, punctuations, letters (even letters from specific languages or scripts), etc. Note: For Unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of Unicode code points. See also RegExp.prototype.unicode. Note: Some Unicode
properties encompasses much more characters than some character classes (such as \w which matches only latin letters, a to z) but the latter is better supported among browsers (as of January 2020). Syntax The following s...
...e of the tokens listed in the Values section, below. Many values have aliases or shorthand (e.g. the value Decimal_Number for the General_Category property may be written Nd, digit, or Decimal_Number). For most values, the UnicodePropertyName part and equals sign may be omitted. If a UnicodePropertyName is specified, the value must correspond to the property type given. Note: As there are many
properties and values available, we will not describe them exhaustively here but rather provide various examples Rationale Before ES2018 there was no performance-efficient way to match characters from different sets based on scripts (like Macedonian, Greek, Georgian etc.) or propertyName (like Emoji etc) in JavaScript. Check out tc39 Proposal on Unicode Property Escapes for more info. Examples General ...
...on of all the subcategories using short aliases) story.match(/\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}/gu); Scripts and script extensions Some languages use different scripts for their writing system. For instance, English and Spanish are written using the Latin script while Arabic and Russian are written with other scripts (respectively Arabic and Cyrillic). The Script and Script_Extensions Unicode
properties allow regular expression to match characters according to the script they are mainly used with (Script) or according to the set of scripts they belong to (Script_Extensions). For example, A belongs to the Latin script and ? to the Greek script. let mixedCharacters = "a??"; // Using the canonical "long" name of the script mixedCharacters.match(/\p{Script=Latin}/u); // a // Using a short alias ...
Memory Management - JavaScript
hms and their respective limitations. References The main concept that garbage collection algorithms rely on is the concept of reference. Within the context of memory management, an object is said to reference another object if the former has access to the latter (either implicitly or explicitly). For instance, a JavaScript object has a reference to its prototype (implicit reference) and to its
properties values (explicit reference). In this context, the notion of an "object" is extended to something broader than regular JavaScript objects and also contain function scopes (or the global lexical scope). Reference-counting garbage collection This is the most naive garbage collection algorithm. This algorithm reduces the problem from determining whether or not an object is still needed to determin...
...age collection algorithm. This algorithm reduces the problem from determining whether or not an object is still needed to determining if an object still has any other objects referencing it. An object is said to be "garbage", or collectible if there are zero references pointing to it. Example var x = { a: { b: 2 } }; // 2 objects are created. One is referenced by the other as one of its
properties. // The other is referenced by virtue of being assigned to the 'x' variable. // Obviously, none can be garbage-collected. var y = x; // The 'y' variable is the second thing that has a reference to the object. x = 1; // Now, the object that was originally in 'x' has a unique reference // embodied by the 'y' variable. var z = y.a; // Reference to 'a' property ...
...ver its 'a' property is still referenced by // the 'z' variable, so it cannot be freed. z = null; // The 'a' property of the object originally in x // has zero references to it. It can be garbage collected. Limitation: Circular references There is a limitation when it comes to circular references. In the following example, two objects are created with
properties that reference one another, thus creating a cycle. They will go out of scope after the function call has completed. At that point they become unneeded and their allocated memory should be reclaimed. However, the reference-counting algorithm will not consider them reclaimable since each of the two objects has at least one reference pointing to them, resulting in neither of them being marked for ga...
TypeError: can't define property "x": "obj" is not extensible - JavaScript
The JavaScript exception "can't define property "x": "obj" is not extensible" occurs when Object.preventExtensions() marked an object as no longer extensible, so that it will never have
properties beyond the ones it had at the time it was marked as non-extensible. Message TypeError: Cannot create property for a non-extensible object (Edge) TypeError: can't define property "x": "obj" is not extensible (Firefox) TypeError: Cannot define property: "x", object is not extensible. (Chrome) Error type TypeError What went wrong? Usually, an object is extensible and new
properties can be added to it. However, in this case Object.preventExtensions() marked an object as no longer extensible, so that it will never have
properties beyond the ones it had at the time it was marked as non-extensible. Examp...
...In sloppy mode, the addition of the "x" property is silently ignored. ...
...In sloppy mode, the addition of the "x" property is silently ignored. ...
SyntaxError: missing : after property id - JavaScript
var obj = { propertyKey: 'value' }; Examples Colons vs. ...
... var obj = { propertyKey: 'value' }; Examples Colons vs. equal signs This code fails, as the equal sign can't be used this way in this object initializer syntax. ...
... as the equal sign can't be used this way in this object initializer syntax. var obj = { propertyKey = 'value' }; // SyntaxError: missing : after property id Correct would be to use a colon, or to use square brackets to assign a new property after the object has been created already. var obj = { propertyKey: 'value' }; // or alternatively var obj = { }; obj['propertyKey'] = 'value'; Empty
properties You can't create empty
properties like this: var obj = { propertyKey; }; // SyntaxError: missing : after property id If you need to define a property without a value, you might use null as a value. var obj = { propertyKey: null }; Computed
properties If you create a property key from an expression, you need to use square brackets. Otherwise the property name can't be computed: var obj = {...
TypeError: "x" is read-only - JavaScript
The global variable or object property that was assigned to is a read-only property. ...
...ome) TypeError: Cannot assign to read only property '0' of [object Array] (Chrome) Error type TypeError What went wrong? The global variable or object property that was assigned to is a read-only property. (Technically, it is a non-writable data property.) This error happens only in strict mode code. In non-strict code, the assignment is silently ignored. Examples Invalid cases Read-only
properties are not super common, but they can be created using Object.defineProperty() or Object.freeze(). 'use strict'; var obj = Object.freeze({name: 'Elsa', score: 157}); obj.score = 0; // TypeError 'use strict'; Object.defineProperty(this, 'LUNG_COUNT', {value: 2, writable: false}); LUNG_COUNT = 3; // TypeError 'use strict'; var frozenArray = Object.freeze([0, 1, 2]); frozenArray[0]++; // TypeErro...
... be created using Object.defineProperty() or Object.freeze(). 'use strict'; var obj = Object.freeze({name: 'Elsa', score: 157}); obj.score = 0; // TypeError 'use strict'; Object.defineProperty(this, 'LUNG_COUNT', {value: 2, writable: false}); LUNG_COUNT = 3; // TypeError 'use strict'; var frozenArray = Object.freeze([0, 1, 2]); frozenArray[0]++; // TypeError There are also a few read-only
properties built into JavaScript. Maybe you tried to redefine a mathematical constant. 'use strict'; Math.PI = 4; // TypeError Sorry, you can't do that. The global variable undefined is also read-only, so you can't silence the infamous "undefined is not a function" error by doing this: 'use strict'; undefined = function() {}; // TypeError: "undefined" is read-only Valid cases 'use strict'; var obj...
The arguments object - JavaScript
. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description Note: If you're writing ES6 compatible code, then rest parameters should be preferred. Note: "Array-like" means that arguments has a length property and
properties indexed from zero, but it doesn't have Array's built-in methods like forEach() or map(). See ?Description for details. The arguments object is a local variable available within all non-arrow functions. You can refer to a function's arguments inside that function by using its arguments object. It has entries for each argument the function was called with, with the first entry's index at 0. For ...
...ument the function was called with, with the first entry's index at 0. For example, if a function is passed 3 arguments, you can access them as follows: arguments[0] // first argument arguments[1] // second argument arguments[2] // third argument Each argument can also be set or reassigned: arguments[1] = 'new value'; The arguments object is not an Array. It is similar, but lacks all Array
properties except length. For example, it does not have the pop() method. However, it can be converted to a real Array: var args = Array.prototype.slice.call(arguments); // Using an array literal is shorter than above but allocates an empty array var args = [].slice.call(arguments); As you can do with any Array-like object, you can use ES2015's Array.from() method or spread syntax to convert arguments t...
... want to count how many parameters a function is declared to accept, inspect that function's length property. Using typeof with arguments The typeof operator returns 'object' when used with arguments console.log(typeof arguments); // 'object' The type of individual arguments can be determined by indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument
Properties arguments.callee Reference to the currently executing function that the arguments belong to. Forbidden in strict mode. arguments.length The number of arguments that were passed to the function. arguments[@@iterator] Returns a new Array iterator object that contains the values for each index in arguments. Examples Defining a function that concatenates several strings This example defin...
Functions - JavaScript
Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value. In JavaScript, functions are first-class objects, because they can have
properties and methods just like any other object. What distinguishes them from other objects is that functions can be called. In brief, they are Function objects. For more examples and explanations, see also the JavaScript guide about functions. Description Every function in JavaScript is a Function object. See Function for information on
properties and methods of Function objects. To return a value other than ...
...or all other functions, the default return value is undefined. The parameters of a function call are the function's arguments. Arguments are passed to functions by value. If the function changes the value of an argument, this change is not reflected globally or in the calling function. ...
...The currently executing function. arguments.caller : The function that invoked the currently executing function. arguments.length: The number of arguments passed to the function. Defining method functions Getter and setter functions You can define getters (accessor methods) and setters (mutator methods) on any standard built-in object or user-defined object that supports the addition of new
properties. The syntax for defining getters and setters uses the object literal syntax. get Binds an object property to a function that will be called when that property is looked up. set Binds an object property to a function to be called when there is an attempt to set that property. Method definition syntax Starting with ECMAScript 2015, you are able to define own methods in a shorter syntax...
Intl.Collator.prototype.resolvedOptions() - JavaScript
The Intl.Collator.prototype.resolvedOptions() method returns a new object with
properties reflecting the locale and collation options computed during initialization of this Collator object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax collator.resolvedOptions() Return value A new object with
properties reflecting the locale and collation options computed during the initialization of the given Collator object. Description The resulting object has the following
properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 langua...
...scription The resulting object has the following
properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. usage sensitivity ignorePunctuation The values provided for these
properties in the options argument or filled in as defaults. collation The value requested using the Unicode extension key "co", if it is supported for locale, or "default". numeric caseFirst The values requested for these
properties in the options argument or using the Unicode extension keys "kn" and "kf" or filled in as defaults. ...
...vided for these
properties in the options argument or filled in as defaults. collation The value requested using the Unicode extension key "co", if it is supported for locale, or "default". numeric caseFirst The values requested for these
properties in the options argument or using the Unicode extension keys "kn" and "kf" or filled in as defaults. If the implementation does not support these
properties, they are omitted. Examples Using the resolvedOptions method var de = new Intl.Collator('de', { sensitivity: 'base' }) var usedOptions = de.resolvedOptions(); usedOptions.locale; // "de" usedOptions.usage; // "sort" usedOptions.sensitivity; // "base" usedOptions.ignorePunctuation; // false usedOptions.collation; // "default" usedOptions.numeric; ...
Intl.DateTimeFormat() constructor - JavaScript
, "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". ca Calendar. Possible values include: "buddhist", "chinese", "coptic", "ethiopia", "ethiopic", "gregory", "hebrew", "indian", "islamic", "iso8601", "japanese", "persian", "roc". hc Hour cycle. Possible values include: "h11", "h12", "h23", "h24". options Optional An object with some or all of the following
properties: dateStyle The date formatting style to use when calling format(). Possible values include: "full" "long" "medium" "short" timeStyle The time formatting style to use when calling format(). Possible values include: "full" "long" "medium" "short" fractionalSecondDigits The number of fractional seconds to apply when calling format(). Valid val...
...e "h11", "h12", "h23", or "h24". This option overrides the hc language tag, if both are present, and the hour12 option takes precedence in case both options have been specified. formatMatcher The format matching algorithm to use. Possible values are "basic" and "best fit"; the default is "best fit". See the following paragraphs for information about the use of this property. The following
properties describe the date-time components to use in formatted output, and their desired representations. Implementations are required to support at least the following subsets: weekday, year, month, day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute Implementations may support other subsets, and requests will ...
...entation of the minute. Possible values are "numeric", "2-digit". second The representation of the second. Possible values are "numeric", "2-digit". timeZoneName The representation of the time zone name. Possible values are: "long" (e.g., British Summer Time) "short" (e.g., GMT+1) The default value for each date-time component property is undefined, but if all component
properties are undefined, then year, month, and day are assumed to be "numeric". Examples Using DateTimeFormat In basic use without specifying a locale, DateTimeFormat uses the default locale and default options. var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0)); // toLocaleString without arguments depends on the implementation, // the default locale, and the default time zone console.log(new Int...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
The Intl.PluralRules.prototype.resolvedOptions() method returns a new object with
properties reflecting the locale and plural formatting options computed during initialization of this PluralRules object. Syntax pluralRule.resolvedOptions() Return value A new object with
properties reflecting the locale and plural formatting options computed during the initialization of the given PluralRules object. Description The resulting object has the following
properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralCategories An Array of plural categories used by the given loc...
...e requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralCategories An Array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other". type The type used (cardinal or ordinal). Only one of the following two groups of
properties is included: minimumIntegerDigits minimumFractionDigits maximumFractionDigits The values provided for these
properties in the options argument or filled in as defaults. These
properties are present only if neither minimumSignificantDigits nor maximumSignificantDigits was provided in the options argument. minimumSignificantDigits maximumSignificantDigits The values provided for these prop...
...aximumFractionDigits The values provided for these
properties in the options argument or filled in as defaults. These
properties are present only if neither minimumSignificantDigits nor maximumSignificantDigits was provided in the options argument. minimumSignificantDigits maximumSignificantDigits The values provided for these
properties in the options argument or filled in as defaults. These
properties are present only if at least one of them was provided in the options argument. Examples Using the resolvedOptions method var de = new Intl.PluralRules('de-DE'); var usedOptions = de.resolvedOptions(); usedOptions.locale; // "de-DE" usedOptions.maximumFractionDigits; // 3 usedOptions.minimumFractionDigits; // 0 usedOptions.minimumIntegerDigits; // 1 usedOptions.pluralCategorie...
JSON - JavaScript
Description JavaScript and JSON differences JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. It is based upon JavaScript syntax but is distinct from it: some JavaScript is not JSON. Objects and Arrays Property names must be double-quoted strings; trailing commas are forbidden. Numbers Leading zeros are prohibited. ...
... no whitespace) or JSONString (where it is interpreted as the corresponding character in the string, or would cause an error). The tab character (U+0009), carriage return (U+000D), line feed (U+000A), and space (U+0020) characters are the only valid whitespace characters. Static methods JSON.parse(text[, reviver]) Parse the string text as JSON, optionally transform the produced value and its
properties, and return the value. Any violations of the JSON syntax, including those pertaining to the differences between JavaScript and JSON, cause a SyntaxError to be thrown. The reviver option allows for interpreting what the replacer has used to stand in for other datatypes. JSON.stringify(value[, replacer[, space]]) Return a JSON string corresponding to the specified value, optionally including only...
...urn the value. Any violations of the JSON syntax, including those pertaining to the differences between JavaScript and JSON, cause a SyntaxError to be thrown. The reviver option allows for interpreting what the replacer has used to stand in for other datatypes. JSON.stringify(value[, replacer[, space]]) Return a JSON string corresponding to the specified value, optionally including only certain
properties or replacing property values in a user-defined manner. By default, all instances of undefined are replaced with null, and other unsupported native data types are censored. The replacer option allows for specifying other behavior. Examples Example JSON { "browsers": { "firefox": { "name": "Firefox", "pref_url": "about:config", "releases": { "1": { "rel...
Number - JavaScript
converts a string or other value to the Number type. If the value can't be converted, it returns NaN. Literal syntax 123 // one-hundred twenty-three 123.0 // same 123 === 123.0 // true Function syntax Number('123') // returns the number 123 Number('123') === 123 // true Number("unicorn") // NaN Number(undefined) // NaN Constructor Number() Creates a new Number value. Static
properties Number.EPSILON The smallest interval between two representable numbers. Number.MAX_SAFE_INTEGER The maximum safe integer in JavaScript (253 - 1). Number.MAX_VALUE The largest positive representable number. Number.MIN_SAFE_INTEGER The minimum safe integer in JavaScript (-(253 - 1)). Number.MIN_VALUE The smallest positive representable number--that is, the positive number closest to zer...
...er.MIN_VALUE The smallest positive representable number--that is, the positive number closest to zero (without actually being zero). Number.NaN Special "Not a Number" value. Number.NEGATIVE_INFINITY Special value representing negative infinity. Returned on overflow. Number.POSITIVE_INFINITY Special value representing infinity. Returned on overflow. Number.prototype Allows the addition of
properties to the Number object. Static methods Number.isNaN() Determine whether the passed value is NaN. Number.isFinite() Determine whether the passed value is a finite number. Number.isInteger() Determine whether the passed value is an integer. Number.isSafeInteger() Determine whether the passed value is a safe integer (number between -(253 - 1) and 253 - 1). Number.parseFloat(string) This ...
...ng([radix]) Returns a string representing the specified object in the specified radix ("base"). Overrides the Object.prototype.toString() method. Number.prototype.valueOf() Returns the primitive value of the specified object. Overrides the Object.prototype.valueOf() method. Examples Using the Number object to assign values to numeric variables The following example uses the Number object's
properties to assign values to several numeric variables: const biggestNum = Number.MAX_VALUE const smallestNum = Number.MIN_VALUE const infiniteNum = Number.POSITIVE_INFINITY const negInfiniteNum = Number.NEGATIVE_INFINITY const notANum = Number.NaN Integer range for Number The following example shows the minimum and maximum integer values that can be represented as Number object. (Mor...
Object.entries() - JavaScript
The order of the array returned by Object.entries() does not depend on how an object is defined. If there is a need for certain ordering, then the array should be sorted first, like Object.entries(obj).sort((a, b) => b[0].localeCompare(a[0]));. ...
... obj The object whose own enumerable string-keyed property [key, value] pairs are to be returned. Return value An array of the given object's own enumerable string-keyed property [key, value] pairs. Description Object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object. The ordering of the
properties is the same as that given by looping over the property values of the object manually. Polyfill To add compatible Object.entries() support in older environments that do not natively support it, you can use any of the following: a demonstration implementation of Object.entries in the tc39/proposal-object-values-entries (if you don't need any support for IE); a polyfill in the es-shims/Object.
... property which isn't enumerable const myObj = Object.create({}, { getFoo: { value() { return this.foo; } } }); myObj.foo = 'bar'; console.log(Object.entries(myObj)); // [ ['foo', 'bar'] ] // non-object argument will be coerced to an object console.log(Object.entries('foo')); // [ ['0', 'f'], ['1', 'o'], ['2', 'o'] ] // returns an empty array for any primitive type, since primitives have no own
properties console.log(Object.entries(100)); // [ ] // iterate through key-value gracefully const obj = { a: 5, b: 7, c: 9 }; for (const [key, value] of Object.entries(obj)) { console.log(`${key} ${value}`); // "a 5", "b 7", "c 9" } // Or, using array extras Object.entries(obj).forEach(([key, value]) => { console.log(`${key} ${value}`); // "a 5", "b 7", "c 9" }); Converting an Object to a Map The n...
Object.isSealed() - JavaScript
ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.isSealed(obj) Parameters obj The object which should be checked. Return value A Boolean indicating whether or not the given object is sealed. Description Returns true if the object is sealed, otherwise false. An object is sealed if it is not extensible and if all its
properties are non-configurable and therefore not removable (but not necessarily non-writable). Examples Using Object.isSealed // Objects aren't sealed by default. var empty = {}; Object.isSealed(empty); // === false // If you make an empty object non-extensible, // it is vacuously sealed. Object.preventExtensions(empty); Object.isSealed(empty); // === true // The same is not true of a non-empty object...
...rable and therefore not removable (but not necessarily non-writable). Examples Using Object.isSealed // Objects aren't sealed by default. var empty = {}; Object.isSealed(empty); // === false // If you make an empty object non-extensible, // it is vacuously sealed. Object.preventExtensions(empty); Object.isSealed(empty); // === true // The same is not true of a non-empty object, // unless its
properties are all non-configurable. var hasProp = { fee: 'fie foe fum' }; Object.preventExtensions(hasProp); Object.isSealed(hasProp); // === false // But make them all non-configurable // and the object becomes sealed. Object.defineProperty(hasProp, 'fee', { configurable: false }); Object.isSealed(hasProp); // === true // The easiest way to seal an object, of course, // is Object.seal. var sealed = {}...
...alse }); Object.isSealed(hasProp); // === true // The easiest way to seal an object, of course, // is Object.seal. var sealed = {}; Object.seal(sealed); Object.isSealed(sealed); // === true // A sealed object is, by definition, non-extensible. Object.isExtensible(sealed); // === false // A sealed object might be frozen, // but it doesn't have to be. Object.isFrozen(sealed); // === true // (all
properties also non-writable) var s2 = Object.seal({ p: 3 }); Object.isFrozen(s2); // === false // ('p' is still writable) var s3 = Object.seal({ get p() { return 0; } }); Object.isFrozen(s3); // === true // (only configurability matters for accessor
properties) Non-object coercion In ES5, if the argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-ob...
Object.prototype.propertyIsEnumerable() - JavaScript
ntax obj.propertyIsEnumerable(prop) Parameters prop The name of the property to test. Return value A Boolean indicating whether the specified property is enumerable and is the object's own property. Description Every object has a propertyIsEnumerable method. This method can determine whether the specified property in an object can be enumerated by a for...in loop, with the exception of
properties inherited through the prototype chain. If the object does not have the specified property, this method returns false. Examples A basic use of propertyIsEnumerable The following example shows the use of propertyIsEnumerable on objects and arrays: var o = {}; var a = []; o.prop = 'is enumerable'; a[0] = 'is enumerable'; o.propertyIsEnumerable('prop'); // returns true a.propertyIsEnumerable(0...
...propertyIsEnumerable The following example shows the use of propertyIsEnumerable on objects and arrays: var o = {}; var a = []; o.prop = 'is enumerable'; a[0] = 'is enumerable'; o.propertyIsEnumerable('prop'); // returns true a.propertyIsEnumerable(0); // returns true User-defined vs. built-in objects The following example demonstrates the enumerability of user-defined vs. ...
... User-defined vs. built-in objects The following example demonstrates the enumerability of user-defined vs. built-in
properties: var a = ['is enumerable']; a.propertyIsEnumerable(0); // returns true a.propertyIsEnumerable('length'); // returns false Math.propertyIsEnumerable('random'); // returns false this.propertyIsEnumerable('Math'); // returns false Direct vs. ...
Reflect - JavaScript
Reflect is a built-in object that provides methods for interceptable JavaScript operations. The methods are the same as those of proxy handlers. Reflect is not a function object, so it's not constructible. Description Unlike most global objects, Reflect is not a constructor. You cannot use it with a new operator or invoke the Reflect object as a function. All
properties and methods of Reflect are static (just like the Math object). The Reflect object provides the following static functions which have the same names as the proxy handler methods. Some of these methods are also the same as corresponding methods on Object, although they do have some subtle differences between them. Static methods Reflect.apply(target, thisArgument, argumentsList) Calls a target function with arguments as speci...
...sExtensible(). Returns a Boolean that is true if the target is extensible. Reflect.ownKeys(target) Returns an array of the target object's own (not inherited) property keys. Reflect.preventExtensions(target) Similar to Object.preventExtensions(). Returns a Boolean that is true if the update was successful. Reflect.set(target, propertyKey, value[, receiver]) A function that assigns values to
properties. ...
... the update was successful. Reflect.set(target, propertyKey, value[, receiver]) A function that assigns values to
properties. Returns a Boolean that is true if the update was successful. Reflect.setPrototypeOf(target, prototype) A function that sets the prototype of an object. Returns a Boolean that is true if the update was successful. ...
RegExp - JavaScript
from another") when the first argument is a RegExp and the second flags argument is present. A new RegExp from the arguments is created instead. When using the constructor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary. ...
...RegExp and the second flags argument is present. A new RegExp from the arguments is created instead. When using the constructor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary. For example, the following are equivalent: let re = /\w+/ let re = new RegExp('\\w+') Perl-like RegExp
properties Note that several of the RegExp
properties have both long and short (Perl-like) names. Both names always refer to the same value. (Perl is the programming language from which JavaScript modeled its regular expressions.). See also deprecated RegExp
properties. Constructor RegExp() Creates a new RegExp object. Static
properties get RegExp[@@species] The constructor function that is used to create derived objects. RegExp.lastInde...
... RegExp.prototype.dotAll Whether . matches newlines or not. ...
Iteration protocols - JavaScript
. Whenever an object needs to be iterated (such as at the beginning of a for...of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated. Note that when this zero-argument function is called, it is invoked as a method on the iterable object. Therefore inside of the function, the this keyword can be used to access the
properties of the iterable object, to decide what to provide during the iteration. This function can be an ordinary function, or it can be a generator function, so that when invoked, an iterator object is returned. Inside of this generator function, each entry can be provided by using yield. The iterator protocol The iterator protocol defines a standard way to produce a sequence of values (either finite ...
...The iterator protocol defines a standard way to produce a sequence of values (either finite or infinite), and potentially a return value when all values have been generated. An object is an iterator when it implements a next() method with the following semantics: Property Value next() A zero-argument function that returns an object with at least the following two
properties: done (boolean) Has the value false if the iterator was able to produce the next value in the sequence. (This is equivalent to not specifying the done property altogether.) Has the value true if the iterator has completed its sequence. In this case, value optionally specifies the return value of the iterator. value Any JavaScript value returned by the iterator.
...n the sequence. (This is equivalent to not specifying the done property altogether.) Has the value true if the iterator has completed its sequence. In this case, value optionally specifies the return value of the iterator. value Any JavaScript value returned by the iterator. Can be omitted when done is true. The next() method must always return an object with appropriate
properties including done and value. If a non-object value gets returned (such as false or undefined), a TypeError ("iterator.next() returned a non-object value") will be thrown. Note: It is not possible to know reflectively whether a particular object implements the iterator protocol. However, it is easy to create an object that satisfies both the iterator and iterable protocols (as shown in th...
Property accessors - JavaScript
However, the property/method distinction is little more than a convention. ...
...xample is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax object.property object['property'] Description One can think of an object as an associative array (a.k.a. map, dictionary, hash, lookup table). The keys in this array are the names of the object's
properties. It's typical when speaking of an object's
properties to make a distinction between
properties and methods. However, the property/method distinction is little more than a convention. A method is simply a property that can be called (for example, if it has a reference to a Function instance as its value). There are two ways to access
properties: dot notation and bracket notation. Dot notation ...
...For example, object.$1 is valid, while object.1 is not. ...
var - JavaScript
rty of the global object. This means its property descriptor cannot be changed and it cannot be deleted using delete. The corresponding name is also added to a list on the internal [[VarNames]] slot on the global environment record (which forms part of the global lexical environment). The list of names in [[VarNames]] enables the runtime to distinguish between global variables and straightforward
properties on the global object. The property created on the global object for global variables, is set to be non-configurable because the identifier is to be treated as a variable, rather than a straightforward property of the global object. JavaScript has automatic memory management, and it would make no sense to be able to use the delete operator on a global variable. 'use strict'; var x = 1; globalThi...
...or on a global variable. 'use strict'; var x = 1; globalThis.hasOwnProperty('x'); // true delete globalThis.x; // TypeError in strict mode. Fails silently otherwise. delete x; // SyntaxError in strict mode. Fails silently otherwise. Note that in both NodeJS CommonJS modules and native ECMAScript modules, top-level variable declarations are scoped to the module, and are not, therefore added as
properties to the global object. Unqualified identifier assignments The global object sits at the top of the scope chain. When attempting to resolve a name to a value, the scope chain is searched. This means that
properties on the global object are conveniently visible from every scope, without having to qualify the names with globalThis. or window. or global.. So you can just type: function foo() { S...
... you want to create a property with that name on the global object. foo = 'f' // In non-strict mode, assumes you want to create a property named `foo` on the global object globalThis.hasOwnProperty('foo') // true In ECMAScript 5, this behavior was changed for strict mode. Assignment to an unqualified identifier in strict mode will result in a ReferenceError, to avoid the accidental creation of
properties on the global object. Note that the implication of the above, is that, contrary to popular misinformation, JavaScript does not have implicit or undeclared variables, it merely has a syntax that looks like it does. var hoisting Because variable declarations (and declarations in general) are processed before any code is executed, declaring a variable anywhere in the code is equivalent to declari...
JavaScript reference - JavaScript
This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference. Built-ins JavaScript standard built-in objects, along with their methods and
properties. ...
... This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference. Built-ins JavaScript standard built-in objects, along with their methods and
properties. ...
... This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference. Built-ins JavaScript standard built-in objects, along with their methods and
properties. ...
The "codecs" parameter in common media types - Web media technologies
mas. audio/ogg; codecs=vorbis An Ogg file containing a Vorbis audio track. video/webm; codecs="vp8, vorbis" A WebM file containing VP8 video and/or Vorbis audio. video/mp4; codecs="avc1.4d002a" An MPEG-4 file containing AVC (H.264) video, Main Profile, Level 4.2. As is the case with any MIME type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the
properties of the codec use special characters which must be percent-encoded per RFC 2231, section 4: MIME Parameter Value and Encoded Word Extensions. You can use the JavaScript encodeURI() function to encode the parameter list; similarly, you can use decodeURI() to decode a previously encoded parameter list. When the codecs parameter is used, the specified list of codecs must include every codec used fo...
...ils. T The one-character tier indicator. For the Main tier (seq_tier equals 0), this character is the letter M. For the High tier (seq_tier is 1), this character is the letter H. The High tier is only available for level 4.0 and up. DD The two-digit component bit depth. This value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other
properties. M The one-digit monochrome flag; if this is 0, the video includes the U and V planes in addition to the Y plane. Otherwise, the video data is entirely in the Y plane and is therefore monochromatic. See YUV in Digital video concepts for details on how the YUV color system works. The default value is 0 (not monochrome). CCC CCC indicates the chroma subsampling as three...
...ome example AV1 codec strings: av01.2.15M.10.0.100.09.16.09.0 AV1 Professional Profile, level 5.3, Main tier, 10 bits per color component, 4:2:2 chroma subsampling using ITU-R BT.2100 color primaries, transfer characteristics, and YCbCr color matrix. The studio swing representation is indicated. av01.0.15M.10 AV1 Main Profile, level 5.3, Main tier, 10 bits per color component. The remaining
properties are taken from the defaults: 4:2:0 chroma subsampling, BT.709 color primaries, transfer characteristics, and matrix coefficients. Studio swing representation. ISO Base Media File Format: MP4, QuickTime, and 3GP All media types based upon the ISO Base Media File Format (ISO BMFF) share the same syntax for the codecs parameter. These media types include MPEG-4 (and, in fact, the QuickTime file f...
Populating the page: how browsers work - Web Performance
TML and CSS, the preload scanner will find the scripts and image, and start downloading them as well. To ensure the script doesn't block the process, add the async attribute, or the defer attribute if JavaScript parsing and execution order is not important. 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. Building the CSSOM The second step in the critical rendering path is processing CSS and building the CSSOM tree. The CSS object model is similar to the DOM. The DOM and CSSOM are both trees. They are independent data structures. The browser converts the CSS rules into a map of styles it can understand and work with. The browser goes through each rule set in the CSS, creatin...
...p preferences mean an unlimited number of differing viewport sizes. In this phase, taking the viewport size into consideration, the browser determines what the dimensions of all the different boxes are going to be on the screen. 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. The first time the size and position of nodes are determined is called layout. Subsequent recalculations of node size and locations are called reflows. In our example, suppose the initial layout occurs before the image is returned. Since we didn't declare the size of our image, there will be...
...ickly. To ensure repainting can be done even faster than the initial paint, the drawing to the screen is generally broken down into several layers. If this occurs, then compositing is necessary. Painting can break the elements in the layout tree into layers. Promoting content into layers on the GPU (instead of the main thread on the CPU) improves paint and repaint performance. There are specific
properties and elements that instantiate a layer, including <video> and <canvas>, and any element which has the CSS
properties of opacity, a 3D transform, will-change, and a few others. These nodes will be painted onto their own layer, along with their descendants, unless a descendant necessitates its own layer for one (or more) of the above reasons. Layers do improve performance, but are expensive when it...
Graphic design for responsive sites - Progressive web apps (PWAs)
ed in. high res and low res image copies One option here is to create a hi res and a low res set of images, then use resolution media queries to serve the hi res images only to hi res devices. Programmatic images You should also try to use programmatic/vector graphics as much as possible, as they theoretically scale infinitely so will still look crisp at high resolutions. ...
...ges You should also try to use programmatic/vector graphics as much as possible, as they theoretically scale infinitely so will still look crisp at high resolutions. 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. The downsides here are that CSS3
properties and SVG don't work on old browsers such as IE6-8 (although Polyfills are available, and you could build in fallbacks), and SVG isn't suitable for high detail images, such as photographs. ...
...Making your own font file can be a bit fiddly, but there are a number of good icon font services available such as font awesome. ...
Media - Progressive web apps (PWAs)
Information: Media The purpose of CSS is to specify how content is presented to the user. This presentation can take more than one form. For example, you are probably reading this on a device with a display. But you might also want to project it to a big screen for a large audience, or you might want to print it. These different media have different characteristics. CSS has the capacity to present content according to the media type. ...
... @page:right. For print media, you normally use appropriate length units like inches (in) and points (pt = 1/72 inch), or centimeters (cm) and millimeters (mm). It is equally appropriate to use ems (em) to match the font size, and percentages (%). You can control how the content of the document breaks across page boundaries, by using the page-break-before, page-break-after and page-break-inside
properties. Example This rule sets the page margins to one inch on all four sides: @page {margin: 1in;} This rule ensures that every H1 element starts on a new page: h1 {page-break-before: always;} More details For full details of CSS support for paged media, see Paged media in the CSS Specification. Like other features of CSS, printing depends on browser choice and its settings. For example, t...
... CSS Specification. Like other features of CSS, printing depends on browser choice and its settings. For example, the Mozilla browser supplies default margins, headers, and footers for printing. Keep in mind that you can't completely control the printed format. It is impossible to anticipate every user's browser choice and settings at the time of printing. User interfaces CSS has some special
properties for devices that support a user interface, like computer displays. These
properties dynamically change the appearance of content as the user works with the interface. There are five special selectors: Selector Selects E:hover Any E element that has the pointer over it E:focus Any E element that has keyboard focus E:active The E element that is inv...
x - SVG: Scalable Vector Graphics
Yes Note: Starting with SVG2, x is a Geometry Property meaning this attribute can also be used as a CSS property for <svg>. text For <text>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, x defines the x coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value 0 ...
... stroke: red; stroke-width: .5px; stroke-dasharray: 2px; } tref Warning: As of SVG2 <tref> is deprecated and shouldn't be used. For <tref>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, x defines the x coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value 0 ...
...es are ignored. Value List of (<length> | <percentage>) Default value 0 Animatable Yes tspan For <tspan>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, x defines the x coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value none ...
y - SVG: Scalable Vector Graphics
Yes Note: Starting with SVG2, y is a Geometry Property meaning this attribute can also be used as a CSS property for <svg>. text For <text>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, y defines the y coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value 0 ...
... stroke: red; stroke-width: .5px; stroke-dasharray: 2px; } tref Warning: As of SVG2 <tref> is deprecated and shouldn't be used. For <tref>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, y defines the y coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value 0 ...
...es are ignored. Value List of (<length> | <percentage>) Default value 0 Animatable Yes tspan For <tspan>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. The content text position is usualy a point on the baseline of the first line of text. The exact content text position is influenced by some
properties like text-anchor, or direction. If there are multiple values, y defines the y coordinate of each individual glyph from the text. If there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. If there are more values than glyphes, extra values are ignored. Value List of (<length> | <percentage>) Default value none ...
selection - Archive of obsolete content
election has been made."); } var selection = require("sdk/selection"); selection.on('select', myListener); // You can remove listeners too. selection.removeListener('select', myListener); Iterating Over Discontiguous Selections Discontiguous selections can be accessed by iterating over the selection module itself. Each iteration yields a Selection object from which text, html, and isContiguous
properties can be accessed. Private Windows If your add-on has not opted into private browsing, then you won't see any selections made in tabs that are hosted by private browser windows. To learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. Examples Log the current contiguous selection as t...
...Setting the selection removes all current selections, inserts the specified text at the location of the first selection, and selects the new text. Getting the selection when there is no current selection returns null. Setting the selection when there is no current selection throws an exception. Getting the selection when isContiguous is tru...
simple-prefs - Archive of obsolete content
an. { "description": "Does it have tentacles?", "type": "bool", "name": "hasTentacles", "value": true, "title": "Tentacles" } boolint Displayed as a checkbox and stores an integer. A boolint is presented to the user as a checkbox, but instead of storing true or false, the "on" or "off" checkbox states are mapped to integers using "on" or "off"
properties in the specification. To provide this mapping the boolint requires two mandatory attributes called "on" and "off", both of which are supplied as strings. Note that even so, the "value" property is supplied as an integer. { "type": "boolint", "name": "myBoolint", "on": "1", "off": "2", "value": 1, "title": "My Boolint" } integer Display...
... Parameters prefName : String The name of the preference to watch for changes. listener : Function The listener function that processes the event. removeListener(prefName, listener) Unregisters an event listener for the specified preference. Parameters prefName : String The name of the preference to watch for changes. listener : Function The listener function that processes the event.
Properties prefs This property is an object containing the simple-prefs you have defined for your add-on. You can use it to access preference values and to change them. Suppose you've defined a preference like this: "preferences": [{ "name": "somePreference", "title": "Some preference title", "description": "Some short description for the preference", "type": "string", "va...
url - Archive of obsolete content
; // "co.uk" console.log(urls.getTLD("https://developer.mozilla.org/")); // "org" Parameters url : string The URL, as a string. Returns string : The top-level domain for the URL. URL Methods toString() Returns a string representation of the URL. Returns string : The URL as a string. toJSON() Returns a string representation of the URL. Returns string : The URL as a string.
Properties scheme The name of the protocol in the URL, without the trailing ':'. Compare with protocol. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.scheme); // https userPass The username:password part of the URL, null if not present. host The host of the URL, null if not present. For example: var url = require...
.... Mirrors window.location.search. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.search); // ?example=true&visible=yes DataURL Methods toString() Returns a string representation of the Data URL. If base64 is true, the data property is encoded using base-64 encoding. Returns string : The URL as a string.
Properties mimeType The MIME type of the data. By default is an empty string. parameters An hashmap that contains the parameters of the Data URL. By default is an empty object. base64 Defines the encoding for the value in data property. data The string that contains the data in the Data URL. If the uri given to the constructor contains base64 parameter, this string is decoded. ...
widget - Archive of obsolete content
he listener function that was registered. getView(window) Retrieve a WidgetView instance of this widget relative to a browser window. Parameters window : BrowserWindow The BrowserWindow instance to match. Returns WidgetView : A WidgetView instance associated with the browser window. Any changes subsequently applied to this object will only be applied to the widget attached to that window.
Properties label The widget's label. Read-only. content A string containing the widget's content. It can contain HTML. Setting it updates the widget's appearance immediately. However, if the widget was created using contentURL, then this property is meaningless, and setting it has no effect. contentURL The URL of content to load into the widget. This can point to local content loaded from your add-on'...
...n event listener with the widget view. Parameters type : string The type of event to listen for. listener : function The listener function that handles the event. removeListener(type, listener) Unregisters an event listener from the widget view. Parameters type : string The type of event for which listener was registered. listener : function The listener function that was registered.
Properties label The widget view's label. Read-only. content A string containing the widget view's content. It can contain HTML. Setting it updates the widget view's appearance immediately. However, if the widget view was created using contentURL, then this property is meaningless, and setting it has no effect. contentURL The URL of content to load into the widget. This can point to local content load...
content/loader - Archive of obsolete content
Provides one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod. Usage The module exports a constructor for the Loader object, which inherits on(), once(), and removeListener() functions that enable its users to listen to events. Loader adds code to initialize and validate a set of
properties for managing content scripts: contentURL contentScript contentScriptFile contentScriptWhen contentScriptOptions allow When certain of these
properties are set, the Loader emits a propertyChange event, enabling its users to take the appropriate action. The Loader is used by modules that use content scripts but don't themselves load content, such as page-mod. Modules that load their own content, such as panel and page-worker...
...Content scripts specified by this property are loaded before those specified by the contentScript property. contentScript The texts of content scripts to load. Content scripts specified by this property are loaded after those specified by the contentScriptFile property. contentScriptWhen When to load the content scripts. This...
content/worker - Archive of obsolete content
the contentScriptFile option. Optional. onMessage function Functions that will registered as a listener to a 'message' events. onError function Functions that will registered as a listener to an 'error' events. Worker Worker is composed from the EventEmitter trait, therefore instances of Worker and their descendants expose all the public
properties exposed by EventEmitter along with additional public
properties that are listed below. Methods postMessage(data) Asynchronously emits "message" events in the enclosed worker, where content script was loaded. Parameters data : number,string,JSON The data to send. Must be stringifiable to JSON. destroy() Destroy the worker by removing the content script from the page and removing all regist...
...es that are listed below. Methods postMessage(data) Asynchronously emits "message" events in the enclosed worker, where content script was loaded. Parameters data : number,string,JSON The data to send. Must be stringifiable to JSON. destroy() Destroy the worker by removing the content script from the page and removing all registered listeners. A detach event is fired just before removal.
Properties port Object that allows you to: send customized messages to the worker using the port.emit function receive events from the worker using the port.on function url The URL of the content. tab If this worker is attached to a content document, returns the related tab. Events message This event allows the content worker to receive messages from its associated content scripts. Calling the...
event/target - Archive of obsolete content
objects in SDK on which events are emitted. Also see the tutorial on implementing event targets to get started with this API. Instantiation It's easy to create event target objects, no special arguments are required. const { EventTarget } = require("sdk/event/target"); let target = EventTarget(); For a convenience though optional options arguments may be used, in which case all the function
properties with keys like: onMessage, onMyEvent... will be auto registered for associated 'message', 'myEvent' events on the created instance. All other
properties of options will be ignored. Adding listeners EventTarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onMessage(message) { // Note: `this` pseudo va...
...ir methods chained: target.on('message', handleMessage) .on('data', parseData) .on('error', handleError); EventTarget EventTarget is an exemplar for creating an objects that can be used to add / remove event listeners on them. Events on these objects may be emitted via emit function exported by event/core module. Methods initialize() Method initializes this event source. It goes through
properties of a given options and registers listeners for the ones that look like event listeners. on(type, listener) Registers an event listener that is called every time events of specified type are emitted. worker.on('message', function (data) { console.log('data received: ' + data) }); Parameters type : String The type of event. listener : Function The listener function that processes the even...
io/text-streams - Archive of obsolete content
TextReader Methods close() Closes both the stream and its backing stream. read(numChars) Reads and returns a string from the stream. If the stream is closed, an exception is thrown. Parameters numChars : number The number of characters to read. If not given, the remainder of the stream is read. Returns string : The string read. If the stream is at the end, the empty string is returned.
Properties closed True if the stream is closed. TextWriter Methods close() Flushes the backing stream's buffer and closes both the stream and the backing stream. If the stream is already closed, an exception is thrown. flush() Flushes the backing stream's buffer. write(str) Writes a string to the stream. If the stream is closed, an exception is thrown. Parameters str : string The string to writ...
...ing stream are closed, also on the background thread. If the stream is already closed, an exception is thrown immediately. Parameters str : string The string to write. callback : callback callback, if given, must be a function. It's called as callback(error) when the write completes. error is an Error object or undefined if there was no error. Inside callback, this is the TextWriter object.
Properties closed True if the stream is closed. ...
system/xul-app - Archive of obsolete content
For more information, see the MDN documentation. Globals Functions is(name) Checks whether the host application is the given application. Parameters name : string A host application name. Returns boolean : True if the host application is name and false otherwise. isOneOf(names) Checks whether the host application is one of the given applications. Parameters names : array An array of host application names. ...
...entation for details on version comparisons. Parameters version : string The version to compare. lowInclusive : string The lower bound of the version range to compare. The range includes this bound. highExclusive : string The upper bound of the version range to compare. The range does not include this bound. Returns boolean : True if version falls in the given range and false otherwise.
Properties ID The GUID of the host application. For example, for Firefox this value is "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}". name The host application name. The possible values here are: "Firefox" "Fennec" "Mozilla" "SeaMonkey" "Sunbird" "Thunderbird" "Firefox"and"Fennec"` are the most commonly used values. version The host application version. platformVersion The Gecko/XULRunner platf...
ui/toolbar - Archive of obsolete content
The event the listener is listening for. Toolbar supports the following events: attach, detach, show, and hide. listener : function The listener to remove. destroy() Destroys the toolbar. After calling this function, the toolbar will no longer be visible and its menu item will no longer appear in the Firefox "Toolbars" menu. Calling this function also causes the detach event to be emitted.
Properties title The toolbar's title. This is read-only and must be unique. It's also not available until after the attach event is emitted. items The array of frames hosted by this toolbar. This property is read-only and is not available until after the attach event is emitted. hidden Boolean indicating whether the toolbar is hidden. This property is read-only and is not available until after the att...
...ted. hidden Boolean indicating whether the toolbar is hidden. This property is read-only and is not available until after the attach event is emitted. Events attach This event is emitted when the toolbar is first loaded. Note that since there is only one toolbar for the whole browser, opening another browser window does not cause this event to be emitted again. ...
window/utils - Archive of obsolete content
nt and an optional hash of options as its second argument. var { open } = require('sdk/window/utils'); var window = open('data:text/html,Hello Window'); This function wraps nsIWindowWatcher.openWindow. Parameters uri : string URI of the document to be loaded into the window. Only chrome, resource, and data schemes are accepted. options : object Options for the function, with the following
properties: Name Type parent nsIDOMWindow Parent for the new window. Optional, defaults to null. name string Name that is assigned to the window. Optional, defaults to null. features object Map of features to set for the window, defined like this: { width: 10, height: 15, chrome: true }. See the window.open features documentation f...
... args object Extra argument(s) to be attached to the new window as the window.arguments property. Returns nsIDOMWindow openDialog(options) Opens a top level window and returns its nsIDOMWindow representation. This is the same as open, but you can supply more features. It wraps window.openDialog. Parameters options : object Options for the function, with the following
properties: Name Type url string URI of the document to be loaded into the window. Defaults to "chrome://browser/content/browser.xul". name string Optional name that is assigned to the window. Defaults to "_blank". features string Map of features to set for the window, defined like: { width: 10, height: 15, chrome: true }. For the ...
File I/O - Archive of obsolete content
Getting files in special directories Components.utils.import("resource://gre/modules/FileUtils.jsm"); // get the "data.txt" file in the profile directory var file = FileUtils.getFile("ProfD", ["data.txt"]); Or the same without using FileUtils.jsm: // Get profile directory. var file = Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsI
Properties). get("ProfD", Components.interfaces.nsIFile); // Or using Services.jsm and Ci = Components.interfaces var file = Services.dirsvc.get("ProfD", Ci.nsIFile); // Append the file name. file.append("data.txt"); // Note: "file" is an object that implements nsIFile. If you want the // file system path, use file.path Note: file is an object that implements nsIFile. If you want the file s...
...mozilla.org/network/safe-file-output-stream;1"]. createInstance(Components.interfaces.nsIFileOutputStream); stream.init(aFile, 0x04 | 0x08 | 0x20, 0600, 0); // readwrite, create, truncate stream.write(pngBinary, pngBinary.length); if (stream instanceof Components.interfaces.nsISafeOutputStream) { stream.finish(); } else { stream.close(); } More There are more methods and
properties on nsIFile and nsILocalFile interfaces; please refer to their documentation for more details. Those methods/
properties are mostly self-explanatory, so we haven't included examples of using them here. ...
Sidebar - Archive of obsolete content
have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and closing with which ever extension going last "winning". Web panels sidebar Content such as web pages can be safely loaded as sidebar in the "viewWebPanelsSidebar". Bookmarks with "Load this bookmark in sidebar" checked in the
properties open in the "viewWebPanelsSidebar". A web page can use window.sidebar to create bookmark with that property. To open a page in the "viewWebPanelsSidebar" from chrome code (browser/addon/extension) such as from menuitem, it can call: openWebPanel(aTitle, aURI); Accessing the sidebar from a browser.xul script The sidebar content is always in a document separate from the main browser document (t...
...sidebar from a browser.xul script The sidebar content is always in a document separate from the main browser document (the sidebar is actually implemented as a XUL browser element). This means you can't directly access the sidebar content from a script referenced from a browser.xul overlay. To access your sidebar's window or document objects, you need to use the contentWindow or contentDocument
properties of document.getElementById("sidebar") respectively. For example the code below calls a function defined in the sidebar's context: var sidebarWindow = document.getElementById("sidebar").contentWindow; // Verify that our sidebar is open at this moment: if (sidebarWindow.location.href == "chrome://yourextension/content/whatever.xul") { // call "yourNotificationFunction" in the sidebar's con...
StringView - Archive of obsolete content
For actually supported values see here. buffer Read only arrayBuffer The buffer to be shared between stringView.rawData and stringView.bufferView view references. rawData Read only arrayBufferView An arrayBufferView con...
... length Optional A number expressing the length in codepoints of the new stringView. If not specified it will take the length of the input. Examples var myStringView = StringView.makeFromBase64("SGVsbG8gd29ybGQh"); alert(myStringView) // "Hello world!" This function is useful in order to pass binary data containing strings. See also this example. StringView instances'
properties encoding A string expressing the encoding type. For possible values see here. buffer The buffer to be shared between stringView.rawData and stringView.bufferView view references. rawData An arrayBufferView containing the representation of the string as an array of 8-bit, 16-bit, or 32-bit integers (depending on the chosen encoding). bufferView An arrayBufferView containing the...
Appendix F: Monitoring DOM changes - Archive of obsolete content
hNodes._i++); const XHTML = 'http://www.w3.org/1999/xhtml'; doc = doc || document; let style = doc.createElementNS(XHTML, 'style'); style.setAttribute('type', 'text/css'); let preamble = ' @-moz-keyframes ' + EVENT + ' { \n\ from { clip: rect(1px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); } \n\ }\n'; let
properties = [ 'animation-duration: 0.0001s;', 'animation-name: ' + EVENT + ' !important;' ];
properties =
properties.map(function (prop) ' ' + watchNodes.NAMESPACE + prop) .join('\n'); doc.addEventListener('animationstart', listener, false); function listener(event) { if (event.animationName == EVENT...
...Content code // should make do without weak references. ...
Setting Up a Development Environment - Archive of obsolete content
at generate the folder structure for the project, and that's not much help. We recommend Komodo Edit. It's free, open source, and cross-platform. It's based on the Mozilla XULRunner platform, so it has support for some of the particularities in Firefox extension development. Komodo Edit has automatic completion for XUL tags and attributes, and it supports Mozilla's CSS extensions (CSS values and
properties beginning with "-moz"). It has an add-on system similar to the one in Firefox, and there are some Komodo extensions that provide additional help in extension development. That is more than what you can get with most other editors, so we recommend you to give it a try. All of our examples are handled with Komodo Edit, so if you see a .kpf or .komodoproject file in an example you download, this is ...
... If everything went well, you should see an output similar to this: Creating XPI file. adding: install.rdf (deflated 50%) adding: chrome.manifest (deflated 50%) adding: content/browserOverlay.js (deflated 42%) adding: content/browserOverlay.xul (deflated 69%) adding: skin/browserOverlay.css (stored 0%) adding: locale/browserOverlay.dtd (deflated 52%) adding: locale/browserOverlay.
properties (stored 0%) Creating XPI file. Done! Build finished successfully. If you inspect the bin directory, you should see the xulschoolhello2.xpi file. If you run make again, you'll only see the last line of the build process. That is because make can tell that the file in the bin directory is up to date, and nothing needs to be done. Making changes on source files will make make run the necessary...
chargingchange - Archive of obsolete content
Property Type Description BatteryManager.charging boolean The system's battery charging status. ...
... The chargingchange event is fired when the charging attribute of the battery API has changed. General info Specification Battery Interface Event Bubbles No Cancelable No Target BatteryManager Default Action None
Properties The event callback doesn't receive any event objects, but
properties can be read from the BatteryManager object received from the navigator.getBattery method. Property Type Description BatteryManager.charging boolean The system's battery charging status. Returns true if the battery is charging, if the state of the system's battery is not determinable, or if no battery is attached to the system. Returns false if the battery is discharging. Read only. Example navigator.getBattery().then(function(battery) { console.
levelchange - Archive of obsolete content
Property Type Description BatteryManager.level double (float) The system's battery charging level scaled from 0 to 1.0. ...
... The levelchange event is fired when the level attribute of the battery API has changed. General info Specification Battery Interface Event Bubbles No Cancelable No Target BatteryManager Default Action None
Properties The event callback doesn't receive any event objects, but
properties can be read from the BatteryManager object received from the navigator.getBattery method. Property Type Description BatteryManager.level double (float) The system's battery charging level scaled from 0 to 1.0. Returns 0 if the battery is empty and the system is about to suspend. Returns 1.0 if the battery is full, if the implementation is unable to report the battery's level, or if there is no battery attached to the system. Read only. Example navigator...
Index of archived content - Archive of obsolete content
Interacting with page scripts Loading Content Scripts Reddit Example port self Contributor's Guide Classes and Inheritance Content Processes Getting Started Modules Private
Properties Firefox Compatibility Module structure of the SDK Porting the Library Detector Program ID SDK API Lifecycle SDK and XUL Comparison Testing the Add-on SDK Two Types of Scripts Working with Events XUL Migration Guide ...
...igger.installChrome InstallTrigger.startSoftwareUpdate Trigger Scripts and Install Scripts Windows Install File Object Methods Install Object Methods
Properties InstallVersion Object Methods
Properties Return Codes WinProfile Object Methods WinReg Object ...
Bookmark Keywords - Archive of obsolete content
ile the bookmark into a folder by using the "File Bookmark..." menu option. To open the Bookmark manager go to "bookmarks" menu and select the "Manage Bookmarks" option. This will open up the Bookmark manager. In Figure 2, we can see the bookmark has been filed into a folder called "Widgets." You can create a folder with another name, or not put your keymarks into a folder at all. Changing the
Properties To alter the
properties of the bookmark, highlight the bookmark and select the "
Properties..." button at the top of the Bookmark manager. This will open up a dialog box that will let you edit the
properties of the bookmark. The original title of the bookmark won't apply. You can name the bookmark whatever you want, but it's often handy to make the title very similar to the keyword you plan to us...
...up a Google Keymark To set up a keymark that will search Google directly form the address bar, go to Google and run a search for any word. Once you get a result page, bookmark that page. You'll need to replace the word for which you searched. One such example, with the relevant term highlighted, is shown in Figure 7. Once this result page has been bookmarked, we need only adjust the boookmark's
properties. In this case, we'll give it a keyword and title of google and replace the term "geitost" with the %s, as shown (with extra highlighting) in Figure 8. Now we can run Google searches straight from the address bar. These searches can be as complex as Google will tolerate, since the entered data will be converted to URL-encoded text before it's sent to the Google servers. Thus we could type any of ...
Creating a Firefox sidebar extension - Archive of obsolete content
ifierskey keys from the dtd, remove the <keyset> from the firefoxOverlay.xul file. One must then set the key attribute of the menuitem to "". The extension needs to provide some special manifest files that control how it is installed and where its chrome resources are stored. The first is install.rdf, the install manifest. See Install Manifests for a complete listing of the required and optional
properties. The install manifest is listed in Example 5. Example 5. install.rdf <?xml version="1.0" encoding="UTF-8"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>emptysidebar@yourdomain.com</em:id> <em:name>EmptySidebar Extension</em:name> <em:version>1.0</em:version> ...
...xVersion> </Description> </em:targetApplication> </Description> </RDF> The other manifest file is chrome.manifest, the chrome manifest file. The chrome manifest creates a lookup for all the resource types used by the extension. The manifest also tells Firefox that the extension has an overlay that needs to be merged into the browser. For more information on chrome manifests and the
properties they support, see the Chrome Manifest reference. The manifest used in this extension is listed in Example 6. Example 6. chrome.manifest content emptysidebar chrome/content/ locale emptysidebar en-US chrome/locale/ skin emptysidebar classic/1.0 chrome/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxOverlay.xul Test While you're developing your sidebar...
Dehydra Function Reference - Archive of obsolete content
process_type(type) Dehydra calls this for each class, struct, enum, union, and typedef declaration. process_type is called after process_function is called for all the member functions. ...
...hould be reported for the warning. If no location is provided, the location is inferred from the last process_type or process_function. _print(msg, ...) The low level function called by print(). It does not print the location. read_file(filename) Read a file a return it as a string. write_file(filename, data) Write a string to a file. Builtin Objects sys this.sys is a container for miscellaneous
properties exposes by Dehydra sys.gcc_version is a GCC version string sys.include_path exposes the search path used by include(). The default value is the following directories: the directory of the dehydra script being processed the libs directory next to the gcc_dehydra.so plugin User script may add additional directories sys.aux_base_name exposes the base filename part of the file being compiled sys.
Drag and Drop Example - Archive of obsolete content
to create an element of a particular type. First, we'll add the wrapper scripts: <script src="chrome://global/content/nsDragAndDrop.js"/> <script src="chrome://global/content/nsTransferable.js"/> <script src="dragboard.js"/> An additional script file dragboard.js is included which will contain the code we will write ourselves. The board will be created using a stack element. We'll use some style
properties to set the width and height of the stack. A maximum size is also specified so that it doesn't resize when new elements are dragged onto it. The board will need to respond to the dragdrop event so that an element is created when the user drags onto it. <stack id="board" style="width:300px; height: 300px; max-width: 300px; max-height: 300px" ondragover="nsDragAndDrop.dragOver(event, b...
...n its body. The onDrop handler first uses the createElement function to create a new element of the type stored in the drag session. Next, appendChild is called to add the new element to the stack, which is the target of the event. Finally, we set some attributes on the new element. The position of elements in a stack is determined by the left and top attributes. The values of the pageX and pageY
properties store the mouse pointer coordinates on the window where the drop occured. This allows us to place the new element at the position where the mouse button was released. This isn't quite the correct way to do this as we actually need to calculate the coordinates of the event relative to the stack. It works here because the board is at the top-left corner of the window. The label attribute is set to ...
Twitter - Archive of obsolete content
Most of Twitter's methods are supported, but not all. List methods, spam reporting methods, and OAuth are not currently supported. If something is not supported but you would like it to be, please file a bug. (Or write a patch!) Arguments Each and every method in the library takes a single argument, an object. There are two styles you can use to define this object. The first is simple: Define
properties on the object corresponding to the parameters of the Twitter method. For instance, some Twitter methods have an id parameter, so you would define an id property and set its value to a user's ID. (You can read about the parameters of the various methods at Twitter's API reference.) There are two special, optional
properties: success and error. success is a function that's called when the request s...
...equest is the XHR used in the request. textStatus is a simple string describing the type of error. errorThrown is an exception object, if one was thrown. The examples below all use this first, simpler style. The second style will be familiar if you have used jQuery.ajax() -- in fact the object is passed as-is (almost) to it. In other words, define a data property that is itself an object whose
properties correspond to the parameters of the Twitter method. With this style you can use any of the various jQuery.ajax() options in your request: data, success, complete, etc. Example: jetpack.lib.twitter.statuses.update({ data: { status: "O frabjous day!" }, username: "basic_auth_username", password: "basic_auth_password", success: function () console.log("Hey!") }); User authentication Y...
Message Summary Database - Archive of obsolete content
which message a message is in reply to, etc. This allows us to store watch/ignore information on a thread object, and avoids having to generate threading information whenever a folder is open. This has arguably been more trouble than it's been worth, especially when we've threaded incorrectly. Meta Information The nsIDBFolderInfo interface handles the folder meta data. This also supports generic
properties. There is a method on nsIMsgDatabase to get the dbFolderInfo. Mork - the Good, the Bad, and the Ugly Mork has a horrible reputation and we're always asked why we don't just replace it with some other db. The bottom line is that we haven't been able to justify the very large cost of doing so because there won't be any benefit to the end-user, at least in the short term. Here are some of the trade...
...here are very few bugs in the Mork code. Mork loads the whole database in memory, and keeps it there. This makes it very fast to access our database objects, but it does increase memory usage. Mork assumes the caller will do file locking, so two processes or threads writing to the same database can corrupt it. But I believe sql-lite has the same problem. Mork is schema-less. This means we can add
properties to rows arbitrarily. And we only pay the storage cost for a property if the row has the property set. We can still index on these
properties, if we want. We would need the equivalent capabilities if we replaced Mork. ...
Monitoring downloads - Archive of obsolete content
this.dlMgr = Components.classes["@mozilla.org/download-manager;1"] .getService(Components.interfaces.nsIDownloadManager); this.dlMgr.addListener(downloadlogger); // Open the database, placing its file in the profile directory this.dbFile = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsI
Properties) .get("ProfD", Components.interfaces.nsIFile); this.dbFile.append("downloadlogger.sqlite"); // Get access to the storage service and open the database this.storageService = Components.classes["@mozilla.org/storage/service;1"] .getService(Components.interfaces.mozIStorageService); var dbConn = this.storageService.openDatabase(this.dbFile); ...
... it doesn't monitor for further changes to the log. It simply displays the state of downloads at the moment the window was opened. ...
File object - Archive of obsolete content
ed, leading and trailing spaces are removed from the filename, so new File(" abc.txt ") just creates a file called abc.txt. Filenames starting and ending with the pipe symbol (|) are interpreted as pipes. Readable pipelines (i.e. pipe to programs generating output on stdout) begin with the pipe symbol; writeable pipelines end with the pipe symbol. Bi-directional pipelines are not supported.
Properties Static
Properties File.input A File object that represents the standard input (stdin). File.currentDir A File object that represents the standard output (stdout). File.currentDir A File object that represents the standard error (stderr). File.currentDir A File object referring to the current directory; this property may be set. File.separator The system name separator (slash on UNIX)...
...erties File.input A File object that represents the standard input (stdin). File.currentDir A File object that represents the standard output (stdout). File.currentDir A File object that represents the standard error (stderr). File.currentDir A File object referring to the current directory; this property may be set. File.separator The system name separator (slash on UNIX). Instance
Properties File.length The length of the file in bytes, or the number of entries in the directory. Note: calculating the length of the directory is very expensive. File.parent The directory containing the file. File.path The canonical path to the file. File.name The name of the file. File.isDirectory True if the file is a directory. File.isFile True if the file is a file. File.exists True if...
XBL 1.0 Reference - Archive of obsolete content
specified by the binding. Bindings can be bound to elements using Cascading Style Sheets (CSS) or DOM. One element can be bound to several bindings at once. Functionally bindings should be correlated with Behaviors and Viewlink but being implemented as one integrated XML solution. Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and
properties that become accessible from the bound element, and anonymous content that is inserted around the bound element. There are numerous adjustments in the current implementation in comparison of earlier XBL proposals, and not all of them are reflected yet in this document. The documentation process is still in progress: please keep it in your mind while using the provided information. XBL Elements...
... This example is targeted to demonstrate the XBL usage rather than to be a practically useful application. For this reason it contains many comments and some blocks could be avoided in a more compact solution yet used here for demonstration purposes. notes.ht...
XBL - Archive of obsolete content
o called Extensible Bindings Language) is a language for describing bindings that can be attached to elements in other documents. The element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding. Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and
properties that become accessible from the bound element, and anonymous content that is inserted underneath the bound element. Most XUL widgets are at least partially implemented using XBL. You can build your own reusable widgets from existing XUL, HTML, SVG, and other primitives using XBL. Specifications ...
...ently a working draft, 2005) stands for SVG's XML Binding Language. It is supposed to include a subset of XBL 2.0 features needed for SVG. It's similar in spirit to Mozilla's XBL, but there are a few subtle (and not-so-subtle) differences. 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. XBL 2.0 (W3C Candidate Recommendation) was developed to address problems found in XBL 1.0 and to allow for implementations in a broader range of Web browsers. In 2009 Mozilla announced plans to implement XBL2 in future versions of Gecko. Some differences between sXBL and XBL2 are lis...
List of commands - Archive of obsolete content
nkey/sou...torOverlay.xul http://lxr.mozilla.org/seamonkey/sou...onalToolbar.js http://lxr.mozilla.org/seamonkey/sou...rceOverlay.xul http://lxr.mozilla.org/seamonkey/sou...extOverlay.xul http://lxr.mozilla.org/seamonkey/sou...lityOverlay.js http://lxr.mozilla.org/seamonkey/sou...oomOverlay.xul http://lxr.mozilla.org/seamonkey/sou...torOverlay.xul http://lxr.mozilla.org/seamonkey/sou...ark.
properties http://lxr.mozilla.org/seamonkey/sou...kmarks-temp.js http://lxr.mozilla.org/seamonkey/sou.../bookmarks.xml http://lxr.mozilla.org/seamonkey/sou...rksOverlay.xul http://lxr.mozilla.org/seamonkey/sou...okmarksTree.js List of commands (listed alphabetically) Browser:AddBookmark Browser:AddBookmarkAs Browser:AddGroupmarkAs Browser:Back Browser:EditPage Browser:Find Browser:FindAgain...
...rowser:Print Browser:PrintPreview Browser:SavePage Browser:SearchInternet Browser:SendPage Browser:UploadFile cmd_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_
properties cmd_bm_rename cmd_bm_selectAll cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeOtherTabs cmd_closeWindow cmd_copy cmd_copyImage cmd_copyLink cmd_cut cmd_delete cmd_editPage cmd_findTypeLinks cmd_findTypeText cmd_goToLine cmd_handleBackspace cmd_handleShiftBackspace cmd_minimize...
appendNotification - Archive of obsolete content
he notification. If "" then an icon appropriate for the priority level is used. priority - notification priority; see Priority Levels. buttons - array of button descriptions to appear on the notification. eventCallback Optional - a JavaScript function to call to notify you of interesting things that happen with the notification box. See Notification box events. ...
...This function is passed three arguments: the <notification> the button is associated with the button description as passed to appendNotification. the element which was the target of the button press event. ...
Extensions - Archive of obsolete content
as Context Clicked Firefox uses its own popupshowing event listener to adjust the items on the context menu. This allows the menu to have different commands for different types of targets. While the popup is open, the gContextMenu global variable is set to an object which handles all of the functionality specific to the Firefox context menu. ...
...he popup is open, the gContextMenu global variable is set to an object which handles all of the functionality specific to the Firefox context menu. Specifically, this object is initialized with a set of
properties that indiciate the type of object that was the target of the context menu. For instance, the 'onLink' property is set to true when a link was context-clicked. You may wish to use these
properties instead of determining the type yourself, as the code already handles various special and complex cases that would take a lot of code to deal with manually. The following are the most common
properties that you can check. An example follows. target The element that was context clicked. If the keyboard was used to open a context menu, this will be the focused element. onTextI...
Menus - Archive of obsolete content
up or down arrow on the keyboard, then pressing the return key or right arrow key will open the menu. If it were a menuitem, then pressing the return key would have launched the command associated with it. There may be occasion to access or set this programatically with a script. If the menu has been created using a menulist, this is easily accomplished using the selectedItem or selectedIndex
properties. However, it is not possible to use these
properties for menus whose popup is the child of menu, button, or toolbarbutton. However, there is a way to access the active item using the nsIMenuBoxObject interface: activeItem = xulMenu.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject).activeChild; where xulMenu is the menu, button, or toolbarbutton object. You can set the active ...
... deactivate all items, and keyboard navigation will start from the top of the menu. It should be noted that setting the active item in this way will not affect the selected property or selected attribute of the previously and newly activated item. You must unset/set those explicity for each item affected, if you want them to be. For menulists, however, setting the selectedItem or selectedIndex
properties on the menu will automatically take care of that for you. ...
Introduction to XBL - Archive of obsolete content
owever, XUL provides no means in which you can change how an element works (or add a new element which can be reused). For example, you might want to change how the pieces of a scroll bar function. For this, you need XBL. An XBL file contains a set of bindings. Each binding describes the behavior of a XUL widget. For example, a binding might be attached to a scroll bar. The behavior describes the
properties and methods of the scroll bar in addition to describing the XUL elements that make up a scroll bar. Like XUL, XBL is an XML language, so it has similar syntax rules. The following example shows the basic skeleton of an XBL file: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="binding1"> <!-- content, property, method and event descriptions go here --> </bi...
...pecific binding, much like how you would point to an anchor in an HTML file. You will usually put all of your bindings in a single file. The result in this example, is that all scrollbar elements will have their behavior described by the binding 'binding1'. A binding has five types of things that it declares: Content: child elements that are added to the element that the binding is bound to.
Properties:
properties added to the element. They can be accessed through a script. Methods: methods added to the element. They can be called from a script. Events: events, such as mouse clicks and keypresses that the element will respond to. The binding can add scripts to provide default handling. In addition new events can be defined. Style: custom style
properties that the XBL defined element has. ...
Templates - Archive of obsolete content
hich is used only for trees. Content Builder The content builder takes the content inside the template element and duplicates it for each row. For instance, if the user had ten bookmarks in the example above, ten label elements would be created and added as children of the vbox element. If you were to use DOM functions to traverse the tree, you will find these elements there and can query their
properties. These elements get displayed, but the template itself is not displayed, although it still exists in the document tree. In addition, the id of each of the labels will be set to the RDF resource for that row. The content builder always starts at the place where uri="rdf:*" is specfied. If the uri attribute is placed on an element lower in the element tree, the elements outside are only created on...
...nd, doesn't generate the DOM elements for the rows. Instead, it gets the data directly from the RDF datasource whenever it needs it. Since trees are often expected to display thousands of rows of data, this is much more efficient. Creating an element for every cell would be too costly. However, the tradeoff is that trees may only display text, and, since no elements are created, you can't use CSS
properties to style tree cells in the same way. The tree builder is only used for trees. Other elements use only the content builder. This isn't a problem though, since other elements such as menus wouldn't be expected to display too many items. It's also possible to use the content builder for trees as well, and a treeitem element and related elements will be created for each row. Rules In the image of ...
XPCOM Interfaces - Archive of obsolete content
lity that could be implemented by components. Components are what implement the code in Mozilla that does things. Each component implements the functionality as described by interfaces. A single component might implement multiple interfaces. And multiple components might implement the same interface. Let's take an example of a file component. An interface would need to be created which describes
properties and functions that can be performed on files. A file would need
properties for its name, modification date and its size. Functions of a file would include moving, copying and deleting it. The File interface only describes the characteristics of a file, it does not implement it. The implementation of the File interface is left to a component. The component will have code which can retrieve the fi...
...nceof operator returns true if aFile implements the nsILocalFile interface. This also has the side effect of calling QueryInterface(), so aFile will be a valid nsILocalFile afterwards. Calling the Functions of an Interface Now that we have an object that refers to a component with the nsILocalFile interface, we can call the functions of nsILocalFile through it. The table below shows some of the
properties and methods of the nsILocalFile interface. initWithPath This method is used to initialize the path and filename for the nsILocalFile. The first parameter should be the file path, such as '/usr/local/mozilla'. leafName The filename without the directory part. fileSize The size of the file. isDirectory() Returns true if the nsILocalFile represents a directory. remove(recursive) Del...
XUL Questions and Answers - Archive of obsolete content
"2" label="vghjkvk" checked="true"/> <listitem type="checkbox" value="3" label="hukfzgjcfj" disabled="true"/> </listbox> </window> List box handlers can only check for listitems not listcells. If user wants checkbox support for multicolumn lists, then they will have to implement one. Are XUL attributes integers? XUL attributes such as left="100" or top="200", as well as corresponding
properties, look as if they're integers but they are actually handled as strings. To convert them to integers use the parseInt() JavaScript function. While the attributes are always strings per the DOM specification, the
properties will eventually be fixed to return the value with the correct type. Using the "icon" attribute on a button From XULPlanet.com reference: This attribute should be used to ...
...attribute on a button From XULPlanet.com reference: This attribute should be used to set the usage for common buttons. Some platforms display these buttons with a small icon indicating their usage. This should be used in place of the image attribute. Possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back,
properties, select-font, select-color, network. If you are using a button that matches one of these common usages, use the icon attribute to indicate this. How to use Dynamic Objects in Toolbar There may be a few ways to implement this: By building your menupopup from an RDF datasource, which could be generated on the server. By getting data (e.g. JSON string) from the server, parsing it on client,...
action - Archive of obsolete content
The action should be contained within a query or rule element. One descendant of the action body should have a uri attribute set to the member variable. This element and its descendants may use variables in place of attribute values. Variables are a question mark followed by a name. For a matched rule, each variable will be a reference to data within the datasource, determined from the query. If the same variable appears multiple times, it will have the same value in each place. For more information, see Actions. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width Me...
assign - Archive of obsolete content
For more information, see XML_Assignments Attributes expr, var Examples (example needed) Attributes expr Type: string For XML queries, an XPath expression which returns results. Any namespace prefixes declared on the element may be used within the expression. var Type: string For the XUL assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name". ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
bbox - Archive of obsolete content
It is equivalent to using an hbox element with an align attribute set to baseline. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
box - Archive of obsolete content
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. Child elements do not overlap. The default orientation is horizontal. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
broadcaster - Archive of obsolete content
Any elements that are observing the broadcaster will share the attributes placed on the broadcaster. For instance, if the broadcaster has a label attribute, the observers will use that label. If the label changes, the labels of the observers will update automatically. An onbroadcast event will be sent to the observers when a change is made. For menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
broadcasterset - Archive of obsolete content
The broadcasterset and its descendants are not displayed. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
caption - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A header for a groupbox. It may contain either a text label, using the label attribute, or child elements for a more complex caption. More information is available in the XUL tutorial. Attributes accesskey, crop, image, label, tabindex
Properties accessKey, crop, image, label, tabIndex Examples <groupbox> <caption label="My groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox label="A checked groupbox"/> </caption> </groupbox> Attributes accesskey Type: character This should be set to a character that is used as a shortcut key. This should be one of the characters that appears in the label attribute for the element. ...
.... If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. crop Type: string Gets and sets the value of the crop attribute. image Type: image URL Gets and sets the value of the image attribute. label Type: string Gets and sets the value of the label attribute. tabIndex ...
colorpicker - Archive of obsolete content
If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. ...
...r in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. type Type: string If this attribute is not present, the colorpicker is displayed inside the window. If this is set to the text button, the colorpicker is displayed as a button. When the user clicks the button, a popup appears for the user to select a color.
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. color Type: color string The currently selected color. This is modified when the user selects a color. You can assign a string of the form #RRGGBB to this property to change the selected color. disabled Type: boolean Gets and s...
column - Archive of obsolete content
Each child of the column element is placed in each successive cell of the grid. 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. More information is available in the XUL tutorial. Example See grid for an example. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
columns - Archive of obsolete content
Child column elements define the individual columns to appear in the grid. The columns element may be nested inside another columns element. Other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns. More information about columns is available in the XUL tutorial. Example See grid for an example. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
conditions - Archive of obsolete content
Within the conditions can be placed content, member and triple elements. These may have attributes whose value is a variable name beginning with a question mark (?). When evaluating the rule for a particular RDF resource, the variables are replaced with values from the resource. If all variables can be replaced, the rule matched. This element is used with Firefox 2/Mozilla 1.8 and earlier instead of the query element. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
grid - Archive of obsolete content
The grid is expected to contain both a columns element as a child which defines the structure of the columns and a rows element as child to define the rows. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
grippy - Archive of obsolete content
More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
hbox - Archive of obsolete content
This is equivalent to the box element, except it defaults to horizontal orientation. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
label - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used to provide a label for a control element. If the user clicks the label, it will move the focus to the associated control, specified with the control attribute. More information is available in the XUL tutorial. Attributes accesskey, control, crop, disabled, href, value
Properties accessKey, accessibleType, control, crop, disabled, value Style classes header, indent, monospace, plain, small-margin, text-link Examples <label value="Email address" control="email"/> <textbox id="email"/> Attributes accesskey Type: character This should be set to a character that is used as a shortcut key. This should be one of the characters that appears in ...
...is attribute out entirely. Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. href Type: string Defines a URL to open when this element is clicked. Requires the class attribute to include text-link. value Type: string The text to be used for the label.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. control Type: element id Gets and sets the value of the control attribute. crop Type: string Gets and sets the value of the...
listcol - Archive of obsolete content
You can make some columns flexible and other columns non-flexible. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
listcols - Archive of obsolete content
There should be only one listcols element in a list box. If there is no listcols element, the list box has a single column. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
listhead - Archive of obsolete content
If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. disabled Type: boolean Gets and sets the value of the disabled attribute. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height...
listheader - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A header for a single column in a listbox. Attributes disabled
Properties acesssibleType Examples <listbox> <listhead> <listheader label="Name"/> <listheader label="Occupation"/> </listhead> <listitem> <listcell label="George"/> <listcell label="House Painter"/> </listitem> <listitem> <listcell label="Mary Ellen"/> <listcell label="Candle Maker"/> </listitem> <listitem> <listcell label="Roger"/> <listcell label="Swashbuckler"/> </listitem> </listbox> Attributes disabled Type: boolean Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ord...
observes - Archive of obsolete content
The observes element should be placed inside the element that wants to observe the broadcaster. When an observed attribute is modified on the broadcaster, the attribute's value will be forwarded and set on the parent element of the observer. More information is available in the XUL tutorial. Attributes attribute, element Examples (example needed) Attributes attribute Type: attribute name The attribute that the observer is observing. When the value of the attribute changes, the broadcast event is called on the observer. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
page - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Similar to a window, except it should be used for XUL files that are to be loaded into an iframe. Examples (example needed) Attributes Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width Pr...
...ize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width Methods Inherited Meth...
popupset - Archive of obsolete content
This element is optional; the given elements need not appear in a popupset container. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
preferences - Archive of obsolete content
It's supposed to be a child of <prefpane> element. <preferences> element should contain one or more <preference> elements. Note: it's not clear which of the following methods and
properties are public. Examples <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> <preference id="pref_two" name="extensions.myextension.two" type="string"/> ... etc ... </preferences> Attributes These ought to be readonly; three of these could be merged into a single member attribute nsIPrefService service; The preferences service. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
query - Archive of obsolete content
The attributes and content of the query are dependent on the type of datasource being used. 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. For SQL datasources, the query should contain an SQL statement as text. Attributes expr Examples (example needed) Attributes expr Type: string For XML queries, an XPath expression which returns results. Any namespace prefixes declared on the element may be used within the expression. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
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. For more information, see Multiple Queries. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
resizer - Archive of obsolete content
If you place a custom resizing button inside the resizer, the user will be able to resize the window by dragging it. The resizer will send a command event after the resize is complete. Note: Starting in Gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
richlistitem - Archive of obsolete content
If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. ...
...n 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.
Properties accessible Type: nsIAccessible Returns the accessibility object for the element. control Type: element id Gets and sets the value of the control attribute. disabled Type: boolean Gets and sets the value of the disabled attribute. label Type: string Gets the concatentation of text from any child label elements. Does ...
row - Archive of obsolete content
Each child of the row element is placed in each successive cell of the grid. 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. More information is available in the XUL tutorial. Example See grid for an example. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
rows - Archive of obsolete content
Child row elements define the individual rows to appear in the grid. Each child of a rows element should be a row element. The rows element may be nested inside another rows element. The children of these nested rows are counted as normal rows as if they were part of the parent. 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. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
script - Archive of obsolete content
You should usually put scripts in a separate file pointed to by the src attribute, but you may also place the script inline inside the opening and closing script tags. More information is available in the XUL tutorial. Attributes src, type Examples <script src="test.js"/> <script src="http://example.com/js/test.js"/> <script> function foo(){ // code } </script> Attributes src Type: URI The URI of the script. type Type: language content type The language of the script. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
scrollbox - Archive of obsolete content
Note that a scrollbox doesn't cause scrollbars to be displayed. It is intended to be used when an application wants to be able to adjust the scroll position itself. If you just want scrollbars to appear, add style='overflow: auto;'. This may also be used with any other container element. Examples The following shows the XUL for a bunch of labels. They come out in a box. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
scrollcorner - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] This element is used for the small box where the horizontal and vertical scrollbars meet. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
separator - Archive of obsolete content
This type of separator should be used to separate parts of a dialog. It doesn't draw a bar visually, but is just a small space. It is functionally equivalent to a spacer except it defaults to a small size (usually 1.5 ems). Attributes orient Style classes groove, groove-thin, thin Examples <separator class="groove-thin"/> Attributes orient Type: one of the values below Used to specify whether the separator is a horizontal or vertical separator. Note that the values are the reverse of what seems more likely. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
spacer - Archive of obsolete content
It is usually used to place spacing within a container. If you don't specify that the spacer has a size or is flexible, the spacer does not occupy any space. If you want a small gap, consider using a separator instead. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
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. For instance, spinbuttons are used for the number type textbox, and with the timepicker and datepicker. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
stack - Archive of obsolete content
The first element is placed on the bottom and each successive child is placed above the previous. All elements are displayed at once. Child elements may also be placed at absolute positions within the stack. The top, right, bottom, and left attributes on a child of the stack specify the position of that element. The bottom and right attributes can also be used in conjunction with top and left to set the width and/or height of the children of the stack. Note that bottom and right attributes, unlike rect, are relative to the bottom and right of the stack. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
stringbundleset - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A container for stringbundle elements. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
tab - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A single tab which should be placed inside a tabs element. The user may click a tab to bring the associated page of the tabbox to the front. More information is available in the XUL tutorial. Attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value
Properties accessKey, accessibleType, command, control, crop, disabled, image, label, linkedPanel, selected, tabIndex, value Examples (example needed) Attributes accesskey Type: character This should be set to a character that is used as a shortcut key. This should be one of the characters tha...
...cates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling: always The image is always checked to see whether it should be reloaded. never The image will be loaded from the cache if possible.
Properties accessKey Type: character Gets and sets the value of the accesskey attribute. accessibleType Type: integer A value indicating the type of accessibility object for the element. command Type: element id Gets and sets the value of the command attribute. control Type: tabs element Returns the enclosing tabs element. crop ...
tabpanel - Archive of obsolete content
This element is optional and you may just use any other container in place of it. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
template - Archive of obsolete content
Elements are constructed from a datasource. For more information see the rule element. More information is available in the XUL tutorial. Attributes container, member Examples (example needed) Attributes container Type: string May optionally be set to the variable to use as the container or reference variable. If not specified, the variable specified in the uri attribute of the content tag in the template's first rule is used. member Type: string May optionally be set to the variable to use as the member variable. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
textnode - Archive of obsolete content
In the case of the textnode element, the entire node is replaced with text corresponding to the result of the value attribute. This is useful if you want to use the html element or other elements that have text content inside them instead of in attributes. This element does nothing outside of a template. Attributes value Examples (example needed) Attributes value Type: URI The text value to display. This value should be an RDF property (predicate). ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
toolbaritem - Archive of obsolete content
This element should wrap all customizable items (unless they're instances of toolbarbutton). If you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. The element is used, for example, to hold the location bar's textbox in Firefox. It is also used to group buttons together so they can be added and removed all at once like Firefox's unified-back-forward-button. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
toolbarpalette - Archive of obsolete content
It is not displayed, but is used by the toolbar customization dialog to display the list of items. The children of the toolbarpalette should be the complete list of toolbarbuttons and toolbaritems that can be added to the toolbar. Do not add the various spacing items, as those are added automatically. You can add your own custom buttons to the Firefox browser by using an overlay that overlays the toolbarpalette with the idBrowserToolbarPalette. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
toolbarset - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] Firefox only This element is used as a container for custom toolbars, which are added in the custom toolbar dialog. Examples (example needed) Attributes Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor...
...sources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width Met...
treechildren - Archive of obsolete content
For content trees, the content will be placed inside this element. This element is also used to define container rows in the tree. More information is available in the XUL tutorial. Attributes alternatingbackground Attributes alternatingbackground Obsolete since Gecko 2.0 Type: boolean If true, the background of the tree's rows will alternate between two colors. You can use the :-moz-tree-row CSS style to do this instead. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
treecols - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes |
Properties | Methods | Related ] A group of treecol elements. There should one and only one treecols element in a tree. More information is available in the XUL tutorial. Attributes pickertooltiptext
Properties accessibleType Examples (example needed) Attributes pickertooltiptext Type: string The text for the tooltip on the column picker. Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ord...
triple - Archive of obsolete content
It is used to check for an assertion within a graph. If such an assertion exists, the rule may match, assuming that all the conditions match. If the assertion does not exist, the rule will not match. Both the subject and object attributes may be variables. The subject of a triple is an RDF resource. In an RDF file this would usually be an RDF Description element. The predicate would be a child element or property. For example, for a bookmark resource, the name and URL would be predicates. They should be specified in their full URI form. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
vbox - Archive of obsolete content
This is equivalent to the box element, except it defaults to vertical orientation. More information is available in the XUL tutorial. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
where - Archive of obsolete content
If the condition is true, the corresponding action body is generated; otherwise the result is ignored and no content is generated. For more information, see Where Elements. Attributes ignorecase, multiple, negate, rel, subject, value Examples (example needed) Attributes ignorecase Type: boolean Set to true to indicate that the case does not matter when making comparisons. Otherwise, the default value is false, to indicate that the value should match with the same case. ...
...ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width
Properties Inherited
Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width M...
Object.prototype.watch() - Archive of obsolete content
This example ensures that every Person always has a valid name and an age between 0 and 200. class Person { constructor(name, age) { this.watch('age', this._isValidAssignment.bind(this)); this.watch('name', this._isValidAssignment.bind(this)); this.name = name; this.age = age; } toString() { return th...
... newval) => { console.log('o.' + id + ' changed from ' + oldval + ' to ' + newval); return newval; }); o.p = 2; o.p = 3; delete o.p; o.p = 4; o.unwatch('p'); o.p = 5; This script displays the following: o.p changed from 1 to 2 o.p changed from 2 to 3 o.p changed from undefined to 4 Using watch() to validate an object's
properties You can use watch to test any assignment to an object's
properties. This example ensures that every Person always has a valid name and an age between 0 and 200. class Person { constructor(name, age) { this.watch('age', this._isValidAssignment.bind(this)); this.watch('name', this._isValidAssignment.bind(this)); this.name = name; this.age = age; } toString() { return this.name + ', ' + this.age; } _isValidAssignment(id, oldval, new...
Packages - Archive of obsolete content
he support for this object was removed in Gecko 16, see LiveConnect for details. Created by The Packages object is a top-level, predefined JavaScript object. You can automatically access it without using a constructor or calling a method. Description The Packages object lets you access the public methods and fields of an arbitrary Java class from within JavaScript. The java, netscape, and sun
properties represent the packages java.*, netscape.*, and sun.* respectively. Use standard Java dot notation to access the classes, methods, and fields in these packages. For example, you can access a constructor of the Frame class as follows: var theFrame = new Packages.java.awt.Frame(); For convenience, JavaScript provides the top-level netscape, sun, and java objects that are synonyms for the Packages...
...represent the packages java.*, netscape.*, and sun.* respectively. Use standard Java dot notation to access the classes, methods, and fields in these packages. For example, you can access a constructor of the Frame class as follows: var theFrame = new Packages.java.awt.Frame(); For convenience, JavaScript provides the top-level netscape, sun, and java objects that are synonyms for the Packages
properties with the same names. Consequently, you can access Java classes in these packages without the Packages keyword, as follows: var theFrame = new java.awt.Frame(); The className property represents the fully qualified path name of any other Java class that is available to JavaScript. You must use the Packages object to access classes outside the netscape, sun, and java packages.
Properties class...
Archived open Web documentation - Archive of obsolete content
ach() Ok, in the end I didn't remove the old code as it isn't hosted anywhere (I thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. Iterator The Iterator function returns an object which implements legacy iterator protocol and iterates over enumerable
properties of an object. LiveConnect (Please update or remove as needed.) MSX Emulator (jsMSX) Old Proxy API Proxies are objects for which the programmer has to define the semantics in JavaScript. The default object semantics are implemented in the JavaScript engine, often written in lower-level languages like C++. Proxies l...
... XHTML(TM) 1.0 The Extensible HyperText Markup Language (Second Edition) defines XHTML to be a reformulation of HTML 4 as an XML 1.0 application. Talk:JavaScript Reference The guide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various
properties within an object from being poked at accidentally. I also just read a document on proper inheritance using apply(). Well if you combine the two, you can have inherited private variables: Scope Cheatsheet JavaScript with Mozilla extensions has both function-scoped vars and block-scoped lets. Along with hoisting and dynamic behavior, scope in Ja...
Using the DOM File API in chrome code - Extensions
from the inherent security risks associated with allowing web content free access to the contents of their disks. If you pass a path to the File constructor from unprivileged code (such as web content), an exception will be thrown. Scope Availability In the JSM scope File is available without needing to do anything special. In Bootstrap scope, this must be imported in like so: Cu.importGlobal
Properties( [ "File" ] ) Accessing a file by hard-coded pathname To reference a file by its path, you can simply use a string literal: var file = File.createFromFileName("path/to/some/file"); Cross platform note: However using hard-coded paths raises cross platform issues since it uses a platform-dependent path separator (here "/"). In the XUL/Mozilla platform there isn't sadly an equivalent to Java Fi...
...s explained in the next section. Accessing files in a special directory You can also use the directory service to obtain and build the path to a file to access. For example, let's say your add-on needs to access a file in the user's profile. You can do so like this: var dsFile = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsI
Properties) .get("ProfD", Components.interfaces.nsIFile); dsFile.append("myfilename.txt"); var file = File.createFromNsIFile(dsFile); This uses the directory service to locate the profile directory (with the location key "ProfD", see below for more details), then appends the name of the file we want to work with by calling nsIFile.append(). Finally, we instantiate the File object by ...
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
to refer to the order in which separate values need to be specified (or parsed) or are to be serialized as part of a CSS property value. It is defined by the formal syntax of the property and normally refers to the order in which longhand values should be specified as part of a single shorthand value. For example, background shorthand property values are made up of several background-* longhand
properties. The canonical order of those longhand values is defined as background-image background-position background-size background-repeat background-attachment background-origin background-clip background-color Furthermore, its syntax defines, that if a value for the background-size is given, it must be specified after the value for the background-position, separated by a slash. Other values...
... The description of the formal syntax used for CSS values on MDN ...
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
task has a Window as its global object. This is the vast majority of JavaScript code on the Web. Code running in a Worker has a WorkerGlobalScope object as its global object. Scripts running under Node.js have an object called global as their global object. window object in the Browser The window object is the Global Object in the Browser. Any Global Variables or Functions can be accessed as
properties of the window object. Access Global Variables var foo = "foobar"; foo === window.foo; // Returns: true After defining a Global Variable foo, we can access its value directly from the window object, by using the variable name foo as a property name of the Global Object window.foo. Explanation: The global variable foo was stored in the window object, like this: foo: "foobar" Access Global F...
...object, by using the variable name foo as a property name of the Global Object window.foo. Explanation: The global variable foo was stored in the window object, like this: foo: "foobar" Access Global Functions function greeting() { console.log("Hi!"); } window.greeting(); // It is the same as the normal invoking: greeting(); The example above explains how Global Functions are stored as
properties in the window object. We created a Global Function called greeting, then invoked it using the window object. Explanation: The global function greeting was stored in the window object, like this: greeting: function greeting() { console.log("Hi!"); } ...
Grid Tracks - MDN Web Docs Glossary: Definitions of Web-related terms
Tracks are also created in the implicit grid by positioning a grid item outside of the tracks created in the explicit grid. The image below shows the first row track on a grid. Track sizing in the explicit grid When defining grid tracks using grid-template-columns and grid-template-rows you may use any length unit, and also the flex unit, fr which indicates a portion of the available space in the grid container. ...
... ...
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
In the example below we have a three-column and two-row track grid, with 20-pixel gaps between column tracks and 20px-gaps between row tracks. ...
...<div class="wrapper"> <div>One</div> <div>Two</div> <div>Three</div> <div>Four</div> <div>Five</div> </div> In terms of grid sizing, gaps act as if they were a regular grid track however nothing can be placed into the gap. The gap acts as if the grid line at that location has gained extra size, so any grid item placed after that line begins at the end of the gap. The grid-gap
properties are not the only thing that can cause tracks to space out. Margins, padding or the use of the space distribution
properties in Box Alignment can all contribute to the visible gap - therefore the grid-gap
properties should not be seen as equal to "the gutter size" unless you know that your design has not introduced any additional space with one of these methods. Learn More Property reference ...
Mixin - MDN Web Docs Glossary: Definitions of Web-related terms
A mixin is a class or interface in which some or all of its methods and/or
properties are unimplemented, requiring that another class or interface provide the missing implementations. The new class or interface then includes both the
properties and methods from the mixin as well as those it defines itself. All of the methods and
properties are used exactly the same regardless of whether they're implemented in the mixin or the interface or class that implements the mixin. The advantage of mixins is that they can be used to simplify the design of APIs in which multiple interfaces need to include the same methods and
properties. ...
...The mixin is implemented by both of those interfaces. ...
Property (JavaScript) - MDN Web Docs Glossary: Definitions of Web-related terms
A property has a name (a string) and a value (primitive, method, or object reference). Note that when we say that "a property holds an object", that is shorthand for "a property holds an object reference". ...
... A property has a name (a string) and a value (primitive, method, or object reference). Note that when we say that "a property holds an object", that is shorthand for "a property holds an object reference". ...
Flexbox - Learn web development
er. This specifies how much of the overflowing amount is taken away from each flex item's size, to stop them overflowing their container. This is quite an advanced flexbox feature, and we won't be covering it any further in this article. The minimum size value we discussed above. This can be specified individually using the flex-basis longhand value. We'd advise against using the longhand flex
properties unless you really have to (for example, to override something previously set). They lead to a lot of extra code being written, and they can be somewhat confusing. Horizontal and vertical alignment You can also use flexbox features to align flex items along the main or cross axis. Let's explore this by looking at a new example -- flex-align0.html (see it live also) -- which we are going to turn ...
...a horizontal menu bar, with some buttons jammed into the top left hand corner. First, take a local copy of this example. Now, add the following to the bottom of the example's CSS: div { display: flex; align-items: center; justify-content: space-around; } Refresh the page and you'll see that the buttons are now nicely centered, horizontally and vertically. We've done this via two new
properties. align-items controls where the flex items sit on the cross axis. By default, the value is stretch, which stretches all flex items to fill the parent in the direction of the cross axis. If the parent hasn't got a fixed width in the cross axis direction, then all flex items will become as long as the longest flex items. This is how our first example got equal height columns by default. The ce...
Multiple-column layout - Learn web development
file and adding the CSS into the appropriate places. At the bottom of the section you can see a live example of what the final code should look like. Our starting point contains some very simple HTML; a wrapper with a class of container inside which is a heading and some paragraphs. The <div> with a class of container will become our multicol container. We switch on multicol by using one of two
properties column-count or column-width. The column-count property will create as many columns as the value you give it, so if you add the following CSS to your stylesheet and reload the page, you will get three columns: .container { column-count: 3; } The columns that you create have flexible widths -- the browser works out how much space to assign each column. column-count example body { width:...
...ellus laoreet sit amet. Sed auctor cursus massa at porta. Integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula.</p> </div> </div> .container { column-width: 250px; column-gap: 20px; } .card { background-color: rgb(207, 232, 220); border: 2px solid rgb(79, 185, 227); padding: 10px; margin: 0 0 1em 0; } To control this behavior we can use
properties from the CSS Fragmentation specification. This specification gives us
properties to control breaking of content in multicol and in paged media. For example, add the property break-inside with a value of avoid to the rules for .card. This is the container of the heading and text, and therefore we do not want to fragment this box. At the present time it is also worth adding the older property page...
Positioning - Learn web development
taken its place in the normal layout flow, you can then modify its final position, including making it overlap other elements on the page. Go ahead and update the position declaration in your code: position: relative; If you save and refresh at this stage, you won't see a change in the result at all. ...
... If you now save and refresh, you'll get a result something like this: <h1>Relative positioning</h1> <p>I am a basic block level element. ...
Styling web forms - Learn web development
ine how you wish to blend them into your content. If you want to keep the native look and feel of the widgets, you'll face a little difficulty if you want to give them a consistent size. This is because each widget has their own rules for border, padding and margin. To give the same size to several different widgets, you can use the box-sizing property along with some consistent values for other
properties: input, textarea, select, button { width : 150px; padding: 0; margin: 0; box-sizing: border-box; } In the screenshot below, the left column shows the default rendering of an <input type="radio">, <input type="checkbox">, <input type="range">, <input type="text">, <input type="date"> input, <select>, <textarea>,<input type="submit">, and <button>. The right column on the other hand shows...
... background : rgba(0,0,0,.1); border-radius: 5px; } Now that our text fields are complete, we need to adjust the display of the single and multiple line text fields to match, since they won't typically look the same using the defaults. Tweaking the textareas <textarea> elements default to being rendered as an inline-block element. The two important things here are the resize and overflow
properties. While our design is a fixed-size design, and we could use the resize property to prevent users from resizing our multi-line text field, it is best to not prevent users from resizing a textarea if they so choose. The overflow property is used to make the field render more consistently across browsers. Some browsers default to the value auto, while some default to the value scroll. In our case, it...
CSS basics - Learn web development
is called a ruleset. (The term ruleset is often referred to as just rule.) Note the names of the individual parts: Selector This is the HTML element name at the start of the ruleset. It defines the element(s) to be styled (in this example, <p> elements). To style a different element, change the selector. Declaration This is a single rule like color: red;. It specifies which of the element's
properties you want to style.
Properties These are ways in which you can style an HTML element. (In this example, color is a property of the <p> elements.) In CSS, you choose which
properties you want to affect in the rule. Property value To the right of the property--after the colon--there is the property value. This chooses one out of many possible appearances for a given property. (For example, there...
... px values as you like. Your work-in-progress should look similar to this: CSS: all about boxes Something you'll notice about writing CSS: a lot of it is about boxes. This includes setting size, color, and position. Most HTML elements on your page can be thought of as boxes sitting on top of other boxes. CSS layout is mostly based on the box model. Each box taking up space on your page has
properties like: padding, the space around the content. In the example below, it is the space around the paragraph text. border, the solid line that is just outside the padding. margin, the space around the outside of the border. In this section we also use: width (of an element). background-color, the color behind an element's content and padding. color, the color of an element's content (usu...
Third-party APIs - Learn web development
es Now let's look at another API example -- the New York Times API. This API allows you to retrieve New York Times news story information and display it on your site. This type of API is known as a RESTful API -- instead of getting data using the features of a JavaScript library like we did with Mapquest, we get data by making HTTP requests to specific URLs, with data like search terms and other
properties encoded in the URL (often as URL parameters). This is a common pattern you'll encounter with APIs. An approach for using third-party APIs Below we'll take you through an exercise to show you how to use the NYTimes API, which also provides a more general set of steps to follow that you can use as an approach for working with new APIs. Find the documentation When you want to use a third party A...
...f no articles are returned. 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. To work out which
properties in the article objects contained the right data to show, we consulted the Article Search API reference (see NYTimes APIs). Most of these operations are fairly obvious, but a few are worth calling out: We used a for loop (for(var j = 0; j < current.keywords.length; j++) { ... } ) to loop through all the keywords associated with each article, and insert each one inside its own <span>, inside ...
CSS performance optimization - Learn web development
s a style sheet it knows that it only needs to apply it for a specific scenario, it still downloads the stylesheet, but doesn't render block. By separating out the CSS into multiple files, the main render-blocking file, in this case styles.css, is much smaller, reducing the time that rendering is blocked. Animating on the GPU Browsers are optimized to handle CSS animations, and handle animating
properties that do not trigger a reflow (and therefore also a repaint) very well. To improve performance, the node being animated can be moved off the main thread and onto the GPU.
Properties that will lead to compositing include 3D transforms (transform: translateZ(), rotate3d(), etc.), animating transform and opacity, position: fixed, will-change, and filter. Some elements, including <video>, <canvas> and...
... moved off the main thread and onto the GPU.
Properties that will lead to compositing include 3D transforms (transform: translateZ(), rotate3d(), etc.), animating transform and opacity, position: fixed, will-change, and filter. Some elements, including <video>, <canvas> and <iframe>, are also on their own layer. When an element is promoted as a layer, also known as composited, animating transform
properties is done in the GPU, resulting in improved performance, especially on mobile. will-change property The CSS will-change property tells browsers which
properties of an element are expected to change enabling browsers to set up optimizations before the element is actually changed, improving performance by doing potentially expensive work before it is required. will-change: opacity, transform; The...
Framework main features - Learn web development
Writing components As mentioned in the previous chapter, most frameworks have some kind of component model. React components can be written with JSX, Ember components with Handlebars, and Angular and Vue components with a templating syntax that lightly extends HTML. Regardless of their opinions on how components should be written, each framework's components offer a way to describe the external
properties they may need, the internal state that the component should manage, and the events a user can trigger on the component's markup. The code snippets in the rest of this section will use React as an example, and are written with JSX.
Properties Properties, or props, are external data that a component needs in order to render. Suppose you're building a website for an online magazine, and you need ...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Componentizing our React app - Learn web development
from our map() function -- remember that JSX allows us to mix up JavaScript and markup structures! Let's try the following instead of what we have already: const taskList = props.tasks.map(task => <Todo />); Look again at your app; now our tasks look more like they used to, but they're missing the names of the tasks themselves. Remember that each task we map over has the id, name, and checked
properties we want to pass into our <Todo /> component. If we put that knowledge together, we get code like this: const taskList = props.tasks.map(task => ( <Todo id={task.id} name={task.name} completed={task.completed} /> )); Now the app looks like it did before, and our code is less repetitive. Unique keys Now that React is rendering our tasks out of an array, it has to keep track of which one is wh...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
React interactivity: Events and state - Learn web development
riggers a simple alert. The onClick attribute has special meaning here: it tells React to run a given function when the user clicks on the button. There are a couple of other things to note: The camel-cased nature of onClick is important -- JSX will not recognize onclick (again, it is already used in JavaScript for a specific purpose, which is related but different -- standard onclick handler
properties). All browser events follow this format in JSX - on, followed by the name of the event. Let's apply this to our app, starting in the Form.js component. Handling form submission At the top of the Form() component function, create a function named handleSubmit(). This function should prevent the default behavior of the submit event. After that, it should trigger an alert(), which can say whate...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Getting started with Svelte - Learn web development
t is being imported and used. This file is the entry point for our app, and it initially looks like this: import App from './App.svelte'; const app = new App({ target: document.body, props: { name: 'world' } }); export default app; main.js starts by importing the Svelte component that we are going to use. Then in line 3 it instantiates it, passing an option object with the following
properties: target: The DOM element inside which we want the component to be rendered, in this case the <body> element. props: the values to assign to each prop of the App component. A look under the hood How does Svelte manage to make all these files work together nicely? The Svelte compiler processes the <style> section of every component and compiles them into the public/build/bundle.css file. I...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Dynamic behavior in Svelte: working with variables and props - Learn web development
p, we covered the following topics: Creating and using components. Turning static markup into a live template. Embedding JavaScript expressions in our markup. Iterating over lists using the {#each} directive. Passing information between components with props. Listening to DOM events. Declaring reactive statements. Basic debugging with console.log() and reactive statements. Binding HTML
properties with the bind:property directive. Triggering reactivity with assignments. Using reactive expressions to filter data Explicitly defining our reactive dependencies In the next article we will add further functionality, which will allow users to edit todos. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side frameworks Framework mai...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Vue conditional rendering: editing existing todos - Learn web development
f that todo item is now out of whack. If you try checking (or unchecking) it again, the completed count will change in the opposite way to what you'd expect. This is because the isDone inside data is only given the value this.done on component load. Fixing this is fortunately quite easy -- we can do this by converting our isDone data item into a computed property -- another advantage of computed
properties is that they preserve reactivity, meaning (among other things) that their state is saved when the template changes like ours is now doing. So, let's implement the fix: Remove the following line from inside our data() property: isDone: this.done, Add the following block below the data() { } block: computed: { isDone() { return this.done; } }, Now when you save and re...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Rendering a list of Vue components - Learn web development
" :done="true"></to-do-item> </li> </ul> When you make this change, every JavaScript expression between the <li> tags will have access to the item value in addition to the other component attributes. This means we can pass the fields of our item objects to our ToDoItem component -- just remember to use the v-bind syntax. This is really useful, as we want our todo items to display their label
properties as their label, not a static label of "My Todo Item". In addition, we want their checked status to reflect their done
properties, not always be set to done="false". Update the label="My ToDo Item" attribute to :label="item.label", and the :done="false" attribute to :done="item.done", as seen in context below: <ul> <li v-for="item in ToDoItems" :key="item.id"> <to-do-item :label="i...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Vue resources - Learn web development
ajor release of the framework with a lot of major changes. It went into active beta in April, 2020. The biggest change is a new Composition API that works as an alternative to the current property-based API. In this new API, a single setup() function is used on the component. Only what you return from this function is available in your <template>s. You are required to be explicit about "reactive"
properties when using this API. Vue handles this for you using the Options API. This makes the new API typically considered a more advanced use case. There are also a handful of other changes, including a change in how Apps are initialized in Vue. To read more about the changes involved with Vue 3, refer to this article by Vue School which goes over most of the major changes in Vue 3. Previous Overvi...
... interactivity: Events, classes and state Ember Interactivity: Footer functionality, conditional rendering Routing in Ember Ember resources and troubleshooting Vue Getting started with Vue Creating our first Vue component Rendering a list of Vue components Adding a new todo form: Vue events, methods, and models Styling Vue components with CSS Using Vue computed
properties Vue conditional rendering: editing existing todos Focus management with Vue refs Vue resources Svelte Getting started with Svelte Starting our Svelte Todo list app Dynamic behavior in Svelte: working with variables and props Componentizing our Svelte app Advanced Svelte: Reactivity, lifecycle, accessibility Working with Svelte stores TypeScript support in Sv...
Theme concepts
o suppress the mandatory "theme_frame": image with an empty or transparent image. You would use an empty or transparent image if, for example, you wanted to tile a centrally justified image, such as to create this effect Here you specify the weta image like this: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta_for_tiling.png"] }, and the images tiling with: "
properties": { "additional_backgrounds_alignment": [ "top" ], "additional_backgrounds_tiling": [ "repeat" ] }, Full details of how to setup this theme can be found in the themes example weta_tiled. Full detais of the alignment and tiling options can be found in the "theme" key description. Alternatively, you can use multiple images, say combining the original weta image with this one anchored to the ...
...gnment and tiling options can be found in the "theme" key description. Alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header to create this effect Where the images are specified with: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta.png", "weta-left.png"] }, and their alignment by: "
properties": { "additional_backgrounds_alignment": [ "right top" , "left top" ] }, Full details of how to setup this theme can be found in the themes example weta_mirror. Full details of the alignment options can be found in the "theme" key description. Static animated themes It is possible to create an animated theme using an APNG format image, as in the themes example animated. However, remember that...
Chrome registration
the user interface are also contained within the content packages, as well as most XBL binding files. Locale Localizable applications keep all their localized information in locale providers. This allows translators to plug in a different chrome package to translate an application without altering the rest of the source code. The two main types of localizable files are DTD files and Java-style
properties files. Skin A skin provider is responsible for providing a complete set of files that describe the visual appearance of the chrome. Typically a skin provider will provide CSS files and images. Note: Scripts (including those found in XBL) loaded from skin packages will not execute. The chrome registry The Gecko runtime maintains a service known as the chrome registry that provides mappings...
...ult since Firefox 1.5. Disabling it manually was possible by specifying xpcnativewrappers=no until Firefox 4. Note: Support for this flag has been removed in Gecko 2.0. You can no longer disable XPCNativeWrappers. To update your add-on to work without this flag: If your add-on depends upon XBL bindings attached to content objects (that is, it needs to be able to call functions or get and set
properties created by the XBL binding), you'll need to use the object's wrappedJSObject property to obtain a wrapped object. If you need to call functions or access
properties defined by the content -- for example, if your add-on wants to add a button to the page that calls a JavaScript function defined by the page. The xpcnativewrappers flag applies only to content packages; it is not recognized for lo...
Debugging on Windows
elect General from the drop down list. "Program arguments:" should show the options. Some common options would be the URL of the file you want the browser to open as soon as it starts, starting the Profile Manager, or selecting a profile. You can also redirect the console output to a file (by adding "> filename.txt" for example, without the quotes). In VC 7 and 8 this option is called Project >
Properties > Debugging > Command Arguments. VC 8 also allows you to set environment variables there. Setting breakpoints in DLLs which are not yet loaded in memory VC++ 6.0: Go to Project > Settings..., Debug tab and select "Additional DLLs" from the drop down list. Check "Locate Additional DLLs" option. For each DLL, click the "New" button which creates a new entry and then hit the "..." buttons which le...
... There is an environment variable that can disable breaking for assertions. This is how you would normally set it: set XPCOM_DEBUG_BREAK=warn The environment variable takes also other values besides warn, see XPCOM_DEBUG_BREAK for more details. Note that unlike Unix, the default for Windows is not warn, it's to pop up a dialog. To set the environment variable for Visual Studio, use Project >
Properties > Debugging > Environment and click the little box. Then use XPCOM_DEBUG_BREAK=warn Changing running code You normally shouldn't need to do this (just quit the application, set the environment variable described above, and run it again). And this can be dangerous (like trashing your hard disc and corrupting your system). So unless you feel comfortable with this, don't do it. You have been warn...
Multiple Firefox profiles
d the selected profile, without prompting at startup. Note: To access other profiles after selecting this option, you must start the Profile Manager first. Using the profiles Windows If you want to have the profile manager to pop up each time you start Firefox, so you can choose a profile, you will need to edit the "Target" of the launch icon. To do this: Right-click the icon and choose "
Properties". When the
properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path. After the closing quote, add -ProfileManager. Click Ok. Now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use. If you want individual icons to launch specific profiles, you wil...
...can edit, and it should show the current file path. After the closing quote, add -ProfileManager. Click Ok. Now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use. If you want individual icons to launch specific profiles, you will need to edit the "Target" of each icon. To do this: Right-click the icon and choose "
Properties". When the
properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path. To permanently set a specific profile, add -p PROFILE_NAME to the target path, but outside of the quotes, replacing "PROFILE_NAME" with the actual profile name you chose. If you would also like to allow multiple instances of Firefox to run at the same time...
Cross Process Object Wrappers
ver, although CPOWs are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid. Passing CPOWs from frame scripts Frame scripts can send messages to chrome using one of two global functions: sendAsyncMessage() or sendSyncMessage(). The optional third parameter to each of these functions is an object whose
properties are objects to wrap. For example, this frame script sends a DOM node to chrome when the user clicks it, as the clicked property of the third argument: // frame script addEventListener("click", function (event) { sendAsyncMessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); In the chrome script, the DOM node is now accessible through a Cross Process Object Wrapper, ...
...he clicked property of the third argument: // frame script addEventListener("click", function (event) { sendAsyncMessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); In the chrome script, the DOM node is now accessible through a Cross Process Object Wrapper, as a property of the objects property of the message. ...
mozbrowseractivitydone
manifest does not include returnValue or returnValue is false, no mozbrowseractivitydone event will be generated as of the landing of bug 1194525 in Firefox OS 2.5. postResult and postError calls made on such an activity will be ignored and have no effect. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: success A Boolean that indicates whether the activity has completed successfully (true) or not (false). Examples var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowseractivitydone", function(event) { if(event.details.success) { console.log('Activity completed successfully'); } else { console.log('Activity not completed successfully'); } }); Re...
mozbrowserasyncscroll
acing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowserasyncscroll event is fired when the content of a browser <iframe> is scrolled. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: top The scroll top position in CSS pixels of the document within the browser <iframe>. left The scroll left position in CSS pixels of the document within the browser <iframe>. width The width in CSS pixels of the visible part of the document within the browser <iframe>. height The height in CSS pixels of the visible part of the document within the browser <iframe>. scrollWidth The to...
mozbrowsererror
ill not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowsererror event is fired when an error occurs while trying to load content within a browser <iframe>. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
...he browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. detail The detail property returns an anonymous JavaScript object with the following
properties: type A DOMString representing the type of error that occurred. Possible values are: fatal(crash) unknownProtocolFound fileNotFound dnsNotFound connectionFailure netInterrupt netTimeout cspBlocked phishingBlocked malwareBlocked unwantedBlocked offline malformedURI redirectLoop unknownSocketType netReset notCached isprinting deniedPortAccess proxyResol...
mozbrowserfindchange
behavior may change in the future. The mozbrowserfindchange event is fired when a search method is invoked in the browser <iframe> content. This includes HTMLIFrameElement.findAll(), HTMLIFrameElement.findNext(), and HTMLIFrameElement.clearMatch(). General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: active A Boolean indicating whether a search is currently active (true), or not (false.) searchString A DOMString representing the string that is currently being searched for. searchLimit A number indicating the maximum number of searches that can be returned. numberOfMatches A number indicating the number of matches returned by the search. activeMatchOrdinal A number indicating the ...
mozbrowsericonchange
d the behavior may change in the future. The mozbrowsericonchange event is sent when a new icon (e.g. <link rel="icon"> or <link rel="apple-touch-icon">) is available in the browser <iframe>'s content. It will be fired once for each icon available. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: href A DOMString representing the path to the new icon. sizes A DOMString listing the sizes the new icon is available in, e.g. "16x16" or "16x16 32x32". The any keyword can also be used, to represent "any size." rel A DOMString representing the rel attribute value from the <link> element used to link to the icon. Example var browser = document.querySelector("iframe"); browser.addEve...
mozbrowserloadend
rloadend event is fired when the browser <iframe> has finished loading all its assets, or has failed to load. This can be used when the embedder wants to stop spinning a loading indicator, or update the UI in some other way to indicate loading is complete. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
...he browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. detail The detail property returns an anonymous JavaScript object with the following
properties: backgroundColor A DOMString representing the main background color of the browser <iframe> content, expressed as an RGB value. Can be used to make the theme of the surrounding UI complement the theme of the currently loaded content, for example. Example In this example the mozbrowserloadstart and mozbrowserloadend events are used to change the icon shown on the stop/reload button between ...
mozbrowserlocationchange
ry user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowserlocationchange event is fired when a browser <iframe>'s location changes -- it is fired every time navigation occurs. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
...he browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. detail The detail property returns an anonymous JavaScript object with the following
properties: url A DOMString representing the URL of the new location. canGoBack A Boolean that defines whether it's possible to go back in the navigation history (true) or not (false). canGoForward A Boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). Example This example updates the URL bar so that it will always display the correct URL for t...
mozbrowsermanifestchange
change in the future. The mozbrowsermanifestchange event is fired when the manifest location of the app loaded in the browser <iframe> changes. By this, we are referring to the href of the manifest, as defined in <link rel="manifest" href=" ... ">. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: href The URL of the new app manifest. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowsermanifestchange", function(event) { console.log("New manifest URL: " + event.details.href); }); Related Events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationc...
mozbrowsermetachange
e large incompatibilities between implementations and the behavior may change in the future. The mozbrowsermetachange event is fired when a <meta> element related to web applications is added, removed or changed. See below for the applicable types. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: name A DOMString representing the <meta> name attribute value. This can be viewmode, theme-color, theme-group, or application-name. content A DOMString representing the <meta> content attribute value, i.e. the content of the meta tag. type A DOMString representing the type of meta change that this event object represents. This can be added, changed, removed, or undefined. lang Optional ...
mozbrowseropensearch
n implementations and the behavior may change in the future. The mozbrowseropensearch event is fired when a link to a search engine is found -- i.e. when an instance of <link rel="search" type="application/opensearchdescription+xml"> is encountered. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: title A DOMString representing the title of the search engine. href A DOMString representing URL of the search engine. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowseropensearch", function( event ) { console.log("New search engine encountered: " + event.details.title); }); Related Events mozbrowserasyncscroll mozbrowserclose mozbrowse...
mozbrowseropentab
entations and the behavior may change in the future. The mozbrowseropentab event is fired when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: url A DOMString representing the URL of the new document loaded. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowseropentab", function( event ) { console.log("A new document has opened containing the content at " + event.details.url + "."); }); Related Events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror moz...
mozbrowseropenwindow
usually when the content of a browser <iframe> successfully calls the window.open() method, or the user clicks on a link with an unknown target. The embedder must use the <iframe> passed in the event.details.frameElement property as the new window content. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: url A DOMString representing the URL of the document loaded within the frameElement property. name A DOMString representing the name of the new browser window. features A DOMString containing features represented by a list of names and values separated by commas. For a complete list of possible features, see window.open(). frameElement An object representing the new browser <iframe> th...
mozbrowserresize
acing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowserresize event is fired when a browser <iframe> viewport is resized in some way. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None
Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
... browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following
properties: width A number representing the new width of the <iframe> viewport, in device pixels. height A number representing the new height of the <iframe> viewport, in device pixels. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowserresize", function( event ) { console.log("The new window size is " + event.details.width + " x " + event.details.height ...
Assert.jsm
act approximation of equality between two objects to keep the chance of false positives to a minimum. JSON.stringify is not designed to be used for this purpose; objects may have ambiguous toJSON() implementations that would influence the test. ...
... as equivalent to expected, including nested
properties expected Test reference to evaluate against actual message Short explanation of the expected result notDeepEqual() The non-equivalence assertion tests for any deep inequality. undefined notDeepEqual( actual, expected, message ); Parameters actual Test subject to be evaluated as not equivalent to expected, including nested
properties expected Test reference to evaluate against actual message Short explanation of the expected result strictEqual() The strict equality assertion tests strict equality, as determined by ===. undefined strictEqual( actual, expected, message ); Parameters actual Test subject to be evaluated as strictly equivalent to expected expected Test reference to evaluate against actual me...
API-provided widgets
Properties Property Description id the ID of the widget (required). type a string indicating the type of widget. Possible types are button for simple button widgets (the default) view for buttons that open a panel or subview, depending on where they are placed. custom for fine-grained control over the creation of the widget. viewId Only useful for views (and required there): the id of the that should be shown when clicking the widget. ...
... in an overflowable toolbar (optional, default: true) defaultArea default area to add the widget to (optional, default: none; required if non-removable) shortcutId id of an element that has a shortcut for this widget (optional, default: null). This is only used to display the shortcut as part of the tooltip for builtin widgets (which have strings inside customizableWidgets.
properties). If you're in an add-on, you should not set this property, and should instead include the shortcut as part of the tooltiptext you pass in yourself. showInPrivateBrowsing whether to show the widget in private browsing mode (optional, default: true) Event handlers You can also define several event handlers which will be called at various stages in a widget's lifetime: ...
Widget Wrappers
Widget wrappers are objects that provide information about a widget. There are 'group' wrappers which provide information about the widget across all windows, and 'single' wrappers which provide information about a specific instance in a specific window. Group wrapper Methods forWindow() A method to obtain a single window wrapper for a widget, in the window aWindow passed as the only argument.
Properties All of a wrapper's
properties are read-only unless otherwise indicated. Attribute Description id the widget's ID type the type of widget (button, view, custom). For XUL-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of PROVIDER_API or PROVIDER_XUL instances an array of all instances (single...
...her the widget is currently disabled. NB: this property is writable, and will toggle all the widgets' nodes' disabled states label for API-provided widgets, the label of the widget tooltiptext for API-provided widgets, the tooltip of the widget showInPrivateBrowsing for API-provided widgets, whether the widget is visible in private browsing Single wrapper
Properties All of a wrapper's
properties are read-only unless otherwise indicated. Attribute Description id the widget's ID type the type of widget (button, view, custom). For XUL-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of PROVIDER_API or PROVIDER_XUL node reference to the corresponding DOM nod...
DownloadError
becauseSourceFailed Read only boolean Indicates an error occurred while reading from the remote location. ...
...re.
Properties Attribute Type Description result Read only nsresult The result code associated with this error. becauseSourceFailed Read only boolean Indicates an error occurred while reading from the remote location. becauseTargetFailed Read only boolean Indicates an error occurred while writing to the local target. Inherits
properties from Error. ...
DownloadTarget
This is a dynamic property, which is updated when the download is completed or when the Download.refresh() method is called. ...
...rom the front-end to reduce file I/O that would be required to check the file directly. Methods refresh() Updates the state of a finished, failed, or canceled download based on the current state as indicated by the file system. If the download is in progress or has been finalized, this method does nothing and returns a resolved Promise. Calling this method lets the Download object's
properties be updated if the user moves or deletes the target file or its associated ".part" file, which contains a partially-downloaded file's contents. Promise refresh(); Parameters None. Promise resolves to undefined when the state of the download has been updated. Promise can be rejected with Never. ...
FxAccountsOAuthClient.jsm
ountsOAuthClient(Object options); Method overview launchWebFlow(); tearDown(); Attributes parameters Object Returns the set of parameters that initialized the Firefox Accounts OAuth flow. onComplete Function Gets called when the Firefox Accounts OAuth flow successfully completes. First and only argument is an Object that has "state" and "code"
properties. Constructor FxAccountsOAuthClient() Creates and returns a new FxAccountsOAuthClient object. FxAccountsOAuthClient FxAccountsOAuthClient( Object options Object parameters String client_id String state String oauth_uri String content_uri [optional] String scope [optional] String action [optional] String authorizationEndpoint ); Parameters cl...
...ks that are in use by this client. ...
XPCOMUtils.jsm
This section provides some pseudocode that demonstrates how to put together a JavaScript class based on the steps listed above. Constructor The constructor is a simple method that handles any required initialization tasks. function MyComponent() { // initialize the component here } Class declaration Declare the class prototype, using a form similar to this. MyComponent.prototype = { //
properties required for XPCOM registration: classDescription: "unique text description", classID: Components.ID("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractID: "@example.com/xxx;1", // [optional] custom factory (an object implementing nsIFactory). If not // provided, the default factory is used, which returns // |(new MyComponent()).QueryInterface(iid)| in its createInstan...
...nts and can be assigned to NSGetFactory global variable. generateCI() Generates an nsIClassInfo implementation for a component. The returned object should be assigned to the classInfo property of a JS object, the QueryInterface() function generated by generateQI will return it automatically then. function generateCI( classInfo ); Parameters classInfo An object containing the optional
properties interfaces, contractID, classDescription, classID, flags. This parameter should not be the component itself because that would cause a memory leak. Return value An nsIClassInfo implementation returning the values of the
properties from the classInfo parameter in its various
properties. Exceptions thrown This method throws an exception with the message "In generateCI, don't use a component fo...
Application Translation with Mercurial
ne new text with the id privatebrowsingpage.howToStart4 in the file aboutPrivateBrowsing.dtd. Tips for finding files with usually easily translateable texts: Look for files in browser/chrome/browser/ Look for a file with only a few changes Suggestions Files starting with about... Files in the preferences directory (browser/chrome/browser/preferences/) The browser.dtd and browser.
properties files if there aren't too many new strings. Tracking the translation progress If you translate more than a few strings, you usually want to keep track of what has already been translated (and later if the text has been tested in the product as fitting into the available area and suiting the functionality it describes). This guide achieves this with the Firefox extension Scrapbook. You ...
... if necessary) using "View" > "Sidebar" > "Scrapbook" or by clicking its toolbar button which you likely have to add by toolbar customization if you didn't do this before. Drag the tab with the localization error showing missing and obsolete strings to the sidebar. After Scrapbook has saved the web page to your local disk, click with the right mouse button on the page in the sidebar and choose "
Properties" from the context menu which gets opened. Rename it something meaningful, e.g. "Firefox <version number> translation". After you saved the dialog, click with the left mouse button on the page in the sidebar to open the locally saved copy. Opening English files and the target locale side-by-side The localization report shows the IDs of added or removed texts, but the English text itself is sti...
Localization: Frequently asked questions
This page lists tweaks and tips that may not require a complete page on its own. For more detailed documentation about localization in general, see our Localization page. ...
...s that may not require a complete page on its own. For more detailed documentation about localization in general, see our Localization page. ...
Index
to compare-locales. It allows Mozilla localizers to easily check their work. 7 L10n testing with xcode Firefox for iOS, Localization Once you have your l10n testing environment set up in Xcode, testing your Firefox on iOS localization is a breeze. 8 Localization and Plurals Internationalization, Localization You're likely here because you're localizing a .
properties file and it had a link to this page. This page is to help explain how to localize these strings so that the correct plural form is shown to the user. For example, "1 page" vs "2 pages". 9 Localization content best practices Apps, Extensions, Internationalization, Localization, Mozilla, l10n, l12y This document provides best practices for developers to create localizable code,...
... out some sweet features that will make you more efficient and make your l10n contributions easier. 27 Localizing without a specialized tool From the Create a New Localization document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (DTD and
properties) used in the Mozilla source code. With that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. Repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. 28 Mozilla L10...
L20n Javascript API
variables that extend the context data available for the evaluation of this entity. Returns a string. ctx.getEntitySync(id: String, ctxdata: Object?) Retrieve an object with data evaluated from an entity called id. If passed, ctxdata is a simple hash object with a list of variables that extend the context data available for the evaluation of this entity. Returns an object with the following
properties: value: the string value of the entity, attributes: an object of evaluated attributes of the entity, globals: a list of global variables used while evaluating the entity, locale: locale code of the language the entity is in; it can be different than the first locale in the current fallback chain if the entity couldn't be evaluated and a fallback translation had to be used. ctx.localize(id...
...textContent = l10n.entities.hello.value; node.classList.remove('hidden'); }); The callback becomes bound to the entities on the ids list. It will be called when the entities become available (asynchronously) or whenever the translation of any of the entities changes. localize should be the preferred way of localizing the UI. The callback function is passed an l10n object with the following
properties: entities: an object whose keys are the identifiers and value are the entity objects as returned by getEntitySync, reason: an object with the reason why callback was invoked. The reason object can be: { locales: Array<String> } if callback was invoked because of a change of the current locale (see requestLocales), { global: String } if callback was invoked because the value of one of th...
NSS API Guidelines
All hashing update, MACing update, and encrypt/decrypt functions which act like filters should have a consistent signature: SECStatus PK11_DigestOp(PK11Context *context, unsigned char *inBuf, SECBufferLeninLe...
...d insert their additional parameters between the context (first parameter) and the output buffer. All hashing update, MACing update, and encrypt/decrypt functions which act like filters should have a consistent signature: SECStatus PK11_DigestOp(PK11Context *context, unsigned char *inBuf, SECBufferLeninLen) Functions like these which have different
properties, for example, additional parameters, callbacks, etc., should insert their additional parameters between the context (first parameter) and the input buffer. Within your layer, multiple similar functions should have consistent parameter order. Callback Functions Callback functions should all contain an opaque parameter (void *) as their first argument, passed by the original caller. Callbacks...
Rhino Debugger
enu item. Simply single-click on the red dot or the line number of the line at which you want to clear a breakpoint. The red dot will disappear and the breakpoint at that location will be cleared. Viewing Variables The lower-left (dockable) pane in the debugger main window contains a tab-pane with two tabs, labeled "this" and "Locals". Each pane contains a tree-table which displays the
properties of the current object and currently visible local variables, respectively. This The
properties of the current object are displayed in the this table. If a property is itself a JavaScript object the property may be expanded to show its sub-
properties. The this table is updated each time control returns to the debugger or when you change the stack location in the Context: window. Locals Th...
...The Locals table is updated each time control returns to the debugger or when you change the stack location in the Context: window Watch Window You may enter arbitrary JavaScript expressions in the Watch: table located in the lower-right (dockable) pane in the debugger main window. ...
The JavaScript Runtime
yped language, the static Java type of a JavaScript value is java.lang.Object. The behavior of the JavaScript engine is undefined if a value of any type other than the ones described above is introduced into JavaScript. (This caveat does not apply to scripts that use LiveConnect; the Java values are wrapped and unwrapped as appropriate to conform to the above type constraints.) Property Access
Properties in JavaScript objects may be accessed using either string or numeric identifiers. Conceptually, all accessors are converted to strings in order to perform the lookup of the property in the object. However, this is not the implementation used in practice because a number to string conversion is too expensive to be performed on every array access. Instead, every property accessor method in Scripta...
...ument objects are host objects. The easiest way to define new host objects is by using ScriptableObject.defineClass(). This method defines a set of JavaScript objects using a Java class. Several of the examples define host objects this way. If the services provided by defineClass are insufficient, try other methods of ScriptableObject and FunctionObject, such as defineProperty and defineFunction
Properties. Contexts and Threads Every thread that executes JavaScript must have an associated Context. Multiple threads (with multiple associated Contexts) may act upon the same set of objects. Any host objects that are defined are responsible for any synchronization required to run safely from multiple threads. ...
Garbage collection
ject. Allocation Kind Cells are classified by allocation kind. The allocation kind determines the size of the object and the finalization behavior. Allocation kind is defined by enum AllocKind. Arenas always hold objects of the same allocation kind. Thus, an arena holds objects all of the same size and finalization behavior. Compartments The JS heap is partitioned into compartments. Some key
properties of compartments are: Every cell (JS heap object) belongs to at most one compartment. (Some cells are shared across all compartments in a Zone.) An object may not hold a direct pointer to an object in another compartment. Instead, it must store a wrapper for the other object. This allows compartments to be used for security checks: objects in the same compartment have the same access requireme...
...artments are a fundamental cross-cutting concept in SpiderMonkey (see also Compartments), though anything related to memory is now more concerned with Zones, especially GC. Zone A zone is a collection of compartments. Zones mainly serve as boundaries for GCs: the garbage collector collects at the level of a zone, not an individual compartment. Unlike compartments, zones have no special security
properties. Some
properties of zones are: Every compartment belongs to exactly one zone Every JS heap object belongs to exactly one zone. Objects from the same zone but different compartments can share an arena. Objects from different zones cannot be stored in the same arena. A zone remains alive as long as any JS heap objects in the zone are alive. Chunk A Chunk is the largest internal unit of m...
SpiderMonkey Internals
ed. The debugger will have to consult jsopcode.def on its own to figure out where to plant trap instructions to implement functions like step out, but a future jsdbgapi.h will provide convenience interfaces to do these things. At most one trap per bytecode can be set. When a script (JSScript) is destroyed, all traps set in its bytecode are cleared. Watchpoints, for intercepting set operations on
properties and running a debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set. Line number to PC and back mapping functions. The line-to-PC direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the PC of a for-loop update part, if given the line number of th...
...imitive types. They have similar structure, generally starting with class definitions and continuing with internal constructors, finalizers, and helper functions. jsobj.*, jsscope.* These two pairs declare and implement the JS object system. All of the following happen here: creating objects by class and prototype, and finalizing objects; defining, looking up, getting, setting, and deleting
properties; creating and destroying
properties and binding names to them. The details of a native object's map (scope) are mostly hidden in jsscope.[ch]. jsatom.cpp, jsatom.h The atom manager. Contains well-known string constants, their atoms, the global atom hash table and related state, the js_Atomize() function that turns a counted string of bytes into an atom, and literal pool (JSAtomMap) methods. ...
JSClass.flags
ERS Obsolete since JSAPI 43 Correctly implements GC read and write barriers. JSCLASS_NEW_ENUMERATE Obsolete since JSAPI 37 This class's enumerate hook is actually a JSNewEnumerateOp, not a JSEnumerateOp. JSCLASS_NEW_RESOLVE Obsolete since JSAPI 36 This class's resolve hook is actually a JSNewResolveOp, not a JSResolveOp. JSCLASS_SHARE_ALL_
PROPERTIES Obsolete since JavaScript 1.8.5 Instructs SpiderMonkey to automatically give all
properties of objects of this class the JSPROP_SHARED attribute. JSCLASS_NEW_RESOLVE_GETS_START Obsolete since JSAPI 16 The resolve hook expects to receive the starting object in the prototype chain passed in via the *objp in/out parameter. (This is meaningful only if the JSCLASS_NEW_RESOL...
...ts the new JSTraceOp signature instead of the old JSMarkOp signature. This is recommended for all new code that needs custom marking. SpiderMonkey reserves a few other flags for its internal use. They are JSCLASS_IS_ANONYMOUS, JSCLASS_IS_GLOBAL, JSCLASS_IS_PROXY, and JSCLASS_HAS_CACHED_PROTO. JSAPI applications should not use these flags. ...
JSObject
JSObject is the type of JavaScript objects in the JSAPI. Objects are made up of the following parts: Most objects have a prototype. See JS_GetPrototype. An object inherits
properties, including methods, from its prototype (which is another object). Most objects have a parent. See JS_GetParent. An object's parent is another object, usually either the global object or an object that represents an activation record. The JavaScript engine sometimes uses this relationship to implement lexical scoping. Security-sensitive applications can use this relationship to make every object a member of some security domain. Almost every object can have any number of its own
properties. The term own property refers to a property of an object that is not inherited from its prototype. Each property...
...See JS_DefineProperty. Every object is associated with a JSClass and a JSObjectOps. ...
JSObjectOps.enumerate
Warning! ...
...ject
properties. The type of the callback is JSNewEnumerateOp. For native objects, the enumerate callback first checks the JSCLASS_NEW_ENUMERATE flag of the object's class. If the flag is present, enumerate simply delegates the call to JSClass.enumerate. Otherwise, it invokes the JSClass.enumerate hook as an old-style JSEnumerateOp to give the object an opportunity to define any remaining lazy
properties. Then it iterates over obj's defined
properties, walking the internal data structure they're stored in. ...
JSPrincipals
Use JS_HoldPrincipals and JS_DropPrincipals. codebase char * Pointer to the codebase for the principal. Obsolete since JSAPI 13 getPrincipalArray void * (*)(JSContext *, JSPrincipals *) Pointer to the function that returns an array of principal definitions. Obsolete since JSAPI 12 globalPrivilegesEnabled JSBool (*)(JSContext *, JSPrincipals *) Flag indicating whether principals are enabled globally. ...
...e principals are no longer in use and are destroyed. ...
JSPropertyDescriptor
setter The set syntax binds an object property to a function to be called when there is an attempt to set that property. ...
... value (function, object, string...) configurable Declare that the property can be modified and deleted enumerable Declare that the property can be enumerated, and the enumerable genus can be traversed by the for...in loop. writable Declare whether the specified attribute can be rewritten Description A descriptor is a property that describes an object's
properties. There are two main types of property descriptors that exist in an object: a data descriptor and an access descriptor. You can use the Object.getOwnPropertyDescriptor() function to get the corresponding property of an object. Descriptor. Examples The following example demonstrates how to use the Object.defineProperty() function to create a property under an object in a javascript via a descript...
JSPropertySpec
any number of Property attributes. getter JSNativeWrapper or SelfHostedWrapper Getter method for the property. setter JSNativeWrapper or SelfHostedWrapper Setter method for the property. If a property is read-only, its setter is never called. Description JSPropertySpec defines the attributes for a single JS property to associate with an object. ...
... getter JSNativeWrapper or SelfHostedWrapper Getter method for the property. setter JSNativeWrapper or SelfHostedWrapper Setter method for the property. If a property is read-only, its setter is never called. Description JSPropertySpec defines the attributes for a single JS property to associate with an object. Pass to JS_Define
Properties or JS_InitClass to create the
properties and assign them to an object. To define an array of JSPropertySpec, use JS_PSG, JS_PSGS, JS_SELF_HOSTED_GET, JS_SELF_HOSTED_GETSET, and JS_PS_END See Also MXR ID Search for JSPropertySpec JSFunctionSpec JSNativeWrapper JS_Define
Properties JS_PSG JS_PSGS JS_SELF_HOSTED_GET JS_SELF_HOSTED_GETSET JS_PS_END bug 766448 - changed type of getter and setter to wrapper bug 938728 - added selfH...
JS_AlreadyHasOwnProperty
y is found or false if it is not found. If an error occurs, the value left in *foundp is undefined. Description These functions attempt to determine whether a property already exists on a specific JSObject without modifying the object. By design, this search may not find a property that other property lookup functions, such as JS_LookupProperty, would find. For native objects--objects whose
properties are stored in the default data structure provided by SpiderMonkey--these functions simply check that data structure to see if the specified field is present. They do not search anywhere else for the property. This means that: The prototype chain of obj is not searched. The object's JSClass.resolve hook is not called, so lazily defined
properties are not found. (This is the only API that can di...
...ta structure to see if the specified field is present. They do not search anywhere else for the property. This means that: The prototype chain of obj is not searched. The object's JSClass.resolve hook is not called, so lazily defined
properties are not found. (This is the only API that can directly detect that a lazily resolved property has not yet been resolved.) Shared, permanent, delegated
properties are not found. (Such
properties are an implementation detail of SpiderMonkey. They are meant to be a transparent optimization; this is the only API that breaks the abstraction.) For non-native objects, this falls back on a complete search. This calls the JSObjectOps.lookupProperty hook. *foundp is set to true only if lookupProperty reports that the property was found on obj itself and not on som...
JS_DefineProperty
escription JS_DefineProperty defines a single property in a specified object, obj. JS_DefineUCProperty is the Unicode version of the function. JS_DefinePropertyById is the same but takes a JS::HandleId for the property name. JS_DefineProperty is the fundamental operation on which several more convenient, higher-level functions are based, including JS_DefineFunction, JS_DefineFunctions, JS_Define
Properties, JS_DefineConstDoubles, JS_DefineObject, and JS_InitClass. It differs from JS_SetProperty in that: it does not behave like ordinary property assignment in the JavaScript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's behavior; it never calls a setter; it can call the JSClass.addProperty callback when JS_SetProperty ...
...er; it can call the JSClass.addProperty callback when JS_SetProperty would not, because it can replace an existing property. The parameters specify the new property's name, initial stored value, getter, setter, and Property attributes (attrs). If obj already has an own property with the given name or id, the existing property is replaced. These functions can currently replace JSPROP_PERMANENT
properties, but such usage is deprecated. The JavaScript engine will call the getter or setter callback each time the property is read or written, whether from JavaScript code or via JSAPI functions like JS_GetProperty and JS_SetProperty. (Exception: If attrs contains the JSPROP_READONLY flag, the setter will never be called, as property assignment will fail before it gets that far. Also note that certain ...
JS_DefinePropertyWithTinyId
obj JSObject * Object for which to create the new property. name const char * or const jschar * Name for the property to create. namelen size_t (only in JS_DefineUCPropertyWithTinyId) The length of name in characters; or (size_t) -1 to indicate that name is null-terminated. tinyid int8 8-bit ID to aid in sharing getter and setter callbacks among
properties. value jsval Initial stored value for the new property. getter JSPropertyOp getProperty method for retrieving the current property value. setter JSPropertyOp setProperty method for specifying a new property value. attrs unsigned int Property attributes. Description JS_DefinePropertyWithTinyId defines an object property with a tin...
...y-id-aware callback, it passes INT_TO_JSVAL(tinyid) instead. The tiny-id-aware callbacks are: property getters and setters; and JSClass.addProperty, .delProperty, .getProperty, and .setProperty. Tiny ids only affect the ids passed to these hooks; the JavaScript engine does not use them as property names internally. Tiny ids are helpful for getters and setters that are shared by several different
properties. Those getters and setters can use switch (JSVAL_TO_INT(id)), instead of checking the value of id as a string, to determine which property is being accessed. However, tiny ids can cause confusion when used with JSClass callbacks. For example, if a property named "color" is defined with tiny id 10, then the JavaScript expressions obj[10] and obj.color will both result in INT_TO_JSVAL(10) being pa...
JS_DeleteElement2
m an object, obj. If an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. If deletion is successful, JS_DeleteElement2 stores true to *succeeded and returns true. Otherwise it returns false and the value of *succeeded is undefined. ...
...Element2 removes read-only
properties from objects as long as they are not also permanent. For JavaScript 1.2 and earlier, if deletion fails because the property is permanent, JS_DeleteElement2 reports the error and returns false. For JavaScript 1.3, the attempt is silently ignored. In both these cases, *succeeded will receive the stored value of the property that was not deleted. To remove all
properties from an object, call JS_ClearScope. See Also MXR ID Search for JS_DeleteElement2 bug 1113369 -- added result parameter ...
JS_FS
Syntax #define JS_FS(name,call,nargs,flags) ... #define JS_FN(name,call,nargs,flags) ... #define JS_SYM_FN(symbol,call,nargs,flags) ... // Added in SpiderMonkey 38 #define JS_FNINFO(name,call,info,nargs,flags) ... // Added in SpiderMonkey 17 #define JS_SELF_HOSTED_FN(name,selfHostedName,nargs,flags) ... // Added in SpiderMonkey 31 #define JS_SELF_HOSTED_SYM_FN(symbol, selfHostedName, nargs, flags) ... // Added in SpiderMonkey 38 #define JS_SYM_FNSPEC(symbol, call, info, nargs, flags, selfHostedName) ... // Added in SpiderMonkey 38 #define JS_FNSPEC(name,call,info,nargs,flags,selfHostedName) ... ...
...nes a method with the string id "@@iterator".) See an example in the JSAPI User Guide. See Also MXR ID Search for JS_FS MXR ID Search for JS_FN MXR ID Search for JS_SYM_FN MXR ID Search for JS_FNINFO MXR ID Search for JS_SELF_HOSTED_FN MXR ID Search for JS_SELF_HOSTED_SYM_FN MXR ID Search for JS_SYM_FNSPEC MXR ID Search for JS_FNSPEC MXR ID Search for JS_FS_END JSFunctionSpec JS_Define
Properties JS_InitClass bug 775788 - added JS_FNINFO. bug 920433 - added JS_SELF_HOSTED_FN and JS_FNSPEC. bug 1082672 - added JS_SYM_FN JS_SELF_HOSTED_SYM_FN JS_SYM_FNSPEC. ...
JS_NewPropertyIterator
is feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. Crate an iterator object for use with JS_NextProperty. Syntax JSObject * JS_NewPropertyIterator(JSContext *cx, JS::Handle<JSObject*> obj); Name Type Description cx JSContext * The JS context in which to enumerate
properties. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JS::Handle<JSObject*> The object whose
properties are to be enumerated. Description Create an object to iterate over the enumerable own
properties of obj, in arbitrary order. (This differs from longstanding for..in loop order, which uses the order in which obj's propertie...
...er must be in a request on this JSContext. obj JS::Handle<JSObject*> The object whose
properties are to be enumerated. Description Create an object to iterate over the enumerable own
properties of obj, in arbitrary order. (This differs from longstanding for..in loop order, which uses the order in which obj's
properties were defined. Note also that while for..in includes
properties inherited from prototypes, iterator objects do not.) On success, this returns an iterator object that can be passed to JS_NextProperty to fetch the property ids. On error, it returns NULL. The iterator object created by this function is not a JavaScript Iterator. It is an opaque object with no
properties visible from JavaScript. See Also bug 1081660 ...
JS_NextProperty
till work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. Get the next property id from an iterator object produced by JS_NewPropertyIterator. Syntax bool JS_NextProperty(JSContext *cx, JS::HandleObject iterobj, JS::MutableHandleId idp); Name Type Description cx JSContext * The JS context in which to enumerate
properties. ...
... Description On success, JS_NextProperty returns true, with *idp containing the id of the next enumerable own property to visit using iterobj, or JSID_VOID if there is no such property left to visit. On error, it returns false, and the value left in *idp is undefined. ...
JS_PSGS
Syntax #define JS_PSG(name, getter, flags) ... #define JS_PSGS(name, getter, setter, flags) ... #define JS_SELF_HOSTED_GET(name, getterName, flags) ... // Added in SpiderMonkey 31 #define JS_SELF_HOSTED_GETSET(name, getterName, setterName, flags) ... // Added in SpiderMonkey 31 #define JS_PS_END ... Name Type Description name const char * The JavaScript name for the property. (or index, if JSPROP_INDEX is present in flags) getter JSNative Pointer to the C/C++ implementation of the getter function. ...
... const char * The function's name in Self-Hosted JavaScript code for setter function. Description These macros encapsulate the definition of JSNative-backed JSPropertySpecs, by defining the JSNativeWrappers for them. See Also MXR ID Search for JS_PSG MXR ID Search for JS_PSGS MXR ID Search for JS_SELF_HOSTED_GET MXR ID Search for JS_SELF_HOSTED_GETSET JSPropertySpec JS_Define
Properties JS_InitClass bug 684526 - added. bug 938728 - added JS_SELF_HOSTED_GET and JS_SELF_HOSTED_GETSET. ...
JS_PreventExtensions
Syntax // Added in SpiderMonkey 45 bool JS_PreventExtensions(JSContext *cx, JS::HandleObject obj, JS::ObjectOpResult &result); // Obsolete since JSAPI 39 bool JS_PreventExtensions(JSContext *cx, JS::HandleObject obj, bool *succeeded); Name Type Description cx JSContext * The context. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext. obj JS::HandleObject Object to be made non-extensible. result JS::ObjectOpResult & (out parameter) Receives the result of the operation. ...
...ject Object to be made non-extensible. result JS::ObjectOpResult & (out parameter) Receives the result of the operation. Added in SpiderMonkey 45 succeeded bool * Outparam indicating, on JSAPI success, whether the object is now non-extensible. Obsolete since JSAPI 39 Description All JavaScript objects recognize the concept of extensibility: whether new
properties may be added to the object. In some situations, it may be convenient to prohibit new
properties. In JavaScript this may be accomplished using the Object.preventExtensions method. The similar JSAPI method is JS_PreventExtensions. The failure-mode information below is new as of SpiderMonkey 36. Before then, JS_PreventExtensions did not accept a succeeded argument; in those cases where *succee...
Stored value
In the JSAPI, the stored value of an object property is its last known value. For a data property, this is exactly the same thing as the property's current value. The JavaScript engine sets aside a field of type jsval for the stored value of most object
properties, even
properties that have getters. The stored value is updated each time the program gets or sets the property. The new stored value is the result of getting or setting the property, after the getter or setter, if any, is called. ...
...even
properties that have getters. The stored value is updated each time the program gets or sets the property. The new stored value is the result of getting or setting the property, after the getter or setter, if any, is called. JS_DefineProperty allows the application to specify a property's initial stored value. JS_LookupProperty fetches a property's stored value without triggering its getter.
Properties with the JSPROP_SHARED attribute do not have a stored value. ES5 accessor
properties, as in {get length() { return 0; }, automatically have JSPROP_SHARED.
Properties of objects that have custom JSObjectOps do not have a stored value. Stored values are strong references for the purpose of garbage collection. As long as an object is reachable, the stored values of its
properties are reachable and w...
SavedFrame
me view that the content compartment has (A -> C), or it can view all stack frames, including the frames from chrome compartments (A -> B -> C). To view everything, use an XrayWrapper. This is the default wrapper. To see the stack as the content compartment sees it, waive the xray wrapper with Components.utils.waiveXrays: const contentViewOfStack = Components.utils.waiveXrays(someStack); Accessor
Properties of the SavedFrame.prototype Object source The source URL for this stack frame, as a string. line The line number for this stack frame. column The column number for this stack frame. functionDisplayName Either SpiderMonkeyaEUR(TM)s inferred name for this stack frameaEUR(TM)s function, or null. asyncCause If this stack frame is the asyncParent of other stack frames, then this is a string repre...
...e asynchronous call, for example where the promise was created. If the frame responsible for the call is not accessible to the caller, this points to the youngest accessible ancestor of the real frame, if any. In all other cases, this is null. parent This stack frameaEUR(TM)s caller, or null if this is the oldest frame on the stack. In this case, there might be an asyncParent instead. Function
Properties of the SavedFrame.prototype Object toString Return this frame and its parents formatted as a human readable stack trace string. Source Metadata Generated from file: js/src/doc/SavedFrame/SavedFrame.md Watermark: sha256:3475238d6704c659cb3e411b9c601d6ee836762dea14203f1f00ecf2c3b32452 Changeset: 251fccc1f62b ...
TPS Password Lists
Required. submitURL: the submit URL for the password. Optional. Used for passwords in form fields. realm: the http realm for the password. Optional. Used for http authentication passwords. username: required. password: required. usernameField: the username field for a form password. Optional. passwordField: the password field for a form password. Optiona...
...ed. submitURL: the submit URL for the password. Optional. Used for passwords in form fields. realm: the http realm for the password. Optional. Used for http authentication passwords. username: required. password: required. usernameField: the username field for a form password. Optional. passwordField: the password field for a form password. Optional. changes: an object containing any of the above
properties, which are applied during a modify action. Optional. Password lists and phase actions Following are the functions that can be used in phase actions related to passwords: Passwords.add Passwords.delete Passwords.modify Passwords.verify Passwords.verifyNot ...
TPS Tests
t Here's an example TPS test to tie it all together. // Phase declarations var phases = { "phase1": "profile1", "phase2": "profile2", "phase3": "profile1" }; // Asset list // the initial list of bookmarks to be added to the browser var bookmarks_initial = { "menu": [ { uri: "http://www.google.com", title "google.com", changes: { // These
properties are ignored by calls other than Bookmarks.modify title: "Google" } }, { folder: "foldera" }, { folder: "folderb" } ], "menu/foldera": [ { uri: "http://www.yahoo.com", title: "testing Yahoo", changes: { location: "menu/folderb" } } ] }; // The state of bookmarks after the first 'modify' action has been performed // on them. Note th...
... title: "Google" } }, { folder: "foldera" }, { folder: "folderb" } ], "menu/foldera": [ { uri: "http://www.yahoo.com", title: "testing Yahoo", changes: { location: "menu/folderb" } } ] }; // The state of bookmarks after the first 'modify' action has been performed // on them. ...
WebReplayRoadmap
er supports DOM mutation breakpoints (bug 1547692), the recording can be searched for DOM mutations, and mutations can be logged to the console and seeked to later. Allowing CSS to be changed while paused somewhere in the recording and update graphics with the effects of those changes. Object Watching (not yet implemented) It would be nice to log the changes to a specific object or one of its
properties, so that the points of those changes can be seeked to later. Bookmarks (not yet implemented) It would be nice to be able to bookmark points in the recording so that they show up on the timeline and can be seeked to later. Code Path Highlighting (not yet implemented) When paused in a frame, the code path taken through the frame (the lines/expressions executed) could be highlighted somehow, whi...
...o use Flow or TypeScript. Type Profiling (not yet implemented) The types that appear in practice have a large effect on how well the associated code can be optimized by JITs. While different JITs optimize code in different ways, for peak performance they all require code to operate on values of consistent types: primitive types, including int32 vs. doubles, or objects that have the same set of
properties. If JS performance is a bottleneck, recordings can be analyzed for code regions that are both very hot and have inconsistent types. These are good candidates for optimization, and as with static type integration above, points where unexpected types appear can be seeked to in the debugger for investigation. Memory Analysis (not yet implemented) Analyzing memory usage and leaks in JS can be dif...
Gecko object attributes
a-atomic live A hint as to whether changes within the current region or subtree should be automatically presented. Possible values are "off" which is the same as not being set -- this means the region is not live. Other possible values are "polite", "assertive", and "rude", which is a suggestion for the policy when interrupting the user for changes to this region. Please see the ARIA States and
Properties module for more information. Additional information may be provide by the object attributes atomic and relevant. Applied to: any role Exposed in ARIA: aria-live relevant Space delimited string with keywords describing what kinds of changes in the subtree are informational, as opposed to presentational. If not specified, the default should be considered "additions text", which indicates that n...
...t Space delimited string with keywords describing what kinds of changes in the subtree are informational, as opposed to presentational. If not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not. Please see the ARIA States and
Properties module for more information. Exposed in ARIA: aria-relevant container-atomic Is this change inside a region that should always be presented at once. If yes, member-of relation will point to the root of the region. See the Live Region Support for more information. container-busy The current changes are not yet complete. A state change event for the A11y API's BUSY state will be fired on the c...
XUL Accessibility
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" />...
... append the accessible value 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 ns...
Using the Places keywords API
keywords API The keywords API is a promise-based API available through the PlacesUtils module: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); Setting a keyword for an URL The insert() method accepts a keyword entry object describing the keyword to insert. It has the following
properties: keyword: string representing the keyword url: either a URL or spec represeting the URL to associate to postData: optional POST data string. Should be omitted if there's no POST data. PlacesUtils.keywords.insert({ keyword: "my_keyword", url: "http://www.example.com/" postData: "post+data=1&test=2" ...
... }).then(() => { /* success */ }, e => { /* failure */ }); Note that setting an already existing keyword to a different URL, will silently update the existing keyword to the new URL. Fetching an entry by keyword The fetch() method acceps a keyword string (or an object having a keywords property) and might resolve to a keyword entry with the following
properties: keyword: string representing the keyword url: the URL represeted by the keyword postData: optional POST data string. Not defined if there's no POST data. If no keyword exists, will resolve to null. PlacesUtils.keywords.fetch("my_keyword").then(entry => { /* entry is either null, or a keyword entry */ }, e => { /* failure */}); Fetching e...
The Publicity Stream API
her native API support is enabled by the user's browser, if not it will shim in a pure HTML implementation. [is this still doable?] The javascript library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js All APIs related to open web applications are accessed under the navigator.apps object. Publicity Stream API (navigator.apps.publicity.*) The publicity API is exposed as
properties on the navigator.apps.publicity object. publicizeActivity( <activity>, [ { [ onsuccess: <function> ], [ onerror: <function> ] } ]): Applications should call this method when an user-initiated activity deemed attractive to potential consumers occurs. This spawns a doorhanger which allows the user to specify which users can view the activity, and (following successful login and authorization...
...e error codes include: denied - if the user refuses to publicize the activity permissionDenied - if the publicizing site is not allowed to post to the publicity stream networkError - if the publicity server is unreachable activityParseError - if the activity contains syntax errors (not proper JSON) invalidActivity - if the activity contains semantic errors (i.e. missing required
properties) Finally, the publicizeActivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. getPublicityStream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <Date> ], [ before: <Date> ], [ count: <int> ]): Provides a means for a web store to receive a list of the current user's socially relevant ap...
How to build an XPCOM component in JavaScript
If not // provided, the default factory is used, which returns // |(new MyComponent()).QueryInt...
...See XPCOM changes in Gecko 2.0 for more details. Installation For extensions: Copy HelloWorld.js, and HelloWorld.xpt (only if you defined and compiled the IDL) to {extensiondir}/components/. Delete compreg.dat and xpti.dat from your profile directory. Restart application. For Firefox: Copy HelloWorld.js, and HelloWorld.xpt (only if you defined...
XPCOM changes in Gecko 2.0
Specifying xpcnativewrappers=no in your manifest (that is, XPCNativeWrapper automation) is no longer supported. This was always intended to be a short-term workaround to allow extensions to continue to work while their authors updated their code to use XPCNativeWrappers. If your add-on depends upon XBL bindings attached to content objects--for example, the ability to call functions or get and set
properties created by the XBL binding--you will need to use the XPCNativeWrapper property wrappedJSObject to access wrapped objects. If you need to be able to call functions or access
properties defined by web content, you'll need to do this as well. This may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a window.delete() fu...
...d objects. If you need to be able to call functions or access
properties defined by web content, you'll need to do this as well. This may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a window.delete() function that you need to call. If, on the other hand, all you're doing with content is accessing DOM methods and
properties, you've never needed to be using xpcnativewrappers=no in the first place, and should simply remove it from your manifest. Miscellaneous XPCNativeWrapper changes Using the delete operator on "expando"
properties of an XPCNativeWrapper no longer throws a security exception. XPCOMUtils.jsm changes The XPCOMUtils.jsm code module has been updated to let you specify the application IDs of the applica...
Components.utils
h a given object is associated (through its prototype chain at birth, for example). getJSTestingFunctions() getObjectPrincipal() Gets the nsIPrincipal for the given JavaScript object. getWeakReference() Gets a weak reference for the object passed in. import() Loads a JS module into the current script, without sharing a scope. importGlobal
Properties() Specify a list of constructors to import into the scope. isXrayWrapper() Test whether a given object is an Xray or not. unload() Unloads a JS module loaded with import(). isDeadWrapper() Determines whether this object is backed by a DeadObjectProxy. lookupMethod() Looks up a native (i.e. declared in the interface) method or property of an X...
...ion cycle has been performed. setGCZeal() Sets the level of garbage collection level for full garbage collection. See JS_SetGCZeal for details; this method calls through to that with the specified value as the zeal value. unwaiveXrays() Undoes waiveXrays(): reapplies the Xray filtering protection. waiveXrays() Removes the filtering provided by an Xray.
Properties Property Type Description Sandbox nsIXPCComponents_utils_Sandbox Creates sandbox objects for use with evalInSandbox(). ion Boolean Read only. strict Boolean Strict mode is enabled. This reflects the value of the JavaScript environment's option by the same name. Read only. strict_mode Boolean Read only. werror ...
inIDOMUtils
specified in Content state flags. getCSSPropertyNames() Get a list of all our supported property names void getCSSPropertyNames( in unsigned long aFlags, Optional out unsigned long aCount, Optional [retval, array, size_is(aCount)] out wstring aProps ); Parameters aFlags Optional Shorthands can be excluded or property aliases included. See constants. aCount Optional Count aProps
Properties getCSSStyleRules() Returns an array of the CSS style rules on the specified element. nsISupportsArray getCSSStyleRules( in nsIDOMElement aElement, in DOMString aPseudo Optional ); Parameters aElement A DOM element to retrieve the style rules of. aPseudo Optional A pseudo element, such as before. Return value An nsISupportsArray containing all the style rules that currently app...
...nsigned long aSelectorIndex, in DOMString aPseudo Optional ) Parameters aElement The element to check the selector against. aRule The style rule containing the selector. aSelectorIndex The index of the selector. aPseudo Optional A string specifying the pseudo-element to match. May be omitted when checking the regular elements. addPseudoClassLock() Makes the element take on style
properties that would apply if the element had the given pseudo-classes. void addPseudoClassLock( in nsIDOMElement aElement, in DOMString aPseudoClass ); Parameters aElement The element to set the pseudo-class lock on. aPseudoClass The pseudo-class to set. e.g. ":hover". removePseudoClassLock() Removes a pseudo-class lock from the element. void removePseudoClassLock( in nsIDOMElement aEle...
mozIStorageStatementRow
This interface has no defined
properties, but has
properties based on the name of the columns in the SQL result from the statement it was accessed off of. ...
... This interface has no defined
properties, but has
properties based on the name of the columns in the SQL result from the statement it was accessed off of. ...
nsIAccessible
nterface nsIAccessible : nsISupports { ... }; accessible/public/nsIAccessible.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0) Overview This section provides short overview of methods and attributes of this interface. All methods and attributes are grouped by categories. Role, states and name These includes main
properties used to describe the accessible. nsIAccessible.role to get the role of the accessible nsIAccessible.getState() to get states of the accessibe nsIAccessible.name, nsIAccessible.value to get the name and the value of the accessible Tree navigation You can navigate through the accessible tree by the following methods and attributes. nsIAccessible.parent to get the parent accessible nsIA...
...ble.getAccessibleToRight(), nsIAccessible.getAccessibleAbove() or nsIAccessible.getAccessibleBelow() to get left, right, top or below placed accessible Methods getKeyBindings Provides array of localized string of global keyboard accelerator for the given action index supported by accessible. getState Provides a bit fields of accessible states which describe boolean
properties of accessible. groupPosition This method returns grouping information. Used for tree items, list items, tab panel labels, radio buttons, etc. Also used for collectons of non-text objects. getChildAtPoint This method returns an accessible child which contains the coordinate at (x, y) in screen pixels. getChildAt This method returns Nth accessible ch...
nsIDOMGlobalPropertyInitializer
An alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification. ...
...An alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification. ...
nsIDOMWindowUtils
aFlushLayout Flushes layout if true. Otherwise, no flush occurs. aScrollX aScrollY getVisitedDependentComputedStyle() Perform the equivalent of: window.getComputedStyle(aElement, aPseudoElement). getPropertyValue(aPropertyName) except that, when the link whose presence in history is allowed to influence aElement's style is visited, get the value the property would have if allowed all
properties to change as a result of :visited selectors (except for cases where getComputedStyle uses data from the frame). This is easier to implement than adding our property restrictions to this API, and is sufficient for the present testing requirements (which are essentially testing 'color'). AString getVisitedDependentComputedStyle( in nsIDOMElement aElement, in AString aPseudoElement, in AStri...
...eventDefault(), indicating that default processing of the event should not occur. setCSSViewport() Sets the dimensions of the CSS viewport to the specified size in CSS pixels, regardless of the size of the enclosing widget/view. This triggers reflow. The caller of this method must have UniversalXPConnect privileges. Note: After calling this method, the window.innerWidth and window.innerHeight
properties return the size of the viewport you've specified instead of the size of the browser widget. void setCSSViewport( in float aWidthPx, in float aHeightPx ); Parameters aWidthPx The width of the viewport in CSS pixels. aHeightPx The height of the viewport in CSS pixels. setDisplayPort() Set the "displayport" to be <xPx, yPx, widthPx, heightPx> in units of CSS pixels, regardless of the...
nsIDOMXULElement
align attribute. allowEvents boolean true if the element's allowevents attribute is the string "true", otherwise false. Removes the attribute if you set it to false. boxObject nsIBoxObject Read only. 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. builder nsIXULTemplateBuilder Read only. Retrives the element's template builder, if it has a template. className DOMString Gets/sets the value of the element's class attribute. collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false. Removes the attribute if you set it to false. contextMenu DOMString Gets/sets ...
...ets/sets the value of the element's ref attribute. resource nsIRDFResource Read only. Returns the nsIRDFResource corresponding to the element's ref or id attribute, if any. statusText DOMString Gets/sets the value of the element's statustext attribute. style nsIDOMCSSStyleDeclaration Read only. Obsolete since Gecko 1.9 Returns an object that may be used to read or write individual CSS style
properties for the element. tooltip DOMString Gets/sets the value of the element's tooltip attribute. tooltipText DOMString Gets/sets the value of the element's tooltiptext attribute. top DOMString Gets/sets the value of the element's top attribute. width DOMString Gets/sets the value of the element's width attribute. Methods blur() Attempts to remove focus from the element. void blur(); Paramet...
nsIFeedResult
aPrefix); Attributes Attribute Type Description bozo boolean The feed processor sets the bozo bit when a feed triggers a fatal error during XML parsing. There may still be feed metadata and entries that were parsed before the error occurred. doc nsIFeedContainer The parsed feed or entry. null if a non-feed was processed. headers nsI
Properties The HTTP response headers that accompanied the feed. stylesheet nsIURI An XSLT stylesheet available to transform the source of the feed. Some feeds include this information in a processing instruction. It's generally intended for use by clients designed to work with specific feeds. uri nsIURI The address from which the feed was fetched. version AString...
...ix() Registers a prefix for a namespace used to access an extension in the feed or entry. Warning: This method is not implemented at this time. void registerExtensionPrefix( in AString aNamespace, in AString aPrefix ); Parameters aNamespace The namespace for the extension. aPrefix The prefix used to access the extension. See also nsISupports nsIFeedContainer nsIURI nsI
Properties Interwiki link ...
nsIFile
te: If this method succeeds, this instance will be updated to point to the new file. If the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file. Usually, "move" means to relocate the file to a different directory without changing the file's contents or
properties, or in fact the file's serial number (inode). That is a very fast operation because it just changes directory information. The actual data doesn't move. Unfortunately, an actual "move" is impossible between different volumes (disks or partitions). This method attempts to do the "right thing" when moving files across volumes. That is, it will copy the old file to the new location, try to assign t...
...te: If this method succeeds, this instance will be updated to point to the new file. If the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file. Usually, "move" means to relocate the file to a different directory without changing the file's contents or
properties, or in fact the file's serial number (inode). That is a very fast operation because it just changes directory information. The actual data doesn't move. Unfortunately, an actual "move" is impossible between different volumes (disks or partitions). This method attempts to do the "right thing" when moving files across volumes. That is, it will copy the old file to the new location, try to assign t...
nsIMessageListener
nder interfaces. Listeners are attached using the nsIMessageListenerManager interface. Methods void receiveMessage(); receiveMessage() This is for JS only. This function receives a message from one of the three message-sending functions in the message manager framework: broadcastAsyncMessage sendAsyncMessage sendSyncMessage. The received message is an object with the following
properties: target The target of the message. Either an element owning the message manager, or the message manager itself if no element owns it. If the message was sent from a frame script using a nsIContentFrameMessageManager, then this property is the XUL <browser> element for the frame from which the message was sent. name The message name. This is the first argument ...
...ent. name The message name. This is the first argument passed into the message-sending function. sync True if the message was sent using sendSyncMessage, false otherwise. data A structured clone of the message payload: the second argument passed into the message-sending function. json Same as data. Deprecated. objects An object whose
properties are any cross process object wrappers exposed by the sender as the third argument to the message-sending function. principal Principal for the window app. Each listener is invoked with its own copy of the message parameter. When the listener is called, 'this' value is the target of the message. If the message is synchronous, the possible return value is returned as JSON (will...
nsIMsgAccountManagerExtension
A Panel consists of a XUL file with a Page Element as root element and the Property File containing the localized name. Note: The Account Manager relies on a very strong naming scheme to load and unload a panel. ...
...count Manager relies on a very strong naming scheme to load and unload a panel. An Account Manager Extension with a "name" attribute of "devmo" and the "chromePackageName" attribute set to "extension@example.org" means, that the Account Manager expects to find a XUL file in "chrome://extension@example.org/content/am-devmo.xul" and a property file in "chrome://extension@example.org/locale/am-devmo.
properties" containing a property named "prefPanel-devmo". You have to register any new Account Manager Extensions via the the category manager at start up. Simply add a new Entry with the Contact ID of the component to the "mailnews-accountmanager-extensions" category. //github.com/RealityRipple/UXP/blob/master/mailnews/base/public/nsIMsgAccountManager.idlScriptable Please add a summary to this article...
nsIMsgCompFields
<< XPCOM API Reference Summary The nsIMsgCompFields interface provides
properties for an composition of an outgoing message.
Properties Attribute Type Description attachments char * obsolete attachments OBSOLETE, DO NOT USE ANYMORE attachmentsArray nsISupportsArray readonly attachVCard PRBool bcc AString body AString bodyIsAsciiOnly PRBool cc AString characterSet char * defaultCharacterSet char * readonly drafId char * DSN PRBool fcc AString fcc2 AString followupTo char * forceMsgEncoding PRBool forcePlainText PR...
...ddressOnly ); void ConvertBodyToPlainText ( ); Attachment Handling Methods void addAttachment ( in nsIMsgAttachment attachment ); void removeAttachment ( in nsIMsgAttachment attachment ); void removeAttachments ( ); Header Methods void setHeader(char* name, char* value); References This interface is the type of the following
properties: nsIMsgCompose.compFields, nsIMsgComposeParams.composeFields This interface is passed as an argument to the following methods: nsIMsgComposeSecure.beginCryptoEncapsulation, nsIMsgComposeSecure.requiresCryptoEncapsulation, nsIMsgSend.createAndSendMessage, nsIMsgSend.sendMessageFile, nsISMimeJSHelper.getNoCertAddresses, nsISMimeJSHelper.getRecipientCertsInfo ...
nsIMsgDBHdr
w code should use keywords instead. accountKey string Indicates the account that was originally used to fetch the message. May be blank if the message has not been moved or copied. folder nsIMsgFolder Readonly: Indicates the folder in which this message is stored. propertyEnumerator nsIUTF8StringEnumerator Readonly: Enumerator for names of all database
properties in the header. (new in 3.1?) Methods getProperty() AString getProperty(in string propertyName); Parameters propertyName The name of the property to retrieve. Return Value The value of the property. setProperty() Sets a property on the header. For the currently selected message, Thunderbird provides a utility function: setMsgHdrPropertyAndReload(aProperty, aValue); which dupli...
... propertyValue); Parameters propertyName The name of the property to set. propertyValue The value of the property. getStringProperty() string getStringProperty(in string propertyName); Parameters propertyName The name of the property to retrieve. Return Value The value of the property. getUint32Property() Get an integer property. Usually you would use this to store your own
properties. unsigned long getUint32Property(in string propertyName); Parameters propertyName The name of the property to retrieve. Thunderbird stored Uint32
properties (not a complete list): indexed Used for Spotlight integration on OSX. notAPhishMessage Indicates whether phisihing filters have been run on a message yet. Return Value The value of the property. setUint32Property()...
nsIParserUtils
sanitize(in AString src, in unsigned long flags); Constants Constant Value Description SanitizerAllowComments (1 << 0) Flag for sanitizer: Allow comment nodes. SanitizerAllowStyle (1 << 1) Flag for sanitizer: Allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). Note: If -moz-binding is absent,
properties that might be XSS risks in other Web engines are preserved! SanitizerCidEmbedsOnly (1 << 2) Flag for sanitizer: Only allow cid: URLs for embedded content. At present, sanitizing CSS backgrounds, and so on., is not supported, so setting this together with SanitizerAllowStyle doesn't make sense. At present, sanitizing CSS syntax in SVG presentational attributes is not...
...and attributes or forms are not removed. To remove these, use SanitizerDropNonCSSPresentation and/or SanitizerDropForms. By default, comments and CSS is removed. To preserve comments, use SanitizerAllowComments. To preserve <style> elements and style attributes on other elements, use SanitizerAllowStyle. -moz-binding is removed from <style> elements and style attributes if present. In this case,
properties that Gecko doesn't recognize can get removed as a side effect. Note: If -moz-binding is not present, <style> elements and style attributes, and if SanitizerAllowStyle is specified, the sanitized content may still be XSS dangerous if loaded into a non-Gecko Web engine! AString sanitize( in AString src, in unsigned long flags ); Parameters src The HTML source to parse (C++ callers are a...
nsIPrinterEnumerator
widget/nsIPrintOptions.idlScriptable Please add a summary to this article. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview void display
PropertiesDlg(in wstring aPrinter, in nsIPrintSettings aPrintSettings); void enumeratePrinters(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult); Obsolete since Gecko 1.9 void initPrintSettingsFromPrinter(in wstring aPrinterName, in nsIPrintSettings aPrintSettings); Attributes Attribute Type Description defaultPrinterName wstring The name of the system default printer. This name should also be present in printerNameList. This is not necessarily gecko's default printer; see nsIPrintSettin...
...ription defaultPrinterName wstring The name of the system default printer. This name should also be present in printerNameList. This is not necessarily gecko's default printer; see nsIPrintSettingsService.defaultPrinterName for that. Read only. printerNameList nsIStringEnumerator The list of printer names. Read only. Methods display
PropertiesDlg() void display
PropertiesDlg( in wstring aPrinter, in nsIPrintSettings aPrintSettings ); Parameters aPrinter aPrintSettings enumeratePrinters() Obsolete since Gecko 1.9 (Firefox 3) Returns an array of the names of all installed printers. void enumeratePrinters( out PRUint32 aCount, [retval, array, size_is(aCount)] out wstring ...
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. Read only. Methods getProperty() Get a property value for the given name. nsIVariant getProperty( in AString name ); Parameters name The name to return the matching property. Return value The property matching the given name. ...
...Also pay attention to their platform-specific meaning (e.g. on Android there is version and kernel_version). ...
nsISHistory
Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) In an embedded browser environment, the nsIWebBrowser object creates an instance of session history for each open window. A handle to the session history object can be obtained from nsIWebNavigation. In a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsIWebNavigation object. Implemented by: @mozilla.org/browser/shistory;1. ...
...rm the following steps: Call GetSHistoryEnumerator() to obtain handle the nsISimpleEnumerator object. Use nsISimpleEnumerator.GetNext() on the object returned by step #1 to obtain handle to the next object in the list. The object returned by this step is of type nsISupports. Perform a QueryInterface on the object returned by step #2 to nsISHEntry. Use nsISHEntry to access
properties of each history entry. Read only. Methods addSHistoryListener() Called to register a listener for the session history component. Listeners are notified when pages are loaded or purged from history. Note: A listener object must implement nsISHistoryListener and nsSupportsWeakReference. void addSHistoryListener( in nsISHistoryListener aListener ); Parameters aListener Lis...
nsISecurityCheckedComponent
otentially unprivileged code. Inherits from: nsISupports Last changed in Gecko 1.7 Capability strings In Gecko, a "capability" is a string identifying a set of actions that code is allowed to perform. Two examples: Code that has the "UniversalXPConnect" capability is allowed to access all of XPCOM. This includes creating instances of arbitrary XPCOM objects and calling methods and setting
properties on them. Code that has the "UniversalBrowserRead" capability is allowed to perform certain actions that allow it to read information from the local system. For example, this capability allows code to set the value of <input type="file"> and access an arbitrary file on disk. Standard web pages have no special capabilities. Extensions can define their own capabilities and use this interface to o...
... to call this method. See Capability strings for details. canCreateWrapper() Returns a string indicating what permissions are required to create a wrapper for the given interface. string canCreateWrapper( in nsIIDPtr iid ); Parameters iid The interface to reflect into JavaScript. Return value The capability required to reflect this interface. Note that if wrapper creation is prevented, the
properties and methods will not be defined on the JavaScript object, whereas if wrapper creation succeeds but methods/
properties are prevented, the
properties and methods will be visible, not not usable. See Capability strings for details. canGetProperty() Returns the permissions required to get the specified property on the given interface. string canGetProperty( in nsIIDPtr iid, in wstring propertyNam...
nsISyncMessageSender
s crashed. Parameters Name Type Description messageName String The name of the message. Optional. This becomes the name property of the received message. obj Object. The message payload. A structured clone of this becomes the data property of the received message. objects Object. An object each of whose
properties is an object. This becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. principal nsIPrincipal Returns Array: an array of structured clones of the objects returned by all the listeners to this message, one element for each listener. If there was only one listener, it is an array with a s...
.... Parameters Name Type Description messageName String The name of the message. Optional. This becomes the name property of the received message. obj JSONable object. The message payload. A structured clone of this becomes the data property of the received message. objects Object. An object each of whose
properties is an object. This becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. principal nsIPrincipal Returns Array: an array of structured clones of the objects returned by all the listeners to this message, one element for each listener. If there was only one listener, it is an array with a s...
nsIXPCScriptable
inter to the JSObject being enumerated. enum_op Indicates what statep and idp represent, as well as indicates how the function should behave. This will always be one of three values: JSENUMERATE_INIT A new, opaque iterator state should be allocated and stored in statep. You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored. If idp is non-null, and provided the number of enumerable
properties is known, the number of
properties that will be enumerated should be returned as an integer jsval in idp. If idp is non-null and the number of enumerable
properties cannot be computed in advance, idp should be set to JSVAL_ZERO. Your function might be passed a null pointer for idp. JSENUMERATE_NEXT A previously allocated opaque iterator state is passed in via statep. Return the next jsid in the...
... JSENUMERATE_DESTROY This function should destroy the opaque iterator state previously allocated in statep by this function when enum_op was JSENUMERATE_INIT. statep An in/out pointer to a jsval whose meaning depends on the value of enum_op. idp An in/out pointer to a jsid whose meaning depends on the value of enum_op. ...
MailNews fakeserver
xpcshell tests: <caption> nsMailServer xpcshell API </caption> Name Arguments Returns Description performTest none nothing Runs until the test is forcibly aborted or stopped normally isStopped none if the server is stopped helper for performTest isTestFinished none if the test is finished helper for performTest playTransaction none the transaction The transaction is an object with two
properties: us, and them; us is an array of responses we sent, them an array of commands received resetTest none nothing prepares the server for the next test without closing the connection start port number nothing Starts the server listening stop none nothing Stops the server and closes the connection Using fakeserver in QA testing Debug output from fakeservers It is possible to get the fakes...
... getArticle message ID newsArticle object Pretty self-explanatory newsArticle API Name Arguments Returns Notes [constructor] text (as a string) N/A initializes all fields headers (p...
Mail event system
nged. This document describes the system that events are passed amongst the mail objects. For example, when a folder gets a new message, its total message count increases. The folder pane needs to know that this changed so that it can update the message count so the user can see it. Interfaces The key interfaces here are: nsIFolder.idl is an interface for storing a hierarchy of objects with
properties. This interface is not (should not be) mail-related. nsIFolders each store individual lists of folder listeners which are maintained with addListener() and removeListener(). When a notification is fired on a folder, all of the folder's folder listeners and the mail session itself is notified. nsIFolderListener.idl is an interface that an object can implement if it is interested in listening to c...
...interface, and nsIMsgMailSession interface. OnItem*<event> - in the nsIFolderListener interface. The mail session implements this interface. Where <event> is the type of event, such as BoolPropertyChanged or the generic Event . Sample control flow Here is an example of a possible flow of control when a new message is added to a folder. In this example, there is a dialog open that shows
properties for this folder including the message count. This dialog is a listener on this particular folder. A message is added to an nsImapMailFolder containing 4 messages. Because the number of messages in the folder have increased, this change in total message count needs to be broadcast to the world. The folder calls NotifyIntPropertyChanged on itself with the atom that represents "TotalMessages": ...
Access StringBundle from Overlay
ing your project by removing all of your strings into a separate, easy to access text file. Unfortunately adding the bundles into Thunderbird isn't as easy as adding them to your XUL overlay. ...
...ment.getElementById("your-extension-strings"); //get the stringbundle object itself str.getString("propertyName"); //get a string (and do something with it) Alternative way let stringBundleService = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService); let bundle = stringBundleService.createBundle("chrome://your_extension/locale/overlay.
properties"); let str = bundle.GetStringFromName("propertyName"); see nsIStringBundleService ...
Theme Packaging
PNG (may contain alpha transparency) which will show up in the Appearance section of the Add-ons Manager. install.rdf Your install.rdf manifest will look something like this: <?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:type>4</em:type> more
properties </Description> </RDF> Required install.rdf
Properties Your install.rdf file must have the following
properties. See the install.rdf Reference for more information: em:id em:version em:type em:targetApplication em:name em:internalName Optional install.rdf
Properties em:description em:creator em:contributor em:homepageURL em:updateURL Note that if your theme will be made ava...
...Do not add to this list without contacting Benjamin Smedberg. Note that this page is included from the pages listed below. So: Don't Add Breadcrumbs! Structure of an Installable B...
ArrayType
n't specify this parameter, the array's length is unspecified. Return value A CType represents the newly declared array type. Exceptions thrown TypeError type is not a CType, or type.size is undefined.If the length is specifed but if it is not a valid one,then it is also thrown RangeError The size of the resulting array can't be represented as both a size_t and as a JavaScript number.
Properties Property Type Description elementType CType The data type of the elements in an array type. Read only. length Number The number of elements in the array, or undefined if the array type doesn't have a specified length. Read only.
Properties inherited from CType These
properties are available on all CType objects. Property Type ...
...; CData unsized_arraytype(length); sized_arraytype and unsized_arraytype are ArrayType CType. Parameters length The number of entries the array type should be able to contain. Only for unsized ArrayType. Return value A CData representing the newly allocated array. Exceptions thrown TypeError length is not provided for unsized array, or is provided for sized array. ArrayType CData
Properties Property Type Description length Number The length of the array. Read only. In addition, each element in the array can be referenced by index using standard bracket notation, such as myArray[index].
Properties inherited from CData Property Type Description constructor CType The data type of the CData object, as a CType. Re...
CData
Read only. Note: This is never ctypes.void_t or an array type with an unspecified length. value object The JavaScript equivalent of the CData object's value. ...
...Read only. Note: This is never ctypes.void_t or an array type with an unspecified length. value object The JavaScript equivalent of the CData object's value. ...
CType
There are several kinds of types: Primitive types These are typical unstructured data, such as the predefined types listed in Predefined data types. Big integer types The Int64 and UInt64 types provide access to 64-bit integer values, which JavaScript doesn't currently support. PointerType These represent pointers to data in memory. ...
...t integer values, which JavaScript doesn't currently support. PointerType These represent pointers to data in memory. FunctionType These represent callable C functions. StructType These represent C structures. ArrayType These represent C arrays. Method overview Methods available on all CType objects CType array([n]) String toSource() String toString()
Properties Properties of all CType objects These
properties are available on all CType objects. Property Type Description name String The type's name. Read only. For primitive types, this is just the name of the corresponding C type. For structure and opaque pointer types, this is simply the string that was passed to the constructor. For other function, pointer, an...
StructType
cannot be represented both as a size_t and as a JavaScript Number. Describing fields The fields array is comprised of field descriptors, one for each field in the structure. Each field descriptor contains the field's name and its type, such as {'serialNumber': ctypes.int}. A complete field descriptor list might look like this: [ {'serialNumber': ctypes.int}, {'userName': ctypes.char.ptr} ]
Properties Property Type Description fields CType[] A sealed array of field descriptors. Read only.
Properties inherited from CType These
properties are available on all CType objects. Property Type Description name String The type's name. Read only. For primitive types, this is just the name of the corresponding C type. For str...
...pe's fields. This lets you convert an opaque structure type into a defined structure type. define( fields ); Parameters fields A field specification, as described above. StructType CData Syntax CData structtype(); structtype is StructType CType. Return value A CData representing the newly allocated struct. Exceptions thrown Error Fields are not yet defined. StructType CData
Properties Every struct object has a getter and a setter for each member field of the structure.
Properties inherited from CData Property Type Description constructor CType The data type of the CData object, as a CType. Read only. Note: This is never ctypes.void_t or an array type with an unspecified length. value object The JavaScript equivalent...
Mozilla
avaScript as the JavaScript representation of the DOM node. When XPConnect wraps a C++ object it will create a JSObject that is unique to this C++ object. In the case where the C++ object has class info (nsIClassInfo), the JSObject is a more or less empty JSObject which is not really that special. All the methods that are supposed to show up on this JSObject are actually not
properties of the object itself, but rather
properties of the prototype of the JSObject for the wrapper (unless the C++ object's class info has the flag nsIXPCScriptable::DONT_SHARE_PROTOTYPE set, but lets assume that's not the case here). js-ctypes js-ctypes allows application and extension code to call back and forth to native code written in C. C++ su...
... Mozilla Quirks Mode Behavior The following is a rough list of the differences that exist between Mozilla's standards mode and quirks mode behavior. Mozilla Style System The Style System is the module of Mozilla's code responsible for the loading and parsing of CSS style sheets, and the computation of computed values for all CSS
properties. The handling of those computed values is the responsibility of other parts of the code. Mozilla Style System Documentation See also the style techtalk for more complete although less detailed documentation. Mozilla SVG Project Since you have come this far, you probably already know that SVG stands for Scalable Vector Graphics, and th...
Scripting plugins - Plugins
API might provide a mechanism for proxying calls from one thread to another to aid in using this API from other threads. Security model The security model for making calls through this API is much like the general same-origin security model enforced by the browser. That means that a script from an origin other than the origin of the page that loaded the plugin is not able to access methods and
properties on the plugin. The same thing applies the other way too; the plugin can reach only JavaScript objects in the same origin as the page that loaded the plugin. In addition to this, a further extension to this API is being discussed that would give a plugin greater flexibility by letting the plugin control the origin of the calling code, so that the plugin can specify the origin of calls that come f...
... loaded the plugin. This is done by using an extension to NPN_GetValue. The extensions are two additions to the NPNVariables enumeration; the new enumerations are NPNVWindowNPObject and NPNVPluginElementNPObject. Calling NPN_GetValue() with either of those new enumerations will return an NPObject representing the browser object, and from there, the functions in this API can be used to get and set
properties, and to call methods on those browser objects. And as always when working with reference counted NPObjects, the caller is responsible for calling NPN_ReleaseObject on the NPObject to drop the reference. The new NPNVariable enumerations are defined in npapi.h as: NPNVWindowNPObject = 15, NPNVPluginElementNPObject = 16 How to call plugin native methods The following HTML code will do the job:...
DOM Property Viewer - Firefox Developer Tools
Enabling the DOM Property Viewer The DOM Property Viewer is not enabled by default. To enable it, open the developer tool settings and check the "DOM" box under "Default Firefox Developer Tools". ...
...iewer by selecting "DOM" from the Web Developer submenu in the Firefox Menu Panel (or Tools menu if you display the menu bar or are on macOS), or by pressing its Ctrl + Shift + W keyboard shortcut. The Toolbox will appear at the bottom of the browser window, with the DOM Property Viewer activated. It's just called "DOM" in the Toolbox. DOM Property Viewer user interface DOM tree The different
properties of the DOM are displayed as an expandable tree. The left-hand side shows the property's name, and the right-hand side shows its value. Up to three
properties of an object and items of an array are displayed. If a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. A lock icon indicates that a property is not writable. ...
Network request list - Firefox Developer Tools
ow when you refresh the page, the item will once enabled. Note: (Starting in Firefox 80) You can also block and unblock URLs from the Web Console, using the :block and :unblock helper commands. These accept any string, and affect any URL containing the string. Filtering requests You can filter requests by content type, by whether they are XMLHttpRequests or WebSocket requests, or by request
properties. Filter type How to apply Content type Use the buttons in the toolbar (HTML, CSS, JS). XHR requests Use the XHR button in the toolbar. WebSocket connections Use the WS button in the toolbar. You can filter by plain text (in which case the text is used to find partial matches; entering "for" will match any message that contains the word "for") o...
...); then start typing. The list of network requests is filtered to include only requests that contain your filter string, in either the Domain or the File portions. You can filter requests that don't contain your filter string by prefixing your query with the "-" operator. For example, the query "-google.com" will show all requests that don't have "google.com" in the URL. Request
properties Use the search box in the toolbar. See next section. Filtering by
properties The search box recognizes specific keywords, which can be used to filter the requests by specific request
properties. Those keywords are followed by a colon and a related filter value. The filter values are matched case insensitive. Prepending a minus (-) negates the filter. You can combine different filters t...
ChildNode - Web APIs
Methods There are no inherited methods. ChildNode.remove() Removes this ChildNode from the children list of its parent. ChildNode.before() Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes. ChildNode.after() Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. ...
... interface in ParentNode and ChildNode. previousElementSibling and nextElementSibling are now defined on the latter. The CharacterData and DocumentType implemented the new interfaces. Added the remove(), before(), after() and replaceWith() methods. Element Traversal SpecificationThe definition of 'ElementTraversal' in that specification. Obsolete Added the initial definition of its
properties to the ElementTraversal pure interface and use it on Element. Polyfill External on GitHub: childNode.js ...
ClipboardEvent - Web APIs
ClipboardEvent.clipboardData Read only Is a DataTransfer object containing the data affected by the user-initiated cut, copy, or paste operation, along with its MIME type. ...
... ClipboardEvent.clipboardData Read only Is a DataTransfer object containing the data affected by the user-initiated cut, copy, or paste operation, along with its MIME type. ...
CloseEvent - Web APIs
CloseEvent.code Read only Returns an unsigned short containing the close code sent by the server. The following values are permitted status codes. The following definitions are sourced from the IANA website [Ref]. ...
... CloseEvent.code Read only Returns an unsigned short containing the close code sent by the server. The following values are permitted status codes. The following definitions are sourced from the IANA website [Ref]. ...
console - Web APIs
sage and stack trace to console if the first argument is false. console.clear() Clear the console. console.count() Log the number of times this line has been called with the given label. console.countReset() Resets the value of the counter with the given label. console.debug() Outputs a message to the console with the log level debug. console.dir() Displays an interactive listing of the
properties of a specified JavaScript object. This listing lets you use disclosure triangles to examine the contents of child objects. console.dirxml() Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible. console.error() Outputs an error message. You may use string substitution and additional arguments with this method. cons...
... Bob. You've called me 5 times. Styling console output You can use the %c directive to apply a CSS style to console output: console.log("This is %cMy stylish message", "color: yellow; font-style: italic; background-color: blue;padding: 2px"); The text before the directive will not be affected, but the text after the directive will be styled using the CSS declarations in the parameter. The
properties usable along with the %c syntax are as follows (at least, in Firefox -- they may differ in other browsers): background and its longhand equivalents. border and its longhand equivalents border-radius box-decoration-break box-shadow clear and float color cursor display font and its longhand equivalents line-height margin outline and its longhand equivalents padding text-* propertie...
ConstrainBoolean - Web APIs
The ConstrainBoolean dictionary is used to specify a constraint for a property whose value is a Boolean value. You can specify an exact value which must be matched, an ideal value that should be matched if at all possible, and a fallback value to attempt to match once all more specific constraints have been applied.
Properties exact A Boolean which indicates a value the property must have. ideal A Boolean value indicating the ideal, but not required, value the property should ideally have. If possible, this value will be used, but the user agent will use the other value if it needs to in order to come up with a workable configuration. You can also specify the value of the property as simply true or false, in which case the user agent will use that value if possible once all efforts have be...
...alue the property should ideally have. If possible, this value will be used, but the user agent will use the other value if it needs to in order to come up with a workable configuration. You can also specify the value of the property as simply true or false, in which case the user agent will use that value if possible once all efforts have been made to match the exact and ideal values for other
properties. Specifications Specification Status Comment Media Capture and StreamsThe definition of 'ConstrainBoolean' in that specification. Candidate Recommendation Initial definition Technically, ConstrainBoolean is actually based on an intermediary dictionary named ConstrainBooleanParameters, which adds exact and ideal to the simple Boolean type. However, for the s...
DOMMatrix - Web APIs
The DOMMatrix interface represents 4x4 matrices, suitable for 2D and 3D operations including rotation and translation. It is a mutable version of the DOMMatrixReadOnly interface. This interface should be available inside web workers, though some implementations don't allow it yet. Constructor DOMMatrix() Creates and returns a new DOMMatrix object.
Properties This interface inherits
properties from DOMMatrixReadOnly, though some of these
properties are altered to be mutable. is2D Read only A Boolean flag whose value is true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D. isIdentity Read only A Boolean whose value is true if the matrix is the identity matrix. The identity matrix is one in which every value is 0 except those on the main diagonal from top-left...
...tes a new mutable DOMMatrix object given an array of double-precision (64-bit) floating-point values. If the array has six values, the result is a 2D matrix; if the array has 16 values, the result is a 3D matrix. Otherwise, a TypeError exception is thrown. fromMatrix() Creates a new mutable DOMMatrix object given an existing matrix or a DOMMatrixInit dictionary which provides the values for its
properties. Usage notes The matrix defined by the DOMMatrix interface is comprised of four rows of four columns each. While it's beyond the scope of this article to explain the mathematics involved, this 4x4 size is enough to describe any transformation you might apply to either 2D or 3D geometries. [m11m21m31m41m12m22m32m42m13m23m33m43m14m24m34m44]\left [ \begin{matrix} m_{11} & m_{21} & m_{31} & m_{...
DOMMatrixReadOnly - Web APIs
dOnly interface represents a read-only 4x4 matrix, suitable for 2D and 3D operations. The DOMMatrix interrface--which is based upon DOMMatrixReadOnly--adds mutability, allowing you to alter the matrix after creating it. A 4x4 matrix is suitable to describe any rotation and translation in 3D. This interface should be available inside web workers, though some implementations doesn't allow it yet.
Properties This interface doesn't inherit any
properties. is2D Read only A Boolean flag whose value is true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D. isIdentity Read only A Boolean whose value is true if the matrix is the identity matrix. The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in ot...
...tes a new mutable DOMMatrix object given an array of double-precision (64-bit) floating-point values. If the array has six values, the result is a 2D matrix; if the array has 16 values, the result is a 3D matrix. Otherwise, a TypeError exception is thrown. fromMatrix() Creates a new mutable DOMMatrix object given an existing matrix or a DOMMatrixInit dictionary which provides the values for its
properties. If no matrix is specified, the matrix is initialized with every element set to 0 except the bottom-right corner and the element immediately above and to its left: m33 and m34. These have the default value of 1. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMMatrixReadOnly' in that specification. Candidate Reco...
DOMPoint - Web APIs
In general, a positive x component represents a position to the right of the origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user). ...
...can also use an existing DOMPoint or DOMPointReadOnly or a DOMPointInit dictionary to create a new point by calling the DOMPoint.fromPoint() static method. Methods DOMPoint inherits methods from its parent, DOMPointReadOnly. Static methods DOMPoint.fromPoint() Creates a new mutable DOMPoint object given an existing point (or a DOMPointInit dictionary) which provides the values for its
properties.
Properties DOMPoint inherits
properties from its parent, DOMPointReadOnly. DOMPoint.x The x coordinate of the DOMPoint. DOMPoint.y The y coordinate of the DOMPoint. DOMPoint.z The z coordinate of the DOMPoint. DOMPoint.w The perspective value of the DOMPoint. Examples In the WebXR Device API, DOMPointReadOnly values are used to represent positions and orientations. In the followi...
DOMRectReadOnly.fromRect() - Web APIs
y: The coordinate of the top side of the rectangle. width: The width of the rectangle. ...
... y: The coordinate of the top side of the rectangle. width: The width of the rectangle. ...
DataTransferItem - Web APIs
DataTransferItem.type Read only The drag data item's type, typically a MIME type. ...
...t a file). DataTransferItem.getAsString() Invokes the specified callback with the drag data item string as its argument. DataTransferItem.webkitGetAsEntry() Returns an object based on FileSystemEntry representing the selected file's entry in its file system. This will generally be either a FileSystemFileEntry or FileSystemDirectoryEntry object. Example All of this interface's methods and
properties have their own reference page, and each reference page has an example of its usage. Specifications Specification Status Comment HTML Living StandardThe definition of 'DataTransferItem' in that specification. Living Standard Initial definition. HTML 5.1The definition of 'DataTransferItem' in that specification. Recommendation W3C snapshot of WHATWG ...
DataTransferItemList - Web APIs
Methods DataTransferItemList.add() Adds an item (either a File object or a string) to the drag item list and returns a DataTransferItem object for the new item. ...
... string) to the drag item list and returns a DataTransferItem object for the new item. DataTransferItemList.remove() Removes the drag item from the list at the given index. DataTransferItemList.clear() Removes all of the drag items from the list. DataTransferItemList.DataTransferItem() Getter that returns a DataTransferItem at the given index. Example Each of this interface's methods and
properties has a reference page, and each reference page has an example of its usage. Specifications Specification Status Comment HTML Living StandardThe definition of 'DataTransferItemList' in that specification. Living Standard HTML 5.1The definition of 'DataTransferItemList' in that specification. Recommendation Not included in W3C HTML5 Recommendation ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
his list will have only one item, which we retrieve by selecting the first element in that list using [0]. Next, we get all the p elements that are descendants of the body: myBodyElements = myBody.getElementsByTagName("p"); Finally, we get the second item from the list of p elements via myP = myBodyElements[1]; Once you have gotten the DOM object for an HTML element, you can set its
properties. For example, if you want to set the style background color property, you just add: myP.style.background = "rgb(255,0,0)"; // setting inline STYLE attribute Creating TextNodes with document.createTextNode("..") Use the document object to invoke the createTextNode method and create your text node. You just need to pass the text content. The return value is an object that represents the text no...
...myceltext currenttext=document.createTextNode(myceltext.data); mybody.appendChild(currenttext); Getting an attribute value At the end of sample1 there is a call to setAttribute on the mytable object. This call was used to set the border property of the table. To retrieve the value of the attribute, use the getAttribute method: mytable.getAttribute("border"); Hiding a column by changing style
properties Once you have the object in your JavaScript variable, you can set style
properties directly. The following code is a modified version of sample1.html in which each cell of the second column is hidden and each cell of the first column is changed to have a red background. Note that the style property was set directly. <html> <body onload="start()"> </body> <script> function start() { v...
EffectTiming.delay - Web APIs
The value of delay corresponds directly to EffectTiming.delay in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. ...
...b Animations API represents the number of milliseconds to delay the start of the animation. Element.animate(), KeyframeEffectReadOnly(), and KeyframeEffect() all accept an object of timing
properties including delay. The value of delay corresponds directly to EffectTiming.delay in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. Syntax var timing
Properties = { delay: delayInMilliseconds }; timing
Properties.delay = delayInMilliseconds; Value A number specifying the delay, in milliseconds, from the start of the animation's play cycle to the beginning of its active interval (the time index at which actual animation begins). Defaults to 0. Examples In the Pool of Tears example, each tear is passed a random delay via its timing object: // Rando...
EffectTiming.fill - Web APIs
on's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. Note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely. See the alternatives to fill modes section below for approaches that are simpler and more performant. Element.animate(), and KeyframeEffect() accept an object of timing
properties including fill. The value of fill corresponds directly to fill in EffectTiming objects returned by getTiming() in AnimationEffect and KeyframeEffect. Syntax var timing
Properties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } Value A DOMString indicating the fill type to use in order to properly render an affected element when outside the animation's active interval (that ...
...eyframe in the animation sequence). Then, when the animation finishes running, the box instantaneously leaps back to its original state and is upright once again. Give it a try below! Follow the White Rabbit example In the Follow the White Rabbit example, the White Rabbit's animation is formed by coupling a KeyframeEffect with an Animation object. The keyframeEffect takes an object of timing
properties, which is where we pass in fill. Forwards makes the rabbit retain its last keyframe rather than reverting to its unanimated state: // Create a set of keyframes to slide the rabbit down the hole--and keep him down with 'fill'! var rabbitDownKeyframes = new KeyframeEffect( whiteRabbit, [ { transform: 'translateY(0%)' }, { transform: 'translateY(100%)' } ], { duration: 3000, ...
EffectTiming.iterationStart - Web APIs
Web Animations API's EffectTiming dictionary's iterationStart property specifies the repetition number which repetition the animation begins at and its progress through it. Element.animate(), KeyframeEffectReadOnly.KeyframeEffectReadOnly(), and KeyframeEffect.KeyframeEffect() all accept an object of timing
properties including iterationStart. The value of iterationStart corresponds directly to AnimationEffectTimingReadOnly.iterationStart in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect. Syntax var timing
Properties = { iterationStart = iterationNumber }; timing
Properties.iterationStart = iterationNumber; Value A floating-point value whose value is at least 0 and is not +Infinity, indicating the offset into the number of iteration...
...Since all animations' iteration indexes start at 0, a value of 0.5 would start the animation halfway through its first iteration or loop. Meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. It's currently undefined what happens if you specify a value of iterationStart which is greater than the value of AnimationEffectTiming
Properties.iterations. See issue 170 in the Web Animations API specification's issue tracker for details and status of any changes to the specification in this regard. Specifications Specification Status Comment Web AnimationsThe definition of 'iterationStart' in that specification. Working Draft Editor's draft. ...
Element.classList - Web APIs
dd/remove/toggle methods. See https://bugzilla.mozilla.org/show_bug.cgi?id=814014 Polyfill The legacy onpropertychange event can be used to create a living classList mockup thanks to a Element.prototype.className property that fires the specified event once it is changed. The following polyfill for both classList and DOMTokenList ensures full compliance (coverage) for all standard methods and
properties of Element.prototype.classList for IE10-IE11 browsers plus nearly compliant behavior for IE 6-9. Check it out: // 1. String.prototype.trim polyfill if (!"".trim) String.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.DOMException) (DOMException = function(reason){this.message = reason}).pr...
...ill is limited in functionality. 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. However, it should work just fine in IE9. A major discrepancy between the polyfilled version of classList and the W3 specs is that for IE6-8, there is no way to create an immutable object (an object whose
properties cannot be directly modified). In IE9, however, it is possible through extending the prototype, freezing the visible object, and overwritting native property methods. However, such actions would not work in IE6-IE8 and, in IE9, slow the performance of the entire webpage to a snail's crawl, making these modifications completely impractical for this polyfill. A minor note is that in IE6-7, this pol...
Element.getClientRects() - Web APIs
s() method of the Element interface returns a collection of DOMRect objects that indicate the bounding rectangles for each CSS border box in a client. Syntax let rectCollection = object.getClientRects(); Return value The returned value is a collection of DOMRect objects, one for each CSS border box associated with the element. Each DOMRect object contains read-only left, top, right and bottom
properties describing the border box, in pixels, with the top-left relative to the top-left of the viewport. For tables with captions, the caption is included even though it's outside the border box of the table. 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 ...
...x transform, if any). Originally, Microsoft intended this method to return a TextRectangle object for each line of text. However, the CSSOM working draft specifies that it returns a DOMRect for each border box. For an inline element, the two definitions are the same. But for a block element, Mozilla will return only a single rectangle. Firefox 3.5 note Firefox 3.5 adds width and height
properties to the TextRectangle object. The amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the rectangles. 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 genera...
ElementTraversal - Web APIs
Specifications Specification Status Comment DOMThe definition of 'ChildNode' in that specification. ...
... Specifications Specification Status Comment DOMThe definition of 'ChildNode' in that specification. ...
ErrorEvent - Web APIs
ErrorEvent.message Read only Is a DOMString containing a human-readable error message describing the problem. ErrorEvent.filename Read only Is a DOMString containing the name of the script file in which the error occurred. ErrorEvent.lineno Read only Is an integer containing the line number of the script file on which the error occurred.
... ErrorEvent.message Read only Is a DOMString containing a human-readable error message describing the problem. ErrorEvent.filename Read only Is a DOMString containing the name of the script file in which the error occurred. ErrorEvent.lineno Read only Is an integer containing the line number of the script file on which the error occurred. ErrorEvent.colno Read on...
EventListener - Web APIs
Methods This interface doesn't inherit any methods. ...
... Methods This interface doesn't inherit any methods. ...
EventTarget - Web APIs
EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. Element, Document, and Window are the most common event targets, but other objects can be event targets, too. For example XMLHttpRequest, AudioNode, AudioContext, and others. Many event targets (including elements, documents, and windows) also support setting event handlers via onevent
properties and attributes. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" wi...
...et.addEventListener() Registers an event handler of a specific event type on the EventTarget. EventTarget.removeEventListener() Removes an event listener from the EventTarget. EventTarget.dispatchEvent() Dispatches an event to this EventTarget. Additional methods in Mozilla chrome codebase Mozilla includes a couple of extensions for use by JS-implemented event targets to implement onevent
properties. See also WebIDL bindings. void setEventHandler(DOMString type, EventHandler handler) EventHandler getEventHandler(DOMString type) Example Simple implementation of EventTarget var EventTarget = function() { this.listeners = {}; }; EventTarget.prototype.listeners = null; EventTarget.prototype.addEventListener = function(type, callback) { if (!(type in this.listeners)) { this.
File - Web APIs
6" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">File</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor File() Returns a newly constructed File. Instance
properties File.prototype.lastModified Read only Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight). File.prototype.lastModifiedDate Read only Returns the last modified Date of the file referenced by the File object. File.prototype.nameRead only Returns the name of the file referenced by the File object. File.prototype.webkitRelative...
...January 1st, 1970 at Midnight). File.prototype.lastModifiedDate Read only Returns the last modified Date of the file referenced by the File object. File.prototype.nameRead only Returns the name of the file referenced by the File object. File.prototype.webkitRelativePath Read only Returns the path the URL of the File is relative to. File implements Blob, so it also has the following
properties available to it: File.prototype.size Read only Returns the size of the file in bytes. File.prototype.type Read only Returns the MIME type of the file. Instance methods The File interface doesn't define any methods, but inherits methods from the Blob interface: Blob.prototype.slice([start[, end[, contentType]]]) Returns a new Blob object containing the data in the specified range of...
FontFace - Web APIs
The FontFace interface represents a single usable font face. It allows control of the source of the font face, being a URL to an external resource, or a buffer; it also allows control of when the font face is loaded and its current status. Constructor FontFace() Constructs and returns a new FontFace object, built from an external resource described by an URL or from an ArrayBuffer.
Properties This interface doesn't inherit any property. FontFace.display A CSSOMString that determines how a font face is displayed based on whether and when it is downloaded and ready to use. FontFace.family A CSSOMString that retrieves or sets the family of the font. It is equivalent to the font-family descriptor. FontFace.featureSettings A CSSOMString that retrieves or sets infrequently used font fea...
...ce.display A CSSOMString that determines how a font face is displayed based on whether and when it is downloaded and ready to use. FontFace.family A CSSOMString that retrieves or sets the family of the font. It is equivalent to the font-family descriptor. FontFace.featureSettings A CSSOMString that retrieves or sets infrequently used font features that are not available from a font's variant
properties. It is equivalent to the font-feature-settings descriptor. FontFace.loaded Read only Returns a Promise that resolves with the current FontFace object when the font specified in the object's constructor is done loading or rejects with a SyntaxError. FontFace.status Read only Returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "error". F...
Gamepad.buttons - Web APIs
The Gamepad.buttons property of the Gamepad interface returns an array of gamepadButton objects representing the buttons present on the device. Each entry in the array is 0 if the button is not pressed, and non-zero (typically 1.0) if the button is pressed. Each gamepadButton object has two
properties: pressed and value: The pressed property is a boolean indicating whether the button is currently pressed (true) or unpressed (false). The value property is a floating point value used to enable representing analog buttons, such as the triggers on many modern gamepads. The values are normalized to the range 0.0 - 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. Syntax readonly attribute GamepadButton[] buttons; Example The fo...
...In this simple example I've just allowed either. function gameLoop() { if(navigator.webkitGetGamepads) { var gp = navigator.webkitGetGamepads()[0]; if(gp.buttons[0] == 1) { b--; } else if(gp.buttons[1] == 1) { a++; } else if(gp.buttons[2] == 1) { b++; } else if(gp.buttons[3] == 1) { ...
GamepadButton - Web APIs
ler, allowing access to the current state of different types of buttons available on the control device. A GamepadButton object is returned by querying any value of the array returned by the buttons property of the Gamepad interface. Note: This is the case in Firefox Gecko 28 and later; Chrome and earlier Firefox versions still return an array of double values when this property is accessed.
Properties GamepadButton.value Read only A double value used to represent the current state of analog buttons, such as the triggers on many modern gamepads. The values are normalized to the range 0.0 --1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. GamepadButton.pressed Read only A Boolean value indicating whether the button is currently...
...In this simple example I've just allowed either. function gameLoop() { if(navigator.webkitGetGamepads) { var gp = navigator.webkitGetGamepads()[0]; if(gp.buttons[0] == 1) { b--; } else if(gp.buttons[1] == 1) { a++; } else if(gp.buttons[2] == 1) { b++; } else if(gp.buttons[3] == 1) { ...
GeolocationCoordinates - Web APIs
GeolocationCoordinates.latitude Read only Secure context Returns a double representing the position's latitude in decimal degrees. GeolocationCoordinates.longitude Read only Secure context Returns a double representing the position's longitude in decimal degrees. ...
...ing the position's longitude in decimal degrees. GeolocationCoordinates.altitude Read only Secure context Returns a double representing the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data. GeolocationCoordinates.accuracy Read only Secure context Returns a double representing the accuracy of the latitude and longitude
properties, expressed in meters. GeolocationCoordinates.altitudeAccuracy Read only Secure context Returns a double representing the accuracy of the altitude expressed in meters. This value can be null. GeolocationCoordinates.heading Read only Secure context Returns a double representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from headi...
GeolocationPosition - Web APIs
GeolocationPosition.coords Read only Secure context Returns a GeolocationCoordinates object defining the current location. ...
... The GeolocationPosition interface represents the position of the concerned device at a given time. The position, represented by a GeolocationCoordinates object, comprehends the 2D position of the device, on a spheroid representing the Earth, but also its altitude and its speed.
Properties The GeolocationPosition interface doesn't inherit any
properties. GeolocationPosition.coords Read only Secure context Returns a GeolocationCoordinates object defining the current location. GeolocationPosition.timestamp Read only Secure context Returns a DOMTimeStamp representing the time at which the location was retrieved. Methods The GeolocationPosition interface neither implements, nor inherits any methods. Specifications Specification Status Comment Geolocat...
Using the Geolocation API - Web APIs
tion object instance, which itself contains a GeolocationCoordinates object instance. The GeolocationPosition instance contains only two things, a coords property that contains the GeolocationCoordinates instance, and a timestamp property that contains a DOMTimeStamp instance representing the time at which the position data was retrieved. The GeolocationCoordinates instance contains a number of
properties, but the two you'll use most commonly are latitude and longitude, which are what you need to draw your position on a map. Hence many Geolocation success callbacks look fairly simple: function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; // Do something with your latitude and longitude } You can however get a number of other ...
...ormation from a GeolocationCoordinates object, including altitude, speed, what direction the device is facing, and an accuracy measure of the altitude, longitude, and latitude data. Handling errors The error callback function, if provided when calling getCurrentPosition() or watchPosition(), expects a GeolocationPositionError object instance as its first parameter. This object type contains two
properties, a code indicating what type of error has been returned, and a human-readable message that describes what the error code means. You could use it like so: function errorCallback(error) { alert(`ERROR(${error.code}): ${error.message}`); }; Examples In the following example the Geolocation API is used to retrieve the user's latitude and longitude. If sucessful, the available hyperlink is popu...
GeometryUtils - Web APIs
Methods GeometryUtils.getBoxQuads() Returns a list of DOMQuad objects representing the CSS fragments of the node. ...
... Methods GeometryUtils.getBoxQuads() Returns a list of DOMQuad objects representing the CSS fragments of the node. ...
GlobalEventHandlers - Web APIs
The GlobalEventHandlers mixin describes the event handlers common to several interfaces like HTMLElement, Document, or Window. Each of these interfaces can, of course, add more event handlers in addition to the ones listed below. Note: GlobalEventHandlers is a mixin and not an interface; you can't actually create an object of type GlobalEventHandlers.
Properties This interface doesn't include any
properties except for the event handlers listed below. Event handlers These event handlers are defined on the GlobalEventHandlers mixin, and implemented by HTMLElement, Document, Window, as well as by WorkerGlobalScope for Web Workers. GlobalEventHandlers.onabort Is an EventHandler representing the code to be called when the abort event is raised. GlobalEventHandlers.onanimationcancel An Ev...
... ...
LargestContentfulPaint - Web APIs
LargestContentfulPaint.renderTime The time the element was rendered to the screen. ...
...e The time the element was loaded. LargestContentfulPaint.size The intrinsic size of the element returned as the area (width * height). LargestContentfulPaint.id The id of the element. This property returns an empty string when there is no id. LargestContentfulPaint.url If the element is an image, the request url of the image. Methods LargestContentfulPaint.toJSON() Returns the above
properties as JSON. Examples The following example shows how to create a PerformanceObserver that listens for largest-contentful-paint entries and logs the LCP value to the console. This example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. Note that in this example data is only sent to the serv...
LayoutShift - Web APIs
LayoutShift.hadRecentInput Returns true if there was a user input in the past 500 milliseconds. LayoutShift.lastInputTime Returns the time of the most recent user input. LayoutShift.sources Returns an array of LayoutShiftAttribution objects with information on the elements that were shifted. ...
...fraction (distance moved as a fraction of viewport). LayoutShift.hadRecentInput Returns true if there was a user input in the past 500 milliseconds. LayoutShift.lastInputTime Returns the time of the most recent user input. LayoutShift.sources Returns an array of LayoutShiftAttribution objects with information on the elements that were shifted. Methods LayoutShift.toJSON() Converts the
properties to JSON. Examples The following example shows how to capture layout shifts and log them to the console. Note that in this example data is only sent to the server when the user leaves the tab. // Catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let cumulativeLayoutShiftScore = 0; const observer = new Performa...
LocalFileSystem - Web APIs
m interface of the File System API gives you access to a sandboxed file system. The methods are implemented by window and worker objects. Basic concepts This section includes a few key concepts for the methods. Creating new storage You request access to a sandboxed file system by calling window.requestFileSystem(). The argument of a successful callback is the FileSystem object, which has two
properties: the name and root of the file system. You can call the method more than once if you want to create two file systems: one that's temporary and one that's persistent. (To learn more about the storage types, see the Basic Concepts article.) In most cases, you need to create only one file system, but in a few cases, it might be useful to create a second one. For example, if you were to create a mai...
...ng size, in FileSystemCallback successCallback, in ErrorCallback errorCallback ); Parameters type The storage type of the file system. The values can be either TEMPORARY or PERSISTENT. size The storage space--in bytes--that you need for your app. successCallback The success callback that is called when the browser provides a file system. Its argument is the FileSystem object with two
properties: name - the unique name assigned by the browser to the file system. root - the read-only DirectoryEntry object representing the root of the file system. opt_errorCallback The error callback that is called when errors happen or when the request to obtain the file system is denied. Its argument is the FileError object. Returns void Exceptions This method can raise an FileError w...
Locks.mode - Web APIs
ck was requested. The mode is either "exclusive" (the default) or "shared". Syntax var mode = Lock.mode Value One of "exclusive" or "shared". Example The following examples show how the mode property is passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. ...
...e One of "exclusive" or "shared". Example The following examples show how the mode property is passed in the call to LockManager.request(). LockManager is the object returned by navigator.locks. // Should show "exclusive" (the default) navigator.locks.request("my_resource", show_lock_
properties); // Should show "exclusive" navigator.locks.request("my_resource", {mode: "exclusive"}, show_lock_
properties); // Should show "shared" navigator.locks.request("my_resource", {mode: "shared"}, show_lock_
properties); function show_lock_
properties(lock) { console.log(`The lock name is: ${lock.name}`); console.log(`The lock mode is: ${lock.mode}`); } Specifications Specification Status Comment Web Locks APIThe definition of 'mode' in that specification. Draft Initial d...
MSSiteModeEvent - Web APIs
This proprietary method is specific to Internet Explorer and Microsoft Edge. ...
...hat the createEvent method created. *Note that as of Microsoft Edge, the createEvent()/initEvent() constructor pattern for synthetic events is deprecated. preventDefault Cancels the default action of an event. stopImmediatePropagation Prevents any further propagation of an event. stopPropagation Prevents propagation of an event beyond the current target.
Properties Property Description actionURL Gets the URL of a Jump List item that is removed. *This property is not supported for Windows Store apps using JavaScript. bubbles Gets a value that indicates whether an event propagates up from the event target. buttonID Gets the Thumbnail Toolbar button ID that is clicked. *This property is not supported for Win...
MediaCapabilitiesInfo - Web APIs
The MediaCapabilitiesInfo interface of the Media Capabilities API is made available when the promise returned by the MediaCapabilities.encodingInfo() or MediaCapabilities.decodingInfo() methods of the MediaCapabilities interface fulfills, providing information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient.
Properties The MediaCapabilitiesInfo interface contains three Boolean attribues: supported: Given the
properties defined in the MediaConfiguration, can the specified piece of media content be encoded (if MediaEncodingConfiguration is set) or decode (if MediaDecodingConfiguration is set) at all? If yes, supported is true. Otherwise, it is false. smooth: Given the
properties defined in the MediaConfiguration, will th...
...Configuration is set) or decode (if MediaDecodingConfiguration is set) at all? If yes, supported is true. Otherwise, it is false. smooth: Given the
properties defined in the MediaConfiguration, will the playback of the specified piece of media be high quality? Will it be smooth? If supported is true, and playback will be smooth, smooth is true, Otherwise, is it false. powerEfficient: Given the
properties defined in the MediaConfiguration, will the playback of the specified piece of media be power efficient? If supported is true, and playback will be power efficient, powerEfficient is true, Otherwise, is it false. Browsers will report a supported media configuration as smooth and powerEfficient until stats on this device have been recorded. All supported audio codecs are reported to be power eff...
MediaDecodingConfiguration - Web APIs
This takes one of two values: file: Represents a configuration that is meant to be used for a plain file playback. ...
... The MediaDecodingConfiguration dictionary of the Media Capabilities API is used to define the type of media being tested when calling MediaCapabilities.decodingInfo() to query whether a specific media configuration is supported, smooth, and/or power efficient.
Properties A MediaDecodingConfiguration dictionary takes two
properties: type -- the type of media being tested. This takes one of two values: file: Represents a configuration that is meant to be used for a plain file playback. media-source: Represents a configuration that is meant to be used for playback of a MediaSource. A media configuration -- a VideoConfiguration or AudioConfiguration dictionary. Examples //Create media configuration to be tested const mediaConfig = { type : 'file', // or 'media-source'...
MediaDevices - Web APIs
Events devicechange Fired when a media input or output device is attached to or removed from the user's computer. Also available via the ondevicechange property. Methods Inherits methods from its parent interface, EventTarget. ...
...to or removed from the user's computer. Also available via the ondevicechange property. Methods Inherits methods from its parent interface, EventTarget. enumerateDevices() Obtains an array of information about the media input and output devices available on the system. getSupportedConstraints() Returns an object conforming to MediaTrackSupportedConstraints indicating which constrainable
properties are supported on the MediaStreamTrack interface. See Capabilities and constraints in Media Capture and Streams API (Media Stream) to learn more about constraints and how to use them. getDisplayMedia() Prompts the user to select a display or portion of a display (such as a window) to capture as a MediaStream for sharing or recording purposes. Returns a promise that resolves to a MediaStream. ge...
MediaEncodingConfiguration - Web APIs
using MediaRecorder. ...
... The MediaEncodingConfiguration dictionary of the Media Capabilities API is used to define the type of media being tested when calling MediaCapabilities.encodingInfo() to query whether a specific media configuration is supported, smooth, and/or power efficient.
Properties A MediaEncodingConfiguration dictionary takes two
properties: type -- the type of media being tested; takes one of two values: record -- Represents a configuration for recording of media, e.g. using MediaRecorder. transmission -- Represents a configuration meant to be transmitted over electronic means (e.g. using RTCPeerConnection). A media configuration -- a VideoConfiguration AudioConfiguration dictionary. Examples //Create media configuration to be tested const mediaConfig = { type : 'record', ...
MediaRecorder() - Web APIs
ration(s) to use by specifying the codecs parameter. Syntax var mediaRecorder = new MediaRecorder(stream[, options]); Parameters stream The MediaStream that will be recorded. This source media can come from a stream created using navigator.mediaDevices.getUserMedia() or from an <audio>, <video> or <canvas> element. options Optional A dictionary object that can contain the following
properties: mimeType: A MIME type specifying the format for the resulting media; you may simply specify the container format (the browser will select its preferred codecs for audio and/or video), or you may use the codecs parameter and/or the profiles parameter to provide detailed information about which codecs to use and how to configure them. Applications can check in advance if a mimeType is support...
...can check in advance if a mimeType is supported by the user agent by calling MediaRecorder.isTypeSupported(). audioBitsPerSecond: The chosen bitrate for the audio component of the media. videoBitsPerSecond: The chosen bitrate for the video component of the media. bitsPerSecond: The chosen bitrate for the audio and video components of the media. This can be specified instead of the above two
properties. If this is specified along with one or the other of the above
properties, this will be used for the one that isn't specified. If bits per second values are not specified for video and/or audio, the default adopted for video is 2.5Mbps, while the audio default is adaptive, depending upon the sample rate and the number of channels. Exceptions NotSupportedError The specified MIME ty...
MediaStreamEvent - Web APIs
MediaStreamEvent.stream Read only Contains the MediaStream containing the stream associated with the event. Constructors MediaStreamEvent() Returns a new MediaStreamEvent. It takes two parameters, the first being a DOMString representing the type of the event; the second a dictionary containing the MediaStream it refers to. ...
...ent.stream Read only Contains the MediaStream containing the stream associated with the event. Constructors MediaStreamEvent() Returns a new MediaStreamEvent. It takes two parameters, the first being a DOMString representing the type of the event; the second a dictionary containing the MediaStream it refers to. Methods A MediaStreamEvent being an Event, this event also implements these
properties. There is no specific MediaStreamEvent method. Examples pc.onaddstream = function( ev ) { alert("A stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
MediaStreamTrack.applyConstraints() - Web APIs
Constraints can be used to ensure that the media meets certain guidelines you prefer. For example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. ...
...can also specify ideal and/or acceptable sizes or ranges of sizes. See Applying constraints in Capabilities, constraints, and settings for more information on how to apply your preferred constraints. Syntax const appliedPromise = track.applyConstraints([constraints]) Parameters constraints Optional A MediaTrackConstraints object listing the constraints to apply to the track's constrainable
properties; any existing constraints are replaced with the new values specified, and any constrainable
properties not included are restored to their default constraints. If this parameter is omitted, all currently set custom constraints are cleared. This object represents the basic set of constraints that must apply for the Promise to resolve. The object may contain an advanced property containing an array ...
MediaStreamTrackEvent - Web APIs
track Read only A MediaStreamTrack object representing the track which was added to the stream. Constructor MediaStreamTrackEvent() Constructs a new MediaStreamTrackEvent with the specified configuration. Methods Also inherits methods from its parent Event. Specifications Specification Status Comment ...
... track Read only A MediaStreamTrack object representing the track which was added to the stream. Constructor MediaStreamTrackEvent() Constructs a new MediaStreamTrackEvent with the specified configuration. Methods Also inherits methods from its parent Event. Specifications Specification Status Comment Media Capture and Strea...
Media Capabilities API - Web APIs
media decoding type and a VideoConfiguration or AudioConfiguration dictionary. MediaEncodingConfiguration Defines the valid values for allowed types of media when the media configuration is submitted as the parameter for mediaCapabilities.encodingInfo(). Consists of a media encoding type and a VideoConfiguration or AudioConfiguration dictionary. ...
...sts of a media encoding type and a VideoConfiguration or AudioConfiguration dictionary. VideoConfiguration Describes the required video
properties that must be configured when querying a video configuration to be passed as part of a MediaConfiguration parameter to the MediaCapabilities.encodingInfo() and MediaCapabilities.decodingInfo() methods. AudioConfiguration Describes the required audio
properties that must be configured when querying an audio configuration to be passed as part of a MediaConfiguration parameter to the MediaCapabilities.encodingInfo() and MediaCapabilities.decodingInfo() methods. Specifications Specification Status Comment Media Capabilities Draft Initial definition ...
MouseEvent - Web APIs
"231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">MouseEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor MouseEvent() Creates a MouseEvent object.
Properties This interface also inherits
properties of its parents, UIEvent and Event. MouseEvent.altKey Read only Returns true if the alt key was down when the mouse event was fired. MouseEvent.button Read only The button number that was pressed (if applicable) when the mouse event was fired. MouseEvent.buttons Read only The buttons being depressed (if any) when the mouse event was fired. Mous...
...ew ModuleThe definition of 'MouseEvent' in that specification. Working Draft Redefines MouseEvent from long to double. This means that a PointerEvent whose pointerType is mouse will be a double. Pointer LockThe definition of 'MouseEvent' in that specification. Candidate Recommendation From Document Object Model (DOM) Level 3 Events Specification, added movementX and movementY
properties. CSS Object Model (CSSOM) View ModuleThe definition of 'MouseEvent' in that specification. Working Draft From Document Object Model (DOM) Level 3 Events Specification, added offsetX and offsetY, pageX and pageY, x, and y
properties. Redefined screen, page, client, and coordinate (x and y)
properties as double from long. UI EventsThe definition of 'MouseEvent' in that speci...
MutationObserverInit - Web APIs
Otherwise, a TypeError exception will be thrown. subtree Optional Set to true to extend monitoring to the entire subtree of nodes rooted at target. All of the other MutationObserverInit
properties are then extended to all of the nodes in the subtree instead of applying solely to the target node. ...
...primarily used as the type of the options parameter on the MutationObserver.observe() method.
Properties At a minimum, one of childList, attributes, and/or characterData must be true when you call observe(). Otherwise, a TypeError exception will be thrown. subtree Optional Set to true to extend monitoring to the entire subtree of nodes rooted at target. All of the other MutationObserverInit
properties are then extended to all of the nodes in the subtree instead of applying solely to the target node. The default value is false. childList Optional Set to true to monitor the target node (and, if subtree is true, its descendants) for the addition of new child nodes or removal of existing child nodes. The default value is false. attributes Optional Set to true to watch for changes to the value ...
NDEFReadingEvent - Web APIs
NDEFReadingEvent.serialNumber Read only Represents the serial number of the device used for anti-collision and identification, or empty string in case none is available. ...
... NDEFReadingEvent.serialNumber Read only Represents the serial number of the device used for anti-collision and identification, or empty string in case none is available. ...
Navigator - Web APIs
The Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. A Navigator object can be retrieved using the read-only window.navigator property.
Properties Doesn't inherit any
properties, but implements those defined in NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorStorage, NavigatorStorageUtils, NavigatorConcurrentHardware, NavigatorPlugins, and NavigatorUserMedia. Standard NavigatorID.appCodeName Read only Returns the internal "code" name of the current browser. Do not rely on this property to return the correct value. NavigatorID.appName Read only Returns a DOMString with the official name of the browser. Do not rely on this property to return ...
...ividing that number by 1024. Navigator.doNotTrack Reports the value of the user's do-not-track preference. When this value is "yes", your web site or application should not track the user. Navigator.mediaDevices Returns a reference to a MediaDevices object which can then be used to get information about available media devices (MediaDevices.enumerateDevices()), find out what constrainable
properties are supported for media on the user's computer and user agent (MediaDevices.getSupportedConstraints()), and to request access to media using MediaDevices.getUserMedia(). Navigator.mediaSession Returns MediaSession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls U...
NodeIterator - Web APIs
The NodeIterator interface represents an iterator over the members of a list of the nodes in a subtree of the DOM. The nodes will be returned in document order. Syntax A NodeIterator can be created using the Document.createNodeIterator() method, as follows: const nodeIterator = document.createNodeIterator(root, whatToShow, filter);
Properties This interface doesn't inherit any property. NodeIterator.root Read only Returns a Node representing the root node as specified when the NodeIterator was created. NodeIterator.whatToShow Read only Returns an unsigned long being a bitmask made of constants describing the types of Node that must to be presented. Non-matching nodes are skipped, but their children may be included, if relevant. The possible values are: Constant Nu...
...deIterator.previousNode() Returns the previous Node in the document, or null if there are none. NodeIterator.nextNode() Returns the next Node in the document, or null if there are none. Specifications Specification Status Comment DOMThe definition of 'NodeIterator' in that specification. Living Standard Added the referenceNode and pointerBeforeReferenceNode
properties. Removed the expandEntityReferences property. The method detach() has been changed to be a no-op. The methods previousNode() and nextNode() don't raise an exception any more. Document Object Model (DOM) Level 2 Traversal and Range SpecificationThe definition of 'NodeIterator' in that specification. Obsolete Initial definition. ...
NonDocumentTypeChildNode - Web APIs
The NonDocumentTypeChildNode interface contains methods that are particular to Node objects that can have a parent, but not suitable for DocumentType. NonDocumentTypeChildNode is a raw interface and no object of this type can be created; it is implemented by Element, and CharacterData objects.
Properties There are no inherited
properties. 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. Methods There are neither inherited nor specific m...
... ...
OrientationSensor - Web APIs
If a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. This is not something that would ever be shown to a user. See Feature-Policy for implementation instructions. Interfaces based on OrientationSensor Below is a list of interfaces based on the OrientationSensor interface. ...
... feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. This is not something that would ever be shown to a user. See Feature-Policy for implementation instructions. Interfaces based on OrientationSensor Below is a list of interfaces based on the OrientationSensor interface. AbsoluteOrientationSensor RelativeOrientationSensor
Properties OrientationSensor.quaternion Returns a four element Array whose elements contain the components of the unit quaternion representing the device's orientation. Methods OrientationSensor.populateMatrix() Populates the given object with the rotation matrix based on the latest sensor reading. The rotation maxtrix is shown below. Examples Basic Example The following example, which is loos...
OscillatorNode - Web APIs
oNode for definitions) are: Number of inputs 0 Number of outputs 1 Channel count mode max Channel count 2 (not used in the default count mode) Channel interpretation speakers Constructor OscillatorNode() Creates a new instance of an OscillatorNode object, optionally providing an object specifying default values for the node's
properties. ...
... Channel count 2 (not used in the default count mode) Channel interpretation speakers Constructor OscillatorNode() Creates a new instance of an OscillatorNode object, optionally providing an object specifying default values for the node's
properties. If the default values are acceptable, you can simply call the BaseAudioContext.createOscillator() factory method.
Properties Inherits
properties from its parent, AudioScheduledSourceNode, and adds the following
properties: OscillatorNode.frequency An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam returned is read-only, the value it represents is not). The default value is 440 Hz (a standard middle-A note). OscillatorNode.detune An a-rate AudioParam representing det...
PageTransitionEvent - Web APIs
PageTransitionEvent.persisted Read only Indicates if the document is loading from a cache. Example HTML <!DOCTYPE html> <html> <body> </body> </html> JavaScript window.addEventListener('pageshow', myFunction); function myFunction(event) { if (event.persisted) { alert("The page was cached by the browser"); } else...
... PageTransitionEvent.persisted Read only Indicates if the document is loading from a cache. Example HTML <!DOCTYPE html> <html> <body> </body> </html> JavaScript window.addEventListener('pageshow', myFunction); function myFunction(event) { if (event.persisted) { alert("The page was cached by the browser"); } else { alert("The page was NOT cached by ...
Page Visibility API - Web APIs
the video when the user puts the tab into the background, and resume playback when the user returns to the tab. The user doesn't lose their place in the video, the video's soundtrack doesn't interfere with audio in the new foreground tab, and the user doesn't miss any of the video in the meantime. Visibility states of an <iframe> are the same as the parent document. Hiding an <iframe> using CSS
properties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame. Use cases Let's consider a few use cases for the Page Visibility API. A site has an image carousel that shouldn't advance to the next slide unless the user is viewing the page An application showing a dashboard of information doesn't want to poll the server for updates ...
...y change document.addEventListener(visibilityChange, handleVisibilityChange, false); // When the video pauses, set the title. // This shows the paused videoElement.addEventListener("pause", function(){ document.title = 'Paused'; }, false); // When the video plays, set the title. videoElement.addEventListener("play", function(){ document.title = 'Playing'; }, false); }
Properties added to the Document interface The Page Visibility API adds the following
properties to the Document interface: Document.hidden Read only Returns true if the page is in a state considered to be hidden to the user, and false otherwise. Document.visibilityState Read only A DOMString indicating the document's current visibility state. Possible values are: visible The page content may...
PaintWorklet - Web APIs
Event handlers None. Methods This interface inherits methods from Worklet. PaintWorklet.registerPaint() Registers a class programmatically generate an image where a CSS property expects a file. ...
... given JavaScript file and adds it to the current PaintWorklet. Examples The following three examples go together to show creating, loading, and using a PaintWorklet. Create a PaintWorklet The following shows an example worklet module. This should be in a separate js file. Note that registerPaint() is called without a reference to PaintWorklet. ...
PannerNode.PannerNode() - Web APIs
The PannerNode() constructor of the Web Audio API creates a new PannerNode object instance. Syntax var myPanner = new PannerNode(context, options); Parameters Inherits parameters from the AudioNodeOptions dictionary. context A BaseAudioContext representing the audio context you want the node to be associated with. ...
...ode to have (the default is 360.) coneOuterAngle: The PannerNode.coneOuterAngle you want the PannerNode to have (the default is 360.) coneOuterGain: The PannerNode.coneOuterGain you want the PannerNode to have. The default is 0, and its value can be in the range 0-1. Return value A new PannerNode object instance. Exceptions RangeError The refDistance, maxDistance, or rolloffFactor
properties have been given a value that is outside the accepted range. InvalidStateError The coneOuterGain property has been given a value outside the accepted range (0-1). Example var ctx = new AudioContext(); var options = { positionX : 1, maxDistance: 5000 } var myPanner = new PannerNode(ctx, options); Specifications Specification Status Comment Web Audio APIThe defin...
PannerNode - Web APIs
o or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels! Number of inputs 1 Number of outputs 1 Channel count mode "clamped-max" Channel count 2 Channel interpretation "speakers" Constructor PannerNode.PannerNode Creates a new PannerNode object instance.
Properties Inherits
properties from its parent, AudioNode. The orientation and position value are set and retrieved using different syntaxes, since they're stored as AudioParam values. Retrieval is done by accessing, for example, PannerNode.positionX. While setting the same property is done with PannerNode.positionX.value. This is why these values are not marked read only, which is how they appear in the...
...D "Room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! Note how we have used some feature detection to either give the browser the newer property values (like AudioListener.forwardX) for setting position, etc. if it supports those, or older methods (like AudioListener.setOrientation()) if it still supports those but not the new
properties. // set up listener and panner position information var WIDTH = window.innerWidth; var HEIGHT = window.innerHeight; var xPos = Math.floor(WIDTH/2); var yPos = Math.floor(HEIGHT/2); var zPos = 295; // define other variables var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); var panner = audioCtx.createPanner(); panner.panningModel = 'HRTF';...
PaymentAddress.addressLine - Web APIs
These lines may include the street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box. Syntax var paymentAddressLines = PaymentAddress.addressLine; Value An array of DOMString objects, each containing one line of the address. ...
...ining one line of the address. For example, the addressLine array for the Mozilla Space in London would have the following entries: Example showing addressLine entries for an address in London Index addressLine[] value 0 Metal Box Factory 1 Suite 441, 4th floor 2 30 Great Guildford Street These, combined with additional values for other
properties of the PaymentAddress, would represent the full address, which is: Mozilla Metal Box Factory Suite 441, 4th floor 30 Great Guildford Street London SE1 0HS United Kingdom Specifications Specification Status Comment Payment Request APIThe definition of 'PaymentAddress.addressLine' in that specification. Candidate Recommendation Initial definition. ...
PaymentCurrencyAmount - Web APIs
The PaymentCurrencyAmount dictionary describes an amount of money in terms of both a number of units and the currency (US dollars, Euro, yen, etc.), and is part of the Payment Request API. This is used to specify the prices of both line items on a payment, using PaymentItem objects, and to provide the cost of a shipping option, using PaymentShippingOption.
Properties All
properties are required. currency A string containing a valid 3-letter ISO 4217 currency identifier (ISO 4217) indicating the currency used for the payment value. value A string containing a valid decimal value representing the mount of currency constituting the payment amount. This string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional d...
...sed for the payment value. value A string containing a valid decimal value representing the mount of currency constituting the payment amount. This string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of locale) followed by at least one more digit. No whitespace is permitted. Obsolete
properties These
properties have been removed from the specification and should no longer be used. currencySystem Optional A string describing the standard or specification as well as the currency system identifier within that system which was used to provide the value. This has been removed; instead of allowing sites to choose the standard to use, ISO 4217 is always used for the currency identifier ...
PerformanceEntry.duration - Web APIs
performance entry's type: "frame" - returns a timestamp indicating the difference between the startTimes of two successive frames. "mark" - returns "0" (a mark has no duration). "measure" - returns the timestamp that is the duration of the measure. "navigation" - returns the timestamp that is the difference between the PerformanceNavigationTiming.loadEventEnd and PerformanceEntry.startTime
properties, respectively. "resource" - returns the difference between the resource's responseEnd timestamp and its startTime timestamp. This property is Read only . Syntax entry.duration; Return value A DOMHighResTimeStamp representing the duration of the performance entry. If the duration concept doesn't apply for a particular performance metric, the browser may choose to return a duration of 0. No...
...ed"); return; } // Create some performance entries via the mark() method performance.mark("Begin"); do_work(50000); performance.mark("End"); // Use getEntries() to iterate through the each entry var p = performance.getEntries(); for (var i=0; i < p.length; i++) { log("Entry[" + i + "]"); check_PerformanceEntry(p[i]); } } function check_PerformanceEntry(obj) { var
properties = ["name", "entryType", "startTime", "duration"]; var methods = ["toJSON"]; for (var i=0; i <
properties.length; i++) { // check each property var supported =
properties[i] in obj; if (supported) log("..." +
properties[i] + " = " + obj[
properties[i]]); else log("..." +
properties[i] + " = Not supported"); } for (var i=0; i < methods.length; i++) { // check...
RTCAnswerOptions - Web APIs
Note: At this time, RTCAnswerOptions does not have any additional
properties defined beyond those included in RTCOfferAnswerOptions. ...
... The RTCAnswerOptions dictionary is used to provide optional settings when creating an SDP answer using RTCPeerConnection.createOffer() after receiving an offer from a remote peer. The createOffer() method's options parameter is of this type.
Properties This dictionary inherits
properties from the RTCOfferAnswerOptions dictionary, on which it's based. Note: At this time, RTCAnswerOptions does not have any additional
properties defined beyond those included in RTCOfferAnswerOptions. However, this is likely to change in the future, so the type has been defined in preparation for that eventuality. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCAnswerOptions' in that specification. Candidate Recommen...
RTCDTMFToneChangeEvent - Web APIs
Constructors RTCDTMFToneChangeEvent() Returns a new RTCDTMFToneChangeEvent. ...
... The RTCDTMFToneChangeEvent interface represents events sent to indicate that DTMF tones have started or finished playing. This interface is used by the tonechange event.
Properties In addition to the
properties of Event, this interface offers the following: RTCDTMFToneChangeEvent.tone Read only A DOMString specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing. Constructors RTCDTMFToneChangeEvent() Returns a new RTCDTMFToneChangeEvent. It takes two parameters, the first being a DOMString representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the
properties of the event. Methods Supports the methods defined in Event. There are no additional methods. Examples This snipp...
RTCDtlsTransport - Web APIs
Description Allocation of DTLS transports RTCDtlsTr...
...erty. You can, in turn, identify the RTCDtlsTransport used to securely encapsulate the data channels' SCTP communications by looking at the RTCSctpTransport object's transport property. Examples This example presents a function, tallySenders(), which iterates over an RTCPeerConnection's RTCRtpSenders, tallying up how many of them are in various states. The function returns an object containing
properties whose values indicate how many of the senders are in each state. let pc = new RTCPeerConnection({ bundlePolicy: "max-bundle" }); /* ... */ function tallySenders(pc) { let results = { transportMissing: 0, connectionPending: 0, connected: 0, closed: 0, failed: 0, unknown: 0 }; let senderList = pc.getSenders(); senderList.forEach(sender => { let transport = se...
RTCIceCandidate.RTCIceCandidate() - Web APIs
ate object, optionally configured based on the specified object based on the RTCIceCandidateInit dictionary. If candidateInfo is provided, the new RTCIceCandidate is initialized as follows: Each member of the RTCIceCandidateInit object is initialized to the value of the property by the same name from RTCIceCandidateInit. This includes the candidate, sdpMid, sdpMLineIndex, and usernameFragment
properties. The candidate string (which is SDP text) is parsed; each property found is stored in the corresponding field in the RTCIceCandidate. If any of the fields is invalid, parsing of the string silently aborts without throwing an exception. The default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message. The following fields are initialized to...
...e not included in the RTCIceCandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcpType, relatedAddress, and relatedPort. Note: Parsing of the candidate string is performed using the candidate-attribute grammar from the WebRTC Specification. Exceptions TypeError The specified RTCIceCandidateInit has values of null in both the sdpMid and sdpMLineIndex
properties. Usage notes This constructor does not do complete validation of the specified candidateInfo object or string. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate()' in that specification. Candidate Recommendation Initial definition. ...
RTCIceCandidate.candidate - Web APIs
The candidate string specifies the network connectivity information for the candidate. ...
...The candidate string specifies the network connectivity information for the candidate. If the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. ...
RTCIceServer - Web APIs
This is only used if the RTCIceServer represents a TURN server. credentialType Optional If the RTCIceServer represents a TURN server, this attribute specifies what kind of credential is to be used when connecting. This must be one of the values defined by the RTCIceCredentialType enum. ...
...perty; the startup time for your connection will go up substantially. Every server in the list will be contacted and tried out before one is selected to be used for negotiation. Older versions of the WebRTC specification included an url property instead of urls; this was changed in order to let you specify multiple addresses for each server in the list, as shown in the example below. Obsolete
properties The following
properties have been removed from the specification and should not be used. url This obsolete property is a string specifies a single ICE server's URL. Do not use this property; use urls instead. Because many older books and examples still use this, we include it to help developers update their code or make sense of older examples. Example The configuration below establish...
RTCIdentityErrorEvent - Web APIs
ted with the identity provider (idP). This is usually for an RTCPeerConnection. Two events are sent with this type: idpassertionerror and idpvalidationerror. Firefox implements this interface under the following name: RTCPeerConnectionIdentityErrorEvent. It is likely that it will correct this name when it will unprefix RTCPeerConnection, once spec and implementation will have been stabilized.
Properties A RTCIdentityErrorEvent being an Event, this event also implements these
properties. RTCIdentityErrorEvent.idp Read only Is a DOMString describing the domain name of the identity provider (idp) generating the error response. RTCIdentityErrorEvent.loginUrl Read only Is a DOMString giving the URL where the user can complete the authentication. It can be null and is provided by the identity...
...idp) generating the error response. RTCIdentityErrorEvent.loginUrl Read only Is a DOMString giving the URL where the user can complete the authentication. It can be null and is provided by the identity provider (idp). RTCIdentityErrorEvent.protocol Read only Is a DOMString describing the Idp protocol in use. Methods A RTCIdentityErrorEvent being an Event, this event also implements these
properties. There is no specific RTCIdentityErrorEvent method. Examples pc.onidpassertionerror = function( ev ) { alert("The idp named '" + ev.idp + "' encountered an error " + "while generating an assertion."); } ...
RTCInboundRtpStreamStats - Web APIs
averageRtcpInterval A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets. ...
... The WebRTC API's RTCInboundRtpStreamStats dictionary, based upon RTCReceivedRtpStreamStats and RTCStats, contains statistics related to the receiving end of an RTP stream on the local end of the RTCPeerConnection.
Properties The RTCInboundRtpStreamStats dictionary is based on the RTCReceivedRtpStreamStats dictionary, whose
properties are also available. averageRtcpInterval A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets. bytesReceived A 64-bit integer which indicats the total numer of bytes that have been received so far for this media source. fecPacketsDiscarded An integer value indicating the number of RTP Forward Error Correction (FEC) packets which have been received for this source, for which the error correction payload was d...
RTCOfferOptions - Web APIs
iceRestart Optional A Boolean which, when set to true, tells createOffer() to generate and use new values for the identifying
properties of the SDP it creates, resulting in a request that triggers renegotiation of the ICE connection. This is useful if network conditions have changed in a way that make the current configuration untenable or impractical, for instance. ...
... The RTCOfferOptions dictionary is used to provide optional settings when creating an RTCPeerConnection offer with the createOffer() method.
Properties This dictionary also inherits
properties from the RTCOfferAnswerOptions dictionary, on which it's based. iceRestart Optional A Boolean which, when set to true, tells createOffer() to generate and use new values for the identifying
properties of the SDP it creates, resulting in a request that triggers renegotiation of the ICE connection. This is useful if network conditions have changed in a way that make the current configuration untenable or impractical, for instance. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCOfferOptions' in that specificati...
RTCOutboundRtpStreamStats - Web APIs
averageRtcpInterval A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets. ...
... averageRtcpInterval A floating-point value indicating the average RTCP interval between two consecutive compound RTCP packets. ...
RTCPeerConnectionIceErrorEvent - Web APIs
The RTCPeerConnectionIceErrorEvent interface--based upon the Event interface--provides details pertaining to an ICE error announced by sending an icecandidateerror event to the RTCPeerConnection object. Constructor RTCPeerConnectionIceErrorEvent() Creates and returns a new RTCPeerConnectionIceErrorEvent object, with its type and other
properties initialized as specified in the parameters. You will not normally create an object of this type yourself. ...
...Event interface--provides details pertaining to an ICE error announced by sending an icecandidateerror event to the RTCPeerConnection object. Constructor RTCPeerConnectionIceErrorEvent() Creates and returns a new RTCPeerConnectionIceErrorEvent object, with its type and other
properties initialized as specified in the parameters. You will not normally create an object of this type yourself.
Properties The RTCPeerConnectionIceErrorEvent interface includes the
properties found on the Event interface, as well as the following
properties: address Read only A DOMString providing the local IP address used to communicate with the STUN or TURN server being used to negotiate the connection, or null if the local IP address has not yet been exposed as part of a local ICE candidate. errorCode Read ...
RTCPeerConnectionIceEvent - Web APIs
RTCPeerConnectionIceEvent.candidate Read only Contains the RTCIceCandidate containing the candidate associated with the event, or null if this event indicates that there are no further candidates to come. Constructors RTCPeerConnectionIceEvent() Returns a new RTCPeerConnectionIceEvent. ...
...his event indicates that there are no further candidates to come. Constructors RTCPeerConnectionIceEvent() Returns a new RTCPeerConnectionIceEvent. It takes two parameters, the first being a DOMString representing the type of the event; the second a dictionary containing the RTCIceCandidate it refers to. Methods A RTCPeerConnectionIceEvent being an Event, this event also implements these
properties. There is no specific RTCDataChannelEvent method. Examples pc.onicecandidate = function( ev ) { alert("The ICE candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCPeerConnectionIceEvent' in...
RTCRtpCapabilities - Web APIs
CRtpReceiver in response to a call to the RTCRtpSender.getCapabilities() or RTCRtpReceiver.getCapabilities() static functions, both of which return an array of RTCRtpCapabilities objects. An RTCRtpCapabilities object contains an array of objects conforming to RTCRtpCodecCapability (each describing the capabilities of one codec) and an array of the supported RTP header extensions for that codec.
Properties codecs An array of RTCRtpCodecCapability objects, each describing one of the codecs supported by the RTCRtpSender or RTCRtpReceiver. There are some special entries in this array, described below in the section The codecs array. headerExtensions An array of objects conforming to the RTCRtpHeaderExtensionCapability dictionary. Each object contains a single DOMString, uri, specifying the URI o...
... array of objects conforming to the RTCRtpHeaderExtensionCapability dictionary. Each object contains a single DOMString, uri, specifying the URI of the header extension, as described in RFC 5285. Description The codecs array The codecs array is an array of objects conforming to the dictionary RTCRtpCodecCapability. Each of these objects describes a single codec and its basic capabilities. Its
properties are: The browser will only report distinct capability combinations separately. If two sets of capabilities can be described as one, they will be. That means that, for instance, if there are two entries for the H.264 codec (as identified by the mimeType being "video/H264"), there are other values in the capabilities objects indicating how they're different in some way. The MIME type strings u...
RTCRtpReceiver - Web APIs
RTCRtpReceiver.transport Read only Returns the RTCDtlsTransport instance over which the media for the receiver's track is received. Obsolete
properties rtcpTransport This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead. ...
...ver interface of the WebRTC API manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection.
Properties RTCRtpReceiver.track Read only Returns the MediaStreamTrack associated with the current RTCRtpReceiver instance. RTCRtpReceiver.transport Read only Returns the RTCDtlsTransport instance over which the media for the receiver's track is received. Obsolete
properties rtcpTransport This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead. Methods RTCRtpReceiver.getContributingSources() Returns an array of RTCRtpContributingSource instances for each unique CSRC (contributing source) identifier received by the current RTCRtpReceiver in the last ten seconds. RTCRtpRecei...
RTCRtpSender - Web APIs
etails about how a particular MediaStreamTrack is encoded and sent to a remote peer. With it, you can configure the encoding used for the corresponding track, get information about the device's media capabilities, and so forth. You can also obtain access to an RTCDTMFSender which can be used to send DTMF codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer.
Properties RTCRtpSender.dtmf Read only An RTCDTMFSender which can be used to send DTMF tones using telephone-event payloads on the RTP session represented by the RTCRtpSender object. If null, the track and/or the connection doesn't support DTMF. Only audio tracks can support DTMF. RTCRtpSender.track Read only The MediaStreamTrack which is being handled by the RTCRtpSender. If track is null, the RTCR...
...tpSender. If track is null, the RTCRtpSender doesn't transmit anything. RTCRtpSender.transport Read only The RTCDtlsTransport over which the sender is exchanging the RTP and RTCP packets used to manage transmission of media and control data. This value is null until the transport is established. When bundling is in use, more than transceiver may be sharing the same transport object. Obsolete
properties rtcpTransport This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead. Methods RTCRtpSender.getParameters() Returns a RTCRtpParameters object describing the current configuration for the encoding and transmission of media on the track. RTCRtpSender.getStats() Returns a Promise which is fulfilled wit...
Functions and classes available to Web Workers - Web APIs
In addition to the standard JavaScript set of functions (such as String, Array, Object, JSON, etc), there are a variety of functions available from the DOM to workers. This article provides a list of those. Workers run in another global context, DedicatedWorkerGlobalScope, different from the current window. ...
...JSON, etc), there are a variety of functions available from the DOM to workers. This article provides a list of those. Workers run in another global context, DedicatedWorkerGlobalScope, different from the current window. By default, methods and
properties of Window are not available to them, but DedicatedWorkerGlobalScope, like Window, implements WindowTimers and WindowBase64. ...
Web Workers API - Web APIs
alScope object (in the case of dedicated workers - workers that are utilized by a single script), or a SharedWorkerGlobalScope (in the case of shared workers - workers that are shared between multiple scripts). You can run whatever code you like inside the worker thread, with some exceptions. For example, you can't directly manipulate the DOM from inside a worker, or use some default methods and
properties of the window object. But you can use a large number of items available under window, including WebSockets, and data storage mechanisms like IndexedDB. See Functions and classes available to workers for more details. Data is sent between workers and the main thread via a system of messages -- both sides send their messages using the postMessage() method, and respond to messages via the onmessag...
...kers in extensions and have access to js-ctypes in your worker. See ChromeWorker for more details. Audio Workers provide the ability for direct scripted audio processing to be done inside a web worker context. Note: As per the Web workers Spec, worker error events should not bubble (see bug 1188141. This has been implemented in Firefox 42. Web Worker interfaces AbstractWorker Abstracts
properties and methods common to all kind of workers (i.e. Worker or SharedWorker). Worker Represents a running worker thread, allowing you to pass messages to the running worker code. WorkerLocation Defines the absolute location of the script executed by the Worker. SharedWorker Represents a specific kind of worker that can be accessed from several browsing contexts, being several windows, iframes or...
WheelEvent - Web APIs
this interface and avoid the non-standard ones. Do not confuse the wheel event with the scroll event: The default action of a wheel event is implementation-defined. Thus, a wheel event doesn't necessarily dispatch a scroll event. Even when it does, that doesn't mean that the delta* values in the wheel event necessarily reflect the content's scrolling direction. Therefore, do not rely on delta*
properties to get the content's scrolling direction. Instead, detect value changes to scrollLeft and scrollTop of the target in the scroll event. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 ...
..."371" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="421" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">WheelEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor WheelEvent() Creates a WheelEvent object.
Properties This interface inherits
properties from its ancestors, MouseEvent, UIEvent, and Event. WheelEvent.deltaXRead only Returns a double representing the horizontal scroll amount. WheelEvent.deltaYRead only Returns a double representing the vertical scroll amount. WheelEvent.deltaZRead only Returns a double representing the scroll amount for the z-axis. WheelEvent.deltaModeRead only Retu...
Window.getSelection() - Web APIs
do stuff with the range } Notes String representation of the Selection object In JavaScript, when an object is passed to a function expecting a string (like window.alert() or document.write()), the object's toString() method is called and the returned value is passed to the function. This can make the object appear to be a string when used with other functions when it is really an object with
properties and methods. In the above example, selObj.toString() is automatically called when it is passed to window.alert(). However, attempting to use a JavaScript String property or method such as length or substr directly on a Selection object will result in an error if it does not have that property or method and may return unexpected results if it does. To use a Selection object as a string, call its ...
...ion object. selectedText is a string (Selected text). Related objects You can call Document.getSelection(), which works identically to Window.getSelection(). 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. HTMLInputElement.setSelectionRange() or the selectionStart and selectionEnd
properties could be used to work around this. Notice also the difference between selection and focus. Document.activeElement returns the focused element. Specifications Specification Status Comment Selection APIThe definition of 'Window.getSelection()' in that specification. Working Draft New spec. ...
window.location - Web APIs
y property returns a Location object with information about the current location of the document. Though window.location is a read-only Location object, you can also assign a DOMString to it. This means that you can work with location as if it were a string in most cases: location = 'http://www.example.com' is a synonym of location.href = 'http://www.example.com'. See Location for all available
properties. Syntax var oldLocation = location; location = newLocation; Examples Basic Example alert(location); // alerts "/docs/Web/API/Window/location" Example #1: Navigate to a new page Whenever a new value is assigned to the location object, a document will be loaded using the URL as if location.assign() had been called with the modified URL. Note that security settings, like CORS, may prevent th...
...xample #2: Force reloading the current page from the server location.reload(true); Example #3 Consider the following example, which will reload the page by using the replace() method to insert the value of location.pathname into the hash: function reloadPageWithHash() { var initialPage = location.pathname; location.replace('http://example.com/#' + initialPage); } Example #4: Display the
properties of the current URL in an alert dialog: function showLoc() { var oLocation = location, aLog = ["Property (Typeof): Value", "location (" + (typeof oLocation) + "): " + oLocation ]; for (var sProp in oLocation){ aLog.push(sProp + " (" + (typeof oLocation[sProp]) + "): " + (oLocation[sProp] || "n/a")); } alert(aLog.join("\n")); } // in html: <button onclick="showLoc();">Show location prop...
WindowEventHandlers - Web APIs
The WindowEventHandlers mixin describes the event handlers common to several interfaces like Window, or HTMLBodyElement and HTMLFrameSetElement. Each of these interfaces can implement additional specific event handlers. Note: WindowEventHandlers is a mixin and not an interface; you can't actually create an object of type WindowEventHandlers.
Properties The events
properties, of the form onXYZ, are defined on the WindowEventHandlers, and implemented by Window, and WorkerGlobalScope for Web Workers. WindowEventHandlers.onafterprint Is an EventHandler representing the code to be called when the afterprint event is raised. WindowEventHandlers.onbeforeprint Is an EventHandler representing the code to be called when the beforeprint event is raised. WindowEventHandlers.onbeforeunload Is an Ev...
... ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
-1 : 1; if (oDmn.task.call(oDmn.owner, oDmn.INDEX, oDmn.length, oDmn.BACKW) === false || oDmn.isAtEnd()) { oDmn.pause(); return false; } r...
...s something like callback.call(thisObject, index, length, backwards). If the callback function returns a false value the daemon is paused. rate (optional) The time lapse (in number of milliseconds) between each invocation. The default value is 100. length (optional) The total number of invocations. It can be a positive integer or Infinity. The default value is Infinity. MiniDaemon instances
properties myDaemon.owner The this object on which is executed the daemon (read/write). It can be an object or null. myDaemon.task The function that is repeatedly invoked (read/write). It is called with three arguments: index (the iterative index of each invocation), length (the number of total invocations assigned to the daemon - finite or Infinity) and backwards (a boolean expressing whether the ind...
WorkerNavigator - Web APIs
The WorkerNavigator interface represents a subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator.
Properties The WorkerNavigator interface implements
properties from the NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorDataStore, and NavigatorConcurrentHardware interfaces. WorkerNavigator.connectionRead only Provides a NetworkInformation object containing information about the network connection of a device. WorkerNavigator.locks Read only Returns a LockManager object which provides methods for requesting a new Lock object and querying for an existing Lock object. WorkerNavigator.permissions Read only Returns...
... methods for requesting a new Lock object and querying for an existing Lock object. WorkerNavigator.permissions Read only Returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API. Navigator.storageRead only Returns a StorageManager interface for managing persistance permissions and estimating available storage. Inherited
properties NavigatorID.appCodeName Read only Always returns 'Mozilla', in any browser. This property is kept only for compatibility purposes. NavigatorID.appName Read only Returns the official name of the browser. Do not rely on this property to return the correct value. NavigatorID.appVersion Read only Returns the version of the browser as a string. Do not rely on this property to return the ...
Worklet - Web APIs
ht version of Web Workers and gives developers access to low-level parts of the rendering pipeline. With Worklets, you can run JavaScript and WebAssembly code to do graphics rendering or audio processing where high performance is required. Worklet types Worklets are restricted to specific use cases; they cannot be used for arbitrary computations like Web Workers. The Worklet interface abstracts
properties and methods common to all kind of worklets, and cannot be created directly. Instead, you can use one of the following classes: Name Description Location Specification PaintWorklet For programmatically generating an image where a CSS property expects a file. Access this interface through CSS.paintWorklet. Chrome: Main thread Gecko: Paint thread ...
...and other high performance procedural animations. Compositor thread CSS Animation Worklet API LayoutWorklet For defining the positioning and dimensions of custom elements. CSS Layout API For 3D rendering with WebGL, you don't use Worklets. Instead, you write Vertex Shaders and Fragment Shaders using GLSL code, and those shaders will then run on the graphics card.
Properties The Worklet interface does not define any
properties. Methods Worklet.addModule() Adds the script module at the given URL to the current worklet. Specifications Specification Status Comment Worklets Level 1The definition of 'Worklet' in that specification. Working Draft ...
XMLDocument - Web APIs
The XMLDocument interface represents an XML document. It inherits from the generic Document and does not add any specific methods or
properties to it: nevertheless, several algorithms behave differently with the two types of documents. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="...
... Methods Also inherits methods from: Document XMLDocument.load() Loads an XML document. Specifications Specification Status Comment DOMThe definition of 'XMLDocument' in that specification. Living Standard No changes. DOM4The definition of ...
Using XMLHttpRequest - Web APIs
ame.toUpperCase() === "INPUT" ? ...
...h > 0) { if (this.technique === 3) { /* enctype is multipart/form-data */ for (nFile = 0; nFile < oField.files.length; nFile++) { oFile = oField.files[nFile]; oSegmReq = new FileReader(); /* (custom
properties:) */ oSegmReq.segmentIdx = this.segments.length; oSegmReq.owner = this; /* (end of custom
properties) */ oSegmReq.onload = pushSegment; this.segments.push("Content-Disposition: form-data; name=\"" + oField.name + "\"; filename=\"" + oFile.name + "\"\r\nContent-Type: " + oFile.type + "\r\n\r\n"); this.status++; oSegmReq.readAsBinaryString(oFile); } } else { /* enctype is application/x-www-f...
XRInputSourceEventInit - Web APIs
It also offers the following: frame An XRFrame object representing the event frame during which the event took place. This event is not associated with the animation process, and has no viewer information contained within it. ...
...It also offers the following: frame An XRFrame object representing the event frame during which the event took place. This event is not associated with the animation process, and has no viewer information contained within it. ...
XRRenderStateInit - Web APIs
The XRRenderStateInit dictionary is a writeable version of the XRRenderState interface, and is used when calling an XRSession's updateRenderState() method to apply changes to the render state prior to rendering the next frame. All distances are specified as floating-point values in meters; you can specify a value of 50 centimeters using a value of 0.5, for example.
Properties baseLayer Optional An XRWebGLLayer object from which the WebXR compositor will obtain imagery. This is null by default. depthFar Optional A floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. All rendering will take place between the distances specified by depthNear and depthFar. Th...
...efault field of view, in radians, to be used when computing the projection matrix for an inline XRSession. The projection matrix calculation also takes into account the output canvas's aspect ratio. This property must not be specified for immersive sessions, so the value is null by default for immersive sessions. The default value is otherwise ? * 0.5 (half of the value of pi). Usage notes Any
properties not specified in the XRRenderStateInit compliant object passed into updateRenderState() are left at their current values. Specifications Specification Status Comment WebXR Device APIThe definition of 'XRRenderStateInit' in that specification. Working Draft Initial definition. ...
XRSession - Web APIs
The WebXR Device API's XRSession interface represents an ongoing XR session, providing methods and
properties used to interact with and control the session. To open a WebXR session, use the XRSystem interface's requestSession() method. With XRSession methods, you can poll the viewer's position and orientation (the XRViewerPose), gather information about the user's environment, and present imagery to the user. XRSession supports both inline and immersive virtual and augmented reality modes.
Properties In addition to the
properties listed below, XRSession inherits
properties from its parent interface, EventTarget. environmentBlendMode Read only Returns this session's blend mode which denotes how much of the real-world environment is visible through the XR device and how the dev...
... This method is comparable to the Window.requestAnimationFrame() method. requestReferenceSpace() Requests that a new XRReferenceSpace of the specified type be created. Returns a promise which resolves with the XRReferenceSpace or XRBoundedReferenceSpace which was requested, or throws a NotSupportedError if the requested space type isn't supported by the device. updateRenderState() Updates the
properties of the session's render state to match the values specified in the specified XRRenderStateInit dictionary. Any
properties not included in the given dictionary are left unchanged from their current values. Events The following events are delivered to XRSession objects. Event Description end Sent to the XRSession object after the WebXR session has ended and all hardw...
Using the group role - Accessibility
ARIA attributes used group Related ARIA techniques region role Compatibility TBD: Add support information for common UA and AT product combinations Addition...
... ARIA attributes used group Related ARIA techniques region role Compatibility TBD: Add support information for common UA and AT product combinations Additional resources ARIA Authoring Practices - Accessible Name G...
ARIA: cell role - Accessibility
riate. A cell can contain a number of property attributes clarifying the cell's position within the tabular data structure, including aria-colindex, aria-colspan, aria-rowindex, and aria-rowspan. Using the native HTML table element (<table>) along with the table row element (<tr>) and table cell element (<td>) whenever possible is strongly encouraged. Associated WAI-ARIA roles, states, and
properties Context roles role="row" An element with role="row" is a row of cells within a tabular structure. A row contains one or more cells, grid cells, column headers, or row headers within a grid, table or treegrid, and optionally within a rowgroup. role="rowgroup" Row is a required cell parent. Rowgroup is an optional contextual row parent. It establishes a relationship between descendant rows.
...th> element with a column scope. Unlike a plain cell, the columnheader role establishes a relationship between it and all cells in the corresponding column. role="rowheader" A header cell that is the structural equivalent of the HTML <th> element with a row scope. Unlike a plain cell, the rowheader role establishes a relationship between it and all cells in the corresponding row. States and
properties aria-colspan Similar to the HTML <th> and <td> colspan attribute, it defines the number of columns spanned by the cell. aria-rowspan Similar to the HTML <th> and <td> rowspan attribute, it defines the number of rows spanned by the cell. aria-colindex attribute The aria-colindex attribute is only needed if columns are hidden from the DOM. The attribute takes as its value an integer betwe...
ARIA: figure role - Accessibility
igure> Generally, you should reference the figure from the main text, but the figure need not be displayed at the same location as the referencing element. 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>. See Best practices for a full example. Associated WAI-ARIA roles, states, and
properties aria-describedby The id of an element containing reference text serving as a caption. aria-labelledby The id of an element containing text serving as a label. aria-label If there is no element containing text that could serve as a label, you can add the label directly as a value on the aria-label on the element with the figure role or on the <figure> element. Keyboard interactions No r...
... serve as a label, you can add the label directly as a value on the aria-label on the element with the figure role or on the <figure> element. Keyboard interactions No role specific keyboard interactions. Required JavaScript features No role specific JavaScript requirements. If you don't have control over the HTML semantics, you can improve the accessibility of HTML by adding these roles and
properties with JavaScript. Examples We could extend the initial example on the page to also identify a paragraph that provides a descriptive label for the figure by referencing its ID in aria-labelledby: <div role="figure" aria-labelledby="figure-1"> <img src="diagram.png" alt="diagram showing the four layers of awesome and their relative priority order -- music, cats, nature, and i...
ARIA: grid role - Accessibility
dget contains one or more rows with one or more cells of thematically related interactive content. While it does not imply a specific visual presentation, it implies a relationship among elements. Uses fall into two categories: presenting tabular information (data grids) and grouping other widgets (layout grids). Even though both data grids and layout grids employ the same ARIA roles, states, and
properties, differences in their content and purpose surface factors that are important to consider in keyboard interaction design. 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. Cell elements need to be owned by elements with a row role. Rows can be grouped using row...
...ing 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. Cell elements need to be owned by elements with a row role. Rows can be grouped using rowgroups. If the grid is used as an interactive widget, keyboard interactions need to be implemented. Associated ARIA roles, states, and
properties Roles treegrid (subclass) If a grid has columns that can expanded or collapsed, a treegrid can be used. row A row inside the grid. rowgroup A group containing one or multiple rows. States and
properties aria-level Indicates the hierarchical level of the grid within other structures. aria-multiselectable If aria-multiselectable is set to true, multiple items in the grid can be...
ARIA: gridcell role - Accessibility
s applied to focusable via the Tab key. If a gridcell is conditionally toggled into a state where editing is prohibited, toggle aria-readonly on the gridcell element. Expandable cells In a treegrid, gridcells may be made expandable by toggling the aria-expanded attribute. Note that if this attribute is provided, it applies only to the individual gridcell. Associated WAI-ARIA Roles, States, and
Properties grid Communicates that a parent element is a a table or tree style grouping of information. row Required to communicate the gridcell is part of a row of a table-style grouping of information. columnheader Specifies which element is the associated column header. aria-colindex Identifies the position of an element in relation to the rest of the table-style grouping of inf...
...If at all possible, utilize native HTML table markup in their place. Best practices The first rule of ARIA is: if a native HTML element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an ARIA role, state or property to make it accessible. As such, it is recommended to use the utilize nat...
ARIA: row role - Accessibility
left to right and top to botton navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead. Note: Using the native HTML table element (<table>) along with the table row element (<tr>) whenever possible is strongly encouraged. Associated WAI-ARIA roles, states, and
properties Context roles role="rowgroup" An optional contextual row parent, it establishes a relationship between descendant rows. It is a structural equivalent to the thead, tfoot, and tbody elements in an HTML table element. role="table" One of the three possible contexts (along with grid and treegrid) in which you'll find a row, it identifies the row as being part of a non-interactive table struct...
...th> element with a column scope. Unlike a plain cell, the columnheader role establishes a relationship between it and all cells in the corresponding column. role="rowheader" A header cell that is the structural equivalent of the HTML <th> element with a row scope. Unlike a plain cell, the rowheader role establishes a relationship between it and all cells in the corresponding row. States and
properties aria-expanded state The aria-expanded attribute, which defines the state of the row, can take one of three values, or be omitted: aria-expanded="true: Row is currently expanded. aria-expanded="false": Row is currently collapsed. aria-expended="undefined" or the attribute is missing: The row is neither expandable nor collapsible. If the element with the aria-expanded attribute c...
ARIA: switch role - Accessibility
an interactive control, it must be focusable and keyboard accessible. If the role is applied to a non-focusable element, use the tabindex attribute to change this. The expected keyboard shortcut for toggling the value of a switch is the Space key. The developer is required to change the value of the aria-checked attribute dynamically when the switch is toggled. Associated ARIA roles, states, and
properties aria-checked attribute The aria-checked attribute is required when using the switch role, as it represents the current state of the widget that the switch role is applied to. A value of true represents the "on" state; false represents the "off" state; a value of mixed is not supported by the switch role, and is treated as false. The default value is false. aria-readonly attribute The aria-r...
... ARIA in HTML Working Draft Describes how ARIA's features integrate into HTML. ...
ARIA: textbox role - Accessibility
res. <label for="txtbox">Enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" id="txtbox"/> <!-- Multi-line text area --> <label for="txtboxMultiline">Enter the tags for the article</label> <textarea id="txtboxMultiline" required></textarea> Where a text field is read-only, indicated this by setting aria-readonly="true" on the element. Associated ARIA
properties aria-activedescendent attribute Taking as it's value the ID of is either a descendant of the element with DOM focus or is a logical descendant as indicated by the aria-owns attribute, it indicates when that element has focus, when it is part of a composite widget such as a combobox. For example, in a combobox, focus may remain on the textbox while the value of aria-activedescendant on the tex...
.... Instead of using aria-required, use the semantic <input type="text"> or <textarea> with a required attribute. Keyboard interactions In a single-line use (when aria-multiline is false or not used), the Return or Enter key submits the form. In a multi-line use (when aria-multiline is true), Return or Enter key inserts a line break. JavaScript features All features associated with any and all
properties and states must be maintained, and forms submission on enter or return on a single line textbox needs to be handled. Focus event handler and aria-activedescendent attribute If you are implementing a composite widget, such as a combobox composed of a text box and a listbox, you need to manage the aria-activedescendent attribute using a handler. Before using this technique, ensure that the brow...
An overview of accessible web applications and widgets - Accessibility
rd HTML tags and the desktop-style controls found in dynamic web applications, ARIA provides roles and states that describe the behavior of most familiar UI widgets. Many of these were later added in HTML5, and developers should always prefer using the correct semantic HTML element over using ARIA. The ARIA specification is split up into three different types of attributes: roles, states, and
properties. Roles describe widgets that aren't otherwise available in HTML 4, such as sliders, menu bars, tabs, and dialogs.
Properties describe characteristics of these widgets, such as if they are draggable, have a required element, or have a popup associated with them. States describe the current interaction state of an element, informing the assistive technology if it is busy, disabled, selected, or hid...
...urrent state of a UI widget. Examples include (but are certainly not limited to): 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). Visibility changes When content visibility is changed (i.e., an element is hidden or shown), developers should change the aria-hidden property value. The techni...
Mobile accessibility checklist - Accessibility
means too (underlined text for links, etc.) Visibility Content hiding techniques such as zero opacity, z-index order and off-screen placement MUST NOT be used exclusively to handle visibility. Everything other than the currently visible screen MUST be truly invisible (especially relevant for single page apps with multiple cards): USE the hidden attribute or visibility or display style
properties. Unless absolutely unavoidable, aria-hidden attribute SHOULD NOT be used. Focus All activatable elements MUST be focusable: Standard controls such as links, buttons, and form fields are focusable by default. Non-standard controls MUST have an appropriate ARIA Role assigned to them, such as button, link, or checkbox. Focus should be handled in a logical order and consi...
... Focus should be handled in a logical order and consistent manner. Text Equivalents Text equivalent MUST be provided for every non-strictly presentational non-text element within the app. Use alt and title where appropriate (see Steve Faulkner's post about Using the HTML title attribute for a good guide.) If the above attributes are not applicable, use appropriate ARIA States and
Properties such as aria-label, aria-labelledby, or aria-describedby. Images of text MUST be avoided. All user interface components with visible text (or image of text) as labels must have the same text available in the programmatic name of the component. WCAG 2.1: Label in name. All form controls MUST have labels (<label> elements) for the benefit of screen reader users. Handling State Standard...
-moz-float-edge - CSS: Cascading Style Sheets
The non-standard -moz-float-edge CSS property specifies whether the height and width
properties of the element include the margin, border, or padding thickness. /* Keyword values */ -moz-float-edge: border-box; -moz-float-edge: content-box; -moz-float-edge: margin-box; -moz-float-edge: padding-box; /* Global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; Syntax Values border-box The height and width
properties include the content, padding and border but not the margin. content-box The height and width
properties include the content, but not the padding, border or margin. ...
...gin-box; -moz-float-edge: padding-box; /* Global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; Syntax Values border-box The height and width
properties include the content, padding and border but not the margin. content-box The height and width
properties include the content, but not the padding, border or margin. margin-box The height and width
properties include the content, padding, border and margin. padding-box The height and width
properties include the content and padding but not the border or margin. 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 ...
@page - CSS: Cascading Style Sheets
The @page CSS at-rule is used to modify some CSS
properties when printing a document. Syntax @page { margin: 1cm; } @page :first { margin: 2cm; } Descriptors size Specifies the target size and orientation of the page box's containing block. In the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet. marks Adds crop and/or registration marks to the document. bleed Specifies the extent beyond the page box at which the page rendering is clipped. Description You can't change all CSS
properties with @page. You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS
properties will be ignored. The @page at-rule can be accessed via the CSS object model in...
...ottom-left | @bottom-center | @bottom-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom Examples @page pseudo-class examples Please refer to the various pseudo-classes of @page for examples. :blank :first :left :right :recto :verso Specifications Specification Status Comment CSS Logical
Properties and Values Level 1The definition of ':recto and :verso' in that specification. Editor's Draft Adds the :recto and :verso page selectors CSS Paged Media Module Level 3The definition of '@page' in that specification. Working Draft No change from CSS Level 2 (Revision 1), though more CSS at-rules can be used inside a @page. CSS Level 2 (Revision 1)The definition of '@pa...
height - CSS: Cascading Style Sheets
x; Values auto The used value is calculated from the other CSS descriptors' values. <length> A non-negative absolute or relative length. <percentage> A percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. Must be non-negative. Formal definition Related at-rule@viewportInitial valueas each of the
properties of the shorthand:min-height: automax-height: nonePercentagesas each of the
properties of the shorthand:min-height: The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0...
...ent is not absolutely positioned, the percentage value is treated as 0.max-height: The percentage is calculated with respect to the height of the generated box's containing block. ...
Box alignment in Flexbox - CSS: Cascading Style Sheets
able space in its dimension. This is how centering a block with auto margins works. By setting the left and right margin to auto, both sides of our block try to take up all of the available space and so push the box into the center. By setting a margin of auto on one item in a set of flex items all aligned to start, we can create a split navigation. This works well with Flexbox and the alignment
properties. As soon as there is no space available for the auto margin, the item behaves in the same way as all the other flex items and shrinks to try to fit into space. The gap
properties row-gap column-gap gap Creating fixed size gaps between items On the main axis, the column-gap property will create fixed size gaps between adjacent items. On the cross axis the row-gap property will create s...
... shrinks to try to fit into space. The gap
properties row-gap column-gap gap Creating fixed size gaps between items On the main axis, the column-gap property will create fixed size gaps between adjacent items. ...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
of Multi-column Layout. As this page aims to detail things which are specific to Multi-column Layout and Box Alignment, it should be read in conjunction with the main Box Alignment page which details the common features of Box Alignment across layout methods. In multi-column layout the alignment container is the content box of the multicol container. The alignment subject is the column box. The
properties which apply to multi-column layouts are detailed below. Note: Multi-column Layout predates the Box Alignment specification. and the
properties listed here, while specified for Multicol, may not be supported in browsers. align-content and justify-content The align-content property applies to the block axis and justify-content to the inline axis. Any spacing added to the columns due to use of ...
...p property. Using a value of justify-content other than normal or stretch will cause column boxes to display at the column-width specified on the multicol container, and the remaining space distributed according to the value of justify-content. column-gap The column-gap property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap
properties for other layout methods in box alignment. While other layout methods treat the initial value of column-gap as 0 multicol treats it as 1em, as in general you would not want to have no gap between columns. Reference CSS
Properties justify-content align-content column-gap Glossary Entries Alignment subject Alignment container Fallback alignment ...
CSS Containment - CSS: Cascading Style Sheets
ly give it a size. Style containment article { contain: style; } Despite the name, style containment does not provide scoped styles such as you would get with the Shadow DOM. The main use case is to prevent situations where a CSS Counter could be changed in an element, which could then affect the rest of the tree. Using contain: style would ensure that the counter-increment and counter-set
properties created new counters scoped to that subtree only. Note: style containment is "at-risk" in the spec and may not be supported everywhere (it's not currently supported in Firefox). Special values There are two special values of contain: content strict We encountered the first in the example above. Using contain: content turns on layout and paint containment. The specification describes th...
.... ...
Class selectors - CSS: Cascading Style Sheets
ed on the contents of their class attribute. ...
...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 and "fancy" styling.</p> <p>This is just a regular paragraph.</p> ...
Center an element - CSS: Cascading Style Sheets
In this recipe you will see how to center one box inside another. Centering both horizontally and vertically was difficult before flexbox, with the Box Alignment
properties it is now straightforward. Requirements To place an item into the center of another box horizontally and vertically. Recipe Download this example Choices made To center one box inside another we make the containing box a flex container. Then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. In the future we may be able to center elements without needing to turn the parent into a flex container, as the Box Alignment
properties used here are specified to apply to block layout too. However, support is currently limited for box alignm...
...ntainer. Then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. In the future we may be able to center elements without needing to turn the parent into a flex container, as the Box Alignment
properties used here are specified to apply to block layout too. However, support is currently limited for box alignment
properties on block layout, so currently centering using Flexbox is the most robust way to achieve this. ...
Testing media queries programmatically - CSS: Cascading Style Sheets
Once you've created a MediaQueryList object, you can check the result of the query or receive notifications when the result changes. Creating a media query list Before you can evaluate the results of a media query, you need to create the MediaQueryList object representing the query. To do this, use the window.matchMedia method. ...
... the parameter as evt -- an event object. This makes sense because newer implementations of MediaQueryList handle event listeners in a standard way. They no longer use the unusual MediaQueryListListener mechanism, but a standard event listener setup, passing an event object of type MediaQueryListEvent as the argument to the callback function. This event object also includes the media and matches
properties, so you can query these features of the MediaQueryList by directly accessing it, or accessing the event object. Ending query notifications To stop receiving notifications about changes to the value of your media query, call removeListener() on the MediaQueryList, passing it the name of the previously-defined callback function: mediaQueryList.removeListener(handleOrientationChange); ...
Paged media - CSS: Cascading Style Sheets
Paged media
properties control the presentation of content for print or any other media that splits content into discrete pages. It allows you to set page breaks, control printable area, style left and right pages differently, and control breaks inside elements. ...
... Paged media
properties control the presentation of content for print or any other media that splits content into discrete pages. It allows you to set page breaks, control printable area, style left and right pages differently, and control breaks inside elements. ...
Replaced elements - CSS: Cascading Style Sheets
se contents are not affected by the current document's styles. The position of the replaced element can be affected using CSS, but not the contents of the replaced element itself. Some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document. The only other impact CSS can have on a replaced element is that there are
properties which support controlling the positioning of the element's content within its box. See Controlling object position within the content box for further information. 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 th...
...d using the CSS content property are anonymous replaced elements. They are "anonymous" because they don't exist in the HTML markup. Using CSS with replaced elements CSS handles replaced elements specifically in some cases, like when calculating margins and some auto values. Note that some replaced elements, but not all, have intrinsic dimensions or a defined baseline, which is used by some CSS
properties, such as vertical-align. Only replaced elements can ever have intrinsic dimensions. Controlling object position within the content box Certain CSS
properties can be used to specify how the object contained within the replaced element should be positioned within the element's box area. These are defined by the CSS Images Module Level 3 and CSS Images Module Level 4 specifications: object-fit ...
Syntax - CSS: Cascading Style Sheets
this goal and its basic building blocks are: The property which is an identifier, that is a human-readable name, that defines which feature is considered. The value which describe how the feature must be handled by the engine. Each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. CSS declarations Setting CSS
properties to specific values is the core function of the CSS language. A property and value pair is called a declaration, and any CSS engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to style it. Both
properties and values are case-insensitive by default in CSS. The pair is separated by a colon, ':' (U+003A COLON), and white spaces befo...
...the core function of the CSS language. A property and value pair is called a declaration, and any CSS engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to style it. Both
properties and values are case-insensitive by default in CSS. The pair is separated by a colon, ':' (U+003A COLON), and white spaces before, between, and after
properties and values, but not necessarily inside, are ignored. There are more than 100 different
properties in CSS and a nearly infinite number of different values. Not all pairs of
properties and values are allowed and each property defines what are the valid values. When a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the CSS engine. CSS declarati...
animation-fill-mode - CSS: Cascading Style Sheets
y sets how a CSS animation applies styles to its target before and after its execution. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation
properties at once. Syntax /* Single animation */ animation-fill-mode: none; animation-fill-mode: forwards; animation-fill-mode: backwards; animation-fill-mode: both; /* Multiple animations */ animation-fill-mode: none, backwards; animation-fill-mode: both, forwards, none; Values none The animation will not apply any styles to the target when it's not executing. The element will instead be displaye...
... this during the animation-delay period. The first relevant keyframe depends on the value of animation-direction: animation-direction first relevant keyframe normal or alternate 0% or from reverse or alternate-reverse 100% or to both The animation will follow the rules for both forwards and backwards, thus extending the animation
properties in both directions. Note: When you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. For more information, see Setting multiple animation property values. Formal definition Initial valuenoneApplies toall elements, ::before and ::after pseudo-e...
animation-timing-function - CSS: Cascading Style Sheets
ction CSS property sets how an animation progresses through the duration of each cycle. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation
properties at once. Syntax /* Keyword values */ animation-timing-function: ease; animation-timing-function: ease-in; animation-timing-function: ease-out; animation-timing-function: ease-in-out; animation-timing-function: linear; animation-timing-function: step-start; animation-timing-function: step-end; /* Function values */ animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); animation-timing-fu...
...ic-bezier(0.0, 0.0, 1.0, 1.0), animates at an even speed. ease-in Equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the speed of the transition of the animating properting increasing until complete. ease-out Equal to cubic-bezier(0, 0, 0.58, 1.0), starts quickly, slowing down the animation continues. o ease-in-out Equal to cubic-bezier(0.42, 0, 0.58, 1.0), with the animating
properties slowly transitioning, speeding up, and then slowing down again. cubic-bezier(p1, p2, p3, p4) An author defined cubic-bezier curve, where the p1 and p3 values must be in the range of 0 to 1. steps(n, <jumpterm>) Displays an animation iteration along n stops along the transition, displaying each stop for equal lengths of time. For example, if n is 5, there are 5 steps. Whether the animation hol...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
Note that Firefox and Edge also support -webkit-appearance, for compatibility reasons. The source for this interactive example is stored in a GitHub repository. ...
... Value Demo Browser Description attachment div{ color: black; -moz-appearance: attachment; -webkit-appearance: attachment; } <div>Lorem</div> Safari borderless-attachment div{ color: black; -moz-appearance: borderless-attachment; -webkit-appearance: borderless-attac...
attr() - CSS: Cascading Style Sheets
The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. 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. ...
...()' in that specification. Editor's Draft Changed it to work like var(). Property values involving attr() are valid at parse time, and the validation of the attribute value is deferred to computed value time. CSS Values and Units Module Level 3The definition of 'attr()' in that specification. Candidate Recommendation Added two optional parameters; can be used on all
properties; may return values other than <string>. These changes are experimental and may be dropped during the CR phase if browser support is too small. CSS Level 2 (Revision 1)The definition of 'attr()' in that specification. Recommendation Limited to the content property; always returns a <string>. ...
background-position-x - CSS: Cascading Style Sheets
is relative to the position layer set by background-origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand
properties applied to the element after it. Syntax /* Keyword values */ background-position-x: left; background-position-x: center; background-position-x: right; /* <percentage> values */ background-position-x: 25%; /* <length> values */ background-position-x: 0px; background-position-x: 1cm; background-position-x: 8em; /* Side-relative values */ background-position-x: right 3px; background-position-x:...
...4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } Result Specifications Specification Status Comment CSS Backgrounds and Borders Module Level 4The definition of 'background-position-x' in that specification. Editor's Draft Initial specification of longhand sub-
properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for An...
background-position-y - CSS: Cascading Style Sheets
is relative to the position layer set by background-origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand
properties applied to the element after it. Syntax /* Keyword values */ background-position-y: top; background-position-y: center; background-position-y: bottom; /* <percentage> values */ background-position-y: 25%; /* <length> values */ background-position-y: 0px; background-position-y: 1cm; background-position-y: 8em; /* Side-relative values */ background-position-y: bottom 3px; background-position-y...
...4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } Result Specifications Specification Status Comment CSS Backgrounds and Borders Module Level 4The definition of 'background-position-y' in that specification. Editor's Draft Initial specification of longhand sub-
properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for An...
block-size - CSS: Cascading Style Sheets
t relates to the height of the element. A related property is inline-size, which defines the other dimension of the element. Initial valueautoApplies tosame as width and heightInheritednoPercentagesblock-size of containing blockComputed valuesame as width and heightAnimation typea length, percentage or calc(); Syntax Values The block-size property takes the same values as the width and height
properties. Formal definition Initial valueautoApplies tosame as width and heightInheritednoPercentagesblock-size of containing blockComputed valuesame as width and heightAnimation typea length, percentage or calc(); Formal syntax <'width'> Examples Block size with vertical text HTML <p class="exampleText">Example text</p> CSS .exampleText { writing-mode: vertical-rl; background-color: yellow...
... Editor's Draft Initial definition ...
border-block-end-color - CSS: Cascading Style Sheets
perty depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax border-block-end-color: yellow; border-block-end-color: #F5F6F7; Related
properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. Values <'color'> The color of the border. See color. Formal definition Initial valuecurrentcolorApplies toall elementsInheritednoComputed valuecomputed colorAnimation typea color Formal syntax <'border-top-color'> Examples Border color with vertica...
... Editor's Draft Initial definition ...
border-block-end-style - CSS: Cascading Style Sheets
tion, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; Related
properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. Values <'border-style'> The line style of the border. See border-style. Formal definition Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <'border-top-style'> Examples Dashed border w...
... Editor's Draft Initial definition ...
text-decoration-line - CSS: Cascading Style Sheets
e text-decoration-line CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When setting multiple line-decoration
properties at once, it may be more convenient to use the text-decoration shorthand property instead. Syntax /* Single keyword */ text-decoration-line: none; text-decoration-line: underline; text-decoration-line: overline; text-decoration-line: line-through; text-decoration-line: blink; /* Multiple keywords */ text-decoration-line: underline overline; /* Two decoration lines */ text-decorati...
... ...
text-decoration-style - CSS: Cascading Style Sheets
active-examples and send us a pull request. If the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an HTML tag, like <del> or <s>. As browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. When setting multiple line-decoration
properties at once, it may be more convenient to use the text-decoration shorthand property instead. Syntax /* Keyword values */ text-decoration-style: solid; text-decoration-style: double; text-decoration-style: dotted; text-decoration-style: dashed; text-decoration-style: wavy; /* Global values */ text-decoration-style: inherit; text-decoration-style: initial; text-decoration-style: unset; Values ...
... ...
text-overflow - CSS: Cascading Style Sheets
ellipsis ('...'), or display a custom string. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The text-overflow property doesn't force an overflow to occur. To make text overflow its container you have to set other CSS
properties: overflow and white-space. For example: overflow: hidden; white-space: nowrap; The text-overflow property only affects content that is overflowing a block container element in its inline progression direction (not text overflowing at the bottom of a box, for example). Syntax The text-overflow property may be specified using one or two values. If one value is given, it specifies overflow behav...
... CSS value direction: ltr direction: rtl Expected Result Live result Expected Result Live result visible overflow 1234567890 1234567890 0987654321 1234567890 text-overflow: clip 1234567890 1234567890 text-overflow: '' 12345 1234567890 5...
url() - CSS: Cascading Style Sheets
as a parameter of another CSS functions, like the attr() function. Depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. The url() functional notation is the value for the <url> data type. ...
...RxVB0...); url(myFont.woff); url(#IDofSVGpath); /* associated
properties */ background-image: url("https://mdn.mozillademos.org/files/16761/star.gif"); list-style-image: url('../images/bullet.jpg'); content: url("pdficon.jpg"); cursor: url(mycursor.cur); border-image-source: url(/media/diamonds.png); src: url('fantasticfont.woff'); offset-path: url(#path); mask-image: url("masks.svg#mask1"); /*
Properties with fallbacks */ cursor: url(pointer.cur), pointer; /* Associated short-hand
properties */ background: url('https://mdn.mozillademos.org/files/16761/star.gif') bottom right repeat-x blue; border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space; /* As a parameter in another CSS function */ background-image: cross-fade(20% url(first.png), url(second.png)); mask-image: image(url(mask...
will-change - CSS: Cascading Style Sheets
problems. It should not be used to anticipate performance problems. Excessive use of will-change will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. This will lead to worse performance. Give it sufficient time to work. This property is intended as a method for authors to let the user-agent know about
properties that are likely to change ahead of time. Then the browser can choose to apply any ahead-of-time optimizations required for the property change before the property change actually happens. So it is important to give the browser some time to actually do the optimizations. Find some way to predict at least slightly ahead of time that something will change, and set will-change then. Be aware, t...
...amples Via script This is an example showing how to apply the will-change property through scripting, which is probably what you should be doing in most cases. var el = document.getElementById('element'); // Set will-change when the element is hovered el.addEventListener('mouseenter', hintBrowser); el.addEventListener('animationEnd', removeHint); function hintBrowser() { // The optimizable
properties that are going to change // in the animation's keyframes block this.style.willChange = 'transform, opacity'; } function removeHint() { this.style.willChange = 'auto'; } Specifications Specification Status Comment CSS Will Change Module Level 1The definition of 'will-change' in that specification. Candidate Recommendation Initial definition ...
Video player styling basics - Developer guides
height). Its position is also specifically set to relative, which is required for its responsiveness (more on that later). ...
...ound-color:#2a84cd; } A .data-state class is also used here when a <progress> element is being "faked"; when it's in this state the background colour needs to be set. The internal <span> element used as the actual progressing part of the faked progress bar has its width initially set to 0% (it is updated via JavaScript) and it also has its background colour set. There are some browser-specific
properties that need to be set to ensure that Firefox and Chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-webkit-progress-value { background-color:#0095dd; } Although the same
properties are set to the same value, these rules need to be defined separately, otherwise Chrome ignores it. JavaScript That's r...
Media buffering, seeking, and time ranges - Developer guides
simple audio example: <audio id="my-audio" controls src="music.mp3"> </audio> We can access these attributes like so: var myAudio = document.getElementById('my-audio'); var bufferedTimeRanges = myAudio.buffered; TimeRanges Object TimeRanges are a series of non-overlapping ranges of time, with start and stop times. (learn more about TimeRanges). A TimeRanges Object consists of the following
properties: length: The number of time ranges in the object. start(index): The start time, in seconds, of a time range. end(index): The end time, in seconds, of a time range. Without any user interaction there is usually only one time range, but if you jump about in the media more than one time range can appear, as illustrated by the below visualization. This represents two buffered time ranges -- on...
...ime ranges -- one spanning 0 to 5 seconds and the second spanning 15 to 19 seconds. ...
Audio and Video Delivery - Developer guides
e to a relative path. This causes the browser to attempt another download to something that is unlikely to be a valid video. Seeking through media Media elements provide support for moving the current playback position to specific points in the media's content. This is done by setting the value of the currentTime property on the element; see HTMLMediaElement for further details on the element's
properties. Simply set the value to the time, in seconds, at which you want playback to continue. You can use the element's seekable property to determine the ranges of the media that are currently available for seeking to. This returns a TimeRanges object listing the ranges of times that you can seek to. var mediaElement = document.querySelector('#mediaElementID'); mediaElement.seekable.start(0); // Ret...
... browser video player using the <video> element. Video player styling basics With the cross-browser video player put in place in the previous article, this article now looks at providing some basic, reponsive styling for the player. Cross-browser audio basics This article provides a basic guide to creating an HTML5 audio player that works cross browser, with all the associated attributes,
properties and events explained, and a quick guide to custom controls created using the Media API. Media buffering, seeking, and time ranges Sometimes it's useful to know how much <audio> or <video> has downloaded or is playable without delay -- a good example of this is the buffered progress bar of an audio or video player. This article discusses how to build a buffer/seek bar using TimeRanges, and o...
Overview of events and handlers - Developer guides
available from several sources, including this one.) Currently, all execution environments for JavaScript code use events and event handling. The event design pattern The event system, at its core, is simply a programming design pattern. The pattern starts with an agreement over a kind of event and: the name String used for the event, the type of the data structure used to represent the key
properties of that event, and the JavaScript object which will 'emit' that event. The pattern is implemented by defining a JavaScript function which takes as an argument the data structure which was agreed upon, and registering the function using the name String with the object which will emit the event. The function is said to be a 'listener' or a 'handler' with both names used interchangeably. Th...
...' with both names used interchangeably. This pattern can easily be followed using completely custom code, as explained in the article on custom events. The pattern is also used by modern web browsers which define many events emitted in response to user input or browser activity. Modern web browsers follow the event pattern using a standardized approach. Browsers use as the data structure for the
properties of the event, an object derived from the EventPrototype object. Browsers use as the registration method for the function which will handle those data structures a method called addEventListener which expects as arguments a string event type name and the handler function. Finally, browsers define a large number of objects as event emitters and define a wide variety of event types generated by the ...
HTML attribute reference - HTML: Hypertext Markup Language
charset <meta>, <script> Declares the character encoding of the page or script. checked <command>, <input> Indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> Contains a URI which points to the source of the quote or change. class Global attribute Often used with CSS to style elements with common
properties. code <applet> Specifies the URL of the applet's class file to be loaded and executed. codebase <applet> This attribute gives the absolute or relative URL of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> This attribute sets the text color using either a named color or a color ...
...ibute() or element.getAttribute(). The content attribute is always a string even when the expected value should be an integer. For example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setAttribute("maxlength", "42") on that element. The IDL attribute is also known as a JavaScript property. These are the attributes you can read or set using JavaScript
properties like element.foo. The IDL attribute is always going to use (but might transform) the underlying content attribute to return a value when you get it and is going to save something in the content attribute when you set it. In other words, the IDL attributes, in essence, reflect the content attributes. Most of the time, IDL attributes will return their values as they are really used. For example, t...
<a>: The Anchor element - HTML: Hypertext Markup Language
TML 4.01, id and name could both be used on <a>, as long as they had identical values. Note: Use the global attribute id instead. revObsolete since HTML5 Specified a reverse link; the opposite of the rel attribute. Deprecated for being very confusing. shapeObsolete since HTML5 The shape of the hyperlink's region in an image map. Note: Use the <area> element for image maps instead.
Properties Content categories Flow content, phrasing content, interactive content, palpable content. Permitted content Transparent, containing either flow content (excluding interactive content) or phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content, or any element th...
... be easily activated. Understanding Success Criterion 2.5.5: Target Size Target Size and 2.5.5 Quick test: Large touch targets Proximity Interactive elements, like links, placed in close visual proximity should have space separating them. Spacing helps people with motor control issues, who may otherwise accidentally activate the wrong interactive content. Spacing may be created using CSS
properties like margin. Hand tremors and the giant-button-problem Specifications Specification Status Comment Referrer PolicyThe definition of 'referrer attribute' in that specification. Candidate Recommendation Added the referrerpolicy attribute. HTML Living StandardThe definition of '<a>' in that specification. Living Standard HTML5The defin...
<basefont> - HTML: Hypertext Markup Language
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. With this set, the font's size can then be varied relative to the base size using the <font> element. You should not use this element; instead, you should use CSS
properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents. Attributes Like all other HTML elements, this element supports the global attributes. color This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. face This attribute contains a list of one or more font names. The document text in the default style is rendered in the first font face that...
...nts related to styling only. Starting with HTML 4, HTML does not convey styling information anymore (outside the <style> element or the style attribute of each element). In HTML5, this element has been removed completely. For any new web development, styling should be written using CSS only. The former behavior of the <font> element can be achieved, and even better controlled using the CSS Fonts
properties. DOM interface This element implements the HTMLBaseFontElement interface. Example <basefont color="#FF0000" face="Helvetica" size="+2" /> ...
<button>: The Button element - HTML: Hypertext Markup Language
o give an icon button an accessible name, put text in the <button> element that concisely describes the button's functionality. Example <button name="favorite"> <svg aria-hidden="true" viewBox="0 0 10 10"><path d="M7 9L5 8 3 9V6L1 4h3l1-3 1 3h3L7 6z"/></svg> Add to favorites </button> If you want to visually hide the button's text, an accessible way to do so is to use a combination of CSS
properties to remove it visually from the screen, but keep it parseable by assistive technology. However, it is worth noting that leaving the button text visually apparent can aid people who may not be familiar with the icon's meaning or understand the button's purpose. This is especially relevant for people who are not technologically sophisticated, or who may have different cultural interpretations for t...
... Adrian Roselli Quick test: Large touch targets - The A11Y Project Proximity Large amounts of interactive content -- including buttons -- placed in close visual proximity to each other should have space separating them. This spacing is beneficial for people who are experiencing motor control issues, who may accidentally activate the wrong interactive content. Spacing may be created using CSS
properties such as margin. Hand tremors and the giant-button-problem - Axess Lab Firefox Firefox will add a small dotted border on a focused button. This border is declared through CSS in the browser stylesheet, but you can override it to add your own focused style using button::-moz-focus-inner { }. If overridden, it is important to ensure that the state change when focus is moved to the button is h...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
t, scripts can access the window object of the framed resource via the contentWindow property. The contentDocument property refers to the document inside the <iframe>, same as contentWindow.document. From the inside of a frame, a script can get a reference to its parent window with window.parent. Script access to a frame's content is subject to the same-origin policy. Scripts cannot access most
properties in other window objects if the script was loaded from a different origin, including scripts inside a frame accessing the frame's parent. Cross-origin communication can be achieved using Window.postMessage(). Positioning and scaling As a replaced element, the position, alignment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and ...
...indow objects if the script was loaded from a different origin, including scripts inside a frame accessing the frame's parent. Cross-origin communication can be achieved using Window.postMessage(). Positioning and scaling As a replaced element, the position, alignment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit
properties. Examples A simple <iframe> An <iframe> in action. After creating the frame, when the user clicks a button, its title is displayed in an alert. HTML <iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" title="iframe Example 1" width="400" height="300"> </iframe> Result Accessibility concerns People navigating with assistive technology suc...
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. Note: the itemref attribute is not part of the microdata data model. It is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. For example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the
properties in the cells. ...
...elements that have an itemscope attribute specified. Note: the itemref attribute is not part of the microdata data model. It is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. For example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the
properties in the cells. Example HTML <div itemscope id="amanda" itemref="a b"></div> <p id="a">Name: <span itemprop="name">Amanda</span> </p> <div id="b" itemprop="band" itemscope itemref="c"></div> <div id="c"> <p>Band: <span itemprop="name">Jazz Band</span> </p> <p>Size: <span itemprop="size">12</span> players</p> </div> Structured data (in JSON-LD format) { "@id": "amanda", "name": "A...
itemtype - HTML: Hypertext Markup Language
In this case, MusicEvent would be the URL used by itemtype, with startDate and location as itemprop's which MusicEvent defines. ...
...In this case, MusicEvent would be the URL used by itemtype, with startDate and location as itemprop's which MusicEvent defines. ...
Expressions and operators - JavaScript
an object's property. The syntax is: delete object.property; delete object[propertyKey]; delete property; // legal only within a with statement where object is the name of an object, property is an existing property, and propertyKey is a string or symbol referring to an existing property. The fourth form is legal only within a with statement, to delete a property from an object, and also for
properties of the global object. If the delete operator succeeds, it removes the propery from the object. Trying to access it afterwards will yield undefined. The delete operator returns true if the operation is possible; it returns false if the operation is not possible. x = 42; // implicitly creates window.x var y = 43; var myobj = {h: 4}; // create object with property h delete x; // returns tru...
...turns true if the operation is possible; it returns false if the operation is not possible. x = 42; // 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. This is however regarded as a bad practice, try to avoid it. When you delete an array property, the array length is not affected and other elements are no re-indexed. To achieve that behavior, it is much better to j...
Grammar and types - JavaScript
renceError let x = 3; Function hoisting In the case of functions, only function declarations are hoisted--but not the function expressions. /* Function declaration */ foo(); // "bar" function foo() { console.log('bar'); } /* Function expression */ baz(); // TypeError: baz is not a function var baz = function() { console.log('bar2'); }; Global variables Global variables are in fact
properties of the global object. In web pages, the global object is window, so you can set and access global variables using the window.variable syntax. Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from...
...ame as those for let block-scope variables. If the const keyword is omitted, the identifier is assumed to represent a variable. You cannot declare a constant with the same name as a function or variable in the same scope. For example: // THIS WILL CAUSE AN ERROR function f() {}; const f = 5; // THIS WILL CAUSE AN ERROR TOO function f() { const g = 5; var g; //statements } However, the
properties of objects assigned to constants are not protected, so the following statement is executed without problems. const MY_OBJECT = {'key': 'value'}; MY_OBJECT.key = 'otherValue'; Also, the contents of an array are not protected, so the following statement is executed without problems. const MY_ARRAY = ['HTML','CSS']; MY_ARRAY.push('JAVASCRIPT'); console.log(MY_ARRAY); //logs ['HTML','CSS','JAVASCR...
Introduction - JavaScript
ased on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be
properties of objects, executing as loosely typed methods. JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed. Java is a class-bas...
... such as HyperTalk and dBASE. These scripting languages offer programming tools to a much wider audience because of their easier syntax, specialized built-in functionality, and minimal requirements for object creation. JavaScript compared to Java JavaScript Java Object-oriented. No distinction between types of objects. Inheritance is through the prototype mechanism, and
properties and methods can be added to any object dynamically. Class-based. Objects are divided into classes and instances with all inheritance through the class hierarchy. Classes and instances cannot have
properties or methods added dynamically. Variable data types are not declared (dynamic typing, loosely typed). Variable data types must be declared (static typing, strongly typed). ...
Groups and ranges - JavaScript
groups. In results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. This is usually just the order of the capturing groups themselves. This becomes important when capturing groups are nested. Matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined RegExp object's
properties ($1, ..., $9). Capturing groups have a performance penalty. If you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). String.match() won't return groups if the /.../g flag is set. However, you can still use String.matchAll() to get all matches. \n Where "n" is a positive integer. A back reference to the last substring matc...
...ame. For example, to extract the United States area code from a phone number, we could use /\((?<area>\d\d\d)\)/. The resulting number would appear under matches.groups.area. (?:x) Non-capturing group: Matches "x" but does not remember the match. The matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined RegExp object's
properties ($1, ..., $9). Examples Counting vowels var aliceExcerpt = "There was a long silence after this, and Alice could only hear whispers now and then."; var regexpVowels = /[aeiouy]/g; console.log("Number of vowels:", aliceExcerpt.match(regexpVowels).length); // Number of vowels: 25 Using groups let personList = `First_Name: John, Last_Name: Doe First_Name: Jane, Last_Name: Smith`; let re...
Public class fields - JavaScript
page describes experimental features. Both Public and private field declarations are an experimental feature (stage 3) proposed at TC39, the JavaScript standards committee. Support in browsers is limited, but the feature can be used through a build step with systems like Babel. See the compat information below. Both static and instance public fields are writable, enumerable, and configurable
properties. As such, unlike their private counterparts, they participate in prototype inheritance. Syntax class ClassWithInstanceField { instanceField = 'instance field' } class ClassWithStaticField { static staticField = 'static field' } class ClassWithPublicInstanceMethod { publicMethod() { return 'hello world' } } Examples Public static fields Public static fields are useful when you ...
...instance = new ClassWithInstanceField() console.log(instance.instanceField) // expected output: "instance field" Fields without initializers are initialized to undefined. class ClassWithInstanceField { instanceField } const instance = new ClassWithInstanceField() console.assert(instance.hasOwnProperty('instanceField')) console.log(instance.instanceField) // expected output: "undefined" Like
properties, field names may be computed. const PREFIX = 'prefix' class ClassWithComputedFieldName { [`${PREFIX}Field`] = 'prefixed field' } const instance = new ClassWithComputedFieldName() console.log(instance.prefixField) // expected output: "prefixed field" When initializing fields this refers to the class instance under construction. Just as in public instance methods, if you're in a subclass yo...
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
only. What went wrong? It was attempted to delete a property, but that property is non-configurable. The configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. This error happens only in strict mode code. In non-strict code, the operation returns false. Examples Attempting to delete non-configurable
properties Non-configurable
properties are not super common, but they can be created using Object.defineProperty() or Object.freeze(). 'use strict'; var obj = Object.freeze({name: 'Elsa', score: 157}); delete obj.score; // TypeError 'use strict'; var obj = {}; Object.defineProperty(obj, 'foo', {value: 2, configurable: false}); delete obj.foo; // TypeError 'use strict'; var frozenArray = Object.freeze(...
...ect.defineProperty() or Object.freeze(). 'use strict'; var obj = Object.freeze({name: 'Elsa', score: 157}); delete obj.score; // TypeError 'use strict'; var obj = {}; Object.defineProperty(obj, 'foo', {value: 2, configurable: false}); delete obj.foo; // TypeError 'use strict'; var frozenArray = Object.freeze([0, 1, 2]); frozenArray.pop(); // TypeError There are also a few non-configurable
properties built into JavaScript. Maybe you tried to delete a mathematical constant. 'use strict'; delete Math.PI; // TypeError ...
TypeError: "x" is not a constructor - JavaScript
not a constructor Error type TypeError What went wrong? There was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor. See constructor or the new operator for more information on what a constructor is. There are many global objects, like String or Array, which are constructable using new. However, some global objects are not and their
properties and methods are static. The following JavaScript standard built-in objects are not a constructor: Math, JSON, Symbol, Reflect, Intl, Atomics. Generator functions cannot be used as constructors either. Examples Invalid cases var Car = 1; new Car(); // TypeError: Car is not a constructor new Math(); // TypeError: Math is not a constructor new Symbol(); // TypeError: Symbol is not a constructo...
...id cases var Car = 1; new Car(); // TypeError: Car is not a constructor new Math(); // TypeError: Math is not a constructor new Symbol(); // TypeError: Symbol is not a constructor function* f() {}; var obj = new f; // TypeError: f is not a constructor A car constructor Suppose you want to create an object type for cars. You want this type of object to be called car, and you want it to have
properties for make, model, and year. To do this, you would write the following function: function Car(make, model, year) { this.make = make; this.model = model; this.year = year; } Now you can create an object called mycar as follows: var mycar = new Car('Eagle', 'Talon TSi', 1993); In Promises When returning an immediately-resolved or immediately-rejected Promise, you do not need to create a n...
TypeError: 'x' is not iterable - JavaScript
s not iterable (Chrome) Error type TypeError What went wrong? The value which is given as the right hand-side of for...of or as argument of a function such as Promise.all or TypedArray.from, is not an iterable object. An iterable can be a built-in iterable type such as Array, String or Map, a generator result, or an object implementing the iterable protocol. ...
...ion such as Promise.all or TypedArray.from, is not an iterable object. An iterable can be a built-in iterable type such as Array, String or Map, a generator result, or an object implementing the iterable protocol. Examples Iterating over Object
properties In JavaScript, Objects are not iterable unless they implement the iterable protocol. Therefore, you cannot use for...of to iterate over the
properties of an object. var obj = { 'France': 'Paris', 'England': 'London' }; for (let p of obj) { // TypeError: obj is not iterable // ... } Instead you have to use Object.keys or Object.entries, to iterate over the
properties or entries of an object. var obj = { 'France': 'Paris', 'England': 'London' }; // Iterate over the property names: for (let country of Object.keys(obj)) { var capital = ...
JavaScript error reference - JavaScript
he Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code. For a beginner's introductory tutorial on fixing JavaScript errors, see What went wrong? Troubleshooting JavaScript. List of errors In this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). Together, these two
properties provide a starting point toward understanding and resolving the error. For more information, follow the links below! Error: Permission denied to access property "x"InternalError: too much recursionRangeError: argument is not a valid code pointRangeError: invalid array lengthRangeError: invalid dateRangeError: precision is out of rangeRangeError: radix must be an integerRangeError: repeat count m...
...rror: missing formal parameterSyntaxError: missing name after . ...
Array.prototype.forEach() - JavaScript
The current element being processed in the array. index Optional The index currentValue in the array. array Optional The array forEach() was called upon. thisArg Optional Value to use as this when executing callback. Return value undefined. Description forEach() calls a provided callback function once for each element in an array in ascending order. It is not invoked for index
properties that have been deleted or are uninitialized. (For sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the index of the element the Array object being traversed If a thisArg parameter is provided to forEach(), it will be used as callback's this value. The thisArg value ultimately observable by callback is determined according to the usual r...
...ng code logs a line for each element in an array: function logArrayElements(element, index, array) { console.log('a[' + index + '] = ' + element) } // Notice that index 2 is skipped, since there is no item at // that position in the array... ...
BigInt64Array - JavaScript
s an array of 64-bit signed integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0n. 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). Constructor BigInt64Array() Creates a new BigInt64Array object. Static
properties BigInt64Array.BYTES_PER_ELEMENT Returns a number value of the element size. 8 in the case of a BigInt64Array. BigInt64Array.name Returns the string value of the constructor name. In the case of the BigInt64Array type, this is "BigInt64Array". Static methods BigInt64Array.from() Creates a new BigInt64Array from an array-like or iterable object. See also Array.from(). BigInt64Array.of(...
...BigInt64Array. BigInt64Array.name Returns the string value of the constructor name. In the case of the BigInt64Array type, this is "BigInt64Array". Static methods BigInt64Array.from() Creates a new BigInt64Array from an array-like or iterable object. See also Array.from(). BigInt64Array.of() Creates a new BigInt64Array with a variable number of arguments. See also Array.of(). Instance
properties BigInt64Array.prototype.buffer Returns the ArrayBuffer referenced by the BigInt64Array. This is fixed at construction time and thus read only. BigInt64Array.prototype.byteLength Returns the length (in bytes) of the BigInt64Array from the start of its ArrayBuffer. This is fixed at construction time and thus read only. BigInt64Array.prototype.byteOffset Returns the offset (in bytes) of the ...
BigUint64Array - JavaScript
array of 64-bit unsigned integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0n. 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). Constructor BigUint64Array() Creates a new BigUint64Array object. Static
properties BigUint64Array.BYTES_PER_ELEMENT Returns a number value of the element size. 8 in the case of a BigUint64Array. BigUint64Array.name Returns the string value of the constructor name. In the case of the BigUint64Array type this is "BigUint64Array". Static methods BigUint64Array.from() Creates a new BigUint64Array from an array-like or iterable object. See also Array.from(). BigUint64Ar...
...64Array. BigUint64Array.name Returns the string value of the constructor name. In the case of the BigUint64Array type this is "BigUint64Array". Static methods BigUint64Array.from() Creates a new BigUint64Array from an array-like or iterable object. See also Array.from(). BigUint64Array.of() Creates a new BigUint64Array with a variable number of arguments. See also Array.of(). Instance
properties BigUint64Array.prototype.buffer Returns the ArrayBuffer referenced by the BigUint64Array. This is fixed at construction time and thus read only. BigUint64Array.prototype.byteLength Returns the length (in bytes) of the BigUint64Array from the start of its ArrayBuffer. This is fixed at construction time and thus read only. BigUint64Array.prototype.byteOffset Returns the offset (in bytes) of...
Float32Array - JavaScript
s (corresponding to the C float data type) in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Float32Array() Creates a new Float32Array object. Static
properties Float32Array.BYTES_PER_ELEMENT Returns a number value of the element size. 4 in the case of an Float32Array. Float32Array.name Returns the string value of the constructor name. In the case of the Float32Array type: "Float32Array". Static methods Float32Array.from() Creates a new Float32Array from an array-like or iterable object. See also Array.from(). Float32Array.of() Creates a ne...
... the case of an Float32Array. Float32Array.name Returns the string value of the constructor name. In the case of the Float32Array type: "Float32Array". Static methods Float32Array.from() Creates a new Float32Array from an array-like or iterable object. See also Array.from(). Float32Array.of() Creates a new Float32Array with a variable number of arguments. See also Array.of(). Instance
properties Float32Array.prototype.buffer Returns the ArrayBuffer referenced by the Float32Array Fixed at construction time and thus read only. Float32Array.prototype.byteLength Returns the length (in bytes) of the Float32Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Float32Array.prototype.byteOffset Returns the offset (in bytes) of the Float32Array from the ...
Float64Array - JavaScript
(corresponding to the C double data type) in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Float64Array() Creates a new Float64Array object. Static
properties Float64Array.BYTES_PER_ELEMENT Returns a number value of the element size. 8 in the case of an Float64Array. Float64Array.name Returns the string value of the constructor name. In the case of the Float64Array type: "Float64Array". Static methods Float64Array.from() Creates a new Float64Array from an array-like or iterable object. See also Array.from(). Float64Array.of() Creates a ne...
... the case of an Float64Array. Float64Array.name Returns the string value of the constructor name. In the case of the Float64Array type: "Float64Array". Static methods Float64Array.from() Creates a new Float64Array from an array-like or iterable object. See also Array.from(). Float64Array.of() Creates a new Float64Array with a variable number of arguments. See also Array.of(). Instance
properties Float64Array.prototype.buffer Returns the ArrayBuffer referenced by the Float64Array Fixed at construction time and thus read only. Float64Array.prototype.byteLength Returns the length (in bytes) of the Float64Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Float64Array.prototype.byteOffset Returns the offset (in bytes) of the Float64Array from the ...
Function.prototype.bind() - JavaScript
A copy of the given function with the specified this value, and initial arguments (if provided). Description The bind() function creates a new bound function, which is an exotic function object (a term from ECMAScript 2015) that wraps the original function object. Calling the bound function generally results in the execution of its wrapped function. A bound function has the following internal
properties: [[BoundTargetFunction]] The wrapped function object [[BoundThis]] The value that is always passed as this value when calling the wrapped function. [[BoundArguments]] A list of values whose elements are used as the first arguments to any call to the wrapped function. [[Call]] Executes code associated with this object. Invoked via a function call expression. The arguments to the internal...
...ot seriously attempt to be exhaustive) between this algorithm and the specified algorithm are: The partial implementation relies on Array.prototype.slice(), Array.prototype.concat(), Function.prototype.call() and Function.prototype.apply(), built-in methods to have their original values. The partial implementation creates functions that do not have immutable "poison pill" caller and arguments
properties that throw a TypeError upon get, set, or deletion. (This could be added if the implementation supports Object.defineProperty, or partially implemented [without throw-on-delete behavior] if the implementation supports the __defineGetter__ and __defineSetter__ extensions.) The partial implementation creates functions that have a prototype property. (Proper bound functions have none.) The partial ...
Generator.prototype.next() - JavaScript
In this case value optionally specifies the return value of the iterator. Has the value false if the iterator was able to produce the next value in the sequence. ...
... done and value. You can also provide a parameter to the next method to send a value to the generator. Syntax gen.next(value) Parameters value The value to send to the generator. The value will be assigned as a result of a yield expression. For example, in variable = yield expression, the value passed to the .next() function will be assigned to variable. Return value An Object with two
properties: done (boolean) Has the value true if the iterator is past the end of the iterated sequence. In this case value optionally specifies the return value of the iterator. Has the value false if the iterator was able to produce the next value in the sequence. This is equivalent of not specifying the done property altogether. value Any JavaScript value returned by the iterator. Can be omitted wh...
Generator.prototype.throw() - JavaScript
In this case value optionally specifies the return value of the iterator. Has the value false if the iterator was able to produce the next value in the sequence. This is equivalent of not specifying the done property altogether. ...
...In this case value optionally specifies the return value of the iterator. Has the value false if the iterator was able to produce the next value in the sequence. This is equivalent of not specifying the done property altogether. ...
Int16Array - JavaScript
rray of twos-complement 16-bit signed integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Int16Array() Creates a new Int16Array object. Static
properties Int16Array.BYTES_PER_ELEMENT Returns a number value of the element size. 2 in the case of an Int16Array. Int16Array.name Returns the string value of the constructor name. In the case of the Int16Array type: "Int16Array". Static methods Int16Array.from() Creates a new Int16Array from an array-like or iterable object. See also Array.from(). Int16Array.of() Creates a new Int16Array wit...
...ement size. 2 in the case of an Int16Array. Int16Array.name Returns the string value of the constructor name. In the case of the Int16Array type: "Int16Array". Static methods Int16Array.from() Creates a new Int16Array from an array-like or iterable object. See also Array.from(). Int16Array.of() Creates a new Int16Array with a variable number of arguments. See also Array.of(). Instance
properties Int16Array.prototype.buffer Returns the ArrayBuffer referenced by the Int16Array Fixed at construction time and thus read only. Int16Array.prototype.byteLength Returns the length (in bytes) of the Int16Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Int16Array.prototype.byteOffset Returns the offset (in bytes) of the Int16Array from the start of its...
Int32Array - JavaScript
rray of twos-complement 32-bit signed integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Int32Array() Creates a new Int32Array object. Static
properties Int32Array.BYTES_PER_ELEMENT Returns a number value of the element size. 4 in the case of an Int32Array. Int32Array.name Returns the string value of the constructor name. In the case of the Int32Array type: "Int32Array". Static methods Int32Array.from() Creates a new Int32Array from an array-like or iterable object. See also Array.from(). Int32Array.of() Creates a new Int32Array wit...
...ement size. 4 in the case of an Int32Array. Int32Array.name Returns the string value of the constructor name. In the case of the Int32Array type: "Int32Array". Static methods Int32Array.from() Creates a new Int32Array from an array-like or iterable object. See also Array.from(). Int32Array.of() Creates a new Int32Array with a variable number of arguments. See also Array.of(). Instance
properties Int32Array.prototype.buffer Returns the ArrayBuffer referenced by the Int32Array Fixed at construction time and thus read only. Int32Array.prototype.byteLength Returns the length (in bytes) of the Int32Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Int32Array.prototype.byteOffset Returns the offset (in bytes) of the Int32Array from the start of its...
Int8Array - JavaScript
The Int8Array typed array represents an array of twos-complement 8-bit signed integers. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Int8Array() Creates a new Int8Array object. Static
properties Int8Array.BYTES_PER_ELEMENT Returns a number value of the element size. 1 in the case of an Int8Array. Int8Array.name Returns the string value of the constructor name. In the case of the Int8Array type: "Int8Array". Static methods Int8Array.from() Creates a new Int8Array from an array-like or iterable object. See also Array.from(). Int8Array.of() Creates a new Int8Array with a variable number of arguments. See also Array.of(). ...
...f the element size. 1 in the case of an Int8Array. Int8Array.name Returns the string value of the constructor name. In the case of the Int8Array type: "Int8Array". Static methods Int8Array.from() Creates a new Int8Array from an array-like or iterable object. See also Array.from(). Int8Array.of() Creates a new Int8Array with a variable number of arguments. See also Array.of(). Instance
properties Int8Array.prototype.buffer Returns the ArrayBuffer referenced by the Int8Array Fixed at construction time and thus read only. Int8Array.prototype.byteLength Returns the length (in bytes) of the Int8Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Int8Array.prototype.byteOffset Returns the offset (in bytes) of the Int8Array from the start of its Array...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
The Intl.DateTimeFormat.prototype.resolvedOptions() method returns a new object with
properties reflecting the locale and date and time formatting options computed during initialization of this DateTimeFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateTimeFormat.resolvedOptions() Return value A new object with
properties reflecting the locale and date and time formatting options computed during the initialization of the given DateTimeFormat object. Description The resulting object has the following
properties: locale The BCP 47 language tag for the locale actually used. If any Unicode exte...
... Warning: Applications should not rely on undefined being returned, as future versions may return a String value identifying the runtime's default time zone instead. hour12 The value provided for this property in the options argument or filled in as a default. weekday era year month day hour minute second timeZoneName The values resulting from format matching between the corresponding
properties in the options argument and the available combinations and representations for date-time formatting in the selected locale. Some of these
properties may not be present, indicating that the corresponding components will not be represented in formatted output. Examples Using the resolvedOptions method var germanFakeRegion = new Intl.DateTimeFormat('de-XX', { timeZone: 'UTC' }); var usedOptions ...
Intl.NumberFormat() constructor - JavaScript
, "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mathsans", "mlym", "modi", "mong", "mroo", "mtei", "mymr", "mymrshan", "mymrtlng", "newa", "nkoo", "olck", "orya", "osma", "rohg", "saur", "segment", "shrd", "sind", "sinh", "sora", "sund", "takr", "talu", "tamldec", "telu", "thai", "tibt", "tirh", "vaii", "wara", "wcho". options Optional An object with some or all of the following
properties: compactDisplay Only used when notation is "compact". Takes either "short" (default) or "long". currency The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB -- see the Current currency & funds code list. There is no default value; if the style is "currency", the cu...
...property must be provided. unitDisplay The unit formatting style to use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) useGrouping Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. Possible values are true and false; the default is true. The following
properties fall into two groups: minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, minimumSignificantDigits and maximumSignificantDigits in the other. If at least one property from the second group is defined, then the first group is ignored. minimumIntegerDigits The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1. minim...
Intl.PluralRules() constructor - JavaScript
The Intl.PluralRules() constructor creates Intl.PluralRules objects. Syntax new Intl.PluralRules([locales[, options]]) Parameters locales Optional. A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. options Optional. An object with some or all of the following
properties: localeMatcher The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". For information about this option, see the Intl page. type The type to use. Possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). This is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "...
...e "lookup" and "best fit"; the default is "best fit". For information about this option, see the Intl page. type The type to use. Possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). This is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "1st", "2nd", "3rd" in English). The following
properties fall into two groups: minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, minimumSignificantDigits and maximumSignificantDigits in the other. If at least one property from the second group is defined, then the first group is ignored. minimumIntegerDigits The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
Intl - JavaScript
The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting. The Intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions. Constructor
properties Intl.Collator() Constructor for collators, which are objects that enable language-sensitive string comparison. Intl.DateTimeFormat() Constructor for objects that enable language-sensitive date and time formatting. Intl.DisplayNames() Constructor for objects that enable the consistent translation of language, region and script display names. Intl.ListFormat() Constructor for objects that enable language-sensitive list forma...
...the constructed object or the behavior of the function. Each constructor or function supports only a subset of the keys defined for the Unicode extension, and the supported values often depend on the language tag. For example, the "co" key (collation) is only supported by Collator, and its "phonebk" value is only supported for German. options argument The options argument must be an object with
properties that vary between constructors and functions. If the options argument is not provided or is undefined, default values are used for all
properties. One property is supported by all language sensitive constructors and functions: The localeMatcher property, whose value must be a string "lookup" or "best fit" and which selects one of the locale matching algorithms described above. Examples Formatt...
Map - JavaScript
Iteration A Map is an iterable, so it can be directly iterated. Iterating over an Object requires obtaining its keys in some fashion and iterating over them. Performance Performs better in scenarios involving frequent additions and removals of key-value pairs. Not optimized for frequent additions and removals of key-value pairs. Setting object
properties Setting Object
properties works for Map objects as well, and can cause considerable confusion. Therefore, this appears to work in a way: let wrongMap = new Map() wrongMap['bla'] = 'blaa' wrongMap['bla2'] = 'blaaa2' console.log(wrongMap) // Map { bla: 'blaa', bla2: 'blaaa2' } But that way of setting a property does not interact with the Map data structure. It uses the feature of the generic...
...ss: "123 N 1st Ave"}) contacts.has('Jessie') // true contacts.get('Hilary') // undefined contacts.set('Hilary', {phone: "617-555-4321", address: "321 S 2nd St"}) contacts.get('Jessie') // {phone: "213-555-1234", address: "123 N 1st Ave"} contacts.delete('Raymond') // false contacts.delete('Jessie') // true console.log(contacts.size) // 1 Constructor Map() Creates a new Map object. Static
properties get Map[@@species] The constructor function that is used to create derived objects. Instance
properties Map.prototype.size Returns the number of key/value pairs in the Map object. Instance methods Map.prototype.clear() Removes all key-value pairs from the Map object. Map.prototype.delete(key) Returns true if an element in the Map object existed and has been removed, or false if ...
Math - JavaScript
Math is a built-in object that has
properties and methods for mathematical constants and functions. It's not a function object. Math works with the Number type. It doesn't work with BigInt. Description Unlike many other global objects, Math is not a constructor. All
properties and methods of Math are static. You refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument. Constants are defined with the full precision of real numbers in JavaScript. Note: Many Math functions have a precision that's implementation-dependent. This means that different browsers can give a different result. ...
...you call the sine function as Math.sin(x), where x is the method's argument. Constants are defined with the full precision of real numbers in JavaScript. Note: Many Math functions have a precision that's implementation-dependent. This means that different browsers can give a different result. Even the same JavaScript engine on a different OS or architecture can give different results! Static
properties Math.E Euler's constant and the base of natural logarithms; approximately 2.718. Math.LN2 Natural logarithm of 2; approximately 0.693. Math.LN10 Natural logarithm of 10; approximately 2.303. Math.LOG2E Base-2 logarithm of E; approximately 1.443. Math.LOG10E Base-10 logarithm of E; approximately 0.434. Math.PI Ratio of the a circle's circumference to its diameter; approximately 3.141...
Object.getOwnPropertySymbols() - JavaScript
The Object.getOwnPropertySymbols() method returns an array of all symbol
properties found directly upon a given object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.getOwnPropertySymbols(obj) Parameters obj The object whose symbol
properties are to be returned. Return value An array of all symbol
properties found directly upon the given object. Description Similar to Object.getOwnPropertyNames(), you can get all symbol
properties of a given object as an array of symbols. ...
...ject.getOwnPropertySymbols(obj) Parameters obj The object whose symbol
properties are to be returned. Return value An array of all symbol
properties found directly upon the given object. Description Similar to Object.getOwnPropertyNames(), you can get all symbol
properties of a given object as an array of symbols. Note that Object.getOwnPropertyNames() itself does not contain the symbol
properties of an object and only the string
properties. As all objects have no own symbol
properties initially, Object.getOwnPropertySymbols() returns an empty array unless you have set symbol
properties on your object. Examples Using getOwnPropertySymbols var obj = {}; var a = Symbol('a'); var b = Symbol.for('b'); obj[a] = 'localSymbol'; obj[b] = 'globalSymbol'; var objectSymbols = Object.getOwnPrope...
Object.keys() - JavaScript
s own enumerable property names, iterated in the same order that a normal loop would. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.keys(obj) Parameters obj The object of which the enumerable's own
properties are to be returned. Return value An array of strings that represent all the enumerable
properties of the given object. Description Object.keys() returns an array whose elements are strings corresponding to the enumerable
properties found directly upon object. The ordering of the
properties is the same as that given by looping over the
properties of the object manually. Polyfill To add comp...
... Non-object coercion In ES5, if the argument to this method is not an object (a primitive), then it will cause a TypeError. From ES2015 onwards, a non-object argument will be coerced to an object. // In ES5 Object.keys('foo'); // TypeError: "foo" is not an object // In ES2015+ Object.keys('foo'); // ["0", "1", "2"] Specificatio...
Object.values() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.values(obj) Parameters obj The object whose enumerable own property values are to be returned. ...
...b.com/mdn/interactive-examples and send us a pull request. Syntax Object.values(obj) Parameters obj The object whose enumerable own property values are to be returned. Return value An array containing the given object's own enumerable property values. Description Object.values() returns an array whose elements are the enumerable property values found on the object. The ordering of the
properties is the same as that given by looping over the property values of the object manually. Polyfill To add compatible Object.values support in older environments that do not natively support it, you can find a Polyfill in the tc39/proposal-object-values-entries or in the es-shims/Object.values repositories. Examples Using Object.values const obj = { foo: 'bar', baz: 42 }; console.log(Object.valu...
Proxy() constructor - JavaScript
Description Use the Proxy() constructor to create a new Proxy object. ...
...ensible() A trap for Object.isExtensible. handler.ownKeys() A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. handler.preventExtensions() A trap for Object.preventExtensions. handler.set() A trap for setting property values. handler.setPrototypeOf() A trap for Object.setPrototypeOf. Examples Selectively proxy property accessors In this example the target has two
properties, notProxied and proxied. We define a handler that returns a different value for proxied, and lets any other accesses through to the target. const target = { notProxied: "original value", proxied: "original value" }; const handler = { get: function(target, prop, receiver) { if (prop === "proxied") { return "replaced value"; } return Reflect.get(...arguments); } }; cons...
Comparing Reflect and Object methods - JavaScript
es not exist in an API, it is marked as N/A. Method Name Object Reflect defineProperty() Object.defineProperty() returns the object that was passed to the function. Returns a TypeError if the property was not successfully defined on the object. Reflect.defineProperty() returns true if the property was defined on the object and false if it was not. define
Properties() Object.define
Properties() returns the objects that were passed to the function. Returns a TypeError if any
properties were not successfully defined on the object. N/A set() N/A Reflect.set() returns true if the property was set successfully on the object and false if it was not. Throws a TypeError if the target was not an Object. get() N/A Reflect.get() retur...
...as the first argument. getOwnPropertyDescriptors() Object.getOwnPropertyDescriptors() returns an object containing a property descriptor of each passed-in object. Returns an empty object if the passed-in object has no owned property descriptors. N/A getPrototypeOf() Object.getPrototypeOf() returns the prototype of the given object. Returns null if there are no inherited
properties. Throws a TypeError for non-objects in ES5, but coerces non-objects in ES2015. Reflect.getPrototypeOf() returns the prototype of the given object. Returns null if there are no inherited
properties, and throws a TypeError for non-objects. setPrototypeOf() Object.setPrototypeOf() returns the object itself if its prototype was set successfully. Throws a TypeError if the prototype bein...
Reflect.has() - JavaScript
to check. Return value A Boolean indicating whether or not the target has the property. Exceptions A TypeError, if target is not an Object. Description The Reflect.has method allows you to check if a property is in an object. It works like the in operator as a function. ...
... ...
Reflect.isExtensible() - JavaScript
The static Reflect.isExtensible() method determines if an object is extensible (whether it can have new
properties added to it). It is similar to Object.isExtensible(), but with some differences. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.isExtensible(target) Parameters target The target object which to check if it is extensible. Return value A Boolean indicating whether or not the target is extensible. Exceptions A TypeError, if target is not an Object. ...
...ples and send us a pull request. Syntax Reflect.isExtensible(target) Parameters target The target object which to check if it is extensible. Return value A Boolean indicating whether or not the target is extensible. Exceptions A TypeError, if target is not an Object. Description The Reflect.isExtensible method allows you determine if an object is extensible (whether it can have new
properties added to it). It is the same method as Object.isExtensible(). Examples Using Reflect.isExtensible() See also Object.isExtensible(). // New objects are extensible. let empty = {} Reflect.isExtensible(empty) // === true // ...but that can be changed. Reflect.preventExtensions(empty) Reflect.isExtensible(empty) // === false // Sealed objects are by definition non-extensible. let sealed = Obj...
Reflect.preventExtensions() - JavaScript
It is similar to Object.preventExtensions(), but with some differences. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.preventExtensions(target) Parameters target The target object on which to prevent extensions. Return value A Boolean indicating whether or not the target was successfully set to prevent extensions. Exceptions A TypeError, if target is not an Object. ...
...ctive-examples and send us a pull request. Syntax Reflect.preventExtensions(target) Parameters target The target object on which to prevent extensions. Return value A Boolean indicating whether or not the target was successfully set to prevent extensions. Exceptions A TypeError, if target is not an Object. Description The Reflect.preventExtensions() method allows you to prevent new
properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to Object.preventExtensions(). Examples Using Reflect.preventExtensions() See also Object.preventExtensions(). // Objects are extensible by default. let empty = {} Reflect.isExtensible(empty) // === true // ...but that can be changed. Reflect.preventExtensions(empty) Reflect.isExtensible(empty...
RegExp.$1-$9 - JavaScript
The legacy RegExp $1, $2, $3, $4, $5, $6, $7, $8, $9
properties are static and read-only
properties of regular expressions that contain parenthesized substring matches. Description The $1, ..., $9
properties are static, they are not a property of an individual regular expression object. Instead, you always use them as RegExp.$1, ..., RegExp.$9. The values of these
properties are read-only and modified whenever successful matches are made. The number of possible parenthesized substrings is unlimited, but the RegExp object can only hold the first nine. You can access all parenthesized substrings through the returned array's indexes. These
properties can be used in the replacement text for the String.replace method. When used this way, do not prepend them with RegExp. The example below illustrate...
...egExp.test The following script uses the test() method of the RegExp instance to grab a number in a generic string. var str = 'Test 24'; var number = /(\d+)/.test(str) ? RegExp.$1 : '0'; number; // "24" Please note that any operation involving the usage of other regular expressions between a re.test(str) call and the RegExp.$n property, might have side effects, so that accessing these special
properties should be done instantly, otherwise the result might be unexpected. Specifications Specification Legacy RegExp features in JavaScript ...
String - JavaScript
ess an individual character in a string. The first is the charAt() method: return 'cat'.charAt(1) // returns "a" The other way (introduced in ECMAScript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" When using bracket notation for character access, attempting to delete or assign a value to these
properties will not succeed. The
properties involved are neither writable nor configurable. (See Object.defineProperty() for more information.) Comparing strings In C, the strcmp() function is used for comparing strings. In JavaScript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ' + b) } else if (a > b) { console.l...
...tion, rather than as a constructor, which is usually more useful. Static methods String.fromCharCode(num1 [, ...[, numN]]) Returns a string created by using the specified sequence of Unicode values. String.fromCodePoint(num1 [, ...[, numN) Returns a string created by using the specified sequence of code points. String.raw() Returns a string created from a raw template string. Instance
properties String.prototype.length Reflects the length of the string. Read-only. Instance methods String.prototype.charAt(index) Returns the character (exactly one UTF-16 code unit) at the specified index. String.prototype.charCodeAt(index) Returns a number that is the UTF-16 code unit value at the given index. String.prototype.codePointAt(pos) Returns a nonnegative integer Number that is the ...
TypeError - JavaScript
exclusively) when a value is not of the expected type. A TypeError may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator or function; or when attempting to modify a value that cannot be changed; or when attempting to use a value in an inappropriate way. Constructor TypeError() Creates a new TypeError object. Instance
properties TypeError.prototype.message Error message. Although ECMA-262 specifies that TypeError should provide its own message property, in SpiderMonkey, it inherits Error.prototype.message. TypeError.prototype.name Error name. Inherited from Error. TypeError.prototype.fileName Path to file that raised this error. Inherited from Error. TypeError.prototype.lineNumber Line number in file that raise...
... Line number in file that raised this error. Inherited from Error. TypeError.prototype.columnNumber Column number in line that raised this error. Inherited from Error. TypeError.prototype.stack Stack trace. Inherited from Error. ...
Uint16Array - JavaScript
resents an array of 16-bit unsigned integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Uint16Array() Creates a new Uint16Array object. Static
properties Uint16Array.BYTES_PER_ELEMENT Returns a number value of the element size. 2 in the case of an Uint16Array. Uint16Array.name Returns the string value of the constructor name. In the case of the Uint16Array type: "Uint16Array". Static methods Uint16Array.from() Creates a new Uint16Array from an array-like or iterable object. See also Array.from(). Uint16Array.of() Creates a new Uint16...
...ze. 2 in the case of an Uint16Array. Uint16Array.name Returns the string value of the constructor name. In the case of the Uint16Array type: "Uint16Array". Static methods Uint16Array.from() Creates a new Uint16Array from an array-like or iterable object. See also Array.from(). Uint16Array.of() Creates a new Uint16Array with a variable number of arguments. See also Array.of(). Instance
properties Uint16Array.prototype.buffer Returns the ArrayBuffer referenced by the Uint16Array Fixed at construction time and thus read only. Uint16Array.prototype.byteLength Returns the length (in bytes) of the Uint16Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Uint16Array.prototype.byteOffset Returns the offset (in bytes) of the Uint16Array from the start ...
Uint32Array - JavaScript
resents an array of 32-bit unsigned integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Uint32Array() Creates a new Uint32Array object. Static
properties Uint32Array.BYTES_PER_ELEMENT Returns a number value of the element size. 4 in the case of an Uint32Array. Uint32Array.name Returns the string value of the constructor name. In the case of the Uint32Array type: "Uint32Array". Static methods Uint32Array.from() Creates a new Uint32Array from an array-like or iterable object. See also Array.from(). Uint32Array.of() Creates a new Uint32...
...ze. 4 in the case of an Uint32Array. Uint32Array.name Returns the string value of the constructor name. In the case of the Uint32Array type: "Uint32Array". Static methods Uint32Array.from() Creates a new Uint32Array from an array-like or iterable object. See also Array.from(). Uint32Array.of() Creates a new Uint32Array with a variable number of arguments. See also Array.of(). Instance
properties Uint32Array.prototype.buffer Returns the ArrayBuffer referenced by the Uint32Array Fixed at construction time and thus read only. Uint32Array.prototype.byteLength Returns the length (in bytes) of the Uint32Array from the start of its ArrayBuffer. Fixed at construction time and thus read only. Uint32Array.prototype.byteOffset Returns the offset (in bytes) of the Uint32Array from the start ...
Uint8Array - JavaScript
1 in the case of an Uint8Array. ...
...ement size. 1 in the case of an Uint8Array. Uint8Array.name Returns the string value of the constructor name. In the case of the Uint8Array type: "Uint8Array". Static methods Uint8Array.from() Creates a new Uint8Array from an array-like or iterable object. See also Array.from(). Uint8Array.of() Creates a new Uint8Array with a variable number of arguments. See also Array.of(). Instance
properties Uint8Array.prototype.buffer Returns the ArrayBuffer referenced by the Uint8Array Fixed at construction time and thus read only. Uint8Array.prototype.byteLength Returns the length (in bytes) of the Uint8Array. Fixed at construction time and thus read only. Uint8Array.prototype.byteOffset Returns the offset (in bytes) of the Uint8Array from the start of its ArrayBuffer. Fixed at constructio...
Uint8ClampedArray - JavaScript
ut of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). Constructor Uint8ClampedArray() Creates a new Uint8ClampedArray object. Static
properties Uint8ClampedArray.BYTES_PER_ELEMENT Returns a number value of the element size. 1 in the case of an Uint8ClampedArray. Uint8ClampedArray.name Returns the string value of the constructor name. In the case of the Uint8ClampedArray type: "Uint8ClampedArray". Static methods Uint8ClampedArray.from() Creates a new Uint8ClampedArray from an array-like or iterable object. See also Array.from(...
...8ClampedArray.name Returns the string value of the constructor name. In the case of the Uint8ClampedArray type: "Uint8ClampedArray". Static methods Uint8ClampedArray.from() Creates a new Uint8ClampedArray from an array-like or iterable object. See also Array.from(). Uint8ClampedArray.of() Creates a new Uint8ClampedArray from a variable number of arguments. See also Array.of(). Instance
properties Uint8ClampedArray.prototype.buffer Returns the ArrayBuffer referenced by the Uint8ClampedArray Fixed at construction time and thus read only. Uint8ClampedArray.prototype.byteLength Returns the length (in bytes) of the Uint8ClampedArray from the start of its ArrayBuffer. Fixed at construction time and thus read only. Uint8ClampedArray.prototype.byteOffset Returns the offset (in bytes) of t...
Destructuring assignment - JavaScript
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e) { console.log('Name: ' + n + ', Father: ' + f); } // "Name: Mike Smith, Father: Harry Smith" // "Name: Tom Jones, Father: Richard Jones" Computed object property names and destructuring Computed property names, like on object literals, can be used with destructuring. let key = 'z'; let {[key]: foo} = {z: 'bar'}; console.log(foo); // "bar" Rest in Object Destructuring The Rest/Spread
Properties for ECMAScript proposal (stage 4) adds the rest syntax to destructuring. Rest
properties collect the remaining own enumerable property keys that are not already picked off by the destructuring pattern. let {a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40} a; // 10 b; // 20 rest; // { c: 30, d: 40 } Invalid JavaScript identifier as a property name Destructuring can be used with property names that...
Optional chaining (?.) - JavaScript
in the chain is valid. The ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when accessing chained
properties when the possibility exists that a reference may be missing. It can also be helpful while exploring the content of an object when there's no known guarantee as to which
properties are required. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and se...
...ng if onError really exists onError(err.message); } } } // Using optional chaining with function calls function doSomething(onContent, onError) { try { // ... ...
Spread syntax (...) - JavaScript
l items from arr2 onto arr1 Array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] With spread syntax, this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] Note: Unlike unshift(), this creates a new arr1, and does not modify the original arr1 array in-place. Spread in object literals The Rest/Spread
Properties for ECMAScript proposal (ES2018) added spread
properties to object literals. It copies own enumerable
properties from a provided object onto a new object. Shallow-cloning (excluding prototype) or merging of objects is now possible using a shorter syntax than Object.assign(). const obj1 = { foo: 'bar', x: 42 }; const obj2 = { foo: 'baz', y: 13 }; const clonedObj = { ...obj1 }; // Object { foo: ...
...he object literal, due to the rest parameter. Only for iterables Objects themselves are not iterable, but they become iterable when used in an Array, or with iterating functions such as map(), reduce(), and assign(). When merging 2 objects together with the spread operator, it is assumed another iterating function is used when the merging occurs. Spread syntax (other than in the case of spread
properties) can be applied only to iterable objects: const obj = {'key1': 'value1'}; const array = [...obj]; // TypeError: obj is not iterable Spread with many values When using spread syntax for function calls, be aware of the possibility of exceeding the JavaScript engine's argument length limit. See apply() for more details. Specifications Specification ECMAScript (ECMA-262)Th...
in operator - JavaScript
// returns true You must specify an object on the right side of the in operator. For example, you can specify a string created with the String constructor, but you cannot specify a string literal. let color1 = new String('green') 'length' in color1 // returns true let color2 = 'coral' // generates an error (color2 is not a String object) 'length' in color2 Using in with deleted or undefined
properties If you delete a property with the delete operator, the in operator returns false for that property. let mycar = {make: 'Honda', model: 'Accord', year: 1998} delete mycar.make 'make' in mycar // returns false let trees = new Array('redwood', 'bay', 'cedar', 'oak', 'maple') delete trees[3] 3 in trees // returns false If you set a property to undefined but do not delete it, the in operator r...
...perator will return false for empty array slots. Even if accessing it directly returns undefined. let empties = new Array(3) empties[2] // returns undefined 2 in empties // returns false To avoid this, make sure a new array is always filled with non-empty values or not write to indexes past the end of array. let empties = new Array(3).fill(undefined) 2 in empties // returns true Inherited
properties The in operator returns true for
properties in the prototype chain. (If you want to check for only non-inherited
properties, use Object.prototype.hasOwnProperty() instead.) 'toString' in {} // returns true Specifications Specification ECMAScript (ECMA-262)The definition of 'Relational Operators' in that specification. ...
new operator - JavaScript
or of) this object to another object; Passes the newly created object from Step 1 as the this context; Returns this if the function doesn't return an object. Creating a user-defined object requires two steps: Define the object type by writing a function. Create an instance of the object with new. To define an object type, create a function for the object type that specifies its name and
properties. An object can have a property that is itself another object. See the examples below. When the code new Foo(...) is executed, the following things happen: A new object is created, inheriting from Foo.prototype. The constructor function Foo is called with the specified arguments, and with this bound to the newly created object. new Foo is equivalent to new Foo(), i.e. if no argument list is s...
...ole.log(car2.color); // 'original color' If you didn't write the new operator, the Constructor Function would be invoked like any Regular Function, without creating an Object. In this case, the value of this is also different. Examples Object type and object instance Suppose you want to create an object type for cars. You want this type of object to be called Car, and you want it to have
properties for make, model, and year. To do this, you would write the following function: function Car(make, model, year) { this.make = make; this.model = model; this.year = year; } Now you can create an object called myCar as follows: var myCar = new Car('Eagle', 'Talon TSi', 1993); This statement creates myCar and assigns it the specified values for its
properties. Then the value of myCar.make...
super - JavaScript
er-calling static methods You are also able to call super on static methods. class Rectangle { constructor() {} static logNbSides() { return 'I have 4 sides'; } } class Square extends Rectangle { constructor() {} static logDescription() { return super.logNbSides() + ' which are all equal'; } } Square.logDescription(); // 'I have 4 sides which are all equal' Deleting super
properties will throw an error You cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a ReferenceError. class Base { constructor() {} foo() {} } class Derived extends Base { constructor() {} delete() { delete super.foo; // this is bad } } new Derived().delete(); // ReferenceError: invalid delete involving 'super'. super.prop cann...
...cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a ReferenceError. class Base { constructor() {} foo() {} } class Derived extends Base { constructor() {} delete() { delete super.foo; // this is bad } } new Derived().delete(); // ReferenceError: invalid delete involving 'super'. super.prop cannot overwrite non-writable
properties When defining non-writable
properties with e.g. Object.defineProperty, super cannot overwrite the value of the property. class X { constructor() { Object.defineProperty(this, 'prop', { configurable: true, writable: false, value: 1 }); } } class Y extends X { constructor() { super(); } foo() { super.prop = 2; // Cannot overwrite the value. } } va...
this - JavaScript
Within a class constructor, this is a regular object. All non-static methods within the class are added to the prototype of this: class Example { constructor() { const proto = Object.getPrototypeOf(this); console.log(Object.getOwnPropertyNames(proto)); } first(){} second(){} static third(){} } new Example(); // ['constructor', 'first', 'second'] Note: Static methods are not
properties of this. They are
properties of the class itself. Derived classes Unlike base class constructors, derived constructors have no initial this binding. Calling super() creates a this binding within the constructor and essentially has the effect of evaluating the following line of code, where Base is the inherited class: this = new Base(); Warning: Referring to this before calling super() will...
...th the new keyword), its this is bound to the new object being constructed. While the default for a constructor is to return the object referenced by this, it can instead return some other object (if the return value isn't an object, then the this object is returned). /* * Constructors work like this: * * function MyConstructor(){ * // Actual function body code goes here. * // Create
properties on |this| as * // desired by assigning to them. E.g., * this.fum = "nom"; * // et cetera... * * // If the function has a return statement that * // returns an object, that object will be the * // result of the |new| expression. Otherwise, * // the result of the expression is the object * // currently bound to |this| * // (i.e., the common case most usually seen). * ...
const - JavaScript
ntax const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]]; nameN The constant's name, which can be any legal identifier. valueN The constant's value. This can be any legal expression, including a function expression. Description This declaration creates a constant whose scope can be either global or local to the block in which it is declared. Global constants do not become
properties of the window object, unlike var variables. An initializer for a constant is required. You must specify its value in the same statement in which it's declared. (This makes sense, given that it can't be changed later.) The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable--just that the variable identifier cannot be reassigned. For insta...
...must specify its value in the same statement in which it's declared. (This makes sense, given that it can't be changed later.) The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable--just that the variable identifier cannot be reassigned. For instance, in the case where the content is an object, this means the object's contents (e.g., its
properties) can be altered. All the considerations about the "temporal dead zone" apply to both let and const. A constant cannot share its name with a function or a variable in the same scope. Examples Basic const usage Constants can be declared with uppercase or lowercase, but a common convention is to use all-uppercase letters. // define MY_FAV as a constant and give it the value 7 const MY_FAV = 7;...
Navigation and resource timings - Web Performance
Navigation timings are metrics measuring a browser's document navigation events. Resource timings are detailed network timing measurements regarding the loading of an application's resources. Both provide the same read-only
properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. The general performance timings below have been deprecated in favor of the Performance Entry API, which provides for marking and measuring times along the navigation and resource loading process. While deprecated, they are supported in all browsers. Performance Timings The performanceTiming API, a JavaScript API for measuring the loading performance o...
...ontentLoaded event from the time value immediately after the event completes. Keeping this at 50ms or faster helps ensure a responsive user interface. DOMContentLoaded = timing.domContentLoadedEventEnd - timing.domContentLoadedEventStart Duration We are provided with the duration. The duration is the difference between the PerformanceNavigationTiming.loadEventEnd and PerformanceEntry.startTime
properties. The PerformanceNavigationTiming interface also provides information about what type of navigation you are measuring, returning navigate, reload, back_forward or prerender. Resource timing Whereas navigation timing is for measuring the performance of the main page, generally the HTML file via which all the other assets are requested, resource timing measures timing for individual resources, th...
Web Performance
e web performance. We cover them in this section: Key performance guides Animation performance and frame rateAnimation on the web can be done via SVG, JavaScript, including <canvas> and WebGL, CSS animation, <video>, animated gifs and even animated PNGs and other image types. The performance cost of animating a CSS property can vary from one property to another, and animating expensive CSS
properties can result in jank as the browser struggles to hit a smooth frame rate.Critical rendering pathThe Critical Rendering Path is the sequence of steps the browser goes through to convert the HTML, CSS, and JavaScript into pixels on the screen. Optimizing the critical render path improves render performance.The critical rendering path includes the Document Object Model (DOM), CSS Object Model (CSSOM),...
... improve performance even further. In this article we discuss the impact video, audio, and image content has on performance, and the methods to ensure that impact is as minimal as possible. CSS performance features CSS may be a less important optimization focus for improved performance, but there are some CSS features that impact performance more than others. In this article we look at some CSS
properties that impact performance and suggested ways of handling styles to ensure performance is not negatively impacted. JavaScript performance best practices JavaScript, when used properly, can allow for interactive and immersive web experiences -- or it can significantly harm download time, render time, in-app performance, battery life, and user experience. This article outlines some JavaScript best p...
mask - 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>, <t...
... Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'mask' in that specification. Recommendation Initial definition ...
text-decoration - SVG: Scalable Vector Graphics
The fill and stroke of the text decoration are given by the fill and stroke of the text at the point where the text decoration is declared. The paint order of the text decoration, i.e. the fill and stroke, is determined by the value of the paint-order attribute at the point where the text decoration is declared. Note: As a presentation attribute, text-decoration can be used as a CSS property. ...
... Specifications Specification Status Comment CSS Text Decoration Module Level 3The definition of 'text-decoration' in that specification. Candidate Recommendation Defines the property as a shorthand for text-decoration-line, text-decoration-style,...
<use> - SVG: Scalable Vector Graphics
es override those set 'earlier' in the cascade). Only the attributes x, y, width, height and href on the use element will override those set on the referenced element. However, any other attributes not set on the referenced element will be applied to the use element. Since the cloned nodes are not exposed, care must be taken when using CSS to style a use element and its cloned descendants. CSS
properties are not guaranteed to be inherited by the cloned DOM unless you explicitly request them using CSS inheritance. 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. Since SVG 2, the xlink:href attribute is deprecated in favo...
...alue type: <length> ; Default value: 0; Animatable: yes height The height of the use element. Value type: <length> ; Default value: 0; Animatable: yes Note: width, and height have no effect on use elements, unless the element referenced has a viewbox - i.e. they only have an effect when use refers to a svg or symbol element. Note: Starting with SVG2, x, y, width, and height are Geometry
Properties, meaning those attributes can also be used as CSS
properties for that element. Global attributes Core Attributes Most notably: id, tabindex Styling Attributes class, style Conditional Processing Attributes Most notably: requiredExtensions, systemLanguage Event Attributes Global event attributes, Graphical event attributes Presentation Attributes Most notably: clip-path, clip-rule, c...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
Change Notes pathLength attribute for all basic shapes Implementation status unknown SVGAnimatedPoints.animatedPoints as alias of SVGAnimatedPoints.points Implementation status unknown Auto behavior for rx and ry in <ellipse> Implementation status unknown Text Change Notes text-decoration-fill and text-decoration-stroke
properties Not implemented yet (bug 1303569) inline-size attribute for <text> Implementation status unknown shape-inside property Inplementation status unknown shape-subtract property Inplementation status unknown white-space Implementation status unknown Deprecated xml:space attribute Implementation status unknown kerning property remo...
...e Notes paint-order Implemented (bug 828805) will-change instead of buffered-rendering Implementation status unknown context-fill and context-stroke paint values Implemented (bug 719286 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15) and bug 798843 (Firefox 26.0 / Thunderbird 26.0 / SeaMonkey 2.23)) child keyword for <paint> values and marker
properties Implementation status unknown vector-effect property Only none and non-scaling-stroke values are supported (bug 528332 (Firefox 15 / Thunderbird 15 / SeaMonkey 2.12), bug 1318208) arcs value for stroke-linejoin Not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute Implemented (bug 879659) SVGPaint removed Implemen...
Scripting - SVG: Scalable Vector Graphics
Preventing default behavior in event code When writing drag and drop code, sometimes you'll find that text on the page gets accidently selected while dragging. ...
... Preventing default behavior in event code When writing drag and drop code, sometimes you'll find that text on the page gets accidently selected while dragging. ...
Clipping and masking - SVG: Scalable Vector Graphics
Clipping refers to removing parts of elements defined by other parts. In this case, any half-transparent effects are not possible, it's an all-or-nothing approach. Masking on the other hand allows soft edges by taking transparency and grey values of the mask into account. ...
...l data will be used to determine, which pixels of the circle "make it" to the final rendering. 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 the clipping, every path inside the clipPath is inspected and evaluated together with its stroke
properties and transformation. Then every part of the target lying in a transparent area of the resulting clipPath's content will not be rendered. Color, opacity and such have no effect as long as they don't let parts vanish completely. Masking The effect of masking is most impressively presented with a gradient. If you want an element to fade out, you can achieve this effect quite quickly with masks. <s...
SVG and CSS - SVG: Scalable Vector Graphics
Example Make a new SVG document as a plain text file, doc8.svg. ...
...idth: 9; } #inner-petals .segment:hover > .segment-fill { fill: darkseagreen; stroke: none; } #inner-petals .segment:hover > .segment-edge { stroke: green; } Open the document in your SVG-enabled browser. Move your mouse pointer over the graphic to see what happens. Result Notes about this demonstration: The SVG document links the stylesheet in the usual way. SVG has its own CSS
properties and values. Some of them are similar to CSS
properties for HTML. Challenge Change the stylesheet so that the inner petals all turn pink when the mouse pointer is over any one of them, without changing the way the outer petals work. See a solution to this challenge. Simplified structure The SVG structure shown above could be written much more concise by referencing the individ...
Texts - SVG: Scalable Vector Graphics
"end" or "inherit", decides in which direction the text flows from this point. The attribute dominant-baseline decides the vertical alignment. Like with the shape elements text can be colorized with the fill attribute and given a stroke with the stroke attribute. Both may also refer to gradients or patterns, which makes simple coloring text in SVG very powerful compared to CSS 2.1. ...
...h the fill attribute and given a stroke with the stroke attribute. Both may also refer to gradients or patterns, which makes simple coloring text in SVG very powerful compared to CSS 2.1. Setting font
properties An essential part of a text is the font in which it is displayed. SVG offers a set of attributes, many similar to their CSS counterparts, to enable font selection. Each of the following
properties can be set as an attribute or via a CSS declaration: font-family, font-style, font-weight, font-variant, font-stretch, font-size, font-size-adjust, kerning, letter-spacing, word-spacing and text-decoration. Other text-related elements tspan This element is used to mark up sub-portions of a larger text. It must be a child of a text element or another tspan element. A typical usecase is to paint...